/* ==========================================================================
   Gamedle BR — tema dark gamer, mobile-first, CSS puro (sem Tailwind runtime)
   Motivo: Tailwind Play CDN pesa ~300KB de JS e não é recomendado em produção;
   CSS enxuto melhora Core Web Vitals, que impacta direto o eCPM.
   ========================================================================== */

:root {
  --bg: #070a12;
  --bg-2: #0b0f1a;
  --panel: #111827;
  --panel-2: #1a2234;
  --line: #243049;
  --text: #e5e9f2;
  --muted: #8b95ab;

  --neon: #a855f7;      /* roxo neon */
  --neon-2: #22d3ee;    /* ciano */
  --neon-glow: 0 0 18px rgb(168 85 247 / .45);

  --correct: #16a34a;
  --partial: #d4a017;
  --wrong: #b4232c;
  --unknown: #334155;

  /* tokens derivados (variam por tema) */
  --text-soft: #b3bccd;
  --glow-1: rgb(168 85 247 / .18);
  --glow-2: rgb(34 211 238 / .08);
  --hover-line: #3a4766;
  --success-text: #4ade80;
  --unknown-text: #cbd5e1;
  --shadow: rgb(0 0 0 / .55);
  --backdrop: rgb(3 5 10 / .78);
  --ad-text: #3b4660;
  --ad-border: #263149;
  --ad-stripe-1: #0d1220;
  --ad-stripe-2: #0f1526;
  --noimg-from: #3b1e5e;
  --noimg-to: #0e3a4a;
  --toast-bg: #f8fafc;
  --toast-fg: #0b0f1a;
  --chip-bg: rgb(168 85 247 / .15);
  --chip-fg: #d8b4fe;
  --cell-border: rgb(255 255 255 / .08);
  --logo-from: #c084fc;
  --notice-bg: rgb(34 211 238 / .08);
  --notice-border: rgb(34 211 238 / .3);

  --radius: 12px;
  --cell-w: 108px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pixel: 'Press Start 2P', monospace;
}

/* ------------------------------------------------------------- tema claro
   <html data-theme="light"> (script inline no <head> escolhe antes do 1º paint:
   escolha salva > preferência do sistema > escuro). Cores de status iguais nos
   dois temas para o significado não mudar. */
:root[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #eef1f7;
  --line: #d6dbe7;
  --text: #121826;
  --muted: #5b6475;
  --neon: #7c3aed;
  --neon-2: #0e7490;
  --neon-glow: 0 0 14px rgb(124 58 237 / .25);
  --unknown: #cbd5e1;

  --text-soft: #3d4657;
  --glow-1: rgb(124 58 237 / .10);
  --glow-2: rgb(14 116 144 / .06);
  --hover-line: #b8c0d4;
  --success-text: #15803d;
  --unknown-text: #1e293b;
  --shadow: rgb(15 23 42 / .15);
  --backdrop: rgb(15 23 42 / .45);
  --ad-text: #94a0b8;
  --ad-border: #c9d0de;
  --ad-stripe-1: #eef1f7;
  --ad-stripe-2: #e6eaf2;
  --noimg-from: #a78bfa;
  --noimg-to: #22d3ee;
  --toast-bg: #121826;
  --toast-fg: #f8fafc;
  --chip-bg: rgb(124 58 237 / .12);
  --chip-fg: #6d28d9;
  --cell-border: rgb(15 23 42 / .08);
  --logo-from: #7c3aed;
  --notice-bg: rgb(14 116 144 / .07);
  --notice-border: rgb(14 116 144 / .3);
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 50% -10%, var(--glow-1), transparent 70%),
    radial-gradient(700px 400px at 100% 100%, var(--glow-2), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--neon-2); }
img { display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 4px; font-size: .85em; }

