/* Adivinhe o Campeão: mesmas cores e fontes do site. */
:root {
  color-scheme: dark;
  --bg: #09090a;
  --panel: #121212;
  --panel-2: #181818;
  --line: #27241d;
  --line-2: #3b352a;
  --text: #f4efe4;
  --muted: #9b9383;
  --gold: #d9a82b;
  --gold-2: #f5cf5a;
  --ok: #1f9a53;
  --part: #d1a02a;
  --miss: #a3352c;
  --display: 'Bebas Neue', 'Oswald', Impact, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --col: 96px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(900px 500px at 50% -220px, rgba(217, 168, 43, 0.1), transparent 70%), var(--bg);
  color: var(--text); font: 15px/1.5 var(--sans); min-height: 100vh; display: flex; flex-direction: column;
}
button, input { font-family: var(--sans); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.adv { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 18px 16px 32px; display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* Cabeçalho */
.adv-head { width: 100%; max-width: 620px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.adv-head .right { display: flex; justify-content: flex-end; }
.adv-title { text-align: center; }
.adv-title .eyebrow { margin: 0; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase; }
.adv-title h1 { margin: 2px 0 0; font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; letter-spacing: 1px; color: var(--gold-2); }
.adv-title .sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; background: transparent; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; cursor: pointer; }
.icon-btn:hover { color: var(--gold-2); border-color: var(--gold); }
.icon-btn svg { width: 18px; height: 18px; }

/* Busca */
.guess { position: relative; width: 100%; max-width: 520px; display: flex; gap: 8px; }
.guess input {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px; font-size: 16px;
  background: #0f0e0c; color: var(--text); border: 1px solid var(--line-2); border-radius: 4px;
}
.guess input:focus { outline: none; border-color: var(--gold); }
.guess input::placeholder { color: #6f685c; }
.guess .go { height: 48px; padding: 0 20px; background: var(--gold); color: #140f02; border: 0; border-radius: 4px; font-weight: 800; font-size: 14px; letter-spacing: 0.5px; cursor: pointer; }
.guess .go:hover { background: var(--gold-2); }
.guess .go:disabled { opacity: 0.5; cursor: default; }
.suggest {
  position: absolute; z-index: 20; top: 52px; left: 0; right: 0; margin: 0; padding: 4px; list-style: none;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 4px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  max-height: 320px; overflow-y: auto;
}
.suggest[hidden] { display: none; }
.suggest li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 3px; cursor: pointer; font-weight: 700; }
.suggest li.on, .suggest li:hover { background: #26221a; }

/* Ícone do campeão (com letra de reserva se a imagem não carregar) */
.champ-ic { width: 36px; height: 36px; flex: none; border-radius: 4px; overflow: hidden; background: #22201b; display: grid; place-items: center; font-weight: 800; color: var(--muted); font-size: 14px; }
.champ-ic img { width: 100%; height: 100%; object-fit: cover; display: block; }

.info { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; font-size: 13px; color: var(--muted); }
.info b { color: var(--text); }
.hint { padding: 8px 12px; border: 1px dashed var(--line-2); border-radius: 4px; font-size: 13px; color: var(--muted); }
.hint.open { border-style: solid; border-color: var(--gold); color: var(--text); }
.hint.open b { color: var(--gold-2); font-size: 15px; }
.hint.open span { color: var(--muted); }
.hint-btn { padding: 8px 14px; background: transparent; color: var(--gold-2); border: 1px dashed var(--gold); border-radius: 4px; font-weight: 800; font-size: 13px; cursor: pointer; }
.hint-btn:hover { background: rgba(217, 168, 43, 0.1); border-style: solid; }
.win.lost { border-color: var(--miss); background: rgba(163, 53, 44, 0.1); }

/* Vitória */
.win { width: 100%; max-width: 620px; padding: 16px; border: 1px solid var(--ok); border-radius: 6px; background: rgba(31, 154, 83, 0.08); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.win .champ-ic { width: 64px; height: 64px; }
.win .w-text { flex: 1; min-width: 180px; }
.win .w-label { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.win .w-name { margin: 0; font-family: var(--display); font-size: 36px; line-height: 1.05; color: var(--gold-2); letter-spacing: 0.5px; }
.win .w-sub { margin: 0; font-size: 13px; color: #d3ccbc; }
.win .w-next { text-align: right; }
.win .w-next span { display: block; font-size: 12px; color: var(--muted); }
.win .w-next b { font-size: 22px; font-variant-numeric: tabular-nums; }
.win .w-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { background: var(--gold); color: #140f02; border: 0; border-radius: 4px; padding: 10px 16px; font-weight: 800; font-size: 14px; cursor: pointer; }
.btn:hover { background: var(--gold-2); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
.btn-ghost:hover { background: transparent; border-color: var(--gold); }

/* Tabela de tentativas (rola na horizontal no celular) */
.table-scroll { width: 100%; overflow-x: auto; padding-bottom: 6px; }
.grid { display: grid; grid-template-columns: repeat(8, var(--col)); gap: 5px; width: max-content; margin: 0 auto; }
.grid .th { font-size: 11px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); text-align: center; padding: 0 2px 6px; border-bottom: 1px solid var(--line-2); display: flex; align-items: flex-end; justify-content: center; line-height: 1.25; }
.cell {
  height: var(--col); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 4px; border-radius: 4px; text-align: center; font-size: 12.5px; font-weight: 700; line-height: 1.2;
  overflow-wrap: anywhere; position: relative; overflow: hidden;
}
.cell.name { background: #1a1815; border: 1px solid var(--line-2); gap: 4px; font-size: 12px; }
.cell.name .champ-ic { width: 52px; height: 52px; }
.cell.ok { background: var(--ok); }
.cell.part { background: var(--part); color: #140f02; }
.cell.miss { background: var(--miss); }
.cell .arrow { position: absolute; inset: 6px 24%; color: rgba(0, 0, 0, 0.32); pointer-events: none; }
.cell .arrow svg { width: 100%; height: 100%; display: block; }
.cell .arrow.down svg { transform: rotate(180deg); }
.cell .val { position: relative; }
.cell.year { font-size: 17px; }
.row-new .cell { animation: flip 0.45s ease both; animation-delay: calc(var(--i) * 140ms); }
@keyframes flip { 0% { transform: rotateY(90deg); opacity: 0; } 100% { transform: rotateY(0); opacity: 1; } }

/* Janelas */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.72); display: grid; place-items: center; padding: 16px; }
.modal { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-top: 2px solid var(--gold); border-radius: 6px; padding: 24px 22px 22px; }
.modal h2 { margin: 0 0 12px; font-family: var(--display); font-weight: 400; font-size: 32px; letter-spacing: 0.5px; color: var(--gold-2); line-height: 1; }
.modal h3 { margin: 18px 0 10px; font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.modal p { margin: 0 0 10px; color: #d3ccbc; }
.modal .close { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; padding: 4px; }
.modal .close:hover { color: var(--text); }
.legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 4px; }
.legend div { font-size: 12.5px; color: var(--muted); }
.legend b { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.legend i { width: 18px; height: 18px; border-radius: 3px; display: inline-block; }
.help-note { font-size: 13px; color: var(--muted) !important; }
.stats-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stats-nums b { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats-nums span { font-size: 12px; color: var(--muted); }
.dist { display: flex; flex-direction: column; gap: 5px; }
.dist-row { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; }
.dist-row .bar { display: block; min-width: 26px; padding: 2px 8px; text-align: right; background: #2a2722; border-radius: 0 4px 4px 0; font-style: normal; font-variant-numeric: tabular-nums; }
.dist-row .bar.now { background: var(--ok); }
.toast { position: fixed; left: 50%; top: 150px; transform: translateX(-50%); z-index: 90; background: var(--text); color: #140f02; font-weight: 800; font-size: 14px; padding: 10px 16px; border-radius: 4px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); pointer-events: none; }
.toast[hidden] { display: none; }
.loading { color: var(--muted); margin-top: 40px; }

@media (max-width: 560px) {
  :root { --col: 78px; }
  .adv { padding: 12px 10px 20px; }
  .adv-title h1 { font-size: 32px; }
  .cell { font-size: 11px; }
  .cell.name .champ-ic { width: 42px; height: 42px; }
  .cell.year { font-size: 15px; }
  .guess .go { padding: 0 14px; }
  .legend { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .row-new .cell { animation: none; } }
.w-pdr { margin: 4px 0 0; font-weight: 800; }
.w-pdr.mais { color: #7fd49a; }
.w-pdr.menos { color: #e58a80; }
.rk-vale { color: var(--gold-2, #f5cf5a); font-weight: 800; }
