:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #101828;
  --muted: rgba(16, 24, 40, 0.62);
  --border: rgba(16, 24, 40, 0.12);
  --shadow: 0 14px 36px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 8px 20px rgba(16, 24, 40, 0.06);

  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --correct: #10b981;
  --correct-bg: #d1fae5;
  --wrong: #ef4444;
  --wrong-bg: #fee2e2;
  --blue-2: #3b82f6;
  --green: #2bb673;
  --orange: #ff9f43;
  --red: #e04f5f;

  --gold: #d9b17a;
  --silver: #bcb6ad;
  --bronze: #8c7359;

  /* A roxo, B azul, C laranja, D verde (cards e gráficos) */
  --optA: #7c3aed;
  --optB: #2563eb;
  --optC: #ea580c;
  --optD: #16a34a;

  /* Escala EdTech — espaçamento, raios e foco (consistência entre telas) */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --focus-ring-color: rgba(37, 99, 235, 0.45);
  --focus-ring: 0 0 0 3px var(--focus-ring-color);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);

  /* Tipografia — escala modular (1rem = 16px). Hierarquia: xs → display */
  --text-xs: 0.75rem; /* 12 — labels, kickers */
  --text-sm: 0.875rem; /* 14 — secundário, UI densa */
  --text-base: 1rem; /* 16 — corpo, inputs, botões padrão */
  --text-md: 1.0625rem; /* 17 */
  --text-lg: 1.125rem; /* 18 — subtítulos, cartões aluno */
  --text-xl: 1.25rem; /* 20 — ênfase, timer */
  --text-2xl: 1.375rem; /* 22 — pergunta no painel */
  --text-3xl: 1.5rem; /* 24 */
  --text-4xl: 1.875rem; /* 30 */
  --text-5xl: 2.25rem; /* 36 — pódio / títulos fortes */
  --text-6xl: 2.625rem; /* 42 — progresso destaque */
  --text-display-sm: 2rem; /* 32 — título dashboard */
  --text-display-md: 2.5rem; /* 40 — título página professor */
  --text-display: 3rem; /* 48 — landing / troféu */

  --leading-tight: 1.18;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.55;

  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  --font-black: 900;

  /* Modo teatro: bases do A+/A− + encaixe JS (mantém valores pedidos) */
  --text-theater-question: 1.2rem;
  --text-theater-option: 0.8rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(900px 600px at 18% -10%, rgba(90, 72, 255, 0.14), transparent 55%),
    radial-gradient(900px 700px at 82% 0%, rgba(22, 163, 255, 0.12), transparent 55%),
    radial-gradient(1200px 800px at 50% 100%, rgba(255, 159, 67, 0.1), transparent 55%), var(--bg);
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Foco visível — teclado e leitores (não remove outline sem substituto) */
:focus:not(:focus-visible) {
  outline: none;
}

button:focus-visible,
.btn2:focus-visible,
.btnWide:focus-visible,
.btnHuge:focus-visible,
.actionBtn:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.input:focus-visible,
select.input:focus-visible,
textarea.input:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--shadow-soft), var(--focus-ring);
}

.whatsappFloat:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.bg {
  background: var(--bg);
}

.whatsappFloat {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #25d366;
  color: white;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: transform 0.2s;
  text-decoration: none;
  font-weight: var(--font-bold);
  font-size: var(--text-base);
  gap: 8px;
}
.whatsappFloat:hover {
  transform: scale(1.05);
  color: white;
}
.whatsappFloat svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Manual interativo (tour): camadas separadas para o assistente «Criar sala» ficar entre o escurecimento e o card */
#cqManualBackdrop {
  position: fixed;
  inset: 0;
  z-index: 2400;
  background: rgba(2, 6, 23, 0.62);
}
#cqManualBackdrop.hidden {
  display: none !important;
}
#cqManualSpot {
  position: fixed;
  z-index: 2510;
  border-radius: 14px;
  box-shadow:
    0 0 0 9999px rgba(2, 6, 23, 0.52),
    0 0 0 4px rgba(255, 255, 255, 0.92),
    0 18px 60px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  display: none;
}
#cqManualCard {
  position: fixed;
  z-index: 2520;
  box-sizing: border-box;
  width: min(420px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(76vh, 760px);
  overflow: auto;
  overflow-x: hidden;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.35);
  padding: 14px 14px 12px;
}
#cqManualCard.hidden {
  display: none !important;
}
/* Com o tour nos passos do assistente, o modal fica acima do escurecimento e abaixo do destaque + card */
body.cardquiz-manualTour--modalStep #createRoomModal.qrModal:not(.hidden) {
  z-index: 2500 !important;
}

/* Destaque extra no alvo do passo (botões «clique aqui») */
@keyframes cqManualTargetPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(37, 99, 235, 0.95),
      0 0 18px rgba(37, 99, 235, 0.45);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(59, 130, 246, 0.75),
      0 0 28px rgba(37, 99, 235, 0.65);
  }
}
.cqManualTargetEmphasis {
  position: relative;
  z-index: 2515;
  outline: 3px solid rgba(37, 99, 235, 0.95);
  outline-offset: 3px;
  border-radius: inherit;
  animation: cqManualTargetPulse 1.15s ease-in-out infinite;
}

.cqManualTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cqManualDragHandle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.cqManualDragHandle:active {
  cursor: grabbing;
}
.cqManualDragGrip {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
  color: #94a3b8;
  letter-spacing: -2px;
}
.cqManualStepPill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-weight: var(--font-extrabold);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
}
.cqManualClose {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: var(--font-extrabold);
}
.cqManualTitle {
  font-size: var(--text-lg);
  font-weight: var(--font-extrabold);
  color: #0f172a;
  line-height: var(--leading-snug);
  margin-bottom: 8px;
}
.cqManualBody {
  font-size: var(--text-sm);
  color: #334155;
  line-height: var(--leading-relaxed);
  overflow-wrap: anywhere;
  word-wrap: break-word;
}
.cqManualFooter {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.cqManualNoShow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: #0f172a;
  user-select: none;
}
.cqManualActions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.cqManualList {
  margin: 10px 0 0;
  padding-left: 1.2rem;
}
.cqManualHint {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #0f172a;
}
.cqManualExample {
  margin-top: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.04);
}
.cqManualExampleTitle {
  font-weight: var(--font-extrabold);
  color: #0f172a;
  margin-bottom: 8px;
}
.cqManualExampleGrid {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: var(--text-sm);
  color: #0f172a;
}

.panel {
  position: relative;
  z-index: 2;
}

.hidden {
  display: none !important;
}

.authBootBanner {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  background: #fef3f2;
  color: #b42318;
  padding: 10px 20px;
  text-align: center;
}

#authBootError.authBootBanner {
  border-bottom: 1px solid #fecdca;
}

.loginSection .authBootBanner {
  max-width: 520px;
  margin: 0 auto 14px;
  border-radius: 10px;
  border: 1px solid #fecdca;
}

.page {
  max-width: 1220px;
  margin: 0 auto;
  padding: 42px 22px 64px;
}

@media (max-width: 640px) {
  .page {
    padding: 24px 16px 48px;
  }
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 26px;
  margin: 0 auto;
}

.panelWide {
  max-width: 880px;
}

.panelNarrow {
  max-width: 560px;
  text-align: center;
}

.notice {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(90, 72, 255, 0.22);
  background: rgba(90, 72, 255, 0.08);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin-bottom: 14px;
}

/* Aviso: recursos experimentais (IA / PDF) */
.notice--experimental {
  border-color: rgba(180, 83, 9, 0.42);
  background: rgba(251, 191, 36, 0.14);
  font-weight: var(--font-semibold, 600);
}

.input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 14px;
  font-size: var(--text-base);
  background: #fff;
  box-shadow: var(--shadow-soft);
  outline: none;
  transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

.inputBig {
  padding: 16px 16px;
  font-size: var(--text-lg);
}

.loginForm {
  display: grid;
  gap: 18px;
}

.loginTitle {
  font-weight: var(--font-bold);
  font-size: var(--text-lg);
  text-align: center;
  color: var(--text);
}

.loginSubtitle {
  font-weight: var(--font-bold);
  font-size: var(--text-base);
  color: var(--text);
  margin-top: 6px;
}

.avatarGrid2 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 720px) {
  .avatarGrid2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.avatarCard {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  padding: 18px 12px 16px;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.avatarCard.selected {
  border: 2px solid var(--blue);
  box-shadow: 0 0 0 4px rgba(90, 72, 255, 0.18);
}

.avatarCircle {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: #fbfbfd;
}

.avatarCircle svg {
  width: 40px;
  height: 40px;
}

.avatarCircle img {
  width: 40px;
  height: 40px;
}

.avatarLabel {
  font-weight: 600;
  color: var(--text);
}

.avatarCheck {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  opacity: 0;
  transform: scale(0.9);
  transition: 120ms ease;
}

.avatarCard.selected .avatarCheck {
  opacity: 1;
  transform: scale(1);
}

.btn2 {
  border: 0;
  border-radius: 16px;
  padding: 20px 24px;
  font-size: var(--text-lg);
  font-weight: var(--font-extrabold);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn2:active {
  transform: scale(0.98);
}

.btn2.primary {
  background: var(--blue);
  color: #fff;
}

.btn2.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.waitTitle {
  font-weight: var(--font-extrabold);
  font-size: var(--text-xl);
  color: var(--blue);
}

.waitSubtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.waitLoader {
  margin: 18px auto 0;
  display: inline-flex;
  gap: 10px;
}

.waitLoader .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(90, 72, 255, 0.35);
  animation: pulse 1s ease-in-out infinite;
}

.waitLoader .dot:nth-child(2) {
  animation-delay: 0.15s;
}

.waitLoader .dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.quiz {
  max-width: 1120px;
  margin: 0 auto;
}

.quizTop {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px 10px;
}

.quizMeta {
  color: var(--text);
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}

.quizRight {
  text-align: right;
}

.quizPercent {
  color: var(--blue);
  font-weight: var(--font-extrabold);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
}

.quizTime {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 2px solid rgba(90, 72, 255, 0.26);
  background: rgba(90, 72, 255, 0.1);
  color: rgba(16, 24, 40, 0.78);
  font-size: var(--text-xl);
  font-weight: var(--font-black);
  letter-spacing: 0.2px;
  box-shadow: var(--shadow-soft);
}

.quizTime.urgent {
  border-color: rgba(224, 79, 95, 0.38);
  background: rgba(224, 79, 95, 0.12);
  color: rgba(224, 79, 95, 1);
  animation: tick 700ms ease-in-out infinite;
}

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

.progress {
  height: 10px;
  border-radius: 999px;
  background: #e9edf5;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.progressFill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--orange) 100%);
}

.questionCard {
  margin-top: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 26px 22px;
  text-align: center;
}

.questionText2 {
  font-size: clamp(1.25rem, 4.5vw, 1.75rem);
  font-weight: var(--font-extrabold);
  color: var(--text);
  line-height: var(--leading-snug);
}

/* Cabeçalho e avisos — sala do aluno */
.sHeader {
  text-align: center;
  margin-bottom: var(--space-5);
}
.sHeaderLogo {
  height: 50px;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;
}
.sSubtitle {
  font-size: var(--text-sm);
  font-weight: var(--font-extrabold);
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.studentResponseNotice {
  margin: 0 auto var(--space-5);
  text-align: center;
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  max-width: 42rem;
}
.studentOptionsHint {
  text-align: center;
  margin-top: var(--space-4);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
  max-width: 38rem;
}

.optionsGrid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

@media (max-width: 760px) {
  .optionsGrid {
    grid-template-columns: 1fr;
  }
}

.optCard {
  --opt: var(--optA);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  padding: 18px 18px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 14px;
  text-align: left;
  min-height: 84px;
  transition: transform 90ms ease, box-shadow 90ms ease, border-color 90ms ease;
}

.optCard:disabled {
  cursor: not-allowed;
  opacity: 0.9;
}

.optCard:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.12);
}

.optCard:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), var(--shadow-soft);
  border-color: var(--blue);
}

.optCard[data-letter="A"] {
  --opt: var(--optA);
}

.optCard[data-letter="B"] {
  --opt: var(--optB);
}

.optCard[data-letter="C"] {
  --opt: var(--optC);
}

.optCard[data-letter="D"] {
  --opt: var(--optD);
}

.optLetter {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--opt);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: var(--font-extrabold);
  font-size: var(--text-lg);
  letter-spacing: 0.3px;
}

.optText {
  font-size: var(--text-lg);
  font-weight: var(--font-extrabold);
  color: rgba(16, 24, 40, 0.86);
  line-height: var(--leading-tight);
}

.optCard.chosen {
  border-color: rgba(16, 24, 40, 0.22);
}

.optCard.chosen[data-letter="A"] {
  border-color: rgba(90, 72, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(90, 72, 255, 0.18), var(--shadow-soft);
}

.optCard.chosen[data-letter="B"] {
  border-color: rgba(22, 163, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(22, 163, 255, 0.18), var(--shadow-soft);
}

.optCard.chosen[data-letter="C"] {
  border-color: rgba(255, 159, 67, 0.75);
  box-shadow: 0 0 0 4px rgba(255, 159, 67, 0.2), var(--shadow-soft);
}

.optCard.chosen[data-letter="D"] {
  border-color: rgba(43, 182, 115, 0.75);
  box-shadow: 0 0 0 4px rgba(43, 182, 115, 0.18), var(--shadow-soft);
}

.optCard.correct {
  border-color: var(--correct);
  background: var(--correct-bg);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14), var(--shadow-soft);
}

.optCard.correct .optLetter {
  background: var(--correct);
}

.optCard.correct .optText {
  color: rgba(16, 24, 40, 0.9);
}

.optCard.correct::after {
  content: "✓";
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(16, 185, 129, 0.16);
  color: var(--correct);
  font-weight: 900;
}

.optCard.wrong {
  border-color: var(--wrong);
  background: var(--wrong-bg);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14), var(--shadow-soft);
}