/* ------------------------------------------------------------------ layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: center;
  gap: 24px;
  padding: 0 16px;
}
.main { width: 100%; max-width: 860px; margin: 0 auto; min-width: 0; }
.ad-rail { display: none; }

@media (min-width: 1280px) {
  .layout { grid-template-columns: 160px minmax(0, 860px) 160px; }
  .ad-rail { display: block; }
  .ad-rail .ad-sky { position: sticky; top: 16px; }
}
@media (min-width: 1500px) {
  .layout { grid-template-columns: 300px minmax(0, 860px) 300px; }
}

/* --------------------------------------------------------------------- ads
   Espaço reservado com min-height = tamanho do criativo → zero CLS. */

.ad {
  position: relative;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ad:empty::after, .ad.placeholder::after {
  content: attr(data-size);
  color: var(--ad-text);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ad.placeholder {
  border: 1px dashed var(--ad-border);
  background: repeating-linear-gradient(45deg, var(--ad-stripe-1), var(--ad-stripe-1) 10px, var(--ad-stripe-2) 10px, var(--ad-stripe-2) 20px);
  border-radius: 8px;
}
.ad-header { width: 100%; max-width: 728px; min-height: 50px; margin: 8px auto; }
@media (min-width: 768px) { .ad-header { min-height: 90px; } }
.ad-sky { width: 160px; min-height: 600px; }
@media (min-width: 1500px) { .ad-sky { width: 300px; } }
.ad-inline { width: 300px; min-height: 250px; margin: 28px auto; }
.ad-modal { width: 300px; min-height: 250px; margin: 18px auto; }
.ad-rewarded { width: 300px; min-height: 250px; }
.ad ins { display: block; width: 100%; }

/* ------------------------------------------------------------------ header */

.top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px 0 4px;
}
.brand { display: block; text-align: center; text-decoration: none; color: inherit; }
.logo {
  display: block;
  font-family: var(--pixel);
  font-size: clamp(22px, 6vw, 38px);
  margin: 0;
  letter-spacing: .04em;
  background: linear-gradient(90deg, var(--logo-from), var(--neon-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgb(168 85 247 / .55));
}
.logo span {
  font-size: .4em;
  vertical-align: super;
  margin-left: 6px;
  color: var(--success-text);
  -webkit-text-fill-color: var(--success-text);
}
.tagline { display: block; margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.icon-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  font-weight: 700;
  font-size: 18px;
  transition: border-color .2s, box-shadow .2s;
}
.icon-btn:hover { border-color: var(--neon); box-shadow: var(--neon-glow); }
.top-group { display: flex; gap: 6px; }
.lang-btn { font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.theme-icon::before { content: '☀️'; font-size: 17px; }                 /* no escuro: ir para o claro */
:root[data-theme="light"] .theme-icon::before { content: '🌙'; }
.logo span:empty { display: none; }
.brand { min-width: 0; }
/* 4 botões + logo precisam caber em 360–420px sem rolagem lateral */
@media (max-width: 480px) {
  .top { gap: 4px; }
  .top-group { gap: 4px; }
  .icon-btn { width: 36px; height: 36px; font-size: 15px; }
  .theme-icon::before { font-size: 15px; }
  .logo { font-size: clamp(18px, 5.6vw, 26px); }
  .tagline { font-size: 12px; }
}

.meta-bar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px;
  color: var(--muted); font-size: 13px; margin: 10px 0 16px;
}
.tier-badge { padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.tier-badge.easy { background: rgb(22 163 74 / .18); color: var(--correct); }
.tier-badge.medium { background: rgb(212 160 23 / .2); color: #b7860b; }
.tier-badge.hard { background: rgb(180 35 44 / .18); color: var(--wrong); }
.meta-bar strong { color: var(--text); font-variant-numeric: tabular-nums; }
.dot { opacity: .4; }

.notice {
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ------------------------------------------------------------------- modes */

.modes {
  display: flex; gap: 6px;
  overflow-x: auto; scrollbar-width: none;
  margin: 10px -16px 0; padding: 4px 16px;
  scroll-snap-type: x proximity;
}
.modes::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .modes { justify-content: center; margin: 10px 0 0; padding: 4px 0; } }
.mode-link {
  position: relative; flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 74px; padding: 8px 10px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted); text-decoration: none;
  font-size: 11px; font-weight: 700;
  scroll-snap-align: center;
  transition: border-color .2s, color .2s;
}
.mode-link .m-icon { font-size: 20px; line-height: 1.1; }
.mode-link:hover { color: var(--text); border-color: var(--hover-line); }
.mode-link.active { color: var(--text); border-color: var(--neon); box-shadow: var(--neon-glow); }
.mode-link.done::after {
  content: '✓'; position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--correct); color: #fff; font-size: 11px;
}
.mode-link.gaveup::after {
  content: '🏳'; position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 10px;
}
.mode-title { text-align: center; font-size: 18px; margin: 0 0 14px; }

/* ------------------------------------------------------------------- stage */

.stage { max-width: 560px; margin: 0 auto 16px; }
.card {
  padding: 18px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  text-align: center;
}
.blur-frame {
  position: relative; overflow: hidden;
  aspect-ratio: 3 / 2; border-radius: var(--radius);
  border: 1px solid var(--line); background: #000;
  container-type: inline-size; /* cqw = % da largura: mesmo desfoque no celular e no desktop */
}
.blur-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: blur(calc(var(--blur, 0) * 1cqw));
  /* o blur esmaece as bordas: amplia um pouco enquanto está desfocada para não aparecer a moldura */
  transform: scale(calc(1 + var(--blur, 0) * 0.04));
  transition: filter .7s ease, transform .7s ease;
}
.blur-level { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.quote { font-size: clamp(18px, 4.5vw, 24px); font-weight: 800; line-height: 1.35; margin: 0; }
.quote::before { content: '“'; color: var(--neon); }
.quote::after { content: '”'; color: var(--neon); }
.quote-pt { color: var(--muted); font-style: italic; margin: 10px 0 0; font-size: 14px; }
.emoji-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: clamp(34px, 10vw, 48px); }
.emoji-row .e-slot {
  width: 1.3em; height: 1.3em; display: grid; place-items: center;
  border-radius: 12px; background: var(--panel-2);
}
.emoji-row .e-slot.hidden { color: var(--ad-text); font-size: .6em; font-weight: 800; }
.emoji-row .e-slot.new { animation: pop .4s ease; }
.clues { display: grid; gap: 8px; margin-top: 14px; text-align: left; }
.clue {
  display: flex; gap: 10px; align-items: baseline;
  padding: 10px 12px; border-radius: 10px;
  background: var(--panel-2); font-size: 14px;
}
.clue b { color: var(--neon-2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; flex: none; min-width: 74px; }
.clue.locked { color: var(--muted); opacity: .7; }
.clue.new { animation: slidein .35s ease; }
.stage-actions { display: flex; justify-content: center; margin-top: 12px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }

/* ------------------------------------------------------------- guess list */

.guess-list { list-style: none; padding: 0; margin: 0 auto; max-width: 560px; display: grid; gap: 6px; }
.guess-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--cell-border);
  font-weight: 700; font-size: 14px;
  animation: slidein .3s ease both;
}
.guess-item.correct { background: var(--correct); }
.guess-item.partial { background: var(--partial); }
.guess-item.wrong { background: var(--wrong); }
.guess-item img, .guess-item .noimg { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.guess-item .gi-name { flex: 1; min-width: 0; }
.guess-item .gi-note { font-size: 12px; font-weight: 600; opacity: .95; text-align: right; }

/* ------------------------------------------------------------------ search */

.search-wrap { position: relative; max-width: 560px; margin: 0 auto 18px; z-index: 20; }
.search { position: relative; }
.search input {
  width: 100%;
  height: 54px;
  padding: 0 48px 0 18px;
  font: 500 16px var(--font); /* 16px evita zoom automático no iOS */
  color: var(--text);
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search input:focus { border-color: var(--neon); box-shadow: var(--neon-glow); }
.search input::-webkit-search-cancel-button { display: none; }
.search-spinner {
  position: absolute; right: 16px; top: 50%;
  width: 20px; height: 20px; margin-top: -10px;
  border: 2px solid var(--line); border-top-color: var(--neon);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px; list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px var(--shadow);
  max-height: 360px; overflow-y: auto;
}
.suggestions li {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
}
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--panel-2); }
.suggestions img, .suggestions .noimg { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.suggestions .s-name { font-weight: 600; }
.suggestions .s-year { color: var(--muted); font-size: 12px; margin-left: auto; }
.suggestions .s-empty { color: var(--muted); cursor: default; justify-content: center; }

.noimg {
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--noimg-from), var(--noimg-to));
  font: 700 13px var(--font); color: #fff;
}

