/* Arena ENEM FTM — visual "Academia Arcana": grande salão de um castelo à noite.
   Abóbada estrelada, velas flutuantes, pergaminho e lacre de cera.
   Tudo original (SVG/CSS deste projeto). Fontes locais, SIL OFL 1.1 (ver /fonts/OFL-*.txt):
   IM Fell English SC (títulos e números) e Pinyon Script (só nos momentos de magia).
   Este arquivo: tokens, peças comuns, celular e termos. Telão em telao.css; host em host.css. */

@font-face {
  font-family: "Fell SC";
  src: url("../fonts/fell-english-sc.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
/* Pinyon vem cortada só com as letras de "Acertou!", "Você está dentro!" e "Fim de jogo!" (6,6 KB).
   Texto novo nessa fonte exige refazer o subconjunto (fontTools) — senão cai na cursiva do sistema. */
@font-face {
  font-family: "Pinyon";
  src: url("../fonts/pinyon-script.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  color-scheme: dark;
  --meia-noite: #0b0f2b;
  --placa: rgba(13, 16, 44, .88);
  --vinho: #7a1630;
  --vela: #ffbe5c;
  --vela-clara: #ffe2a0;
  --latao: #c99a4a;
  --tinta: #2a1a0f;
  --tinta-2: #5a4128;
  --texto-claro: #f4ead6;
  --texto-apagado: #bdb8d2;
  --erro: #ff8f8f;
  --erro-tinta: #9b1026;

  --cera-a: #a3172b; --cera-a-escura: #620b19;
  --cera-b: #1f4fa8; --cera-b-escura: #102d66;
  --cera-c: #d58e14; --cera-c-escura: #85520a;
  --cera-d: #17794a; --cera-d-escura: #0b472a;

  --fonte-titulo: "Fell SC", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --fonte-magia: "Pinyon", "Segoe Script", "Brush Script MT", cursive;
  --fonte-texto: "Inter", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: 16px;
  --rasgado: polygon(0.00% 2.8px, 8.33% 3.3px, 16.67% 3.6px, 25.00% 4.2px, 33.33% 3.3px, 41.67% 4.2px, 50.00% 0.1px, 58.33% 2.1px, 66.67% 4.2px, 75.00% 2.9px, 83.33% 4.1px, 91.67% 0.5px, 100.00% 2.1px, calc(100% - 1.1px) 8.33%, calc(100% - 2.4px) 16.67%, calc(100% - 2.6px) 25.00%, calc(100% - 0.1px) 33.33%, calc(100% - 1.0px) 41.67%, calc(100% - 1.3px) 50.00%, calc(100% - 4.1px) 58.33%, calc(100% - 3.4px) 66.67%, calc(100% - 0.7px) 75.00%, calc(100% - 3.6px) 83.33%, calc(100% - 0.6px) 91.67%, 100.00% calc(100% - 2.8px), 91.67% calc(100% - 0.6px), 83.33% calc(100% - 0.0px), 75.00% calc(100% - 3.9px), 66.67% calc(100% - 0.9px), 58.33% calc(100% - 1.0px), 50.00% calc(100% - 4.4px), 41.67% calc(100% - 3.9px), 33.33% calc(100% - 1.3px), 25.00% calc(100% - 4.3px), 16.67% calc(100% - 2.4px), 8.33% calc(100% - 3.1px), 0.00% calc(100% - 0.9px), 4.2px 91.67%, 3.1px 83.33%, 4.3px 75.00%, 4.0px 66.67%, 1.3px 58.33%, 1.6px 50.00%, 0.7px 41.67%, 0.7px 33.33%, 0.3px 25.00%, 1.4px 16.67%, 2.7px 8.33%);
  --papel:
    url("../img/pergaminho.svg"),
    radial-gradient(ellipse 120% 90% at 50% 40%, #fbf1da 0%, #f0dfb8 55%, #dcc08a 100%);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  color: var(--texto-claro);
  font: 1.0625rem/1.45 var(--fonte-texto);
  background-color: var(--meia-noite);
  background-image:
    radial-gradient(130% 90% at 50% 45%, transparent 50%, rgba(3, 3, 12, .75) 100%),
    linear-gradient(180deg, rgba(5, 6, 20, .15), rgba(5, 6, 20, .35)),
    url("../img/cenario.svg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
p { margin: 0 0 .8em; }
a { color: var(--vela-clara); }
:focus-visible { outline: 3px solid var(--vela-clara); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- velas flutuantes (decoração fixa) ---------- */
.velas { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.vela {
  position: absolute;
  width: 8px; height: 30px;
  border-radius: 2px 2px 1px 1px;
  background: linear-gradient(90deg, #d9c8a4, #fff6e2 45%, #c8b48c);
  animation: flutuar 7s ease-in-out infinite;
}
.vela::before {
  content: ""; position: absolute; left: 50%; bottom: 100%;
  width: 8px; height: 14px; margin-left: -4px; margin-bottom: 2px;
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  background: radial-gradient(circle at 50% 70%, #fff7d6 0 25%, #ffc35a 55%, #ff7a1a 100%);
  box-shadow: 0 0 10px 3px rgba(255, 180, 80, .75), 0 0 34px 12px rgba(255, 150, 50, .28);
  animation: tremular 1.3s ease-in-out infinite alternate;
}
.v1 { left: 6%; top: 18%; }
.v2 { left: 22%; top: 8%; transform: scale(.7); animation-delay: -2s; }
.v3 { left: 41%; top: 15%; transform: scale(.55); animation-delay: -4s; }
.v4 { left: 63%; top: 6%; transform: scale(.75); animation-delay: -1s; }
.v5 { left: 80%; top: 17%; animation-delay: -3s; }
.v6 { left: 93%; top: 7%; transform: scale(.6); animation-delay: -5s; }
.v7 { left: 52%; top: 30%; transform: scale(.45); animation-delay: -6s; }

/* ---------- materiais ---------- */
.placa {
  position: relative;
  background: var(--placa);
  border: 1.5px solid var(--latao);
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px rgba(13, 16, 44, .9), inset 0 0 0 4px rgba(201, 154, 74, .45), 0 14px 30px rgba(0, 0, 0, .55);
}
.papel {
  background: var(--papel);
  background-size: 300px 300px, cover;
  color: var(--tinta);
  clip-path: var(--rasgado);
  box-shadow: inset 0 0 22px rgba(122, 72, 20, .45);
}


/* lacre de cera com letra */
.selo { position: relative; display: block; width: 104px; aspect-ratio: 100 / 120; flex: none; }
.selo__cera { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 4px 4px rgba(40, 10, 0, .45)); }
.lacre__cera { fill: var(--cera, #8f1830); }
.lacre__fita { fill: var(--cera-escura, #4a0b1d); }
.selo__letra {
  position: absolute; left: 0; right: 0; top: 0; height: 83.3%;
  display: grid; place-items: center;
  font-family: var(--fonte-titulo); font-size: 3.6rem; line-height: 1; padding-top: .06em;
  color: #fff1d8;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .5), 0 2px 0 rgba(255, 255, 255, .18);
}
.cera-a { --cera: var(--cera-a); --cera-escura: var(--cera-a-escura); }
.cera-b { --cera: var(--cera-b); --cera-escura: var(--cera-b-escura); }
.cera-c { --cera: var(--cera-c); --cera-escura: var(--cera-c-escura); }
.cera-d { --cera: var(--cera-d); --cera-escura: var(--cera-d-escura); }
.cera-c .selo__letra { color: #2e1700; text-shadow: 0 1px 0 rgba(255, 240, 200, .5); }

/* relógio de luas: as acesas são o tempo que resta */
.relogio { position: relative; width: 92px; height: 92px; flex: none; }
.relogio svg { width: 100%; height: 100%; overflow: visible; }
.relogio__fundo { fill: rgba(10, 12, 36, .92); stroke: var(--latao); stroke-width: 1.5; }
.relogio__aro { fill: none; stroke: var(--latao); stroke-width: 1.2; }
.relogio__marcas { fill: none; stroke: rgba(201, 154, 74, .55); stroke-width: 3; stroke-dasharray: 1 4.24; }
.lua { fill: #1d2148; stroke: #3b4078; stroke-width: .8; transition: fill .4s ease; }
.lua.acesa { fill: var(--vela-clara); stroke: none; filter: drop-shadow(0 0 2px rgba(255, 200, 110, .9)); }
.lua.minguante { fill: #b89a62; stroke: none; }
.relogio__valor {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--fonte-titulo); font-size: 2.2rem; line-height: 1;
  color: var(--vela-clara); text-shadow: 0 0 12px rgba(255, 190, 92, .6);
}

.ord { font-family: var(--fonte-texto); font-weight: 800; font-size: .72em; }

.titulo-arena {
  margin: 0; text-align: center;
  font-family: var(--fonte-titulo); font-weight: 400; font-size: 2.6rem; line-height: 1.05;
  color: var(--vela-clara); text-shadow: 0 0 18px rgba(255, 190, 92, .45), 0 2px 0 #1a0d05;
}
.sub-arena { margin: 2px 0 14px; text-align: center; font-family: var(--fonte-titulo); font-size: 1.05rem; color: var(--texto-apagado); letter-spacing: .06em; }

/* =========================================================
   CELULAR
   ========================================================= */
.cel {
  position: relative; z-index: 1;
  max-width: 440px; margin: 0 auto;
  min-height: 100dvh;
  padding: calc(18px + env(safe-area-inset-top)) var(--gutter) calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
}
[data-tela] { display: flex; flex-direction: column; gap: 12px; }
.tela-centro { flex: 1; justify-content: center; align-items: center; text-align: center; }
#tela-questao, #tela-revelacao, #tela-fim { flex: 1; }

.miudo { font-size: .9rem; color: var(--texto-apagado); text-align: center; margin: 0; }
.dica { margin: 0; text-align: center; font-size: .9rem; color: var(--texto-apagado); }
.dica b { color: var(--texto-claro); }
.carregando { font-family: var(--fonte-titulo); font-size: 1.5rem; color: var(--vela-clara); margin: 18px 0 0; }
.vela--solo { position: relative; display: block; width: 14px; height: 52px; margin-top: 30px; }
.vela--solo::before { width: 14px; height: 24px; margin-left: -7px; }
.nota-papel { padding: 16px 20px; margin: 6px 0 0; font-size: 1.05rem; font-weight: 600; text-align: center; }

.aviso {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  padding: 10px var(--gutter);
  background: linear-gradient(180deg, #9a2440, #5e0f24);
  border-bottom: 2px solid var(--latao);
  color: #fff3e0; text-align: center; font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
}

/* ---------- HUD ---------- */
.hud-bloco { display: flex; flex-direction: column; gap: 12px; }
.hud {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 0 14px; min-height: 74px;
}
.hud__quem { min-width: 0; }
.hud__nome { margin: 0; font-weight: 700; font-size: 1rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud__disciplina { margin: 1px 0 0; font-family: var(--fonte-titulo); font-size: 1.02rem; color: var(--vela); }
.hud__pontos { margin: 0; display: flex; flex-direction: column; align-items: flex-end; }
.hud__pontos-valor { font-family: var(--fonte-titulo); font-size: 1.85rem; line-height: 1; color: var(--vela-clara); text-shadow: 0 0 14px rgba(255, 190, 92, .5); }
.hud__pontos-rotulo { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--texto-apagado); margin-top: 3px; }
.contadores { display: flex; gap: 8px; }
.pilula {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 6px 10px; border-radius: 999px;
  background: var(--placa); border: 1px solid rgba(201, 154, 74, .7);
  font-size: .86rem; font-weight: 700; white-space: nowrap;
}
.pilula svg { width: 18px; height: 20px; flex: none; }
.pilula__fraco { font-weight: 500; color: var(--texto-apagado); }
.pilula b, .pilula .num { font-family: var(--fonte-titulo); font-weight: 400; font-size: 1.15rem; color: var(--vela-clara); }
.trilha { display: grid; grid-template-columns: repeat(var(--total, 16), 1fr); gap: 4px; }
.trilha span { height: 7px; transform: skewX(-20deg); background: rgba(244, 234, 214, .14); }
.trilha .feito { background: linear-gradient(180deg, var(--vela-clara), var(--vela)); }
.trilha .agora { background: #fff; box-shadow: 0 0 8px var(--vela); }

/* ---------- cadastro ---------- */
.pergaminho-form { padding: 22px 20px 20px; color-scheme: light; }
.pergaminho-form h2 { margin: 0 0 12px; font-family: var(--fonte-titulo); font-weight: 400; font-size: 1.6rem; color: var(--vinho); text-align: center; }
.pergaminho-form label { display: block; font-weight: 700; margin-bottom: 14px; color: var(--tinta); }
.pergaminho-form input:not([type=checkbox]):not([type=radio]), .pergaminho-form select {
  display: block; width: 100%; margin-top: 6px; padding: 13px 14px;
  font: inherit; font-weight: 500; color: var(--tinta);
  background: rgba(255, 252, 242, .85);
  border: 2px solid #8a6a3e; border-radius: 6px;
}
.pergaminho-form input:focus, .pergaminho-form select:focus { outline: 3px solid var(--vinho); outline-offset: 1px; border-color: var(--vinho); }
.pergaminho-form .dica { color: var(--tinta-2); text-align: left; margin-bottom: 12px; }
.pergaminho-form a { color: var(--vinho); font-weight: 700; }
.check { display: flex !important; gap: 12px; align-items: flex-start; font-weight: 500 !important; }
.check input { width: 24px; height: 24px; flex: none; margin: 1px 0 0; accent-color: var(--vinho); }
.erro { margin: 0 0 12px; min-height: 1.4em; color: var(--erro-tinta); font-weight: 700; }
.erro:not(:empty) { padding: 8px 12px; border-left: 4px solid var(--erro-tinta); background: rgba(155, 16, 38, .1); }
fieldset { border: 0; margin: 0 0 10px; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-family: var(--fonte-titulo); font-size: 1.25rem; color: var(--tinta); }

.primario {
  display: block; width: 100%; margin-top: 6px; padding: 15px 18px;
  font: inherit; font-family: var(--fonte-titulo); font-size: 1.35rem; letter-spacing: .03em;
  color: #fff3dc; cursor: pointer;
  background: linear-gradient(180deg, #a3243f, #6b1028);
  border: 2px solid var(--latao); border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 14px rgba(60, 10, 20, .45);
}
.primario:active { transform: translateY(1px); }
.primario:disabled { opacity: .6; cursor: progress; }

/* ---------- espera ---------- */
.espera__disciplina { margin: 4px 0 0; font-family: var(--fonte-titulo); font-size: 2.1rem; color: var(--vela-clara); text-shadow: 0 0 14px rgba(255, 190, 92, .5); }
.espera__professor { margin: 0 0 6px; font-family: var(--fonte-titulo); font-size: 1.25rem; color: var(--vela); }

/* ---------- questão ---------- */
.questao-topo { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.questao-topo__num { margin: 0; font-family: var(--fonte-titulo); font-size: 1.35rem; letter-spacing: .04em; }
.questao-topo__num b { font-weight: 400; font-size: 2.1rem; color: var(--vela-clara); }

/* barra fixa no alto: número, selo da área e o relógio continuam à vista ao rolar */
.questao-barra {
  position: sticky; top: 0; z-index: 4;
  margin: 0 calc(var(--gutter) * -1); padding: 8px var(--gutter);
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(11, 15, 43, .97), rgba(11, 15, 43, .9));
  border-bottom: 1px solid rgba(201, 154, 74, .6);
  box-shadow: 0 8px 16px rgba(0, 0, 0, .35);
}
.relogio--barra { width: 70px; height: 70px; }
.relogio--barra .relogio__valor { font-size: 1.75rem; }

.enunciado-cel { padding: 16px 18px 18px; }
.enunciado-cel__tema { margin: 0 0 6px; font-family: var(--fonte-titulo); font-size: 1.02rem; color: var(--vinho); }
.enunciado-cel__texto { margin: 0; font-size: 1.1rem; line-height: 1.45; font-weight: 600; color: var(--tinta); overflow-wrap: anywhere; }

/* alternativas: linha inteira de pergaminho, lacre com a letra à esquerda */
.linhas { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.linha {
  position: relative; display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: center; gap: 12px;
  width: 100%; min-height: 72px; margin: 0; padding: 8px 16px 8px 10px; border: 0; background: none;
  font: inherit; text-align: left; color: var(--tinta); cursor: pointer;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .5));
  transition: transform .15s ease, filter .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.linha__papel { position: absolute; inset: 0; }
.linha__papel::after { content: ""; position: absolute; inset: 5px; border: 2px solid var(--cera); border-left-width: 6px; border-radius: 3px; opacity: .8; }
.linha .selo { position: relative; width: 60px; margin: 0 0 -10px; }
.linha .selo__letra { font-size: 2.6rem; }
.linha__texto { position: relative; font-size: 1.03rem; line-height: 1.32; font-weight: 650; overflow-wrap: anywhere; }
.linha:active:not(:disabled) { transform: scale(.98); }
.linha:focus-visible { outline: none; filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 12px var(--vela)); }
.linha:disabled { cursor: default; filter: brightness(.55) saturate(.6) drop-shadow(0 4px 5px rgba(0, 0, 0, .6)); }
.linha.escolhida, .linha.escolhida:disabled { filter: drop-shadow(0 0 8px rgba(255, 200, 110, .95)) drop-shadow(0 0 22px rgba(255, 150, 40, .55)); }
.carta__carimbo {
  display: none; position: absolute; right: 10px; bottom: 6px; padding: 0 7px;
  border: 2px solid var(--vinho); border-radius: 3px; color: var(--vinho); background: rgba(255, 248, 230, .7);
  font-family: var(--fonte-titulo); font-size: .82rem; letter-spacing: .08em;
  transform: rotate(-6deg); opacity: .95;
}
.linha.escolhida .carta__carimbo { display: block; }
.opcao.escolhida .linha__texto { padding-bottom: 12px; }

/* gabarito na revelação */
.linhas--gabarito { margin-top: 14px; }
.linhas--gabarito .linha { cursor: default; }
.linhas--gabarito .linha.apagada { filter: brightness(.55) saturate(.6) drop-shadow(0 4px 5px rgba(0, 0, 0, .6)); }
.linhas--gabarito .linha.certa { filter: drop-shadow(0 0 8px rgba(255, 205, 120, .95)) drop-shadow(0 0 20px rgba(255, 160, 50, .55)); }
.linhas--gabarito .linha.certa .linha__papel::after { border-color: #b8862f; border-width: 3px; border-left-width: 6px; opacity: 1; }
.linha__marca:empty { display: none; }
.linhas--gabarito .linha:has(.linha__marca:not(:empty)) { padding-top: 24px; }
.linha__marca {
  position: absolute; top: -6px; right: 12px; padding: 1px 10px 4px;
  background: var(--vinho); color: #fff0d2; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  font-family: var(--fonte-titulo); font-size: .82rem;
}
.linha.certa .linha__marca { background: #2b7337; }
.linhas--gabarito .linha.escolhida:not(.certa) .linha__texto { text-decoration: line-through; text-decoration-color: rgba(155, 16, 38, .7); text-decoration-thickness: 2px; }

.status { margin: 0; min-height: 1.6em; text-align: center; font-weight: 700; font-size: .95rem; }
.questao-barra .status { grid-column: 1 / -1; min-height: 0; font-size: .9rem; }
.questao-barra .status:not(:empty) { padding: 6px 12px; }
.status:not(:empty) { padding: 9px 14px; border-radius: 999px; background: var(--placa); border: 1px solid rgba(201, 154, 74, .7); }
.status[data-tom="pausa"], .status[data-tom="rede"] { background: linear-gradient(180deg, #9a2440, #5e0f24); border-color: var(--latao); color: #fff3e0; }
.status[data-tom="travada"] { background: #2a1630; border-color: var(--erro); color: #ffd6d6; }
.status[data-tom="ok"] { color: var(--vela-clara); }

/* ---------- revelação ---------- */
.feitico { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow-x: clip; }
.feitico__aura {
  position: absolute; left: 50%; top: 140px; width: 480px; height: 480px; margin: -240px 0 0 -240px;
  background:
    radial-gradient(circle, rgba(255, 214, 140, .55) 0%, rgba(255, 170, 60, .22) 28%, transparent 60%),
    repeating-conic-gradient(from 8deg, rgba(255, 220, 150, .16) 0 4deg, transparent 4deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 64%);
          mask-image: radial-gradient(circle, #000 18%, transparent 64%);
  animation: girar 40s linear infinite; pointer-events: none;
}
.feitico > :not(.feitico__aura):not(.faisca):not(.brasa) { position: relative; }
.feitico__titulo {
  margin: 0; font-family: var(--fonte-magia); font-weight: 400; font-size: 3.9rem; line-height: 1.15;
  color: var(--vela-clara);
  text-shadow: 0 0 6px rgba(255, 200, 110, .9), 0 0 26px rgba(255, 150, 40, .7), 0 3px 0 #3a1408;
}
.feitico__titulo--menor { font-size: 3.3rem; text-align: center; }
.selo-grande { position: relative; width: 168px; height: 168px; margin-top: -4px; --cera: #8f1830; }
.selo-grande svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.selo-grande__cera { filter: drop-shadow(0 0 18px rgba(255, 170, 70, .7)) drop-shadow(0 8px 8px rgba(0, 0, 0, .5)); animation: carimbar .45s cubic-bezier(.3, 1.4, .5, 1) both; }
.selo-grande__mancha { display: none; }
.selo-grande__texto { position: absolute; inset: 0; margin: 0; display: grid; place-content: center; color: #fff0d2; }
.selo-grande__pontos { font-family: var(--fonte-titulo); font-size: 3rem; line-height: 1; text-shadow: 0 -1px 0 rgba(0, 0, 0, .55), 0 2px 0 rgba(255, 255, 255, .15); }
.selo-grande__rotulo { font-size: .72rem; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; margin-top: 4px; opacity: .85; }

.faisca { position: absolute; width: 18px; height: 18px; fill: var(--vela-clara); filter: drop-shadow(0 0 4px var(--vela)); animation: cintilar 2.4s ease-in-out infinite; }
.f1 { left: 8%; top: 8%; } .f2 { right: 10%; top: 12%; width: 12px; height: 12px; animation-delay: -.8s; }
.f3 { left: 14%; top: 36%; width: 13px; height: 13px; animation-delay: -1.4s; } .f4 { right: 12%; top: 40%; width: 22px; height: 22px; animation-delay: -.4s; }
.f5 { left: 30%; top: 2%; width: 10px; height: 10px; animation-delay: -1.9s; } .f6 { right: 30%; top: 26%; width: 9px; height: 9px; animation-delay: -1.1s; }
.brasa { position: absolute; bottom: 46%; width: 4px; height: 4px; border-radius: 50%; background: var(--vela-clara); box-shadow: 0 0 6px 2px rgba(255, 170, 60, .8); animation: subir 3.6s linear infinite; opacity: 0; }
.b1 { left: 22%; } .b2 { left: 38%; animation-delay: -1.2s; } .b3 { left: 61%; animation-delay: -2.3s; } .b4 { left: 77%; animation-delay: -.6s; } .b5 { left: 50%; animation-delay: -3s; }

/* sem acerto: nada de brilho; a nota vira mancha de tinta */
.feitico:not([data-resultado="acerto"]) :is(.feitico__aura, .faisca, .brasa) { display: none; }
.feitico:is([data-resultado="erro"], [data-resultado="nada"]) .feitico__titulo {
  font-family: var(--fonte-titulo); font-size: 3rem; color: #d9cfe8;
  text-shadow: 0 2px 0 #000, 0 0 18px rgba(120, 100, 180, .35);
}
.feitico[data-resultado="espera"] .feitico__titulo { font-family: var(--fonte-titulo); font-size: 2.2rem; color: var(--vela-clara); text-shadow: 0 0 14px rgba(255, 190, 92, .5); }
.feitico:is([data-resultado="erro"], [data-resultado="nada"]) .selo-grande__cera { display: none; }
.feitico:is([data-resultado="erro"], [data-resultado="nada"]) .selo-grande__mancha { display: block; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .5)); }
.feitico:is([data-resultado="erro"], [data-resultado="nada"]) .selo-grande__texto { color: #cfc6dd; }

.livro { position: relative; width: 100%; margin: 10px 0 0; padding: 18px 18px 16px; }
.livro__dados { margin: 0; display: grid; grid-template-columns: 1fr 1fr; }
.livro__dados > div + div { border-left: 1px solid rgba(90, 65, 40, .35); }
.livro dt { font-family: var(--fonte-titulo); font-size: 1rem; color: var(--tinta-2); }
.livro dd { margin: 0; font-family: var(--fonte-titulo); font-size: 2rem; line-height: 1.1; color: var(--tinta); }
.livro dd small { display: block; font-family: var(--fonte-texto); font-size: .76rem; font-weight: 600; color: var(--tinta-2); }
.rev-nota { margin: 10px 0 0; font-weight: 700; color: var(--vela-clara); }
.rev-nota:empty { display: none; }
.aguarde {
  margin: 20px 0 0; padding: 9px 20px; border-radius: 999px;
  background: var(--placa); border: 1px solid var(--latao);
  font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--vela-clara); white-space: nowrap;
}
.aguarde::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: var(--vela); vertical-align: middle; box-shadow: 0 0 8px var(--vela); animation: pulsar 1.6s ease-in-out infinite; }
#tela-revelacao:has(.feitico[data-resultado="espera"]) .aguarde { display: none; }
#tela-revelacao .aguarde { align-self: center; }

/* ---------- fim ---------- */
#tela-fim { align-items: stretch; }
.livro--fim { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin: 0; }
.livro--fim > div + div { border-left: 1px solid rgba(90, 65, 40, .35); }
.livro--fim dd { font-size: 1.9rem; }
.codigo-premio { display: flex; flex-direction: column; align-items: center; text-align: center; }
.codigo-premio__texto { margin: 6px 0 0; font-weight: 700; color: var(--vela-clara); }
.codigo-premio__selo { position: relative; width: 230px; height: 230px; --cera: #8f1830; }
.codigo-premio__selo svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 22px rgba(255, 170, 70, .75)) drop-shadow(0 8px 8px rgba(0, 0, 0, .5)); }
.codigo-premio__selo strong {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--fonte-titulo); font-weight: 400; font-size: 3rem; letter-spacing: .06em; padding-left: .06em;
  color: #fff0d2; text-shadow: 0 -1px 0 rgba(0, 0, 0, .55), 0 2px 0 rgba(255, 255, 255, .15);
}
#final-status { margin: 10px 0 0; font-weight: 700; color: var(--vinho); text-align: center; }

/* =========================================================
   TERMOS (página de leitura)
   ========================================================= */
.pagina-texto main {
  position: relative; z-index: 1;
  max-width: 46rem; margin: 24px auto; padding: 32px clamp(20px, 5vw, 48px) 36px;
  background: var(--papel); background-size: 300px 300px, cover;
  color: var(--tinta); font-size: 1.05rem; line-height: 1.6;
  clip-path: var(--rasgado);
  box-shadow: inset 0 0 30px rgba(122, 72, 20, .45);
}
.pagina-texto h1, .pagina-texto h2 { font-family: var(--fonte-titulo); font-weight: 400; color: var(--vinho); line-height: 1.15; }
.pagina-texto h1 { font-size: 2.2rem; margin: 0 0 .5em; }
.pagina-texto h2 { font-size: 1.5rem; margin: 1.2em 0 .4em; }
.pagina-texto a { color: var(--vinho); }

/* ---------- movimento ---------- */
@keyframes flutuar { 50% { translate: 0 -8px; } }
@keyframes tremular { from { transform: scale(1) rotate(-2deg); opacity: 1; } to { transform: scale(.9, 1.08) rotate(3deg); opacity: .85; } }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes cintilar { 50% { transform: scale(.55) rotate(45deg); opacity: .5; } }
@keyframes subir { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-260px); opacity: 0; } }
@keyframes pulsar { 50% { opacity: .3; } }
@keyframes carimbar { from { opacity: 0; transform: scale(1.6) rotate(-12deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .brasa { display: none; }
}

@media (max-height: 700px) {
  .selo-grande { width: 160px; height: 160px; }
  .selo-grande__pontos { font-size: 2.8rem; }
  .feitico__titulo { font-size: 3.6rem; }
}