.optCard.wrong.chosen .optLetter {
  background: var(--wrong);
}

.bonusWrap {
  margin-top: 26px;
}

.qrAnswerWrap {
  margin-top: 22px;
  border-radius: 22px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  padding: 18px 18px;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.qrAnswerTitle {
  font-weight: var(--font-black);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: rgba(16, 24, 40, 0.86);
  text-align: center;
}

.qrAnswerImg {
  width: min(320px, 70vw);
  height: auto;
  border-radius: 18px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.qrAnswerMeta {
  color: var(--muted);
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  text-align: center;
}

.bonusBanner {
  border-radius: 18px;
  border: 2px solid rgba(90, 72, 255, 0.28);
  background: linear-gradient(90deg, rgba(90, 72, 255, 0.16), rgba(43, 182, 115, 0.12));
  padding: 22px 18px;
  text-align: center;
  font-size: var(--text-xl);
  font-weight: var(--font-extrabold);
  color: rgba(43, 182, 115, 1);
  box-shadow: var(--shadow-soft);
}

.finalHeader {
  text-align: center;
  margin-bottom: 18px;
}

.finalTitleRow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.finalTitle {
  font-size: var(--text-5xl);
  font-weight: var(--font-black);
  color: var(--blue);
  line-height: var(--leading-tight);
}

.trophy {
  font-size: var(--text-3xl);
  opacity: 0.7;
}

.finalSubtitle {
  margin-top: 6px;
  color: var(--muted);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
}

.finalIcons {
  margin-top: 18px;
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

.finalIcon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
}

.finalIcon svg {
  width: 42px;
  height: 42px;
}

.finalIcon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.podium2 {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
}

@media (max-width: 860px) {
  .podium2 {
    grid-template-columns: 1fr;
  }
}

.podiumCol {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.podiumTop {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.podiumAvatar {
  width: 82px;
  height: 82px;
  border-radius: 999px;
  background: #fff;
  border: 4px solid #e9edf5;
  box-shadow: var(--shadow-soft);
  display: grid;
  place-items: center;
  position: relative;
}

.podiumAvatar svg {
  width: 54px;
  height: 54px;
}

.podiumAvatar img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  display: block;
}

.podiumAvatar.empty {
  opacity: 0.5;
}

.podiumRank {
  position: absolute;
  bottom: -10px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 3px solid #e9edf5;
  font-weight: 900;
  color: rgba(21, 34, 56, 0.7);
}

.podiumName {
  font-weight: 900;
  font-size: 16px;
  color: var(--text);
}

.podiumScore {
  font-weight: 900;
  font-size: 28px;
  color: var(--blue);
  line-height: 1;
}

.podiumScore span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.podiumBase {
  width: 100%;
  max-width: 220px;
  border-radius: 14px 14px 0 0;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(21, 34, 56, 0.08);
}

.podiumPosText {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  font-size: 34px;
}

.pos1 .podiumBase {
  height: 210px;
  background: linear-gradient(180deg, rgba(217, 177, 122, 0.95), rgba(217, 177, 122, 0.82));
}

.pos2 .podiumBase {
  height: 180px;
  background: linear-gradient(180deg, rgba(188, 182, 173, 0.95), rgba(188, 182, 173, 0.82));
}

.pos3 .podiumBase {
  height: 160px;
  background: linear-gradient(180deg, rgba(140, 115, 89, 0.95), rgba(140, 115, 89, 0.82));
}

.ranking2 {
  margin-top: 26px;
  max-height: 420px;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding-right: 6px;
}

.rankRow2 {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  padding: 14px 14px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 16px;
  align-items: center;
}

.rankMe {
  box-shadow: 0 0 0 4px rgba(224, 140, 98, 0.18), var(--shadow-soft);
  border-color: rgba(224, 140, 98, 0.35);
}

.rankPos2 {
  font-weight: var(--font-black);
  font-size: var(--text-lg);
  color: rgba(21, 34, 56, 0.6);
  text-align: center;
  line-height: 1;
}

.rankAvatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fbfbfd;
  display: grid;
  place-items: center;
}

.rankAvatar svg {
  width: 32px;
  height: 32px;
}

.rankAvatar img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.rankNameWrap {
  display: grid;
  gap: 4px;
}

.rankName {
  font-weight: var(--font-black);
  font-size: var(--text-base);
  line-height: var(--leading-snug);
  color: var(--text);
}

.rankSub {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: var(--leading-normal);
}

.rankPts {
  font-weight: var(--font-black);
  color: var(--blue);
  font-size: var(--text-base);
  text-align: right;
  min-width: 80px;
}

.rankPts span {
  display: block;
  font-weight: var(--font-bold);
  color: var(--muted);
  font-size: var(--text-xs);
  text-align: right;
}

/* Professor */

.tHeader {
  margin-bottom: 22px;
}

.tTitleRow {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.tTitle {
  font-size: var(--text-display-md);
  font-weight: var(--font-black);
  color: var(--blue);
  letter-spacing: -0.04em;
  line-height: var(--leading-tight);
}

.tSubtitle {
  margin-top: 4px;
  color: var(--muted);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.authBar {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.authUser {
  font-weight: var(--font-black);
  font-size: var(--text-sm);
  color: rgba(16, 24, 40, 0.86);
}

.authLogin {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.authHint {
  color: rgba(16, 24, 40, 0.7);
  font-weight: var(--font-extrabold);
  font-size: var(--text-sm);
}

.googleBtn {
  min-height: 40px;
}

.tTopGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
  margin-bottom: 24px;
}

@media (max-width: 1040px) {
  .tTopGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.statCard {
  --stat: var(--blue);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.statCard.blue { --stat: var(--optA); }
.statCard.green { --stat: var(--optD); }
.statCard.orange { --stat: var(--optC); }
.statCard.blue2 { --stat: var(--blue-2); }

.statCard::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--stat);
}

.statHeader {
  display: flex;
  align-items: center;
  gap: 12px;
}

.statIcon {
  font-size: var(--text-3xl);
  line-height: 1;
}

.statValue {
  font-size: var(--text-display-sm);
  font-weight: var(--font-black);
  line-height: 1;
}

.statLabel {
  font-size: var(--text-base);
  color: var(--muted);
  font-weight: var(--font-semibold);
  display: flex;
  align-items: center;
  gap: 6px;
}

.statLabel::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--stat);
}

/* Dashboard Header */
.dashHeader {
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  padding: 12px clamp(16px, 4vw, 40px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
  flex-wrap: wrap;
}
.dashLogoWrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dashLogoWrap img {
  height: 40px;
  width: auto;
  max-width: min(220px, 52vw);
  object-fit: contain;
}

/* Dashboard Title Area */
.dashTitleWrap {
  margin-top: 30px;
  margin-bottom: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dashTitleCluster {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 260px;
  min-width: 0;
}
.dashTitle {
  font-size: var(--text-display-sm);
  font-weight: var(--font-black);
  color: #101828;
  margin: 0;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}
.dashSubtitle {
  font-size: var(--text-lg);
  color: var(--muted);
  font-weight: var(--font-semibold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btnSupportProject {
  appearance: none;
  border: 2px solid rgba(220, 38, 38, 0.35);
  background: linear-gradient(180deg, #fff 0%, #fff5f5 100%);
  color: #991b1b;
  font-weight: var(--font-black);
  font-size: var(--text-md);
  font-family: inherit;
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.btnSupportProject:hover {
  border-color: rgba(220, 38, 38, 0.55);
  box-shadow: 0 10px 28px rgba(220, 38, 38, 0.18);
  transform: translateY(-1px);
}
.btnSupportProject:active {
  transform: translateY(0);
}
.btnSupportProjectIcon {
  font-size: 1.15em;
  line-height: 1;
}

.supportPixModal {
  z-index: 20040;
  /* Respiro nas bordas do ecrã (taskbar, notch) */
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  box-sizing: border-box;
}
.supportPixModal .supportPixModalBackdrop {
  background: rgba(15, 23, 42, 0.52);
}
/* Tipografia e QR — o layout do cartão está em .qrModalCard.supportPixCard (depois de .qrModalCard) */
.supportPixTitle {
  font-size: clamp(var(--text-lg), 2.8vw, 1.35rem);
  line-height: var(--leading-tight);
  padding-right: 28px;
  flex-shrink: 0;
  text-align: center;
}
.supportPixImpact {
  margin: 0;
  font-size: clamp(var(--text-sm), 2.4vw, var(--text-md));
  font-weight: var(--font-semibold);
  line-height: var(--leading-normal);
  color: rgba(16, 24, 40, 0.88);
  text-align: left;
  flex-shrink: 0;
}
.supportPixImpact strong {
  color: #0f172a;
  font-weight: 900;
}
.supportPixBeneficiary {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  font-size: clamp(var(--text-xs), 2.2vw, var(--text-sm));
  font-weight: var(--font-semibold);
  line-height: var(--leading-relaxed);
  color: rgba(16, 24, 40, 0.9);
  text-align: center;
  flex-shrink: 0;
}
.supportPixBeneficiary strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 900;
  color: #0f172a;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.supportPixBeneficiaryRole {
  display: inline;
  font-weight: var(--font-semibold);
  color: rgba(16, 24, 40, 0.78);
}
.supportPixQrWrap {
  margin: 6px auto 0;
  padding: clamp(6px, 1.5vw, 10px);
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  max-width: 100%;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.supportPixQrImg {
  display: block;
  width: auto;
  height: auto;
  max-width: min(240px, 100%);
  max-height: min(240px, 34vh, 52vw);
  border-radius: 10px;
  object-fit: contain;
}
.supportPixHint {
  margin: 8px 0 0;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--muted);
  line-height: var(--leading-relaxed);
  flex-shrink: 0;
}

/* Active Room Card */
.activeRoomCard {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px 32px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}
.activeRoomInfo {
  font-size: var(--text-xl);
  color: var(--blue);
  font-weight: var(--font-extrabold);
  display: flex;
  align-items: center;
  gap: 10px;
}
.activeRoomActions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1024px) {
  .activeRoomActions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .activeRoomCard {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
  }
}
.btnHuge {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: var(--text-sm);
  font-weight: var(--font-extrabold);
  cursor: pointer;
  transition: transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btnHuge:active { transform: scale(0.98); }
.btnHuge:disabled { opacity: 0.5; cursor: not-allowed; }
.btnHuge.primary { background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2); }
.btnHuge.outline { background: #fff; color: var(--text); border: 2px solid var(--border); }
.btnHuge.outline.danger { color: var(--red); }

.btnHuge:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Dashboard Columns */
.dashColumns {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
}
.dashColumns .infoCard {
  box-shadow: var(--shadow-soft);
}
@media (max-width: 900px) {
  .dashColumns { grid-template-columns: 1fr; }
}

.cameraStatusCard {
  background: #eefdf4;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
}
.camStatusIcon {
  color: var(--correct);
  font-weight: var(--font-black);
  font-size: var(--text-sm);
  margin-bottom: 4px;
}
.camStatusText {
  color: var(--text);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  margin-bottom: 12px;
}

.cameraStatusCard .scanVideoWrap {
  min-height: 250px;
  height: auto;
}

.cameraStatusCard .scanTheaterControls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.cameraStatusCard .scanTheaterControls + .scanTheaterControls {
  margin-top: 10px;
}
.cameraStatusCard .scanTheaterControls .scanDockBtn {
  padding: 10px 14px;
}
.dashCameraSelect {
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: var(--font-black);
}
.scanDockBtn--neutral {
  background: #e2e8f0;
  color: #0f172a;
  border: none;
}

body:not(.theater-mode) #videoWrap.scanVideoWrap {
  margin-top: 15px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
body:not(.theater-mode) #videoWrap .scanVideo {
  width: 100%;
  display: block;
}
body:not(.theater-mode) #videoWrap .scanOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Horizontal Bar Chart */
.barChart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.barItem {
  display: flex;
  align-items: center;
  gap: 12px;
}
.barLabel {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  display: grid;
  place-items: center;
  font-weight: var(--font-black);
  font-size: var(--text-sm);
  flex-shrink: 0;
}
.barItem[data-letter="A"] .barLabel { background: var(--optA); }
.barItem[data-letter="B"] .barLabel { background: var(--optB); }
.barItem[data-letter="C"] .barLabel { background: var(--optC); }
.barItem[data-letter="D"] .barLabel { background: var(--optD); }

.barTrack {
  flex: 1;
  height: 12px;
  background: #f0f0f0;
  border-radius: 999px;
  overflow: hidden;
}
.barFill {
  height: 100%;
  width: 0; /* JS will set width instead of height now */
  border-radius: 999px;
  transition: width 0.3s ease;
}
.barItem[data-letter="A"] .barFill { background: var(--optA); }
.barItem[data-letter="B"] .barFill { background: var(--optB); }
.barItem[data-letter="C"] .barFill { background: var(--optC); }
.barItem[data-letter="D"] .barFill { background: var(--optD); }

.barValue {
  font-weight: var(--font-black);
  font-size: var(--text-sm);
  width: 40px;
  text-align: right;
}

.scanOpt {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
}
.scanOptBadge {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: white;
  display: grid;
  place-items: center;
  font-weight: var(--font-black);
  font-size: var(--text-xl);
  flex-shrink: 0;
}
.scanOptText {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text);
  line-height: var(--leading-snug);
}

.scanOpt[data-letter="A"] .scanOptBadge { background: var(--optA); }
.scanOpt[data-letter="B"] .scanOptBadge { background: var(--optB); }
.scanOpt[data-letter="C"] .scanOptBadge { background: var(--optC); }
.scanOpt[data-letter="D"] .scanOptBadge { background: var(--optD); }

.scanOpt.wrong {
  opacity: 0.5;
  filter: grayscale(1);
}
.scanOpt.correct {
  border: 2px solid var(--correct);
  background: #f0fdf4;
  transform: scale(1.02);
}

.controlCard {
  background: var(--card);
  border: 1px solid rgba(90, 72, 255, 0.22);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.marketingGrid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

@media (max-width: 980px) {
  .marketingGrid {
    grid-template-columns: 1fr;
  }
}

.marketingCard {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.marketingTitle {
  font-weight: var(--font-black);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--text);
}

.marketingText {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: rgba(16, 24, 40, 0.88);
}

.ruleList {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: rgba(16, 24, 40, 0.86);
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.whatsappBtn {
  background: rgba(43, 182, 115, 1);
  border-color: rgba(43, 182, 115, 1);
  color: #fff;
}

.whatsappBtn:hover {
  filter: brightness(0.96);
}

.whatsappBtn:focus-visible {
  outline: 3px solid rgba(43, 182, 115, 0.35);
  outline-offset: 2px;
}

.whatsIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
}

.controlTitle {
  font-weight: 900;
  color: var(--text);
}

.btnWide {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: rgba(16, 24, 40, 0.86);
  border-radius: 14px;
  padding: 14px 14px;
  font-size: var(--text-base);
  font-weight: var(--font-black);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.1s;
}

.btnWide:active {
  transform: scale(0.98);
}

.btnWide.primary {
  border: 0;
  background: var(--blue);
  color: #fff;
}

.btnWide.danger {
  border: 0;
  background: var(--red);
  color: #fff;
}

.btnWide:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btnWide:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), var(--shadow-soft);
}

.btnWide.primary:focus-visible {
  box-shadow: var(--focus-ring), 0 8px 20px rgba(37, 99, 235, 0.25);
}

.qrSmallWrap {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.qrSmall {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fbfbfd;
}

.joinLink {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  word-break: break-all;
}

.tMidGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
  align-items: start;
}

@media (max-width: 1040px) {
  .tMidGrid {
    grid-template-columns: 1fr;
  }
}

.cardBlock {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.cardBlockTitle {
  font-weight: var(--font-black);
  color: var(--text);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  margin-bottom: 12px;
}

.editorTopRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.editorActions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.editorList {
  display: grid;
  gap: 14px;
}

.editorCard {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.editorCardTitle {
  font-weight: var(--font-black);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}

.editorTextarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.3;
}

.editorOpts {
  display: grid;
  gap: 10px;
}

.editorOptRow {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
}

.editorOptBadge {
  width: 56px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
}

.editorOptBadge.optA {
  background: var(--optA);
}
.editorOptBadge.optB {
  background: var(--optB);
}
.editorOptBadge.optC {
  background: var(--optC);
}
.editorOptBadge.optD {
  background: var(--optD);
}

.editorCorrectRow {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.editorCorrectLabel {
  font-weight: 900;
  color: rgba(16, 24, 40, 0.86);
}

.editorSelect {
  max-width: 720px;
}

.editorCardActions {
  display: inline-flex;
  gap: 10px;
  justify-content: flex-end;
}

.editorPdfRow,
.editorIaRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.editorIaRow {
  grid-template-columns: 1fr 1fr auto;
}

.editorSticky {
  position: sticky;
  top: 10px;
  z-index: 50;
}

.editorSticky::before {
  content: "";
  position: absolute;
  inset: -10px -10px auto -10px;
  height: 10px;
}

.editorSticky {
  background: rgba(248, 246, 241, 0.92);
  backdrop-filter: blur(6px);
}

.sideStack {
  display: grid;
  gap: 18px;
}

.infoCard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.infoCard.infoBlue {
  background: rgba(90, 72, 255, 0.1);
  border-color: rgba(90, 72, 255, 0.22);
}

.infoKicker {
  font-size: var(--text-xs);
  font-weight: var(--font-black);
  color: rgba(16, 24, 40, 0.6);
  letter-spacing: 0.06em;
}

.infoKicker--dashBrand {
  color: var(--blue);
  font-weight: var(--font-black);
  margin-bottom: var(--space-2);
}

.infoKicker--dashDark {
  color: #101828;
  font-weight: var(--font-black);
  margin-bottom: var(--space-2);
}

.infoKicker2 {
  margin-top: 10px;
  font-size: var(--text-xs);
  font-weight: var(--font-black);
  color: rgba(16, 24, 40, 0.65);
  letter-spacing: 0.04em;
}

.infoQuestion {
  margin-top: 10px;
  font-size: var(--text-base);
  font-weight: var(--font-extrabold);
  color: var(--text);
  line-height: var(--leading-snug);
}

.infoAnswer {
  margin-top: 6px;
  font-size: var(--text-sm);
  font-weight: var(--font-black);
  color: rgba(21, 34, 56, 0.72);
  line-height: var(--leading-relaxed);
}

/* Professor — blocos do painel (substitui font-size inline no HTML) */
.dashTeacherQuestion {
  background: #f8fafc;
  padding: var(--space-5);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  color: #0f172a;
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-snug);
}

.progressPanelKicker {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: var(--font-extrabold);
  margin-bottom: var(--space-2);
  letter-spacing: 0.08em;
}

.progressPanelNums {
  font-size: var(--text-6xl);
  font-weight: var(--font-black);
  color: var(--blue);
  line-height: 1;
}

.progressPanelNums .progressSep {
  font-size: var(--text-3xl);
  color: #cbd5e1;
  margin: 0 var(--space-2);
}

.progressPanelNums .progressTotal {
  font-size: var(--text-xl);
  color: #64748b;
}

.scanDockBtn {
  font-size: var(--text-sm);
}

.finalPanelEmoji {
  font-size: var(--text-display);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.finalPanelKicker {
  font-size: var(--text-lg);
}

body:not(.theater-mode) #liveOptions.optionsList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Painel professor — blocos da página (evita inline no HTML) */
.authLogoutBtn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-weight: var(--font-bold);
}
.adminNavBtn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #0f172a;
  background: #0f172a;
  color: #fff;
  font-weight: var(--font-bold);
  font-size: var(--text-xs);
  text-decoration: none;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}
.adminNavBtn:hover {
  background: #334155;
  border-color: #334155;
  color: #fff;
}
.manualEscritoNav {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-weight: var(--font-bold);
  font-size: var(--text-xs);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}
.manualEscritoNav:hover {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.5);
  color: #1e40af;
}
.cardBlock--sectionGap {
  margin-bottom: 30px;
}
.roomSectionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cardBlockTitle--flush {
  margin: 0;
}
.btnCreateRoom {
  width: auto;
  padding: 10px 14px;
}
.notice--privacy {
  background: #eef2ff;
  border-left: 4px solid var(--blue);
  padding: 15px;
  margin: 15px 0;
}
.roomsStudentsPanel--spaced {
  margin-top: 20px;
}
.roomsPublicWrap--spaced {
  margin-top: 30px;
}
.searchWrap--tight {
  margin-bottom: 15px;
}
.activeRoomName {
  color: #101828;
}
.questionProgressPanel {
  text-align: center;
  padding: 20px;
  background: #f8fafc;
  border-radius: 16px;
}
.finalRankingPanel {
  text-align: center;
}
.btnFinishReplay {
  margin-top: 20px;
}
.panelFinalGap {
  margin-top: 40px;
}
.infoDivider--muted {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.infoDivider {
  height: 1px;
  background: rgba(21, 34, 56, 0.12);
  margin: 14px 0;
}

.statLines {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.statLine {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(21, 34, 56, 0.72);
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.statLine strong {
  color: var(--blue);
  font-weight: var(--font-black);
}

.top5List {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.top5Row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.top5Avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: #fbfbfd;
}

.top5Avatar svg {
  width: 28px;
  height: 28px;
}

.top5Avatar img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.top5Name {
  font-weight: var(--font-black);
  font-size: var(--text-base);
  line-height: var(--leading-snug);
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top5Pts {
  font-weight: var(--font-black);
  font-size: var(--text-lg);
  color: var(--blue);
  line-height: var(--leading-tight);
}

.studentList {
  display: grid;
  gap: 12px;
  max-height: 440px;
  overflow: auto;
  padding-right: 6px;
}

.roomsGrid2 {
  grid-template-columns: 1fr 1fr;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

@media (max-width: 980px) {
  .roomsGrid2 {
    grid-template-columns: 1fr;
  }
}

.scanGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 980px) {
  .scanGrid {
    grid-template-columns: 1fr;
  }
}

.scanControls {
  display: grid;
  gap: 10px;
}

.scanStatus {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: rgba(16, 24, 40, 0.72);
  font-weight: 800;
}

.scanTimer {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(90, 72, 255, 0.22);
  background: rgba(90, 72, 255, 0.08);
  color: rgba(16, 24, 40, 0.86);
  font-weight: 900;
  font-size: 20px;
  text-align: center;
}

.scanQuestion {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: rgba(255, 255, 255, 0.86);
  color: rgba(16, 24, 40, 0.92);
  font-weight: 900;
}

.scanOptions {
  display: grid;
  gap: 10px;
}

.scanOpt {
  border-radius: 14px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: rgba(255, 255, 255, 0.86);
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.scanOptBadge {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
}

.scanOptText {
  font-weight: 800;
  color: rgba(16, 24, 40, 0.86);
}

.scanLast {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(43, 182, 115, 0.22);
  background: rgba(43, 182, 115, 0.08);
  color: rgba(16, 24, 40, 0.84);
  font-weight: 900;
}

.scanVideoWrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: rgba(16, 24, 40, 0.06);
  box-shadow: var(--shadow-soft);
  min-height: 320px;
}

.scanHud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 5;
  display: grid;
  gap: 8px;
  pointer-events: auto;
}

.scanHudTop {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.scanVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #111827;
}

.scanOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

body.scanMode .page {
  max-width: 1220px;
}

body.scanMode .scanTimerBarWrap {
  margin-top: -6px;
}

body.scanMode .scanControls > :not(.scanTimer):not(.scanQuestion):not(.scanOptions):not(.scanAnswered):not(.scanCamHint):not(.scanMiniRow) {
  display: none;
}

body.scanMode .scanQuestion {
  font-size: 30px;
  line-height: 1.15;
  padding: 22px 22px;
  max-height: 22vh;
  overflow: auto;
}

body.scanMode .scanCorrect {
  border-radius: 16px;
  border: 2px solid rgba(43, 182, 115, 0.32);
  background: rgba(43, 182, 115, 0.1);
  padding: 16px 16px;
  display: grid;
  gap: 8px;
}

body.scanMode .scanCorrectKicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: rgba(16, 24, 40, 0.72);
}

body.scanMode .scanCorrectRow {
  display: flex;
  gap: 12px;
  align-items: center;
}

body.scanMode .scanCorrectBadge {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(43, 182, 115, 1);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 22px;
}

body.scanMode .scanCorrectText {
  font-weight: 900;
  font-size: 20px;
  line-height: 1.2;
  color: rgba(16, 24, 40, 0.92);
}

body.scanMode.scanReveal .scanTimerBar {
  background: linear-gradient(90deg, rgba(43, 182, 115, 1), rgba(90, 72, 255, 1));
}

body.scanMode .scanTimer {
  font-size: 32px;
  padding: 14px 18px;
}

body.scanMode .scanTimer.urgent {
  animation: scanFlash 650ms ease-in-out infinite;
}

@keyframes scanFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(224, 79, 95, 0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(224, 79, 95, 0.18);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(224, 79, 95, 0);
  }
}

body.scanMode .scanTimerBarWrap {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: rgba(16, 24, 40, 0.06);
  overflow: hidden;
}

body.scanMode .scanTimerBar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--optD), var(--optA));
  transition: width 140ms linear;
}

body.scanMode .scanTimerBar.urgent {
  background: linear-gradient(90deg, rgba(224, 79, 95, 1), rgba(255, 159, 67, 1));
}

body.scanMode .scanCamHint {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(224, 79, 95, 0.22);
  background: rgba(224, 79, 95, 0.08);
  color: rgba(16, 24, 40, 0.86);
  font-weight: 900;
  font-size: 13px;
}

body.scanMode .scanMiniRow {
  display: flex;
  gap: 10px;
  align-items: center;
}

body.scanMode .scanMiniRow .btnWide {
  padding: 10px 10px;
  border-radius: 12px;
  font-size: 13px;
}

body.scanMode .scanOpt {
  padding: 14px 14px;
}

/* Painel scan (não teatro): fundo do card = cor da opção (A roxo, B azul, C laranja, D verde) */
body.scanMode:not(.theater-mode) .scanOpt[data-letter="A"] {
  background: var(--optA);
  border-color: rgba(255, 255, 255, 0.28);
}
body.scanMode:not(.theater-mode) .scanOpt[data-letter="B"] {
  background: var(--optB);
  border-color: rgba(255, 255, 255, 0.28);
}
body.scanMode:not(.theater-mode) .scanOpt[data-letter="C"] {
  background: var(--optC);
  border-color: rgba(255, 255, 255, 0.28);
}
body.scanMode:not(.theater-mode) .scanOpt[data-letter="D"] {
  background: var(--optD);
  border-color: rgba(255, 255, 255, 0.28);
}
body.scanMode:not(.theater-mode) .scanOpt[data-letter] .scanOptText {
  color: #fff;
}
body.scanMode:not(.theater-mode) .scanOpt[data-letter="A"] .scanOptBadge {
  background: #fff !important;
  color: var(--optA) !important;
  border: 2px solid rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}
body.scanMode:not(.theater-mode) .scanOpt[data-letter="B"] .scanOptBadge {
  background: #fff !important;
  color: var(--optB) !important;
  border: 2px solid rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}
body.scanMode:not(.theater-mode) .scanOpt[data-letter="C"] .scanOptBadge {
  background: #fff !important;
  color: var(--optC) !important;
  border: 2px solid rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}
body.scanMode:not(.theater-mode) .scanOpt[data-letter="D"] .scanOptBadge {
  background: #fff !important;
  color: var(--optD) !important;
  border: 2px solid rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

body.scanMode .scanOpt.correct {
  border-color: rgba(43, 182, 115, 0.38);
  background: rgba(43, 182, 115, 0.12);
}

/* Revelação no painel normal: verde semântico por cima da cor A–D */
body.scanMode:not(.theater-mode) .scanOpt.correct[data-letter] {
  background: linear-gradient(145deg, #10b981 0%, #059669 100%) !important;
  border-color: rgba(16, 185, 129, 0.65) !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}
body.scanMode:not(.theater-mode) .scanOpt.correct .scanOptText {
  color: #fff !important;
}
body.scanMode:not(.theater-mode) .scanOpt.correct .scanOptBadge {
  background: #fff !important;
  color: #059669 !important;
  border: 2px solid rgba(5, 150, 105, 0.35) !important;
}

body.scanMode .scanTimerSmall {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: rgba(255, 255, 255, 0.86);
  color: rgba(16, 24, 40, 0.86);
  font-weight: 900;
  font-size: 13px;
}

body.scanMode .scanOptBadge {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  font-size: 18px;
}

body.scanMode .scanOptText {
  font-size: 18px;
  line-height: 1.2;
}

body.scanMode .scanOptions {
  max-height: 36vh;
  overflow: auto;
  padding-right: 4px;
}

body.scanMode .scanAnsweredList {
  max-height: 24vh;
}

body.scanMode .scanTimer {
  font-size: 24px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(16, 24, 40, 0.14);
  background: rgba(17, 24, 39, 0.62);
  color: #fff;
  text-align: center;
}

body.scanMode .scanTimerSmall {
  position: static;
  right: auto;
  bottom: auto;
  border-radius: 14px;
  border: 1px solid rgba(16, 24, 40, 0.14);
  background: rgba(17, 24, 39, 0.62);
  color: #fff;
  font-weight: 900;
  padding: 12px 14px;
  font-size: 24px;
}

/* Faixa total + preenchimento que encolhe (painel normal, não teatro) */
body.scanMode:not(.theater-mode) .liveTimerBarWrap {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.08);
  border: 1px solid rgba(16, 24, 40, 0.12);
  overflow: hidden;
  box-sizing: border-box;
  margin-top: 14px;
  margin-bottom: 6px;
}

body.scanMode:not(.theater-mode) .liveTimerBarWrap #liveTimerBar {
  display: block !important;
  height: 100%;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  border-radius: 999px;
  box-sizing: border-box;
  transition: width 120ms linear;
}

body.scanMode .scanAnswered {
  border-radius: 14px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: rgba(255, 255, 255, 0.86);
  padding: 14px 14px;
  display: grid;
  gap: 10px;
  min-height: 0;
}

body.scanMode .scanAnsweredTitle {
  font-weight: 900;
  color: rgba(16, 24, 40, 0.9);
}

body.scanMode .scanAnsweredList {
  max-height: 32vh;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

body.scanMode .scanAnsweredRow {
  border-radius: 12px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 12px;
  font-weight: 800;
  color: rgba(16, 24, 40, 0.86);
}

body.scanMode .scanAnsweredRow.ok {
  border-color: rgba(43, 182, 115, 0.38);
  background: rgba(43, 182, 115, 0.12);
  color: rgba(16, 24, 40, 0.92);
}

body.scanMode .scanAnsweredRow.bad {
  border-color: rgba(220, 38, 38, 0.32);
  background: rgba(220, 38, 38, 0.08);
  color: rgba(16, 24, 40, 0.9);
}

body.scanMode:not(.theater-mode) #rankingContainer > #liveAnswered.scanAnswered {
  margin-bottom: 12px;
  max-height: min(28vh, 260px);
}

body.scanMode #scanStartBtn,
body.scanMode #scanStopBtn {
  padding: 10px 10px;
  border-radius: 12px;
  font-size: 13px;
}

body.scanMode .scanStatus {
  padding: 10px 12px;
  font-size: 13px;
}

body.scanMode .scanLast {
  padding: 10px 12px;
  font-size: 13px;
}

.notice.notice--compact {
  margin-top: 8px;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.cardsPrintBlank {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px dashed rgba(37, 99, 235, 0.35);
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.04);
}

.cardsPrintBlankTitle {
  font-weight: var(--font-extrabold);
  font-size: var(--text-sm);
  color: #1e40af;
  margin-bottom: 6px;
}

.cardsPrintBlankHint {
  margin: 0 0 10px;
  font-size: var(--text-sm);
  color: #334155;
  line-height: var(--leading-relaxed);
}

.cardsPrintBlankRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cardsPrintBlankLabel {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: #0f172a;
}

.cardsPrintBlankInput {
  width: min(120px, 100%);
}

.cardsForm {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

@media (max-width: 980px) {
  .cardsForm {
    grid-template-columns: 1fr;
  }
}

.cardsList {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  align-items: start;
}

.cardsModalFooter {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.cardSetRow {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (max-width: 980px) {
  .cardSetRow {
    grid-template-columns: 1fr;
  }
}

.cardSetLeft {
  min-width: 0;
}

.cardSetTitle {
  font-weight: 900;
  color: rgba(16, 24, 40, 0.9);
}

.cardSetSub {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.cardPreview {
  margin-top: 12px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  padding: 12px;
  width: min(300px, 100%);
  margin-left: 0;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  grid-template-rows: 36px 1fr 36px;
  gap: 16px; /* Aumentado de 10px para 16px para dar mais espaço */
  align-items: center;
  justify-items: center;
}

.cardPreview .qr {
  grid-column: 2;
  grid-row: 2;
  width: 100%; /* Aproveita o máximo do espaço disponível */
  height: 100%; /* Aproveita o máximo do espaço disponível */
  min-width: 180px;
  min-height: 180px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: #fff;
  overflow: hidden;
  padding: 5px; /* Evita que o qr cole na borda se houver margem */
}

.cardPreview .qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cardSide {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: var(--optA);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
}

.cardSide.top {
  grid-column: 2;
  grid-row: 1;
  background: var(--optA);
}

.cardSide.right {
  grid-column: 3;
  grid-row: 2;
  transform: rotate(90deg);
  background: var(--optD);
}

.cardSide.bottom {
  grid-column: 2;
  grid-row: 3;
  transform: rotate(180deg);
  background: var(--optC);
}

.cardSide.left {
  grid-column: 1;
  grid-row: 2;
  transform: rotate(-90deg);
  background: var(--optB);
}

.cardSetActions {
  display: inline-flex;
  gap: 10px;
  align-items: start;
  justify-content: flex-end;
  justify-self: end;
}

.studentRow {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.roomRow.roomRow3 {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
}
.roomRow .roomLine1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.roomRow .roomLine2 {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.roomRow .roomTags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.roomRow .tagPill {
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  background: #fff;
}
.roomRow .tagPill:hover { background: #f7f8fb; }

.studentLeft {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.studentAvatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fbfbfd;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.studentAvatar svg {
  width: 32px;
  height: 32px;
}

.studentAvatar img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.studentNameWrap {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.studentName {
  font-weight: 900;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studentPts {
  color: rgba(21, 34, 56, 0.6);
  font-weight: 700;
  font-size: 13px;
}

.statusPill {
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 900;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.statusPill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(21, 34, 56, 0.28);
}

.statusPill.ok {
  background: rgba(79, 124, 87, 0.16);
  color: rgba(79, 124, 87, 1);
}

.statusPill.ok::before {
  background: rgba(79, 124, 87, 1);
}

.statusPill.free {
  background: rgba(43, 182, 115, 0.14);
  color: rgba(43, 182, 115, 1);
}

.statusPill.free::before {
  background: rgba(43, 182, 115, 1);
}

.statusPill.wait {
  background: rgba(107, 114, 128, 0.14);
  color: rgba(107, 114, 128, 1);
}

.statusPill.wait::before {
  background: rgba(107, 114, 128, 1);
}

.statusPill.off {
  background: rgba(107, 114, 128, 0.1);
  color: rgba(107, 114, 128, 1);
  opacity: 0.8;
}

.barChart {
  height: 260px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
  padding: 12px 10px 6px;
  border-radius: 14px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.barItem {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: end;
  gap: 8px;
  justify-items: center;
}

.barValue {
  font-weight: 900;
  color: rgba(21, 34, 56, 0.55);
  font-size: 12px;
}

.barTrack {
  width: 100%;
  height: 200px;
  border-radius: 10px;
  background: rgba(16, 24, 40, 0.06);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.barFill {
  width: 100%;
  background: var(--optA);
  border-radius: 10px 10px 0 0;
  transition: height 140ms ease;
}

.barItem[data-letter="A"] .barFill {
  background: var(--optA);
}

.barItem[data-letter="B"] .barFill {
  background: var(--optB);
}

.barItem[data-letter="C"] .barFill {
  background: var(--optC);
}

.barItem[data-letter="D"] .barFill {
  background: var(--optD);
}

.barLabel {
  font-weight: 900;
  color: rgba(16, 24, 40, 0.72);
  min-width: 34px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: rgba(255, 255, 255, 0.8);
}

/* MODO TEATRO (FULLSCREEN GAME) */
body.theater-mode {
  overflow: hidden;
  background: #0f172a;
}
body.theater-mode .dashHeader,
body.theater-mode .dashTitleWrap,
body.theater-mode #roomSelectionSection,
body.theater-mode .activeRoomCard,
body.theater-mode .tTopGrid,
body.theater-mode .infoKicker:not(#theaterKicker),
body.theater-mode .cameraStatusCard > .camStatusIcon,
body.theater-mode .cameraStatusCard > .camStatusText {
  display: none !important;
}

/* Painel "Leitura dos cards" ativo no modo apresentação, como no modelo */
body.theater-mode #camStatusContainer { display: flex !important; flex-direction: column; min-height: 0; }
body.theater-mode .cameraStatusCard {
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  padding: 12px;
}
body.theater-mode .cameraStatusCard .scanTheaterControls {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 8px;
}
body.theater-mode .cameraStatusCard .scanTheaterControls .btnWide,
body.theater-mode .cameraStatusCard .scanTheaterControls button {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 800;
  font-size: 12px;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
body.theater-mode .cameraStatusCard .scanTheaterControls .btnWide.primary {
  background: #111827;
  color: #fff;
}

/* Pausar e Minimizar/Maximizar: já existem na barra flutuante sobre o vídeo (esquerda). */
body.theater-mode .cameraStatusCard #pauseMiniBtn,
body.theater-mode .cameraStatusCard #maximizeBtn {
  display: none !important;
}

body.theater-mode .page {
  padding: 0;
  max-width: none;
}

html.theater-mode {
  /* A+/A− no teatro: passo inteiro, aplicado em calc() na pergunta e nas opções */
  --theater-font-step: 0;
}

html.theater-mode,
body.theater-mode {
  height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden;
}

body.theater-mode .dashColumns {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0f172a;
  display: grid;
  /* Coluna direita mais estreita (antes: minmax(260px, min(40vw, 520px))) */
  grid-template-columns: minmax(0, 1fr) minmax(200px, min(25vw, 350px));
  gap: max(8px, 10px);
  padding: max(4px, env(safe-area-inset-top, 0px)) max(4px, env(safe-area-inset-right, 0px))
    max(4px, env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
  margin: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
}

body.theater-mode .dashColLeft {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

body.theater-mode .dashColRight {
  display: block;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

/*
  Palco maximizado — coluna esquerda (viewport cheia, sem scroll na página):
  ~62–66% câmera · ~11% pergunta · ~24–28% opções A–D (2×2 preenche a célula).
  Proporções em fr mantêm-se estáveis com zoom 80–100% (dvh/largura da coluna, não só vw global).
*/
/* Não participar da grelha do palco: duplicava “quem respondeu” por baixo das opções */
body.theater-mode #leftCardContainer #answeringList {
  display: none !important;
}

body.theater-mode #leftCardContainer {
  flex: 1 1 auto;
  min-height: 0;
  padding: clamp(2px, 0.6dvh, 6px);
  background: transparent;
  border: none;
  box-shadow: none;
  display: grid;
  /* Mais altura para a câmera; faixa A–D mais baixa (fontes: tokens + ajuste JS inalterados) */
  grid-template-rows: minmax(0, 64fr) minmax(40px, 11fr) minmax(0, 25fr);
  grid-template-areas:
    "cam"
    "question"
    "answers";
  gap: clamp(6px, 1dvh, 10px);
  position: relative;
  overflow: hidden;
  border-radius: 0;
  box-sizing: border-box;
}

/* Revelação: sem grelha A–D (evita cartões erguidos só para “bater” no cinza); só resposta certa + tempo */
body.theater-mode.scanReveal #leftCardContainer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  grid-template-rows: unset;
  grid-template-areas: unset;
}

body.theater-mode.scanReveal #liveOptions {
  display: none !important;
}

/* Ordem visual: câmera → pergunta → resposta certa (no DOM #liveCorrect vem antes do #videoWrap) */
body.theater-mode.scanReveal #videoWrap {
  order: 1;
  flex: 1 1 auto;
  min-height: 0;
}

body.theater-mode.scanReveal #teacherQuestionText {
  order: 2;
  flex: 0 0 auto;
  max-height: 24vh;
}

body.theater-mode.scanReveal #liveCorrect {
  order: 3;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 0;
  max-height: min(42dvh, 360px);
  overflow: auto;
  margin: 0;
}

/* Cartão legível no fundo escuro do palco (antes: texto #101828 sobre verde 10% = sem contraste) */
body.theater-mode.scanReveal .scanCorrect {
  background: rgba(15, 23, 42, 0.92);
  border: 2px solid rgba(52, 211, 153, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

body.theater-mode.scanReveal .scanCorrectKicker {
  color: #a7f3d0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

body.theater-mode.scanReveal .scanCorrectBadge {
  width: clamp(56px, 8vw, 80px);
  height: clamp(56px, 8vw, 80px);
  font-size: clamp(22px, 3vw, 32px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

body.theater-mode.scanReveal .scanCorrectText {
  font-size: clamp(18px, 2.2vw, 26px);
  color: #f8fafc;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

body.theater-mode #leftKicker,
body.theater-mode #liveQuestion,
body.theater-mode #scanCamHint,
body.theater-mode #scanContinueHint {
  display: none !important;
}

body.theater-mode #teacherQuestionText {
  grid-area: question;
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  margin: 0;
  width: 100% !important;
  text-align: center;
  border-radius: clamp(14px, 2dvh, 22px);
  padding: clamp(8px, 1.12dvh, 13px) clamp(14px, 2vw, 24px) !important;
  font-size: calc(var(--text-theater-question) + var(--theater-font-step, 0) * 0.12rem) !important;
  line-height: 1.18 !important;
  font-weight: 900 !important;
  color: #0f172a;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  height: auto;
  min-height: 0;
  max-height: min(22dvh, 240px);
  overflow: hidden;
  display: block;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Sobrepõe o bloco anterior (mesma especificidade, vem depois): revelação usa flex, não grelha */
body.theater-mode.scanReveal #teacherQuestionText {
  grid-area: unset;
  max-height: min(28dvh, 260px) !important;
}

/* Lobby maximizado: iniciar jogo sem só “Aguardando início…” */
body.theater-mode #theaterLobbyPanel:not(.hidden) {
  grid-column: 1;
  grid-row: 1 / -1;
  z-index: 25;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 20px max(16px, env(safe-area-inset-bottom, 0px));
  margin: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 18px;
  /* Deixa cliques passar para a barra de controlos do vídeo (z-index acima desta célula). */
  pointer-events: none;
}

body.theater-mode .theaterLobbyInner {
  max-width: 420px;
  width: 100%;
  text-align: center;
  display: grid;
  gap: 14px;
  justify-items: center;
  pointer-events: auto;
}

body.theater-mode .theaterLobbyTitle {
  margin: 0;
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  font-weight: var(--font-black);
  color: #f8fafc;
  letter-spacing: 0.02em;
  line-height: var(--leading-tight);
}

body.theater-mode .theaterLobbySub {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  line-height: var(--leading-relaxed);
  color: rgba(248, 250, 252, 0.88);
}

body.theater-mode .theaterLobbyStartBtn {
  appearance: none;
  border: none;
  cursor: pointer;
  width: 100%;
  max-width: 320px;
  padding: 16px 22px;
  border-radius: 16px;
  font-size: var(--text-lg);
  font-weight: var(--font-black);
  font-family: inherit;
  color: #0f172a;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

body.theater-mode .theaterLobbyStartBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

body.theater-mode .theaterLobbyStartBtn:active {
  transform: translateY(0);
}

body.theater-mode .theaterLobbyRegisterBtn {
  appearance: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #f8fafc;
  font-weight: var(--font-extrabold);
  font-size: var(--text-md);
  font-family: inherit;
  padding: 12px 20px;
  border-radius: 999px;
  transition: background 0.12s ease;
}

body.theater-mode .theaterLobbyRegisterBtn:hover {
  background: rgba(255, 255, 255, 0.2);
}

body.theater-mode #videoWrap {
  grid-area: cam;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0 !important;
  border-radius: 18px;
  z-index: 1;
  box-sizing: border-box;
  overflow: hidden;
  /* Faixas fixas: controles → timer → vídeo (evita barra escondida sob os botões) */
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: start;
}

body.theater-mode #theaterControlsFloating {
  grid-column: 1 / -1;
  grid-row: 1;
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  pointer-events: none;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px;
  gap: 6px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.5) 85%, transparent 100%);
  border-radius: 16px 16px 0 0;
}

body.theater-mode #liveTimerSmall {
  grid-column: 1;
  grid-row: 2;
  position: relative;
  top: auto;
  left: auto;
  z-index: 7;
  align-self: center;
  justify-self: start;
  margin: 4px 6px 4px 12px;
}

body.theater-mode #liveTimerBarWrap.theaterTimerInVideo {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  width: auto;
  height: 10px;
  z-index: 7;
  align-self: center;
  margin: 4px 12px 6px 0;
}

body.theater-mode #videoWrap video {
  grid-column: 1 / -1;
  grid-row: 3;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border-radius: 0 0 16px 16px;
  z-index: 1;
}

body.theater-mode #videoWrap canvas {
  grid-column: 1 / -1;
  grid-row: 3;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  border-radius: 0 0 16px 16px;
  z-index: 2;
  /* Inline HTML usa absolute na área inteira; na grelha o bloco de posição é só a linha do vídeo */
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  pointer-events: none !important;
}
body.theater-mode #videoWrap::before {
  content: "Câmera ao vivo";
  position: absolute;
  bottom: 12px;
  left: 12px;
  top: auto;
  transform: none;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  z-index: 4;
  pointer-events: none;
}
body.theater-mode #videoWrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.0));
  border-radius: 0 0 18px 18px;
  pointer-events: none;
}

body.theater-mode #liveOptions {
  grid-area: answers;
  position: relative;
  z-index: 10;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 3px 4px;
  margin: 0;
  background: rgba(15,23,42,0.22);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: clamp(12px, 1.8vw, 18px);
  overflow: hidden;
  align-content: stretch;
  justify-content: stretch;
  align-self: stretch;
  min-height: 0;
  height: 100%;
  max-height: none;
  box-sizing: border-box;
}

body.theater-mode .scanOpt {
  margin: 0;
  padding: 2px 5px;
  border-radius: clamp(10px, 1.2vw, 14px);
  color: white !important;
  border: none;
  box-shadow: 0 10px 26px rgba(0,0,0,0.28);
  transition: transform 0.2s, opacity 0.2s;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 5px;
  background-color: var(--card) !important; /* fallback */
  min-height: 0;
  height: 100%;
  align-self: stretch;
  overflow: hidden;
  box-sizing: border-box;
  /* Sem container-type: size — com cqw/cqh no badge + JS a ajustar fonte do texto,
     o tamanho da célula e do badge oscilavam e geravam loop (texto a “piscar”). */
}
body.theater-mode .scanOpt[data-letter="A"] { background: var(--optA) !important; background-color: var(--optA) !important; }
body.theater-mode .scanOpt[data-letter="B"] { background: var(--optB) !important; background-color: var(--optB) !important; }
body.theater-mode .scanOpt[data-letter="C"] { background: var(--optC) !important; background-color: var(--optC) !important; }
body.theater-mode .scanOpt[data-letter="D"] { background: var(--optD) !important; background-color: var(--optD) !important; }

body.theater-mode .scanOpt.correct {
  transform: scale(1.05);
  box-shadow: 0 0 0 6px white, 0 10px 40px rgba(0,0,0,0.5);
}

body.theater-mode .scanOptBadge {
  background: #ffffff !important;
  color: #0f172a !important;
  flex-shrink: 0;
  align-self: center;
  /* Só vw — dvh oscila com barras do browser / viewport dinâmico e fazia A–D “piscar”. */
  width: clamp(28px, 7.2vw, 44px);
  height: clamp(28px, 7.2vw, 44px);
  font-size: clamp(12px, 2.85vw, 18px);
  box-shadow: none;
  border: 1px solid rgba(0,0,0,0.1);
  box-sizing: border-box;
}

/* Cores das letras em círculo branco, seguindo o card */
body.theater-mode .scanOpt[data-letter="A"] .scanOptBadge { color: var(--optA) !important; border-color: rgba(124,58,237,0.35) !important; }
body.theater-mode .scanOpt[data-letter="B"] .scanOptBadge { color: var(--optB) !important; border-color: rgba(37,99,235,0.35) !important; }
body.theater-mode .scanOpt[data-letter="C"] .scanOptBadge { color: var(--optC) !important; border-color: rgba(249,115,22,0.35) !important; }
body.theater-mode .scanOpt[data-letter="D"] .scanOptBadge { color: var(--optD) !important; border-color: rgba(34,197,94,0.35) !important; }
body.theater-mode .scanOptText {
  color: white !important;
  box-sizing: border-box;
  font-size: calc(var(--text-theater-option) + var(--theater-font-step, 0) * 0.08rem);
  font-weight: 800;
  line-height: 1.22;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  align-self: center;
  justify-self: stretch;
  width: 100%;
  scrollbar-width: thin;
}

/* Posição base em grelha no #videoWrap (ver bloco #videoWrap acima); regras legacy removidas */
body.theater-mode #liveTimerBarWrap.theaterTimerInVideo {
  display: block !important;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  box-sizing: border-box;
}

body.theater-mode #liveTimerBarWrap.theaterTimerInVideo #liveTimerBar {
  display: block !important;
  position: relative;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  max-width: 100%;
  border-radius: 999px;
  box-sizing: border-box;
  transition: width 120ms linear, background 200ms ease;
}

body.theater-mode #liveTimerSmall {
  display: block !important;
  background: #ffffff;
  color: #ef4444;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 15px;
  border: 2px solid #ef4444;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#liveTimerBar.tGreen { background: #22c55e; }
#liveTimerBar.tWarn { background: #f59e0b; }
#liveTimerBar.tUrgent { background: #ef4444; }
#liveTimerSmall.tGreen { background: rgba(34,197,94,0.75); }
#liveTimerSmall.tWarn { background: rgba(245,158,11,0.75); }
#liveTimerSmall.tUrgent { background: rgba(239,68,68,0.75); }

/* Controles flutuantes do Modo Teatro */
body.theater-mode .whatsappFloat {
  display: none !important;
}

/* Dica discreta: sair da tela cheia (F11; ver teacher.js) */
#theaterFullscreenHint {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom, 12px));
  transform: translateX(-50%) translateY(12px);
  z-index: 65;
  max-width: min(92vw, 420px);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

#theaterFullscreenHint.theaterFullscreenHint--in {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#theaterFullscreenHint.theaterFullscreenHint--out {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
}