/* ------------------------------------------------------------------- hints */

.hints {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 560px;
  margin: 0 auto 10px;
}
.hint {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 12px;
  text-align: center;
  transition: border-color .2s, transform .15s;
}
.hint .h-icon { font-size: 20px; }
.hint .h-label { font-weight: 700; }
.hint .h-sub { color: var(--muted); font-size: 11px; }
.hint.ready { border-color: var(--neon); box-shadow: var(--neon-glow); animation: pulse 1.6s ease-in-out infinite; }
.hint.active { border-color: var(--neon-2); background: var(--panel-2); }
.hint:not(.locked):hover { transform: translateY(-2px); }
.hint.locked { opacity: .75; }
.hint .h-ad {
  margin-top: 4px; padding: 3px 8px; border-radius: 999px;
  background: var(--chip-bg); color: var(--chip-fg); font-size: 10px; font-weight: 600;
  border: 0;
}
@keyframes pulse { 50% { box-shadow: 0 0 4px rgb(168 85 247 / .2); } }

.hint-content {
  max-width: 560px; margin: 0 auto 18px;
  padding: 14px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  text-align: center;
}
.hint-content .hint-img-wrap img {
  width: 100%; max-width: 480px; aspect-ratio: 3 / 2; object-fit: cover;
  margin: 0 auto; border-radius: 10px;
  filter: blur(8px) saturate(1.15); /* dica 1: era 14 px, o dono pediu menos (2026-10-20) */
  transform: scale(1.03); /* esconde a borda clara que o blur gera */
}
.hint-content .hint-img-wrap.blur-low img { filter: blur(5px) saturate(1.1); transform: scale(1.02); } /* dica 2 sem personagem */
.hint-img-wrap { overflow: hidden; border-radius: 10px; max-width: 480px; margin: 0 auto; }
.hint-rating { display: flex; justify-content: center; gap: 28px; }
.stage-clues { margin-top: 10px; }
.char-photo { text-align: center; }
.char-photo img { width: 150px; height: 190px; object-fit: cover; object-position: top; border-radius: 10px; display: block; margin: 0 auto 6px; transition: filter .6s; }
.char-photo img.blurred { filter: blur(7px) saturate(1.1); }
.char-photo p { margin: 0; font-size: 12px; color: var(--muted); }
.hint-character { text-align: center; }
.hint-character img, .hint-character .noimg { width: 120px; height: 150px; object-fit: cover; object-position: top; border-radius: 10px; margin: 0 auto 6px; display: block; }
.hint-character p { margin: 0; font-weight: 700; }
.hint-rating b { display: block; font-size: 30px; font-family: var(--pixel); color: var(--success-text); }
.hint-rating span { color: var(--muted); font-size: 12px; }
.hint-quote { font-style: italic; margin: 0; }

