/* ================================================================
   MEDIDOR DE BARULHO (PRO)
   Palco: .mb-palco[data-nivel=ok|atencao|alto|pausado][data-visao=semaforo|ponteiro|bolinhas|carinha]
   ================================================================ */
.mb-palco {
  --cor-nivel: #22c55e;
  min-height: clamp(520px, calc(100vh - 215px), 660px);
  transition: background 0.6s ease;
}

.mb-palco[data-nivel="ok"] { --cor-nivel: #22c55e; background: radial-gradient(120% 90% at 50% 0%, #10301e 0%, #0c0d10 65%); }
.mb-palco[data-nivel="atencao"] { --cor-nivel: #f59e0b; background: radial-gradient(120% 90% at 50% 0%, #382b0c 0%, #0c0d10 65%); }
.mb-palco[data-nivel="alto"] { --cor-nivel: #ef4444; background: radial-gradient(120% 90% at 50% 0%, #3f1215 0%, #0c0d10 65%); }
.mb-palco[data-nivel="pausado"] { --cor-nivel: #6b7280; }

.mb-palco:fullscreen,
.mb-palco.mb-expandido { border: none; border-radius: 0; min-height: 100vh; }
.mb-palco:fullscreen[data-nivel="ok"], .mb-palco.mb-expandido[data-nivel="ok"] { background: radial-gradient(120% 90% at 50% 0%, #10301e 0%, #07080a 65%); }
.mb-palco:fullscreen[data-nivel="atencao"], .mb-palco.mb-expandido[data-nivel="atencao"] { background: radial-gradient(120% 90% at 50% 0%, #382b0c 0%, #07080a 65%); }
.mb-palco:fullscreen[data-nivel="alto"], .mb-palco.mb-expandido[data-nivel="alto"] { background: radial-gradient(120% 90% at 50% 0%, #3f1215 0%, #07080a 65%); }

/* iPhone (sem tela cheia): o palco ocupa a tela toda */
.mb-palco.mb-expandido { position: fixed; inset: 0; z-index: 9999; min-height: 100dvh; }
.mb-palco.mb-expandido .sala-dica-teclas { display: none; }
body.mb-travado { overflow: hidden; }

/* Alerta: a borda da tela pisca em vermelho */
.mb-palco.mb-alertou::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 4;
  animation: mbAlerta 1.4s ease-out;
}

@keyframes mbAlerta {
  0%, 40% { box-shadow: inset 0 0 0 6px #ef4444, inset 0 0 90px rgba(239, 68, 68, 0.55); }
  20%, 60% { box-shadow: inset 0 0 0 3px rgba(239, 68, 68, 0.3); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}

/* ---------- Barra de cima ---------- */
.mb-titulo-grupo { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.mb-pilula {
  flex-shrink: 0;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.mb-palco .sala-icon-btn.mb-ligado { color: #fff; background: var(--primary); border-color: var(--primary); }
.mb-palco:fullscreen .mb-pilula, .mb-palco.mb-expandido .mb-pilula { font-size: 1rem; }

.mb-corpo { padding: 0.5rem 1.5rem 2.6rem; }

/* ---------- Tela de início ---------- */
.mb-inicio {
  text-align: center;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-muted);
}
.mb-coruja { display: block; width: 100%; height: 100%; overflow: visible; }
.mb-calib-fig { width: 150px; height: 150px; }
.mb-inicio-fig { width: clamp(150px, 16vw, 200px); height: clamp(150px, 16vw, 200px); filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45)); animation: mbRespira 3s ease-in-out infinite; }
.mb-inicio h2 { color: var(--text); font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-weight: 800; letter-spacing: -0.02em; }
.mb-btn-ligar { min-height: 52px; padding: 0.7rem 1.6rem; font-size: 1.05rem; }
.mb-inicio-priv { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; color: var(--text-subtle); }
.mb-inicio-priv .ico { width: 14px; height: 14px; }

@keyframes mbRespira {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ---------- Medidor: layout por visão ---------- */
.mb-medidor {
  flex: 1;
  align-self: stretch;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 1rem;
}
.mb-palco[data-visao="ponteiro"] .mb-medidor,
.mb-palco[data-visao="carinha"] .mb-medidor { grid-template-rows: auto auto; align-content: center; }
.mb-palco[data-visao="semaforo"] .mb-medidor {
  grid-template-columns: auto minmax(0, 900px);
  justify-content: center;
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4.5rem);
  max-width: 980px;
  margin: 0 auto;
}

.mb-visual { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 0; }
.mb-v { display: none; }
.mb-palco[data-visao="semaforo"] .mb-v-semaforo,
.mb-palco[data-visao="ponteiro"] .mb-v-ponteiro,
.mb-palco[data-visao="bolinhas"] .mb-v-bolinhas,
.mb-palco[data-visao="carinha"] .mb-v-carinha { display: flex; }

.mb-info {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}
.mb-palco:not([data-visao="semaforo"]) .mb-rosto { display: none; }
.mb-palco[data-visao="ponteiro"] .mb-barra,
.mb-palco[data-visao="bolinhas"] .mb-barra { display: none; }

.mb-rosto {
  width: clamp(120px, 15vw, 190px);
  height: clamp(120px, 15vw, 190px);
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
}
.mb-palco[data-nivel="alto"] .mb-rosto { animation: mbTreme 0.5s ease-in-out infinite; }

.mb-mensagem {
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-wrap: balance;
}
.mb-palco[data-nivel="pausado"] .mb-mensagem { color: var(--text-muted); }

.mb-barra {
  position: relative;
  width: 100%;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}
.mb-zonas { position: absolute; inset: 0; border-radius: inherit; }
.mb-preenchimento {
  position: relative;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--cor-nivel);
  box-shadow: 0 0 18px color-mix(in srgb, var(--cor-nivel) 60%, transparent);
  transition: width 0.1s linear, background 0.3s ease;
}
.mb-limite {
  position: absolute;
  top: -7px;
  bottom: -7px;
  width: 4px;
  margin-left: -2px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

/* ---------- Semáforo ---------- */
.mb-semaforo {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 42px;
  background: linear-gradient(145deg, #2d3038 0%, #121317 55%, #0a0b0d 100%);
  border: 2px solid #3a3d47;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.1), inset 0 -4px 0 rgba(0, 0, 0, 0.55);
}
/* poste */
.mb-semaforo::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  width: 24px;
  height: 400px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #121317, #3a3d47 45%, #121317);
  z-index: -1;
}
/* cada foco: o encaixe fundo e a aba de cima */
.mb-foco {
  position: relative;
  display: block;
  padding: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 25%, #050506, #1d1f25);
  /* a aba: uma meia-lua mais clara por cima de cada foco */
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.85), 0 -7px 0 0 #3d414c, 0 -8px 0 0 rgba(255, 255, 255, 0.18), 0 2px 0 rgba(255, 255, 255, 0.06);
}
.mb-semaforo .luz {
  position: relative;
  display: block;
  width: clamp(64px, 9.5vw, 116px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2;
  filter: saturate(0.55) brightness(0.3);
  transition: filter 0.3s ease, box-shadow 0.3s ease;
  box-shadow: inset 0 -8px 16px rgba(0, 0, 0, 0.3);
}
/* lente: a textura quadriculada e o reflexo */
.mb-semaforo .luz::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.13) 0 1.5px, transparent 1.5px 8%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.13) 0 1.5px, transparent 1.5px 8%);
}
.mb-semaforo .luz::after {
  content: "";
  position: absolute;
  left: 16%;
  top: 10%;
  width: 40%;
  height: 26%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.8), transparent 70%);
  transform: rotate(-28deg);
}
.mb-semaforo .luz.vermelho { background: radial-gradient(circle at 38% 32%, #fecaca, #ef4444 45%, #b91c1c); }
.mb-semaforo .luz.amarelo { background: radial-gradient(circle at 38% 32%, #fef3c7, #f59e0b 45%, #b45309); }
.mb-semaforo .luz.verde { background: radial-gradient(circle at 38% 32%, #bbf7d0, #22c55e 45%, #15803d); }
.mb-palco[data-nivel="ok"] .luz.verde,
.mb-palco[data-nivel="atencao"] .luz.amarelo,
.mb-palco[data-nivel="alto"] .luz.vermelho {
  filter: none;
  box-shadow: 0 0 26px 4px var(--cor-nivel), inset 0 -8px 16px rgba(0, 0, 0, 0.2);
}
/* o clarão em volta do foco aceso */
.mb-foco::after {
  content: "";
  position: absolute;
  inset: -55%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--cor-nivel) 42%, transparent) 30%, transparent 68%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}
.mb-palco[data-nivel="ok"] .mb-foco:has(.verde)::after,
.mb-palco[data-nivel="atencao"] .mb-foco:has(.amarelo)::after,
.mb-palco[data-nivel="alto"] .mb-foco:has(.vermelho)::after { opacity: 1; }
.mb-palco[data-nivel="alto"] .luz.vermelho { animation: salaPiscar 0.8s ease-in-out infinite; }

/* ---------- Ponteiro ---------- */
.mb-v-ponteiro { flex-direction: column; align-items: center; width: 100%; }
.mb-gauge { width: min(100%, 600px); height: auto; overflow: visible; }
.mb-gauge-fundo { fill: none; stroke: #08090b; stroke-width: 29; stroke-linecap: round; }
#gaugeArcos path { fill: none; stroke-width: 20; stroke-linecap: butt; }
#gaugeArcos .mb-gauge-pontas path { stroke-linecap: round; }
#gaugeArcos .mb-gauge-brilho path { stroke-width: 2.5; stroke-linecap: round; opacity: 0.28; }
.mb-gauge-trilha { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 5; stroke-linecap: round; }
.mb-gauge-nivel {
  fill: none; stroke: var(--cor-nivel); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 201.1; stroke-dashoffset: 201.1;
  filter: drop-shadow(0 0 4px var(--cor-nivel));
  transition: stroke 0.3s ease, stroke-dashoffset 0.1s linear;
}
#gaugeMarcas line { stroke: rgba(255, 255, 255, 0.5); stroke-width: 1.6; stroke-linecap: round; }
#gaugeMarcas line.mb-gauge-fina { stroke: rgba(255, 255, 255, 0.22); stroke-width: 1; }
#gaugeMarcas .mb-gauge-limite { fill: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); }
#gaugeMarcas .mb-gauge-rotulo { fill: rgba(255, 255, 255, 0.8); font-size: 7px; font-weight: 700; letter-spacing: 0.02em; }
.mb-agulha path { fill: #f8fafc; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.mb-agulha { transition: transform 0.1s linear; }
.mb-eixo-aro { fill: #0c0d10; stroke: rgba(255, 255, 255, 0.22); stroke-width: 1.5; }
.mb-eixo { fill: var(--cor-nivel); transition: fill 0.3s ease; }
.mb-eixo-brilho { fill: rgba(255, 255, 255, 0.55); }
.mb-gauge-num {
  margin-top: 0.1rem;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--cor-nivel);
  line-height: 1;
  transition: color 0.3s ease;
}

/* ---------- Bolinhas ---------- */
.mb-v-bolinhas { width: 100%; height: 100%; }
.mb-v-bolinhas canvas { display: block; width: 100%; height: clamp(250px, 44vh, 420px); }

/* ---------- Carinha ---------- */
#carinhaGrande {
  --escala: 1;
  width: clamp(190px, 26vw, 330px);
  height: clamp(190px, 26vw, 330px);
  transform: scale(var(--escala));
  transition: transform 0.12s linear;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.5));
}
.mb-v-carinha { position: relative; }
.mb-v-carinha::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--cor-nivel);
  filter: blur(60px);
  opacity: 0.3;
  transition: background 0.4s ease;
}
.mb-palco[data-nivel="alto"] .mb-v-carinha svg { animation: mbTreme 0.45s ease-in-out infinite; }

@keyframes mbTreme {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  25% { translate: -4px 0; rotate: -3deg; }
  75% { translate: 4px 0; rotate: 3deg; }
}

/* ---------- Estrelas ---------- */
.mb-estrelas { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; }
.mb-estrelas[hidden] { display: none; }
.mb-estrelas-linha { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.3rem; }
.mb-estrelas-linha img { width: clamp(28px, 3.2vw, 40px); height: clamp(28px, 3.2vw, 40px); filter: grayscale(1) brightness(0.5); opacity: 0.45; transition: filter 0.3s, opacity 0.3s; }
.mb-estrelas-linha img.cheia { filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.55)); opacity: 1; }
.mb-estrelas-linha img.nova { animation: mbEstrela 1s cubic-bezier(.2, 1.6, .4, 1); }
.mb-estrelas-linha b { color: #fbbf24; font-weight: 800; font-size: 1.1rem; margin-left: 0.2rem; }
.mb-proxima { width: min(260px, 70%); height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.mb-proxima i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f59e0b, #fde047); border-radius: inherit; transition: width 0.3s linear; }

@keyframes mbEstrela {
  0% { transform: scale(0.2) rotate(-90deg); }
  60% { transform: scale(1.5) rotate(10deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ---------- Rodapé do palco ---------- */
.mb-rodape {
  position: absolute;
  right: 0.9rem;
  bottom: 0.55rem;
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  z-index: 3;
}
.mb-rodape[hidden] { display: none; }
.mb-rodape strong { color: var(--text); margin-left: 0.25rem; }

/* ---------- Sobreposições (calibrar, resultado, festa) ---------- */
.mb-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(8, 9, 12, 0.86);
  backdrop-filter: blur(6px);
  animation: salaSubir 0.25s ease;
}
.mb-overlay[hidden] { display: none; }
.mb-palco:has(.mb-overlay:not([hidden])) .mb-rodape,
.mb-palco:has(.mb-overlay:not([hidden])) .sala-dica-teclas { visibility: hidden; }
.mb-overlay-caixa { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; text-align: center; max-width: 640px; width: 100%; }
.mb-overlay-caixa h2 { font-size: clamp(1.5rem, 3.4vw, 2.6rem); font-weight: 900; letter-spacing: -0.02em; color: #fff; }
.mb-overlay-caixa p { color: var(--text-secondary); font-size: 1rem; }
.mb-contagem { font-size: clamp(4rem, 12vw, 8rem); font-weight: 900; line-height: 1; color: #60a5fa; font-variant-numeric: tabular-nums; }
.mb-festa { cursor: pointer; background: rgba(8, 9, 12, 0.7); }
.mb-festa img { animation: mbEstrela 1s cubic-bezier(.2, 1.6, .4, 1); filter: drop-shadow(0 0 30px rgba(251, 191, 36, 0.6)); }
.mb-festa h2 { font-size: clamp(2rem, 6vw, 4.5rem); color: #fde047; }

.mb-res-grade { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; width: 100%; }
.mb-res-grade div { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.7rem 0.4rem; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); }
.mb-res-grade strong { font-size: clamp(1.3rem, 3vw, 2.1rem); font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.mb-res-grade span { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.mb-res-grafico { width: 100%; height: clamp(110px, 24vh, 220px); border-radius: 10px; }
.mb-res-legenda { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem; font-size: 0.78rem; color: var(--text-muted); }
.mb-res-legenda span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.35rem; vertical-align: -1px; }
.mb-res-legenda .ok::before, .mb-ponto.ok { background: #22c55e; }
.mb-res-legenda .atencao::before, .mb-ponto.atencao { background: #f59e0b; }
.mb-res-legenda .alto::before, .mb-ponto.alto { background: #ef4444; }
.mb-res-compara { margin: 0; text-align: center; font-size: 1rem; color: var(--text-secondary); }
.mb-res-compara b { color: #22c55e; }
.mb-res-acoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }

/* ---------- Disputa entre equipes ---------- */
.mb-disputa {
  --eq: #3b82f6;
  background: radial-gradient(110% 90% at 50% 0%, color-mix(in srgb, var(--eq) 38%, #0c0d10) 0%, #0c0d10 70%);
  backdrop-filter: none;
}
.mb-disp-caixa { width: 100%; max-width: 980px; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.mb-disp-topo { width: 100%; display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.mb-disp-tela { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; text-align: center; }
.mb-disp-equipe {
  font-size: clamp(2.2rem, 6vw, 4.6rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.05;
  color: color-mix(in srgb, var(--eq) 55%, #fff); text-shadow: 0 0 40px color-mix(in srgb, var(--eq) 60%, transparent);
}
.mb-disp-frase { font-size: clamp(1.1rem, 2.4vw, 1.6rem); font-weight: 700; color: var(--text); max-width: 680px; text-wrap: balance; }
.mb-disp-recorde { color: var(--text-secondary); font-size: 1rem; }
.mb-disp-recorde b { color: #fde047; }
.mb-disp-contagem { font-size: clamp(6rem, 22vw, 14rem); font-weight: 900; line-height: 1; color: #fff; animation: mbEstrela 0.9s cubic-bezier(.2, 1.6, .4, 1); }
.mb-disp-num { font-size: clamp(5rem, 16vw, 11rem); font-weight: 900; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.mb-disp-barra { position: relative; width: 100%; height: 34px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.mb-disp-barra i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--eq) 70%, #fff), var(--eq)); box-shadow: 0 0 24px var(--eq); transition: width 0.08s linear; }
.mb-disp-barra s { position: absolute; top: -8px; bottom: -8px; width: 4px; margin-left: -2px; background: #fff; border-radius: 2px; left: 0; }
.mb-disp-barra em { position: absolute; top: -14px; bottom: -14px; width: 4px; margin-left: -2px; background: #fde047; border-radius: 2px; box-shadow: 0 0 10px #fde047; }
.mb-disp-tempo { font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 800; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.mb-disp-trofeu { width: clamp(80px, 12vw, 130px); height: clamp(80px, 12vw, 130px); animation: mbEstrela 1s cubic-bezier(.2, 1.6, .4, 1); filter: drop-shadow(0 0 30px rgba(251, 191, 36, 0.55)); }
.mb-disp-vencedor { font-size: clamp(1.8rem, 4.6vw, 3.4rem); font-weight: 900; color: #fde047; letter-spacing: -0.02em; line-height: 1.1; }
.mb-disp-ranking { list-style: none; padding: 0; margin: 0; width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 0.45rem; }
.mb-disp-ranking li { position: relative; display: grid; grid-template-columns: 2.6rem 1fr auto; align-items: center; gap: 0.6rem; padding: 0.55rem 0.9rem; border-radius: 12px; background: rgba(255, 255, 255, 0.06); overflow: hidden; isolation: isolate; }
.mb-disp-ranking li i { position: absolute; inset: 0 auto 0 0; z-index: -1; background: color-mix(in srgb, var(--eq) 40%, transparent); }
.mb-disp-ranking b { font-weight: 900; color: #fff; }
.mb-disp-ranking span { text-align: left; font-weight: 800; color: #fff; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-disp-ranking strong { font-size: 1.4rem; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.mb-disp-ranking li:first-child { box-shadow: inset 0 0 0 2px #fde047; }
.mb-disp-acoes { display: flex; gap: 0.6rem; justify-content: center; }
.mb-disp-acoes .sala-btn[hidden] { display: none; }
.mb-palco:fullscreen .mb-disp-caixa, .mb-palco.mb-expandido .mb-disp-caixa { max-width: 1400px; }
.mb-palco:fullscreen .mb-disp-barra, .mb-palco.mb-expandido .mb-disp-barra { height: 5vh; }
.mb-palco:fullscreen .mb-disp-num, .mb-palco.mb-expandido .mb-disp-num { font-size: min(30vh, 22vw); }
.mb-palco:fullscreen .mb-disp-ranking, .mb-palco.mb-expandido .mb-disp-ranking { max-width: 900px; }
.mb-palco:fullscreen .mb-disp-ranking li, .mb-palco.mb-expandido .mb-disp-ranking li { padding: 1.2vh 1.4rem; }
.mb-palco:fullscreen .mb-disp-ranking span, .mb-palco.mb-expandido .mb-disp-ranking span { font-size: 2rem; }
.mb-palco:fullscreen .mb-disp-ranking strong, .mb-palco.mb-expandido .mb-disp-ranking strong { font-size: 2.4rem; }

/* painel da disputa */
.mb-disp-tipos { margin-bottom: 0.4rem; }
.mb-disp-tipos button { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; }
.mb-disp-tipos .ico { width: 15px; height: 15px; }
.mb-disp-regra { display: block; margin-bottom: 0.7rem; }
.mb-equipes { display: flex; flex-direction: column; gap: 0.4rem; }
.mb-equipe { display: grid; grid-template-columns: 14px 1fr 34px; align-items: center; gap: 0.5rem; }
.mb-equipe-cor { width: 14px; height: 14px; border-radius: 50%; background: var(--eq); box-shadow: 0 0 0 3px color-mix(in srgb, var(--eq) 25%, transparent); }
.mb-equipe-tirar { height: 34px; border: 1px solid var(--border); border-radius: var(--radius); background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mb-equipe-tirar:hover:not(:disabled) { color: #f87171; border-color: #f87171; }
.mb-equipe-tirar:disabled { opacity: 0.3; cursor: default; }
.mb-equipe-tirar .ico { width: 15px; height: 15px; }

/* ---------- Tela cheia e TV: tudo proporcional à tela ---------- */
.mb-palco:fullscreen .mb-corpo, .mb-palco.mb-expandido .mb-corpo { padding: 1vh 3vw 6vh; }
.mb-palco:fullscreen .mb-semaforo .luz, .mb-palco.mb-expandido .mb-semaforo .luz { width: min(21vh, 17vw); }
.mb-palco:fullscreen .mb-semaforo, .mb-palco.mb-expandido .mb-semaforo { gap: 2vh; padding: 2.2vh; border-radius: 6vh; }
.mb-palco:fullscreen .mb-medidor, .mb-palco.mb-expandido .mb-medidor { max-width: none; }
.mb-palco:fullscreen .mb-info, .mb-palco.mb-expandido .mb-info { max-width: min(60vw, 900px); gap: 2.2vh; }
.mb-palco:fullscreen .mb-mensagem, .mb-palco.mb-expandido .mb-mensagem { font-size: min(10vh, 6.5vw); }
.mb-palco:fullscreen .mb-rosto, .mb-palco.mb-expandido .mb-rosto { width: min(36vh, 24vw); height: min(36vh, 24vw); }
.mb-palco:fullscreen .mb-barra, .mb-palco.mb-expandido .mb-barra { height: 3.4vh; }
.mb-palco:fullscreen .mb-gauge, .mb-palco.mb-expandido .mb-gauge { width: min(84vw, 88vh); }
.mb-palco:fullscreen .mb-gauge-num, .mb-palco.mb-expandido .mb-gauge-num { font-size: min(10vh, 12vw); }
.mb-palco:fullscreen .mb-v-bolinhas canvas, .mb-palco.mb-expandido .mb-v-bolinhas canvas { height: 64vh; }
.mb-palco:fullscreen #carinhaGrande, .mb-palco.mb-expandido #carinhaGrande { width: min(56vh, 44vw); height: min(56vh, 44vw); }
.mb-palco:fullscreen .mb-estrelas-linha img, .mb-palco.mb-expandido .mb-estrelas-linha img { width: min(6.5vh, 5vw); height: min(6.5vh, 5vw); }
.mb-palco:fullscreen .mb-proxima, .mb-palco.mb-expandido .mb-proxima { height: 1vh; width: min(40vw, 480px); }
.mb-palco:fullscreen .mb-rodape, .mb-palco.mb-expandido .mb-rodape { font-size: 1.1rem; right: 1.6rem; bottom: 1.1rem; }
.mb-palco.mb-expandido .sala-palco-titulo { font-size: 1.2rem; }
.mb-palco:not([data-visao="semaforo"]):fullscreen .mb-mensagem { font-size: min(8vh, 6vw); }
.mb-palco.mb-expandido:not([data-visao="semaforo"]) .mb-mensagem { font-size: min(8vh, 9vw); }

/* ---------- Painel ---------- */
.mb-bloco-ligar { display: flex; flex-direction: column; gap: 0.6rem; }
.mb-medidor-mini { height: 6px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.mb-medidor-mini i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #f59e0b 70%, #ef4444); background-size: 340px 100%; border-radius: inherit; transition: width 0.1s linear; }
.mb-campo-mic { margin: 0; }
.mb-campo-mic[hidden] { display: none; }

.mb-abas {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.25rem; padding: 0.25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  position: sticky; top: 64px; z-index: 5;
}
.mb-abas button {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.45rem 0.2rem; border-radius: 8px;
  border: none; background: none; color: var(--text-muted); font: inherit; font-size: 0.75rem; font-weight: 700; cursor: pointer;
}
.mb-abas button .ico { width: 17px; height: 17px; }
.mb-abas button:hover { color: var(--text); background: var(--surface-2); }
.mb-abas button.ativo { color: #fff; background: var(--primary); }
.mb-aba { display: flex; flex-direction: column; gap: 0.75rem; }
.mb-aba[hidden] { display: none; }
.mb-largo { width: 100%; }
.mb-mt { margin-top: 0.85rem; }
.mb-btn-leve { margin-top: 0.5rem; background: transparent; font-weight: 600; font-size: 0.85rem; min-height: 40px; }
.mb-ajuda-topo { margin: 0.1rem 0 0.7rem; }
.mb-ajuda-calibrar { display: block; margin-top: 0.45rem; }
.mb-painel input[type="text"] {
  width: 100%; padding: 0.5rem 0.6rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; font-size: 0.88rem;
}
.mb-painel .sala-campo label { display: flex; align-items: center; gap: 0.4rem; }
.mb-ponto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }

/* Ainda não calibrou: o botão chama atenção */
.mb-palco.mb-sem-calibrar ~ .mb-painel #btnCalibrar { border-color: var(--primary); color: var(--accent-hover); animation: mbChamar 2.4s ease-in-out infinite; }
@keyframes mbChamar {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
  50% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25); }
}

.mb-modos, .mb-visoes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.45rem; }
.mb-modo, .mb-visao-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.6rem 0.4rem;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg);
  color: var(--text-secondary); font: inherit; cursor: pointer; transition: var(--transition);
}
.mb-modo:hover, .mb-visao-card:hover { border-color: var(--border-hover); color: var(--text); }
.mb-modo.ativo, .mb-visao-card.ativo { border-color: var(--primary); background: var(--primary-light); color: #fff; box-shadow: inset 0 0 0 1px var(--primary); }
.mb-modo img { width: 32px; height: 32px; }
.mb-modo b, .mb-visao-card b { font-size: 0.86rem; }
.mb-modo small { font-size: 0.7rem; color: var(--text-muted); }

.mb-thumb { width: 100%; height: 54px; border-radius: 8px; background: radial-gradient(120% 100% at 50% 0%, #10301e, #0c0d10 70%); display: flex; align-items: center; justify-content: center; gap: 4px; }
.mb-thumb-semaforo i { width: 13px; height: 13px; border-radius: 50%; background: #ef4444; opacity: 0.2; }
.mb-thumb-semaforo i:nth-child(2) { background: #f59e0b; }
.mb-thumb-semaforo i:nth-child(3) { background: #22c55e; opacity: 1; box-shadow: 0 0 10px #22c55e; }
.mb-thumb-ponteiro svg { width: 64px; height: 38px; }
.mb-thumb-ponteiro path { fill: none; stroke-width: 6; }
.mb-thumb-ponteiro line { stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.mb-thumb-bolinhas { align-items: flex-end; padding-bottom: 8px; }
.mb-thumb-bolinhas i { width: 11px; height: 11px; border-radius: 50%; background: #60a5fa; }
.mb-thumb-bolinhas i:nth-child(2) { background: #f472b6; margin-bottom: 14px; }
.mb-thumb-bolinhas i:nth-child(3) { background: #fbbf24; margin-bottom: 6px; }
.mb-thumb-bolinhas i:nth-child(4) { background: #34d399; margin-bottom: 20px; }
.mb-thumb-bolinhas i:nth-child(5) { background: #a78bfa; margin-bottom: 3px; }
.mb-thumb-carinha svg { width: 48px; height: 48px; }

.mb-mini-grafico { width: 100%; height: 90px; border-radius: 8px; display: block; }
.mb-mini-stats { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin: 0.6rem 0 0.7rem; font-size: 0.8rem; color: var(--text-muted); }
.mb-mini-stats strong { color: var(--text); margin-left: 0.2rem; }

.mb-privacidade { display: flex; gap: 0.45rem; align-items: flex-start; font-size: 0.75rem; color: var(--text-subtle); line-height: 1.45; padding: 0 0.25rem; }
.mb-privacidade .ico { flex-shrink: 0; width: 14px; height: 14px; margin-top: 0.1rem; }

/* ---------- Mais coisas para a sua sala (abaixo do medidor) ---------- */
.mb-mais { margin: 2rem 0 0.5rem; }
.mb-mais h2 { font-size: 1.35rem; font-weight: 800; color: var(--text); margin: 0 0 0.3rem; }
.mb-mais-sub { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 1.1rem; }
.mb-mais h3 { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 1.1rem 0 0.6rem; }
.mb-mais-grade { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.mb-mais-card { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.9rem; border-radius: var(--radius-lg, 14px); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s, background 0.15s; }
.mb-mais-card:hover, .mb-mais-card:focus-visible { border-color: var(--cor); background: var(--surface-hover); transform: translateY(-2px); }
.mb-mais-ico { flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); background: color-mix(in srgb, var(--cor) 18%, transparent); color: var(--cor); }
.mb-mais-ico .ico { width: 22px; height: 22px; }
.mb-mais-txt { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.mb-mais-txt b { font-size: 0.95rem; line-height: 1.25; }
.mb-mais-txt small { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
.mb-mais-todas { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1.1rem; padding: 0.7rem 1.2rem; border-radius: 999px; background: var(--primary); color: var(--primary-contrast); font-weight: 700; text-decoration: none; }
.mb-mais-todas:hover { background: var(--primary-hover); }
.mb-mais-todas .ico { width: 18px; height: 18px; }
@media (max-width: 1024px) { .mb-mais-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) {
  .mb-mais h2 { font-size: 1.15rem; }
  .mb-mais-card { flex-direction: column; gap: 0.5rem; padding: 0.75rem; }
  .mb-mais-txt small { display: none; }
  .mb-mais-txt b { font-size: 0.88rem; }
  .mb-mais-todas { width: 100%; justify-content: center; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1024px) {
  .mb-palco { min-height: 520px; }
  .mb-abas { top: 56px; }
}

@media (max-width: 700px) {
  .mb-some-cel { display: none; }
  /* no celular: o botão de trocar a tela ganha nome, "controlar pelo celular" não faz sentido e os botões crescem para o dedo */
  #btnVisao .mb-some-cel { display: inline; }
  .mb-palco .sala-palco-acoes [data-celular] { display: none; }
  .mb-palco .sala-icon-btn { height: 40px; min-width: 40px; }
  .chat-fab { width: 44px; height: 44px; right: 0.6rem; bottom: 0.6rem; }
  .mb-palco { min-height: 470px; }
  .mb-corpo { padding: 0.25rem 0.75rem 2.4rem; }
  .mb-palco[data-visao="semaforo"] .mb-medidor { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; gap: 1rem; }
  .mb-semaforo { flex-direction: row; border-radius: 999px; padding: 14px 16px; gap: 10px; }
  .mb-semaforo::after { display: none; }
  .mb-foco { padding: 4px; }
  .mb-semaforo .luz { width: clamp(52px, 18vw, 80px); }
  .mb-rosto { width: 116px; height: 116px; }
  .mb-res-grade { grid-template-columns: repeat(2, 1fr); }
  .mb-abas button { font-size: 0.68rem; }
  .mb-rodape { left: 0; right: 0; justify-content: center; }
  .mb-v-bolinhas canvas { height: 240px; }
  .mb-palco.mb-expandido[data-visao="semaforo"] .mb-semaforo .luz { width: min(14vh, 22vw); }
  .mb-palco.mb-expandido .mb-info { max-width: 100%; }
}

@media (max-width: 480px) {
  .mb-pilula { display: none; }
  .mb-convite > .ico { display: none; }
  .mb-convite { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .mb-inicio-fig, .mb-rosto, .mb-v-carinha svg, .mb-estrelas-linha img.nova, .mb-festa img { animation: none !important; }
}

/* ---------- Diário da turma e o que pede conta ---------- */
.mb-diario { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.mb-diario-texto { margin: 0 0 0.7rem; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.45; }
#diarioConta .mb-diario-texto { margin: 0.6rem 0 0; }
.mb-diario-linha { display: flex; gap: 0.5rem; }
.mb-diario-linha input { flex: 1; min-width: 0; }
.mb-diario-linha .sala-btn { flex-shrink: 0; white-space: nowrap; }
.mb-diario-linha .sala-btn.mb-salva { background: #166534; border-color: #166534; }
.mb-diario-ver {
  display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.55rem; padding: 0; border: none; background: none;
  color: var(--accent); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.mb-diario-ver .ico { width: 14px; height: 14px; }
.mb-diario-ver[hidden] { display: none; }
.mb-aulas-media { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--text-secondary); }
.mb-aula-item { padding: 0.55rem 0; border-top: 1px solid var(--border); }
.mb-aula-topo { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.mb-aula-topo span { flex: 1; color: var(--text-muted); font-size: 0.8rem; }
.mb-aula-apagar { border: none; background: none; color: var(--text-subtle); cursor: pointer; padding: 0.2rem; border-radius: 6px; }
.mb-aula-apagar:hover { color: #ef4444; background: var(--surface-2); }
.mb-aula-apagar .ico { width: 15px; height: 15px; }
.mb-aula-barra { height: 8px; margin: 0.35rem 0 0.3rem; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.mb-aula-barra i { display: block; height: 100%; border-radius: 99px; }
.mb-aula-item small { font-size: 0.76rem; color: var(--text-muted); }

.mb-tranca { display: none; }
.mb-aba.mb-trancado > :not(.mb-tranca) { display: none; }
.mb-aba.mb-trancado > .mb-tranca { display: block; }
.mb-tranca p { margin: 0 0 0.5rem; font-size: 0.88rem; line-height: 1.45; }
.mb-tranca p .ico { color: #f59e0b; vertical-align: -2px; }
.mb-cadeado { display: none; }
.mb-sem-conta .mb-cadeado {
  display: block; position: absolute; top: 4px; right: 5px; width: 11px; height: 11px; color: #f59e0b;
}
.mb-abas button, .mb-visao-card, #btnFlutuante, #btnFlutuante2 { position: relative; }

/* ---------- Convite para ajustar ao silêncio (primeira vez) ---------- */
.mb-convite {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 0.7rem;
  margin-top: 0.4rem; padding: 0.55rem 0.6rem 0.55rem 0.9rem; border-radius: 16px;
  background: rgba(23, 25, 31, 0.92); border: 1px solid color-mix(in srgb, var(--primary) 60%, transparent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); font-size: 0.88rem; color: var(--text-secondary); text-align: left;
  animation: salaSubir 0.3s ease;
}
.mb-convite[hidden] { display: none; }
.mb-convite > .ico { flex-shrink: 0; width: 18px; height: 18px; color: var(--accent); }
.mb-convite b { color: var(--text); }
.mb-convite .sala-btn { min-height: 38px; padding: 0.35rem 0.9rem; font-size: 0.86rem; white-space: nowrap; }
.mb-convite-x { display: grid; place-items: center; width: 32px; height: 32px; border: none; border-radius: 50%; background: none; color: var(--text-muted); cursor: pointer; }
.mb-convite-x:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.mb-convite-x .ico { width: 16px; height: 16px; }
.mb-palco:fullscreen .mb-convite { font-size: 1.1rem; }

/* Antes de ligar, o botão grande fica só na tela (sem repetir no painel); medindo, some a dica de teclas */
.mb-app:not(.mb-ligou) .mb-bloco-ligar { display: none; }
.mb-palco.mb-ligou .sala-dica-teclas { display: none; }

/* ---------- Ajustes finos (análise de 11/11) ---------- */
/* resultado e calibração: fundo quase fechado, para o texto de trás não vazar */
#resultado, #calibrando { background: rgba(8, 9, 12, 0.96); }
/* alvos de toque */
.mb-aula-apagar { min-width: 38px; min-height: 38px; display: inline-grid; place-items: center; }
.mb-diario-ver { padding: 0.55rem 0; margin-top: 0.2rem; }
.mb-convite .sala-btn { min-height: 40px; }
.mb-convite-x { width: 40px; height: 40px; }
/* a última aula como meta, na tela de início */
.mb-inicio-meta { margin: 0; padding: 0.55rem 0.9rem; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--text-secondary); font-size: 0.95rem; line-height: 1.45; }
.mb-inicio-meta[hidden], #statMeta[hidden] { display: none; }
.mb-inicio-meta b { font-weight: 800; }
/* lembrete de guardar a página */
.mb-guardar[hidden] { display: none; }
.mb-guardar p { margin: 0 0 0.4rem; font-size: 0.9rem; line-height: 1.45; }
.mb-guardar p .ico { color: #fbbf24; vertical-align: -3px; }