#theaterFullscreenHint kbd {
  display: inline-block;
  margin: 0 1px;
  padding: 2px 7px;
  font-size: 0.88em;
  font-family: inherit;
  font-weight: 800;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

/* Sugestão ao iniciar jogo: ativar tela cheia do navegador */
#theaterFullscreenSuggest {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom, 16px));
  transform: translateX(-50%) translateY(16px);
  z-index: 20060;
  width: min(420px, calc(100vw - 24px));
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#theaterFullscreenSuggest.theaterFullscreenSuggest--in {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#theaterFullscreenSuggest.theaterFullscreenSuggest--out {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
}

.theaterFullscreenSuggestInner {
  padding: 14px 16px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f8fafc;
}

.theaterFullscreenSuggestTitle {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  color: #fde68a;
}

.theaterFullscreenSuggestText {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: rgba(248, 250, 252, 0.95);
}

.theaterFullscreenSuggestActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.theaterFullscreenSuggestPrimary {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  color: #0f172a;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.theaterFullscreenSuggestPrimary:hover {
  filter: brightness(1.05);
}

.theaterFullscreenSuggestSecondary {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.theaterFullscreenSuggestKbd {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(248, 250, 252, 0.72);
}

.theaterFullscreenSuggestKbd kbd {
  display: inline-block;
  margin: 0 2px;
  padding: 2px 6px;
  font-size: 0.9em;
  font-family: inherit;
  font-weight: 800;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 5px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

body.theater-mode #theaterControlsFloating .theaterCtrlCluster {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

body.theater-mode #theaterControlsFloating .theaterCtrlClusterPrimary {
  flex: 1 1 auto;
  justify-content: center;
  min-width: min(100%, 200px);
}

/* Toda a faixa central é clicável: o cluster cresce com flex mas o botão era estreito,
   deixando área “morta” que não disparava o clique (parecia precisar de 2 toques). */
body.theater-mode #theaterControlsFloating .theaterCtrlClusterPrimary .theaterCtrlBtnAccent {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

body.theater-mode .theaterCtrlIcon {
  display: inline-block;
  margin-right: 6px;
  font-size: 1.05em;
}

body.theater-mode .theaterCtrlLabel {
  font-size: var(--text-sm);
  font-weight: var(--font-extrabold);
  letter-spacing: 0.02em;
}

@media (max-width: 720px) {
  body.theater-mode .theaterCtrlLabel {
    display: none;
  }
  body.theater-mode .theaterCtrlIcon {
    margin-right: 0;
  }
  body.theater-mode #theaterControlsFloating .theaterCtrlClusterPrimary {
    order: -1;
    width: 100%;
    justify-content: center;
  }
}