/* ------------------------------------------------------------------- board */

.board-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding-bottom: 6px;
}
.board { --cols: 5; min-width: calc(150px + (var(--cell-w) + 6px) * var(--cols)); }
.row {
  display: grid;
  grid-template-columns: 150px repeat(var(--cols), minmax(var(--cell-w), 1fr));
  gap: 6px;
  margin-bottom: 6px;
}
.cell.dense { font-size: 10.5px; line-height: 1.2; }
.cell .c-sub { display: block; margin-top: 3px; font-size: 10px; font-weight: 600; opacity: .85; }
.row.head .cell {
  min-height: 0; padding: 6px 4px;
  background: none; border: 0;
  border-bottom: 2px solid var(--line);
  color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  border-radius: 0;
}
.cell {
  min-height: 72px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px;
  border-radius: 10px;
  font-size: 12px; font-weight: 600; line-height: 1.25;
  text-align: center;
  word-break: break-word;
  border: 1px solid var(--cell-border);
  text-shadow: 0 1px 2px rgb(0 0 0 / .45);
}
.cell.correct { background: var(--correct); }
.cell.partial { background: var(--partial); }
.cell.wrong   { background: var(--wrong); }
.cell.unknown { background: var(--unknown); color: var(--unknown-text); text-shadow: none; }
.cell .arrow { font-size: 18px; line-height: 1; margin-top: 2px; }
.cell .year { font-size: 16px; font-weight: 800; }

