/* Quiz do Ano · estilo mínimo: azul MAG + neutros, 3 tamanhos de texto (título 28, corpo 16, pequeno 13), grade de 8 px. */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/assets/montserrat-latin.woff2) format("woff2"); }
:root {
  --blue: #0267B1; --blue-press: #01548F; --blue-tint: #EAF3FA;
  --ink: #0F1B2A; --muted: #5E6A78; --line: #E3E8EE; --soft: #F4F6F8; --bg: #FFFFFF;
  --ease: cubic-bezier(.2, .9, .25, 1);
  --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: "Montserrat", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, select { font: inherit; color: inherit; }
.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; }
.app.wide { max-width: 880px; }
.screen { flex: 1; display: flex; flex-direction: column; padding: calc(16px + var(--st)) 24px calc(24px + var(--sb)); min-height: 100dvh; }
.screen.in { animation: in .16s var(--ease) both; }
@keyframes in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* texto: só três tamanhos */
.title { font-size: 28px; line-height: 34px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 16px; }
.body { font-size: 16px; line-height: 24px; margin: 0 0 16px; }
.small, .kicker { font-size: 13px; line-height: 20px; margin: 0; }
.kicker { font-weight: 700; color: var(--blue); margin-bottom: 8px; letter-spacing: .02em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.strong { font-weight: 700; }
.blue { color: var(--blue); }
.grow { flex: 1 1 auto; min-height: 24px; }

.bar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-bottom: 40px; }
.logo { height: 27px; width: auto; display: block; }

.btn { appearance: none; border: 0; width: 100%; min-height: 56px; border-radius: 16px; background: var(--blue); color: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s ease, background .08s; touch-action: manipulation; }
.btn:active, .btn.press { transform: scale(.98); background: var(--blue-press); }
.btn:disabled { opacity: .4; }
.link { appearance: none; border: 0; background: none; color: var(--blue); font-size: 16px; font-weight: 700; min-height: 48px; margin-top: 8px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; touch-action: manipulation; }
.link.small { font-size: 13px; min-height: 40px; margin: 0; }

/* pergunta */
.qhead { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.segs { display: flex; gap: 4px; }
.segs i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.segs i.done { background: var(--blue); }
.segs i.on { background: var(--blue); opacity: .45; }
.qmeta { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.bonus { display: flex; align-items: center; gap: 8px; }
.bonus .track { width: 72px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bonus .fill { height: 100%; width: 100%; background: var(--blue); transform-origin: left; }
.bonus b { font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.bonus.zero { color: var(--muted); }
.qbody { animation: qin .14s var(--ease) both; display: flex; flex-direction: column; flex: 1; }
@keyframes qin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { appearance: none; width: 100%; min-height: 56px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--bg); padding: 8px 16px; font-size: 16px; line-height: 24px; font-weight: 600; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 8px; transition: transform .08s ease, border-color .08s, background .12s, color .12s, opacity .16s; touch-action: manipulation; }
.opt svg { width: 20px; height: 20px; flex-shrink: 0; }
.opt.press { transform: scale(.98); border-color: var(--blue); background: var(--blue-tint); }
.opt.right { background: var(--blue); border-color: var(--blue); color: #fff; animation: pop .22s var(--ease); }
.opt.wrong { background: var(--soft); border-color: var(--soft); color: var(--muted); animation: shake .24s ease; }
.opt.dim { opacity: .4; }
.opts.locked .opt { pointer-events: none; }
@keyframes pop { 50% { transform: scale(1.02); } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.plus { position: fixed; z-index: 30; font-size: 16px; font-weight: 800; color: var(--blue); pointer-events: none; animation: rise .6s var(--ease) forwards; }
@keyframes rise { to { transform: translateY(-40px); opacity: 0; } }

/* folha de resposta */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; transform: translateY(100%); transition: transform .18s var(--ease); }
.sheet.show { transform: none; }
.sheet .in { width: 100%; max-width: 480px; background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(15, 27, 42, .06); padding: 24px 24px calc(24px + var(--sb)); border-radius: 24px 24px 0 0; }
.sheet .verdict { font-size: 16px; line-height: 24px; font-weight: 800; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.sheet .verdict svg { width: 20px; height: 20px; }
.sheet .cur { margin: 0 0 24px; }

/* resultado */
.score { font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 8px; margin: 8px 0 24px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; background: var(--line); }
.dots i.ok { background: var(--blue); }
.dots.anim i { animation: dot .2s var(--ease) both; }
@keyframes dot { from { transform: scale(0); } }
.stat { display: flex; justify-content: space-between; padding: 16px 0; border-top: 1px solid var(--line); }
.stat:last-of-type { border-bottom: 1px solid var(--line); }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.field label { font-size: 13px; line-height: 20px; font-weight: 700; color: var(--muted); }
.input { width: 100%; min-height: 56px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--bg); padding: 0 16px; font-size: 16px; font-weight: 600; outline: none; appearance: none; }
.input:focus { border-color: var(--blue); }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }

/* ranking */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--soft); border-radius: 16px; margin-bottom: 16px; }
.tabs button { appearance: none; border: 0; background: none; min-height: 40px; border-radius: 12px; font-size: 13px; font-weight: 700; color: var(--muted); touch-action: manipulation; }
.tabs button.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(15,27,42,.08); }
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 32px 1fr auto; gap: 8px; align-items: center; min-height: 56px; border-bottom: 1px solid var(--line); font-size: 16px; }
.row .pos { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.row .who { min-width: 0; }
.row .who b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .who span { display: block; font-size: 13px; line-height: 20px; color: var(--muted); }
.row .val { font-weight: 700; font-variant-numeric: tabular-nums; }
.row.me { background: var(--blue-tint); border-radius: 12px; border-bottom-color: transparent; padding: 0 8px; margin: 0 -8px; }
.row.me .pos, .row.me .val { color: var(--blue); }
.row.new { animation: qin .2s var(--ease) both; }

/* cartão */
.card { width: 100%; max-width: min(280px, calc((100dvh - 344px) * 9 / 16)); margin: 0 auto 24px; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); }
.card img, .card canvas { width: 100%; height: 100%; display: block; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--sb)); transform: translate(-50%, 16px); opacity: 0; background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 12px; transition: all .2s var(--ease); z-index: 50; pointer-events: none; font-weight: 600; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@keyframes drain { to { transform: scaleX(0); } }
.game .title { margin-bottom: 32px; }
.foot { position: sticky; bottom: 0; background: var(--bg); padding: 16px 0 calc(8px + var(--sb)); margin-bottom: calc(-24px - var(--sb)); display: flex; flex-direction: column; box-shadow: 0 -16px 16px -16px rgba(15,27,42,.08); }
.game .title { margin-bottom: 32px; }