body.theater-mode .theaterCtrlBtn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border-radius: 12px;
  min-height: 36px;
  min-width: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  font-weight: var(--font-bold);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

body.theater-mode .theaterCtrlBtn:hover {
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

body.theater-mode .theaterCtrlBtn:active {
  transform: scale(0.97);
}

body.theater-mode .theaterCtrlBtnGhost {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

body.theater-mode .theaterCtrlBtnGhost:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

body.theater-mode .theaterCtrlBtnAccent {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  color: #1c1917;
  border-color: rgba(251, 191, 36, 0.95);
  font-weight: 900;
  min-width: 120px;
  padding: 0 18px;
}

body.theater-mode .theaterCtrlBtnAccent:hover {
  filter: brightness(1.05);
}

body.theater-mode .theaterCtrlBtnAccent:disabled {
  filter: grayscale(0.4);
}

body.theater-mode .theaterCtrlBtnCompact {
  min-width: 44px;
  padding: 0 10px;
  font-weight: 900;
  font-size: 16px;
}

body.theater-mode .theaterCtrlBtnNext {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border-color: rgba(37, 99, 235, 0.9);
}

body.theater-mode .theaterCtrlBtnNext:hover {
  filter: brightness(1.06);
}

body.theater-mode .theaterCtrlBtnPrev {
  background: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.28);
}

body.theater-mode .theaterCtrlBtnPrev:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
}