/* Coluna do jogo fixa durante o scroll horizontal no mobile */
.cell-game {
  position: sticky; left: 0; z-index: 2;
  flex-direction: row; justify-content: flex-start; gap: 8px;
  background: var(--panel); text-align: left;
  box-shadow: 6px 0 10px -6px var(--shadow);
}
.row.head .cell-game { background: var(--bg); justify-content: flex-start; }
.cell-game img, .cell-game .noimg { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; flex: none; }
.cell-game .g-name { font-size: 12px; font-weight: 700; text-shadow: none; }
.row.win .cell-game { outline: 2px solid var(--correct); }

/* Animação de virar carta ao revelar cada célula */
.row.reveal .cell:not(.cell-game) {
  animation: flip .5s ease both;
  animation-delay: calc(var(--i) * 140ms);
}
@keyframes flip {
  0% { transform: rotateX(90deg); opacity: 0; }
  100% { transform: rotateX(0); opacity: 1; }
}
.row.reveal .cell-game { animation: slidein .3s ease both; }
@keyframes slidein { from { transform: translateX(-12px); opacity: 0; } }

.empty { color: var(--muted); text-align: center; font-size: 14px; margin: 18px 0; }

.legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px;
  margin-top: 14px; color: var(--muted); font-size: 12px;
}
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.correct { background: var(--correct); }
.sw.partial { background: var(--partial); }
.sw.wrong { background: var(--wrong); }

/* --------------------------------------------------------------- win banner */

.win-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  max-width: 560px; margin: 0 auto 18px; padding: 14px;
  background: linear-gradient(135deg, rgb(22 163 74 / .22), rgb(34 211 238 / .1));
  border: 1px solid rgb(74 222 128 / .45);
  border-radius: var(--radius);
}
.win-banner.gaveup {
  background: linear-gradient(135deg, rgb(148 163 184 / .18), rgb(99 102 241 / .08));
  border-color: var(--line);
}
.win-banner.gaveup .win-game { color: var(--text); }
.giveup-wrap { text-align: center; margin-top: 10px; }
.btn-giveup { font-size: 12px; color: var(--muted); }
.btn-giveup.armed { color: #fff; background: var(--wrong, #b91c1c); border-color: transparent; }
.win-media img, .win-media .noimg { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; }
.win-media:empty { display: none; }
.win-actions { display: flex; flex-direction: column; gap: 6px; }
.win-actions .btn { text-decoration: none; }
.win-banner > div { flex: 1; min-width: 160px; }
.win-title { margin: 0; font-weight: 800; }
.win-game { margin: 2px 0; font-size: 18px; font-weight: 700; color: var(--success-text); }
.win-sub { margin: 0; color: var(--muted); font-size: 13px; }

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-2); font-weight: 700;
  transition: transform .1s, box-shadow .2s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  border: 0;
  background: linear-gradient(135deg, #9333ea, #6d28d9);
  box-shadow: var(--neon-glow);
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; }

/* ------------------------------------------------------------------- modal */

