/* Quiz DialogXpert — identidade DialogXpert */

:root {
  --navy: #1b2c3e;
  --navy-fundo: #0d1a2b;
  --azul: #3d7fbf;
  --azul-hover: #2d6fab;
  --azul-claro: #7db8e8;
  --painel: #f5f8fc;
  --muted: #7a90a8;
  --borda: #dde4ed;
  --verde: #21c45d; /* só no indicador de acerto da tela de resultado */
  --erro: #b4342d;
  --raio: 16px;
  --fonte: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--fonte);
  background: var(--painel);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, p { margin: 0; }

/* ---------- compartilhado ---------- */

.logo-branca { filter: brightness(0) invert(1); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 0 24px;
  font: 700 19px/1 var(--fonte);
  color: var(--painel);
  background: var(--azul);
  border: 0;
  border-radius: var(--raio);
  cursor: pointer;
  transition: background-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--azul-hover); }
.btn:focus-visible { outline: 3px solid var(--azul-claro); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; background: var(--azul); }

.btn-sec {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--borda);
  font-weight: 600;
  font-size: 17px;
}
.btn-sec:hover { background: transparent; border-color: var(--azul); color: var(--azul-hover); }
.btn-sec:disabled { background: transparent; }

.campo {
  display: block;
  width: 100%;
  height: 54px;
  padding: 0 16px;
  font: 500 17px/1 var(--fonte);
  color: var(--navy);
  background: var(--painel);
  border: 1.5px solid var(--borda);
  border-radius: var(--raio);
  box-shadow: inset 0 1px 2px rgba(27, 44, 62, .06);
  transition: border-color .15s, box-shadow .15s;
}
.campo::placeholder { color: var(--muted); font-weight: 400; }
.campo:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(61, 127, 191, .28);
}

.cartao {
  background: var(--painel);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  box-shadow: 0 8px 24px rgba(27, 44, 62, .08);
}

/* ---------- telão (index.html) ---------- */

/* O telão é desenhado em 1920×1080 e escalado por inteiro para caber em qualquer
   resolução de projetor (a escala --s vem do script no <head> de index.html).
   Se a proporção não for 16:9, o palco cresce na outra dimensão e o layout estica. */
.telao {
  height: 100vh;
  overflow: hidden;
  color: var(--painel);
  background-color: var(--navy-fundo);
  background-image:
    radial-gradient(circle, rgba(61, 127, 191, .26) 1.5px, transparent 1.8px),
    linear-gradient(135deg, #0d1a2b, #1b2c3e);
  background-size: 24px 24px, 100% 100%;
  background-attachment: fixed;
}

.palco {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100vw / var(--s, 1));
  height: calc(100vh / var(--s, 1));
  transform: scale(var(--s, 1));
  transform-origin: 0 0;
}

.telao main {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(0, 1fr);
  gap: 72px;
  height: 100%;
  padding: 56px 72px;
}

.coluna-esq { display: flex; flex-direction: column; align-items: flex-start; }

.telao .logo { height: 64px; width: auto; }

.telao h1 {
  margin-top: 36px;
  font-size: 60px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -.015em;
}

.chamada {
  margin-top: 14px;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--azul-claro);
}

.cartao-qr {
  margin-top: 32px;
  padding: 24px;
  /* 580 px em 16:9; cresce (até a largura da coluna) quando o palco fica mais alto, como em 4:3 */
  width: min(100%, max(580px, calc(100vh / var(--s, 1) - 500px)));
  box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
}
.cartao-qr img { display: block; width: 100%; height: auto; aspect-ratio: 1; }