body.theater-mode .theaterCtrlBtnActive {
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.95), 0 4px 14px rgba(0, 0, 0, 0.25);
  background: rgba(251, 191, 36, 0.35) !important;
  color: #fff !important;
  border-color: rgba(251, 191, 36, 0.9) !important;
}

/* Modo foco: menos distração na lateral (ranking final continua visível) */
body.theater-mode.theater-readonly:not(.theater-show-final) .dashColumns {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.theater-mode.theater-readonly:not(.theater-show-final) .dashColRight {
  display: none !important;
}

body.theater-mode.theater-readonly #camStatusContainer,
body.theater-mode.theater-readonly #answerChart,
body.theater-mode.theater-readonly #questionProgressCard {
  display: none !important;
}

/* Revelação: resposta certa = verde semântico (não “opção D”) */
body.theater-mode.scanReveal .scanOpt.correct {
  background: linear-gradient(145deg, #10b981 0%, #059669 100%) !important;
  filter: none;
  opacity: 1;
  border-color: rgba(16, 185, 129, 0.65) !important;
}

body.theater-mode.scanReveal .scanOpt.correct .scanOptText {
  color: #ffffff !important;
}

body.theater-mode.scanReveal .scanOpt.correct .scanOptBadge {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #059669 !important;
  box-shadow: inset 0 0 0 2px rgba(5, 150, 105, 0.35);
}

body.theater-mode .theaterCtrlBtn.primary {
  border-color: #1e40af;
  background: #fff;
  color: #0f172a;
}

body.theater-mode .theaterCtrlBtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

body.theater-mode #rightCardContainer {
  background: transparent;
  border: none;
  color: white;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1.12fr) minmax(0, 0.22fr) minmax(0, 0.52fr);
  gap: 8px;
  overflow: hidden;
  min-height: 0;
}