.modal {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 24px 20px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 80px var(--shadow), var(--neon-glow);
  overflow-y: auto;
}
.modal::backdrop { background: var(--backdrop); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .25s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-close {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--panel); color: var(--muted);
}
.modal-title { font-family: var(--pixel); font-size: 15px; text-align: center; margin: 4px 0 16px; line-height: 1.6; padding: 0 34px; } /* espaço p/ o ✕ */
.result-reveal { text-align: center; margin-bottom: 14px; }
.result-reveal img { width: 100%; height: auto; max-width: 320px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; margin: 0 auto 8px; }
.result-reveal .noimg { width: 100%; max-width: 320px; aspect-ratio: 3/2; margin: 0 auto 8px; border-radius: 12px; font-size: 22px; }
.result-reveal p { margin: 0; font-weight: 800; font-size: 18px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.stats b { display: block; font-size: 24px; font-weight: 800; }
.stats span { font-size: 11px; color: var(--muted); line-height: 1.2; display: block; }
.dist-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 8px; text-align: center; }
.dist { display: grid; gap: 4px; }
.dist-row { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 6px; font-size: 12px; }
.dist-bar {
  min-width: 26px; padding: 2px 8px; text-align: right; font-weight: 700;
  background: var(--panel-2); border-radius: 4px;
}
.dist-bar.current { background: var(--correct); }
.modal-actions { text-align: center; }
.btn-share { width: 100%; font-size: 16px; min-height: 52px; }
.btn-next { width: 100%; margin-top: 8px; text-decoration: none; }
.result-reveal .r-sub { color: var(--muted); font-weight: 500; font-size: 13px; margin-top: 4px; }
.result-reveal .r-detail { font-size: 14px; font-weight: 600; margin-top: 8px; color: var(--text-soft); }
.today { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 18px; }
.today a {
  padding: 8px 4px; border-radius: 10px; text-align: center; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700;
}
.today a.done { border-color: var(--correct); color: var(--text); }
.today a span { display: block; font-size: 18px; }
.next { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.next strong { color: var(--text); font-variant-numeric: tabular-nums; }

.help-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.help-list li { display: flex; gap: 10px; align-items: flex-start; }
.help-list .sw { margin-top: 5px; flex: none; }

/* ---------------------------------------------------------- rewarded overlay */

.rewarded {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: rgb(3 5 10 / .9);
}
.rewarded-box { text-align: center; padding: 16px; }
.rewarded-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* ----------------------------------------------------------------- consent */

.consent {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 90;
  max-width: 640px; margin: 0 auto;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 40px var(--shadow);
  font-size: 13px;
}
.consent p { margin: 0 0 10px; }
.consent-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* -------------------------------------------------------------- toast & fx */

.toast {
  position: fixed; left: 50%; top: 18px; z-index: 120;
  transform: translate(-50%, -150%);
  padding: 10px 18px; border-radius: 999px;
  background: var(--toast-bg); color: var(--toast-fg); font-weight: 700; font-size: 14px;
  transition: transform .3s ease;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 200; }

/* --------------------------------------------------------------- seo & foot */

.seo { margin: 36px auto 0; max-width: 680px; color: var(--text-soft); font-size: 14px; }
.seo h2 { font-size: 16px; color: var(--text); margin: 24px 0 6px; }
.seo details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.seo summary { cursor: pointer; font-weight: 600; color: var(--text); }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 28px 16px 40px; }
.footer nav { display: flex; gap: 16px; justify-content: center; margin-bottom: 8px; }
.footer a { color: var(--muted); }

/* páginas estáticas (sobre / privacidade) */
.page { max-width: 720px; margin: 0 auto; padding: 24px 16px 60px; }
.page h1 { font-family: var(--pixel); font-size: 18px; line-height: 1.6; }
.page h2 { font-size: 17px; margin-top: 28px; }
.page p, .page li { color: var(--text-soft); }

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

/* fotos de personagem (retrato quadrado 160px, public/img/characters) */
.cell-game img, .suggestions img, .guess-item img { background: var(--panel-2); }
.result-reveal img.portrait { width: 160px; max-width: 160px; aspect-ratio: 1; object-fit: cover; border-radius: 16px; }
.win-media img.portrait { width: 80px; height: 80px; object-fit: cover; }

/* modo de teste */
.test-reset-wrap { display: flex; justify-content: center; margin: -6px 0 12px; }
.test-reset-wrap .btn { border-style: dashed; }