.contador {
  margin-top: auto;
  padding-top: 24px;
  font-size: 36px;
  line-height: 1.1;
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.contador strong {
  font-size: 96px;
  line-height: 1;
  font-weight: 800;
  color: var(--azul-claro);
  font-variant-numeric: tabular-nums;
}

.ranking {
  display: flex;
  flex-direction: column;
  padding: 36px 40px 32px;
  background: rgba(245, 248, 252, .05);
  border: 1px solid rgba(125, 184, 232, .2);
  border-radius: var(--raio);
}
.ranking h2 { font-size: 48px; line-height: 1.1; font-weight: 700; }
.ranking .sub { margin-top: 6px; font-size: 24px; color: var(--muted); font-weight: 500; }

#lista {
  flex: 1;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.linha {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 20px;
  flex: 1 1 66px;
  max-height: 100px;
  padding: 0 20px 0 12px;
  font-size: 32px;
  font-weight: 600;
  background: rgba(245, 248, 252, .05);
  border-radius: var(--raio);
}

.linha .pos {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  font-size: 28px;
  font-weight: 700;
  color: var(--muted);
  border: 2px solid rgba(122, 144, 168, .45);
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
}
.linha .nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linha .acertos { font-size: 28px; font-weight: 500; color: var(--muted); text-align: right; min-width: 210px; }
.linha .tempo { font-size: 28px; font-weight: 600; text-align: right; min-width: 128px; font-variant-numeric: tabular-nums; }

.linha.destaque {
  color: var(--azul-claro);
  background: rgba(125, 184, 232, .14);
  box-shadow: inset 0 0 0 1.5px rgba(125, 184, 232, .5);
}
.linha.destaque .pos { color: var(--navy-fundo); background: var(--azul-claro); border-color: var(--azul-claro); }
.linha.destaque .acertos { color: var(--azul-claro); }

.vazio {
  margin: auto;
  padding: 40px 0;
  font-size: 32px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 899px) {
  .telao { height: auto; overflow: visible; }
  .palco { position: static; width: auto; height: auto; transform: none; }
  .telao main { grid-template-columns: minmax(0, 1fr); gap: 40px; height: auto; min-height: 100vh; padding: 28px 20px 40px; }
  .telao .logo { height: 40px; }
  .telao h1 { margin-top: 24px; font-size: 38px; }
  .chamada { font-size: 20px; }
  .cartao-qr { padding: 16px; width: min(100%, 420px); }
  .contador { margin-top: 28px; font-size: 22px; gap: 12px; }
  .contador strong { font-size: 56px; }
  .ranking { padding: 24px 16px; }
  .ranking h2 { font-size: 34px; }
  .ranking .sub { font-size: 18px; }
  .linha { grid-template-columns: 40px minmax(0, 1fr) auto auto; column-gap: 10px; flex: 0 0 56px; max-height: none; padding: 0 12px 0 8px; font-size: 20px; }
  .linha .pos { width: 40px; height: 40px; font-size: 20px; }
  .linha .acertos { font-size: 15px; min-width: 0; }
  .linha .tempo { font-size: 16px; min-width: 0; }
  .vazio { font-size: 22px; }
}

/* ---------- celular (responder.html) ---------- */

.topo {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 20px;
  background: var(--navy);
}
.topo img { height: 30px; width: auto; display: block; }

.celular main { max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; }

.celular .cartao { padding: 24px 20px; }

.celular h1 { font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.celular .intro { margin-top: 10px; font-size: 16px; line-height: 1.5; color: rgba(27, 44, 62, .8); }

.form-id { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.rotulo { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }

.erro { margin-top: 14px; font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--erro); }
.erro:empty { display: none; }

.prog-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.prog-rotulo { font-size: 15px; font-weight: 700; }
.prog-titulo { font-size: 13px; font-weight: 500; color: var(--muted); text-align: right; }
.barra { margin-top: 10px; height: 8px; background: var(--borda); border-radius: 999px; overflow: hidden; }
.barra > div { height: 100%; width: 0; background: var(--azul); border-radius: 999px; transition: width .25s; }

.pergunta { margin: 24px 0 18px; font-size: 22px; line-height: 1.3; font-weight: 700; outline: none; }

.opcoes { display: flex; flex-direction: column; gap: 12px; }
.opcao {
  display: block;
  width: 100%;
  min-height: 60px;
  padding: 14px 18px;
  font: 600 17px/1.3 var(--fonte);
  text-align: left;
  color: var(--navy);
  background: var(--painel);
  border: 2px solid var(--borda);
  border-radius: var(--raio);
  cursor: pointer;
  transition: border-color .12s, background-color .12s;
  -webkit-tap-highlight-color: transparent;
}
.opcao:hover { border-color: var(--azul); }
.opcao:focus-visible { outline: 3px solid var(--azul-claro); outline-offset: 2px; }
.opcao[aria-pressed="true"] { border-color: var(--azul); background: rgba(61, 127, 191, .14); }
.opcao:disabled { cursor: default; }

.acoes { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }

/* resultado: cartão navy para o verde do acerto ter contraste */
.celular .resultado {
  padding: 36px 24px 32px;
  text-align: center;
  color: var(--painel);
  background: var(--navy);
  border-color: var(--navy);
}
.selo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  margin: 0 auto 22px;
  color: var(--verde);
  background: rgba(33, 196, 93, .14);
  border-radius: 50%;
}
.selo.zero { color: var(--azul-claro); background: rgba(125, 184, 232, .14); }
.selo svg { width: 46px; height: 46px; }
.res-aviso { margin-bottom: 14px; font-size: 18px; font-weight: 700; color: var(--azul-claro); }
.res-rotulo { font-size: 20px; font-weight: 500; }
.res-nota { display: block; margin-top: 4px; font-size: 60px; line-height: 1.1; font-weight: 800; color: var(--verde); }
.res-nota.zero { color: var(--painel); }
.res-nome { margin-top: 14px; font-size: 18px; font-weight: 600; color: var(--azul-claro); }
.res-msg { margin-top: 22px; font-size: 16px; line-height: 1.5; color: rgba(245, 248, 252, .85); }
.res-outro {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 18px;
  padding: 0 12px;
  font: 500 15px/1 var(--fonte);
  color: var(--azul-claro);
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.res-outro:hover { color: var(--painel); }
.res-outro:focus-visible { outline: 3px solid var(--azul-claro); outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