/* Viewport baixa: compactar texto; manter 2×2 nas opções (não forçar 1 coluna por altura) */
@media (max-height: 700px) {
  body.theater-mode #teacherQuestionText {
    padding: clamp(6px, 0.96dvh, 11px) clamp(12px, 1.8vw, 18px) !important;
    max-height: min(18dvh, 140px) !important;
  }
  body.theater-mode #leftCardContainer {
    gap: clamp(4px, 0.7dvh, 8px);
    grid-template-rows: minmax(0, 60fr) minmax(36px, 11fr) minmax(0, 29fr);
  }
}

body.theater-mode #rightCardContainer .infoKicker {
  color: #cbd5e1 !important;
}

#closeTheaterBtn {
  display: none !important;
}
body.theater-mode #theaterKicker { display: none !important; }
body.theater-mode .infoDivider { display: none !important; }
body.theater-mode #rankingContainer { display: contents; }
body.theater-mode #camStatusContainer {
  grid-row: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
body.theater-mode #camStatusContainer .scanVideoWrap { display: none !important; }
/* Nomes “quem respondeu” dentro do cartão da câmera (não ocupam linha própria no grid da direita) */
body.theater-mode #camStatusContainer #liveAnswered.scanAnswered {
  flex: 0 1 auto;
  margin-top: 8px;
  width: 100%;
  align-self: stretch;
  min-height: 0;
  max-height: min(30vh, 220px);
}
body.theater-mode #camStatusContainer #liveAnswered.scanAnswered .scanAnsweredList--namesOnly {
  max-height: min(22vh, 140px);
}
body.theater-mode #questionProgressCard { grid-row: 2; min-height: 0; height: 100%; overflow: hidden; }
body.theater-mode #answerChart { grid-row: 3; min-height: 0; height: 100%; overflow: hidden; }

/* Contagem A/B/C/D só na revelação (durante a pergunta, mais espaço para câmera + progresso) */
body.theater-mode.scanMode:not(.scanReveal) #answerChart {
  display: none !important;
}
body.theater-mode.scanMode:not(.scanReveal) #rightCardContainer {
  /* Controles/conteúdo ocupam o espaço flexível; progresso encosta na base (sem meia-linha vazia) */
  grid-template-rows: minmax(0, 1fr) auto !important;
}

body.theater-mode.scanMode:not(.scanReveal) #questionProgressCard {
  height: auto;
  max-height: min(42dvh, 320px);
  align-self: stretch;
}

body.theater-mode #answerChart {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  margin: 0;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  min-height: 0;
}
body.theater-mode .barItem {
  flex-direction: row;
  background: rgba(255,255,255,0.95);
  padding: 12px 14px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  min-width: 0;
  width: 100%;
  height: 100%;
}

/* Lista de quem respondeu — modo apresentação ou tela cheia: cartão alinhado aos blocos da direita */
body.theater-mode #liveAnswered,
body.live-answered-compact-ui #liveAnswered {
  position: relative;
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(0,0,0,0.06);
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}
/* Maximizado: mesmo “cartão” que câmera / progresso (não faixa esmagada) */
body.theater-mode #liveAnswered.liveAnswered--compact,
body.theater-mode.live-answered-compact-ui #liveAnswered.liveAnswered--compact {
  padding: 12px 14px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
body.live-answered-compact-ui:not(.theater-mode) #liveAnswered.liveAnswered--compact {
  padding: 10px 12px;
  border-radius: 14px;
  min-height: 52px;
}
body.theater-mode #liveAnsweredList,
body.live-answered-compact-ui #liveAnsweredList {
  overflow-y: auto;
  min-height: 0;
  padding-right: 6px;
  flex: 1 1 auto;
}
body.theater-mode #liveAnsweredTitle,
body.live-answered-compact-ui #liveAnsweredTitle {
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 8px;
  font-size: 13px;
  letter-spacing: 0.02em;
}
body.live-answered-compact-ui .scanAnsweredList--namesOnly {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  align-content: flex-start;
  max-height: min(22vh, 148px);
  min-height: 36px;
  overflow-y: auto;
  padding: 2px 4px 2px 0;
}
body.theater-mode.live-answered-compact-ui .scanAnsweredList--namesOnly {
  max-height: min(20vh, 132px);
  min-height: 40px;
}
body.live-answered-compact-ui .scanAnsweredNameChip {
  font-size: 13px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  line-height: 1.3;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.theater-mode.live-answered-compact-ui .scanAnsweredNameChip {
  font-size: 14px;
  padding: 7px 14px;
}

body.live-answered-compact-ui .scanAnsweredNameChip--ok {
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.42);
  color: #064e3b;
}

body.live-answered-compact-ui .scanAnsweredNameChip--bad {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.38);
  color: #7f1d1d;
}
body.theater-mode #liveAnsweredList .scanAnsweredRow,
body.live-answered-compact-ui #liveAnsweredList .scanAnsweredRow {
  display: flex;
  align-items: center;
  padding: 12px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.04);
  font-weight: 800;
  color: #0f172a;
  font-size: 16px;
}

/* Modo foco + revelação: lista de acertos na esquerda */
body.theater-mode.theaterRevealWinnersOnLeft #liveAnswered {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  top: auto;
  max-height: 38vh;
  width: auto;
  z-index: 25;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.4);
}
body.theater-mode.theaterRevealWinnersOnLeft #liveAnswered.liveAnswered--compact .scanAnsweredList--namesOnly,
body.live-answered-compact-ui.theaterRevealWinnersOnLeft #liveAnswered.liveAnswered--compact .scanAnsweredList--namesOnly {
  max-height: min(28vh, 200px);
}

/* Últimos 5s da pausa de revelação: destaca quem acertou */
@keyframes theaterRevealWinnerPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 28px 4px rgba(34, 197, 94, 0.55);
    transform: scale(1.01);
  }
}

body.theater-mode.theaterRevealSpotlight #liveAnswered {
  outline: 3px solid rgba(34, 197, 94, 0.85);
  outline-offset: 2px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97) !important;
  animation: theaterRevealWinnerPulse 1.1s ease-in-out infinite;
}

body.theater-mode.theaterRevealSpotlight #liveAnsweredTitle {
  color: #047857;
  font-size: 17px;
}

body.theater-mode.theaterRevealSpotlight #liveAnsweredList .scanAnsweredRow.ok {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.22), rgba(16, 185, 129, 0.12)) !important;
  border: 2px solid rgba(34, 197, 94, 0.55);
  font-size: 18px;
  font-weight: 900;
  color: #064e3b;
}

body.theater-mode.theaterRevealSpotlight #liveAnsweredList .scanAnsweredNameChip--ok,
body.live-answered-compact-ui.theaterRevealSpotlight #liveAnsweredList .scanAnsweredNameChip--ok {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.28), rgba(16, 185, 129, 0.14)) !important;
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #064e3b;
}

body.theater-mode.theaterRevealSpotlight #liveAnsweredList .scanAnsweredNameChip--bad,
body.live-answered-compact-ui.theaterRevealSpotlight #liveAnsweredList .scanAnsweredNameChip--bad {
  background: rgba(220, 38, 38, 0.14) !important;
  border: 1px solid rgba(220, 38, 38, 0.45);
  color: #7f1d1d;
}

body.theater-mode.theaterRevealSpotlight #liveAnsweredList .scanAnsweredRow.bad {
  background: rgba(220, 38, 38, 0.1) !important;
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #450a0a;
}

/* Overlay de contagem regressiva / tempo esgotado */
body.theater-mode #countdownOverlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 70;
  pointer-events: none;
}
body.theater-mode #countdownNumber {
  font-weight: 900;
  color: #fff;
  text-shadow: 0 12px 40px rgba(0,0,0,0.6);
  font-size: clamp(64px, 14vw, 220px);
  padding: 10px 24px;
  border-radius: 24px;
  background: rgba(15,23,42,0.35);
  backdrop-filter: blur(4px);
}
body.theater-mode #countdownNumber.countdownNumber--phrase {
  font-size: clamp(22px, 4.2vw, 56px);
  max-width: min(92vw, 720px);
  text-align: center;
  line-height: 1.2;
  white-space: balance;
}
body.theater-mode .barLabel {
  width: 36px;
  height: 36px;
  font-size: 18px;
}
body.theater-mode .barTrack { height: 16px; }
body.theater-mode .barValue {
  color: #0f172a;
  font-size: 18px;
}

/* Efeito Confete */
.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #f00;
  opacity: 0;
}

@keyframes drop {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  80% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

#finalRankingCard.animate-pop {
  animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Top 5 no painel direito durante o quiz (fundo escuro do teatro) */
body.theater-mode:not(.theater-show-final) .top5Row {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
body.theater-mode:not(.theater-show-final) .top5Name {
  color: #f8fafc;
}
body.theater-mode:not(.theater-show-final) .top5Pts {
  color: #fbbf24;
}

/* Resultado final no teatro: cartão claro + texto escuro (evita nomes brancos em fundo branco) */
body.theater-mode.theater-show-final #finalRankingCard {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 20px;
  padding: 18px 16px 22px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.35);
  color: #0f172a;
}

body.theater-mode.theater-show-final #finalRankingCard .infoKicker {
  color: #0f172a !important;
}

body.theater-mode.theater-show-final #finalRankingCard .top5Row {
  background: #f1f5f9 !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

body.theater-mode.theater-show-final #finalRankingCard .top5Name {
  color: #0f172a !important;
}

body.theater-mode.theater-show-final #finalRankingCard .top5Pts {
  color: #b45309 !important;
}

/* Contagens A–D no fim (se o gráfico ainda aparecer): valores legíveis */
body.theater-mode.theater-show-final #answerChart .barValue {
  color: #0f172a !important;
}

/* ========== Modo MAXIMIZADO (teatro): responsivo ========== */

@media (max-width: 1200px) {
  body.theater-mode:not(.theater-readonly) .dashColumns {
    grid-template-columns: minmax(0, 1fr) minmax(188px, min(24vw, 310px));
    gap: 8px;
  }
}

/* Tablet / telemóvel: palco em cima, painel (câmera + progresso + A–D) com scroll */
@media (max-width: 1024px) {
  body.theater-mode:not(.theater-readonly) .dashColumns {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(200px, min(44dvh, 360px));
    overflow: hidden;
  }

  body.theater-mode .dashColLeft {
    min-height: 0;
    overflow: hidden;
  }

  body.theater-mode .dashColRight {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  body.theater-mode #leftCardContainer {
    grid-template-rows: minmax(0, 58fr) minmax(40px, 12fr) minmax(0, 30fr);
    gap: 8px;
    padding: 2px;
  }

  body.theater-mode.scanReveal #leftCardContainer {
    max-height: none;
  }

  body.theater-mode #teacherQuestionText {
    padding: 10px 16px !important;
  }

  body.theater-mode #cameraSelect {
    max-width: 100%;
    width: 100%;
  }

  body.theater-mode .cameraStatusCard .scanTheaterControls {
    flex-wrap: wrap;
    justify-content: center;
  }

  body.theater-mode #camStatusContainer #liveAnswered.scanAnswered {
    max-height: min(24dvh, 180px);
  }
}

@media (max-width: 768px) {
  body.theater-mode:not(.theater-readonly) .dashColumns {
    grid-template-rows: minmax(0, 1fr) minmax(180px, min(48dvh, 400px));
    padding: max(2px, env(safe-area-inset-top, 0px)) max(2px, env(safe-area-inset-right, 0px))
      max(2px, env(safe-area-inset-bottom, 0px)) max(2px, env(safe-area-inset-left, 0px));
  }

  body.theater-mode #leftCardContainer {
    grid-template-rows: minmax(0, 56fr) minmax(36px, 12fr) minmax(0, 32fr);
    gap: 6px;
  }

  body.theater-mode .scanOpt {
    padding: 3px 6px;
    column-gap: 6px;
  }

  body.theater-mode #liveOptions {
    gap: 5px;
    padding: 4px 5px;
  }

  body.theater-mode #rightCardContainer {
    gap: 6px;
  }

  body.theater-mode #countdownNumber.countdownNumber--phrase {
    font-size: clamp(18px, 5vw, 40px);
    padding: 12px 16px;
  }
}

/* Só em larguras realmente estreitas: 1 coluna (desktop + zoom comum mantém 2×2) */
@media (max-width: 520px) {
  body.theater-mode #liveOptions {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    margin: 0 4px;
  }
}

/* Paisagem baixa (ex.: telemóvel deitado): duas colunas compactas em vez de torre alta */
@media (max-height: 520px) and (orientation: landscape) {
  body.theater-mode:not(.theater-readonly) .dashColumns {
    grid-template-columns: minmax(0, 1fr) minmax(168px, 26vw);
    grid-template-rows: 1fr;
  }

  body.theater-mode .dashColRight {
    max-height: 100%;
  }

  body.theater-mode #leftCardContainer {
    grid-template-rows: minmax(0, 58fr) minmax(32px, 11fr) minmax(0, 31fr);
  }

  body.theater-mode #teacherQuestionText {
    padding: 6px 12px !important;
  }

  body.theater-mode .scanOpt {
    padding: 2px 5px;
    column-gap: 5px;
  }

  body.theater-mode #theaterControlsFloating {
    padding-top: calc(6px + env(safe-area-inset-top, 0px));
    gap: 6px;
  }
}

@media (pointer: coarse) {
  body.theater-mode .theaterCtrlBtn {
    min-height: 44px;
    min-width: 44px;
  }

  body.theater-mode .cameraStatusCard .scanTheaterControls .btnWide,
  body.theater-mode .cameraStatusCard .scanTheaterControls button {
    min-height: 44px;
    padding: 8px 14px;
  }
}

/* Diálogos globais (app-dialogs.js) — acima do ranking final (20050), Pix (20040) e sugestão fullscreen (20060) */
.appDialogModal {
  z-index: 20100;
}

.qrModalCard.appDialogCard {
  width: min(440px, calc(100vw - 32px));
  max-height: min(86vh, 560px);
  overflow: auto;
  justify-items: stretch;
  text-align: left;
}

.appDialogMessage {
  margin: 0;
  width: 100%;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text);
  font-weight: var(--font-semibold);
}

.appDialogField {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.appDialogLabel {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--muted);
}

.appDialogActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  width: 100%;
  margin-top: 4px;
}

.appDialogActions.appDialogActions--multi {
  flex-direction: column;
  align-items: stretch;
}

.appDialogActions.appDialogActions--multi .btnWide {
  width: 100%;
  justify-content: center;
}

.qrModal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
}

/* app-dialogs.js: o root tem .qrModal e .appDialogModal; .qrModal vem mais abaixo no CSS e (1 classe) empata com .appDialogModal e deixava z-index 50 — o confirm ficava atrás do ranking. Duas classes restauram 20100. */
.qrModal.appDialogModal {
  z-index: 20100;
}

/* Empilhamento: cartões (cadastro de alunos) acima do wizard «Criar sala»; preview entre os dois */
#createRoomModal.qrModal {
  z-index: 55;
}
#previewModal.qrModal {
  z-index: 60;
}
/* Acima do modo apresentação (.dashColumns em teatro = 9999), para «Cadastrar alunos» no lobby */
#cardsModal.qrModal {
  z-index: 11000;
}

.qrModalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 34, 56, 0.4);
}

.qrModalCard {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 12px;
  justify-items: center;
  animation: pop 120ms ease-out;
}

/* Pix: caber na viewport sem scroll (vence especificidade sobre .qrModalCard) */
.qrModalCard.supportPixCard {
  width: min(400px, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 12px 14px 12px;
  gap: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-items: unset;
  text-align: center;
  box-sizing: border-box;
}

@media (max-height: 720px) {
  .qrModalCard.supportPixCard {
    padding: 10px 12px;
    gap: 6px;
  }
  .supportPixQrImg {
    max-height: min(200px, 30vh, 48vw);
    max-width: min(200px, 88vw);
  }
  .supportPixImpact {
    line-height: 1.4;
  }
}

@media (max-height: 600px) {
  .supportPixQrImg {
    max-height: min(160px, 28vh, 45vw);
    max-width: min(160px, 85vw);
  }
  .supportPixTitle {
    font-size: var(--text-md);
  }
}

@media (max-height: 520px) {
  .qrModalCard.supportPixCard {
    padding: 8px 10px;
    gap: 4px;
  }
  .supportPixImpact {
    font-size: var(--text-xs);
    line-height: 1.35;
  }
  .supportPixQrImg {
    max-height: min(130px, 26vh, 42vw);
    max-width: min(130px, 80vw);
  }
  .supportPixHint {
    margin-top: 4px;
    font-size: var(--text-xs);
  }
}

.cardsModalCard {
  width: min(980px, calc(100vw - 32px));
  max-height: min(86vh, 820px);
  overflow: auto;
  justify-items: stretch;
}

.cardsModalCard--md {
  width: min(760px, calc(100vw - 32px));
}

.cardsModalCard--sm {
  width: min(600px, calc(100vw - 32px));
}

.previewQuestionsList--scroll {
  max-height: 50vh;
  overflow-y: auto;
  margin-top: 15px;
  text-align: left;
}

.modalActions--top {
  margin-top: 20px;
}

.btnImportPreview {
  font-weight: var(--font-bold);
  font-size: var(--text-base);
}

.cardsModalRoom {
  font-weight: 900;
  color: rgba(16, 24, 40, 0.86);
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  padding: 10px 12px;
}

.finalModalCard {
  width: min(980px, calc(100vw - 32px));
  max-height: min(92vh, 920px);
  overflow: auto;
  justify-items: stretch;
}

/* Fim do quiz: acima do modo teatro (z-index 9999) */
.gameFinishedModal {
  z-index: 20050;
}

.gameFinishedModal .qrModalBackdrop {
  background: rgba(15, 23, 42, 0.58);
}

.gameFinishedModalCard {
  width: min(440px, calc(100vw - 28px));
  max-height: min(88vh, 720px);
  justify-items: stretch;
  text-align: center;
}

.gameFinishedModalTitle {
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  margin-top: 4px;
}

.gameFinishedModalSub {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.45;
}

.gameFinishedModalRanking {
  width: 100%;
  margin-top: 8px;
  max-height: min(46vh, 400px);
  overflow-y: auto;
  justify-self: stretch;
  text-align: left;
}

.gameFinishedModalActions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
}

.gameFinishedModalBtn {
  width: 100%;
  justify-content: center;
}

@keyframes pop {
  from {
    transform: translateY(8px) scale(0.98);
    opacity: 0.65;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.qrModalClose {
  position: sticky;
  top: 6px;
  z-index: 10;
  justify-self: end;
  align-self: flex-end;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(185, 28, 28, 0.45);
  background: #fff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1;
  color: #b91c1c;
}

.qrModalClose:hover {
  background: #fef2f2;
  border-color: rgba(185, 28, 28, 0.7);
  color: #991b1b;
}

.qrModalClose:focus-visible {
  outline: 2px solid #b91c1c;
  outline-offset: 2px;
}

.qrModalTitle {
  font-weight: 900;
  color: var(--text);
}

.qrLarge {
  width: 360px;
  height: 360px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fbfbfd;
}

@media (max-width: 420px) {
  .qrLarge {
    width: 300px;
    height: 300px;
  }
}

.joinLinkLarge {
  color: var(--blue);
  text-decoration: none;
  font-weight: 800;
  word-break: break-all;
  text-align: center;
}

.roomsForm {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.createStep .roomsForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  grid-template-columns: 1fr;
}

.createField {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

/* Rótulos discretos (criar sala — passo 1) */
.createFieldLabel {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(16, 24, 40, 0.45);
  margin: 0 0 4px 2px;
  line-height: 1.2;
}

.createFieldLabelHint {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(16, 24, 40, 0.35);
  font-size: 10px;
}

.createFieldLabelExample {
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(16, 24, 40, 0.38);
  font-size: 11px;
}

@media (max-width: 720px) {
  .roomsForm {
    grid-template-columns: 1fr;
  }
}

.roomsCreateWrap {
  margin-top: 10px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.roomsCreateTitle {
  font-weight: 900;
  color: rgba(16, 24, 40, 0.92);
}

.stepsBar {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.stepDot {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(16, 24, 40, 0.14);
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: rgba(16, 24, 40, 0.7);
}

.stepDot.active {
  border-color: rgba(43, 182, 115, 0.45);
  color: rgba(43, 182, 115, 1);
  background: rgba(43, 182, 115, 0.12);
}

.stepLine {
  height: 2px;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.14);
}

.createStep {
  display: grid;
  gap: 10px;
}
.roomTags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.tagPill {
  font-size: 11px;
  background: #f3f4f6;
  color: #4b5563;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}
.previewQuestionItem {
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #eee;
}
.previewQuestionItem strong {
  display: block;
  margin-bottom: 8px;
  color: #111827;
}
.previewQuestionItem ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.previewQuestionItem li {
  padding: 4px 0;
  color: #4b5563;
}
.searchWrap .input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  transition: border-color 0.2s;
}
.searchWrap .input:focus {
  border-color: var(--blue);
  outline: none;
}

.createStepTitle {
  font-weight: 900;
  color: rgba(16, 24, 40, 0.84);
}

.createStep2Lead {
  margin: 8px 0 12px;
  line-height: var(--leading-relaxed);
}

#createRoomModal #createdRoomHint .createRoomChecklist {
  display: block;
  margin-top: 8px;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: rgba(15, 23, 42, 0.88);
}

.createQuestionsModeTabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.createQTab.createQTab--active {
  box-shadow: 0 0 0 2px var(--blue);
}

.createQPanel {
  margin-bottom: 16px;
}

.createQuestionsList {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: min(52vh, 480px);
  overflow-y: auto;
  padding: 4px 2px 10px;
  margin-bottom: 10px;
}

.createModalQBlock {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  gap: 10px;
}

.createModalQHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.createModalQLabel {
  font-weight: 900;
  font-size: var(--text-sm);
  color: #0f172a;
}

.createModalQOpts {
  display: grid;
  gap: 6px;
}

.createModalQRow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.createModalQRow .input {
  flex: 1;
  min-width: 120px;
}

.createModalQLetter {
  font-weight: 900;
  width: 22px;
  text-align: center;
  color: var(--muted);
}

.createQuestionsManualActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.createIaLabel {
  display: block;
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: 6px;
}

.createIaHint {
  margin: 10px 0 12px;
  font-size: var(--text-sm);
}

.createActions--step2 {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.createActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

.roomsSuggestions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.roomsSugBtn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--blue);
  font-weight: 900;
  border-radius: 999px;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.roomRow {
  cursor: pointer;
  text-align: left;
}

.roomRow.roomActive {
  border: 2px solid rgba(43, 182, 115, 0.9);
  background: rgba(43, 182, 115, 0.12);
  box-shadow: 0 0 0 4px rgba(43, 182, 115, 0.12);
}

.roomRowIconBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 12px 14px;
}

.roomRowIconGlyph {
  font-size: 1.05em;
  line-height: 1;
}

.roomRowIconCount {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  min-width: 1.1em;
}

.roomRowStudents {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(16, 24, 40, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.roomRowStudents.hidden {
  display: none !important;
}

.roomRowStudentsEmpty {
  font-size: var(--text-sm);
  color: rgba(16, 24, 40, 0.62);
  font-weight: 600;
  line-height: var(--leading-relaxed);
}

.roomsStudentsPanel {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.roomsPublicWrap {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.roomsPublicTitle {
  font-weight: 900;
  color: rgba(16, 24, 40, 0.86);
}

.roomsStudentsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.roomsStudentsTitle {
  font-weight: 900;
  color: rgba(16, 24, 40, 0.86);
}

.roomsStudentsList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roomsChip {
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 900;
  color: rgba(16, 24, 40, 0.78);
  background: rgba(255, 255, 255, 0.86);
}

.rowActions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.actionBtn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  color: rgba(16, 24, 40, 0.75);
}

.actionBtn.primary {
  border-color: rgba(43, 182, 115, 0.35);
  color: rgba(43, 182, 115, 1);
}

.actionBtn.danger {
  border-color: rgba(224, 79, 95, 0.35);
  color: rgba(224, 79, 95, 1);
}

/* --- ESTILOS DE IMPRESSÃO (CARDS) --- */
@media print {
  /* Ocultar elementos desnecessários na impressão */
  .tHeader, .roomsStudentsHeader, .roomsForm, .modalActions, .actionBtn, .authBar, #roomSuggestions {
    display: none !important;
  }
  
  body {
    background: white;
  }

  .page {
    padding: 0;
    max-width: none;
  }

  .panel {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  /* Exibir apenas a lista de cards */
  #cardsList {
    display: block; /* Tira o grid para forçar quebra de página por card */
  }

  .cardSetRow {
    page-break-inside: avoid;
    break-inside: avoid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 95vh; /* Ocupa quase toda a folha A4 */
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }

  .cardSetLeft {
    text-align: center;
    margin-bottom: 20px;
  }

  /* Oculta o nome do aluno na impressão */
  .cardSetTitle {
    display: none !important;
  }

  /* Exibe apenas o número do cartão e aumenta o tamanho */
  .cardSetSub {
    font-size: 32px !important;
    font-weight: 900 !important;
    color: #000 !important;
    margin-bottom: 20px;
  }

  /* Aumenta drasticamente o tamanho do card e afasta as letras */
  .cardPreview {
    width: 170mm !important;
    height: 170mm !important;
    max-width: none !important;
    border: 3px solid #ccc !important;
    padding: 30px !important;
    /* Reduz o gap e usa grid para empurrar as letras para as bordas sem invadir o centro */
    gap: 10px !important; 
    grid-template-columns: 50px 1fr 50px !important;
    grid-template-rows: 50px 1fr 50px !important;
    box-sizing: border-box !important;
  }

  /* Letras maiores para leitura à distância */
  .cardSide {
    width: 50px !important;
    height: 50px !important;
    font-size: 24px !important;
    border: 2px solid #000 !important;
    /* Cores forçadas para impressão caso o navegador permita background graphics */
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cardPreview .qr {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border: none !important;
    padding: 10px !important; /* Espaço de respiro extra em volta do código */
    box-sizing: border-box !important;
  }
}

/* =============================================================================
   Landing pública (/) — escopo .homeLanding evita colidir com .loginTitle do aluno
   Desktop (≥769px): tudo cabe em 100dvh, sem barra de rolagem no cartão nem na página.
   ============================================================================= */
body.homeLanding.bg {
  background-color: #eaf0f8;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
}

.homeLanding .mainWrapper {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(16, 24, 40, 0.1);
  width: 100%;
  max-width: 1000px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  box-sizing: border-box;
}

.homeLanding .topBar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  gap: 16px;
  flex-shrink: 0;
}

.homeLanding .topBarLogo {
  display: block;
  max-width: 220px;
  height: 48px;
  width: auto;
  object-fit: contain;
}

.homeLanding .userProfileIcon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), transform 0.2s var(--ease-out), border-color 0.2s;
}

.homeLanding .userProfileIcon:hover {
  background: #e2e8f0;
  transform: scale(1.04);
}

.homeLanding .userProfileIcon:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--blue);
}

.homeLanding .contentArea {
  padding: 0 40px 40px;
  box-sizing: border-box;
}

.homeLanding .hero {
  text-align: center;
  padding: 20px 0 40px;
}

.homeLanding .heroTitle {
  font-size: clamp(1.75rem, 5vw, 2.375rem);
  font-weight: var(--font-black);
  color: var(--text);
  margin: 0 0 12px;
  letter-spacing: -0.03em;
  line-height: var(--leading-tight);
}

.homeLanding .heroSubtitle {
  font-size: clamp(var(--text-base), 2.5vw, var(--text-lg));
  color: var(--muted);
  margin: 0 auto 40px;
  max-width: 36em;
  line-height: var(--leading-normal);
}

.homeLanding .hero--loginOnly {
  padding: 32px 0 48px;
  min-height: min(60vh, 520px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.homeLanding .hero--loginOnly .heroSubtitle {
  margin-bottom: 28px;
}
.homeLanding .bottomSection--loginOnly {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}
.homeLanding .loginSection--solo {
  width: 100%;
}

.homeLanding .actionCardsGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.homeLanding .actionCard {
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: left;
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  border: 1px solid transparent;
  min-width: 0;
}

.homeLanding .actionCard:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.homeLanding .actionCard.actionCard--static {
  cursor: default;
  pointer-events: none;
  user-select: none;
}
.homeLanding .actionCard.actionCard--static:hover {
  transform: none;
  box-shadow: var(--shadow-soft);
}

.homeLanding .actionCard:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}

.homeLanding .homeHowToPlay {
  max-width: none;
  margin: 0;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.15);
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 88px;
  position: relative;
  z-index: 2;
}

.homeLanding .homeHowDetails {
  width: 100%;
  max-width: none;
  margin: 0 0 28px;
}

.homeLanding .homeHowSummary {
  display: none;
  list-style: none;
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-lg);
  background: #ffffff;
  padding: 14px 16px;
  font-weight: var(--font-extrabold);
  color: #0f172a;
  box-shadow: var(--shadow-soft);
}

.homeLanding .homeHowSummary::-webkit-details-marker {
  display: none;
}

.homeLanding .homeMainGrid {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  text-align: left;
}

.homeLanding .homeLeftCol {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.homeLanding .homeMainGrid .loginSection {
  margin-bottom: 0;
  max-width: none;
}

.homeLanding .homeLeftCol,
.homeLanding .homeRightCol {
  min-width: 0;
}

.homeLanding .homeHowToPlayTitle {
  margin: 0 0 12px;
  font-size: var(--text-xl);
  font-weight: var(--font-extrabold);
  color: #0f172a;
}

.homeLanding .homeHowToPlayList {
  margin: 0;
  padding-left: 1.25rem;
  color: #334155;
  line-height: var(--leading-relaxed);
  font-size: var(--text-sm);
}

.homeLanding .homeHowToPlayList li + li {
  margin-top: 8px;
}

.homeLanding .homeManualWritten {
  margin: 16px 0 0;
  font-size: var(--text-sm);
  color: #334155;
  line-height: var(--leading-relaxed);
  text-align: center;
}
.homeLanding .homeManualWritten a {
  color: #1d4ed8;
  font-weight: var(--font-extrabold);
}

.homeLanding .actionCard.blue {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.homeLanding .actionCard.green {
  background: linear-gradient(135deg, #10b981, #059669);
}
.homeLanding .actionCard.yellow {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.homeLanding .actionCardIcon {
  font-size: var(--text-3xl);
  background: rgba(255, 255, 255, 0.95);
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.homeLanding .actionCard.blue .actionCardIcon {
  color: #2563eb;
}
.homeLanding .actionCard.green .actionCardIcon {
  color: #10b981;
}
.homeLanding .actionCard.yellow .actionCardIcon {
  color: #f59e0b;
}

.homeLanding .actionCardContent {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.homeLanding .actionCardTitle {
  font-size: var(--text-lg);
  font-weight: var(--font-extrabold);
  margin: 0;
  line-height: var(--leading-snug);
}

.homeLanding .actionCardDesc {
  font-size: var(--text-sm);
  opacity: 0.92;
  line-height: var(--leading-relaxed);
  margin: 0;
}

.homeLanding .bottomSection {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  text-align: left;
  position: relative;
  z-index: 1;
}

.homeLanding .loginSection {
  flex: 1;
  max-width: 400px;
  margin-bottom: 40px;
  min-width: 0;
}

.homeLanding .homeLoginTitle {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 16px;
  line-height: 1.2;
}

.homeLanding .loginDesc {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.5;
}

.homeLanding .loginBox {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

.homeLanding .homeDevLoginBtn {
  margin-top: 12px;
  width: 100%;
  max-width: 320px;
  background: #1e293b !important;
  color: #fff !important;
  border: 1px solid #334155 !important;
}
.homeLanding .homeDevLoginBtn:hover {
  filter: brightness(1.06);
}

/* Modal de login (ícone do utilizador na landing) */
.homeLoginModal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.homeLoginModal.hidden {
  display: none !important;
}
.homeLoginModalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
}
.homeLoginModalCard {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: var(--card, #fff);
  border-radius: 16px;
  padding: 22px 20px 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}
.homeLoginModalClose {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-weight: var(--font-extrabold);
  color: #64748b;
}
.homeLoginModalClose:hover {
  background: #f8fafc;
  color: #0f172a;
}
.homeLoginModalTitle {
  margin: 0 32px 8px 0;
  font-size: var(--text-xl);
  font-weight: var(--font-extrabold);
  color: #0f172a;
  line-height: var(--leading-snug);
}
.homeLoginModalLead {
  margin: 0 0 12px;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-relaxed);
}
.homeLoginModal .authBootBanner {
  margin-bottom: 12px;
  text-align: left;
}
.homeLanding .homeLoginModal .loginBox {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

.homeLanding .illustrationWrapper {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  min-height: 0;
}

.homeLanding .bottomImage {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 280px;
  object-fit: contain;
}

.homeLanding .footerCredit {
  text-align: center;
  margin-top: 20px;
  padding: 0 16px 20px;
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.homeLanding .footerCredit a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s;
}

.homeLanding .footerCredit a:hover {
  color: var(--blue-hover);
  text-decoration: underline;
}

/* ——— Desktop: encaixar na altura da janela, sem scroll ——— */
@media (min-width: 769px) {
  html:has(body.homeLanding.bg) {
    height: 100%;
    overflow: hidden;
  }

  body.homeLanding.bg {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding: clamp(6px, 1.2dvh, 16px) clamp(12px, 2.5vw, 28px);
  }

  .homeLanding .mainWrapper {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
    width: 100%;
    max-width: min(1000px, 100%);
    max-height: calc(100dvh - clamp(14px, 2.6dvh, 36px));
  }

  .homeLanding .topBar {
    padding: clamp(10px, 1.4dvh, 18px) clamp(16px, 2.5vw, 36px);
  }

  .homeLanding .topBarLogo {
    height: clamp(36px, 5dvh, 46px);
    max-height: 5.5dvh;
  }

  .homeLanding .userProfileIcon {
    width: clamp(40px, 5dvh, 48px);
    height: clamp(40px, 5dvh, 48px);
    min-width: clamp(40px, 5dvh, 48px);
  }

  .homeLanding .contentArea {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0 clamp(16px, 2.5vw, 36px) clamp(4px, 0.9dvh, 12px);
  }

  .homeLanding .hero {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(4px, 1dvh, 14px) 0 clamp(4px, 0.9dvh, 12px);
  }

  .homeLanding .heroTitle {
    flex-shrink: 0;
    margin: 0 0 clamp(4px, 0.7dvh, 10px);
    font-size: clamp(22px, 2.8dvh + 1.5vw, 34px);
    line-height: 1.12;
  }

  .homeLanding .heroSubtitle {
    flex-shrink: 0;
    margin: 0 auto clamp(8px, 1.2dvh, 18px);
    font-size: clamp(14px, 1.45dvh + 0.4vw, 17px);
    line-height: 1.35;
    max-width: 38em;
  }

  .homeLanding .actionCardsGrid {
    flex-shrink: 0;
    width: 100%;
    gap: clamp(8px, 1.1dvh, 16px);
    margin-bottom: clamp(6px, 0.9dvh, 14px);
  }

  .homeLanding .actionCard {
    padding: clamp(10px, 1.4dvh, 18px) clamp(10px, 1.6vw, 18px);
    gap: clamp(8px, 1vw, 14px);
  }

  .homeLanding .actionCardIcon {
    width: clamp(40px, 5dvh, 54px);
    height: clamp(40px, 5dvh, 54px);
  }

  .homeLanding .actionCardTitle {
    font-size: clamp(14px, 1.65dvh, 17px);
  }

  .homeLanding .actionCardDesc {
    font-size: clamp(11px, 1.35dvh, 13px);
    line-height: 1.32;
  }

  .homeLanding .bottomSection {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    align-items: center;
    gap: clamp(12px, 2vw, 28px);
    text-align: left;
  }

  .homeLanding .loginSection {
    margin-bottom: 0;
    max-width: none;
    align-self: center;
  }

  .homeLanding .homeLoginTitle {
    font-size: clamp(17px, 2.2dvh, 24px);
    margin: 0 0 clamp(5px, 0.9dvh, 12px);
  }

  .homeLanding .loginDesc {
    margin: 0 0 clamp(6px, 1dvh, 14px);
    font-size: clamp(13px, 1.45dvh, 15px);
    line-height: 1.38;
  }

  .homeLanding .loginBox {
    gap: clamp(8px, 1dvh, 14px);
  }

  .homeLanding .illustrationWrapper {
    justify-content: center;
    max-height: 100%;
    min-height: 0;
  }

  .homeLanding .bottomImage {
    max-height: min(36dvh, 100%);
    max-width: 100%;
  }

  .homeLanding .footerCredit {
    margin-top: 0;
    padding: clamp(3px, 0.7dvh, 8px) 12px clamp(4px, 0.85dvh, 10px);
    font-size: clamp(11px, 1.35dvh, 13px);
  }
}

@media (min-width: 769px) and (max-height: 740px) {
  html:has(body.homeLanding.bg) {
    overflow: auto;
  }
  body.homeLanding.bg {
    overflow: auto;
    align-items: flex-start;
  }
  .homeLanding .mainWrapper {
    max-height: none;
  }
  .homeLanding .contentArea {
    overflow: visible;
  }
  .homeLanding .hero {
    overflow: visible;
  }
}

@media (max-width: 768px) {
  html:has(body.homeLanding.bg) {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.homeLanding.bg {
    display: block;
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px;
  }

  .homeLanding .mainWrapper {
    display: block;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .homeLanding .contentArea {
    display: block;
    min-height: 0;
    overflow: visible;
  }

  .homeLanding .hero {
    display: block;
    min-height: 0;
    overflow: visible;
    padding: 16px 0 28px;
  }

  .homeLanding .actionCardsGrid {
    grid-template-columns: 1fr;
  }

  .homeLanding .bottomSection {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
  }

  .homeLanding .homeMainGrid {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
  }

  .homeLanding .homeHowDetails {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
  }

  .homeLanding .homeHowSummary {
    display: block;
    width: 100%;
    max-width: 720px;
    text-align: left;
  }

  .homeLanding .homeHowToPlay {
    margin-top: 12px;
    margin-bottom: 0;
    text-align: left;
  }

  .homeLanding .loginSection {
    margin-bottom: 0;
    max-width: none;
  }

  .homeLanding .loginBox {
    align-items: center;
  }

  .homeLanding .illustrationWrapper {
    justify-content: center;
  }

  .homeLanding .bottomImage {
    max-height: min(240px, 55vw);
  }

  .homeLanding .topBar,
  .homeLanding .contentArea {
    padding: 20px;
  }
}

@media (max-width: 768px) and (orientation: landscape) and (max-height: 520px) {
  .homeLanding .bottomImage {
    max-height: min(160px, 40vh);
  }
  .homeLanding .hero {
    padding: 8px 0 12px;
  }
}
