/* ---------------------------------------------------------------
   Pesquisa: o próximo jogo de cartas
   Paleta: mesa de carteado à meia-luz. Berinjela funda, papel-carta,
   um vermelho de risco, um dourado de naipe, um jade de "cabe aqui".
   --------------------------------------------------------------- */

:root {
  --felt:      #1B1420;
  --felt-2:    #241A2C;
  --felt-3:    #2E2138;
  --ivory:     #F4EDE0;
  --ink:       #14101A;
  --hot:       #FF3D6E;
  --gold:      #E8B44C;
  --jade:      #48C79E;
  --mute:      #9A8CA6;
  --line:      rgba(244, 237, 224, 0.14);

  --display: "Bungee", "Impact", system-ui, sans-serif;
  --body:    "Karla", "Segoe UI", system-ui, sans-serif;
  --mono:    "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --pad: clamp(1rem, 4vw, 3rem);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--felt);
  color: var(--ivory);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Luz de abajur sobre a mesa */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(232, 180, 76, 0.10), transparent 60%),
    radial-gradient(90% 60% at 50% 110%, rgba(255, 61, 110, 0.06), transparent 60%);
}

main, header, footer { position: relative; z-index: 1; }

a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ivory); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; letter-spacing: -0.01em; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 0.9rem;
}

/* =============================== HERO =============================== */

.hero { padding: clamp(3rem, 9vw, 6rem) 0 1rem; text-align: center; }

.hero h1 {
  font-size: clamp(2.4rem, 9vw, 5.6rem);
  margin: 0 0 1.2rem;
  color: var(--ivory);
  text-shadow: 0 0 60px rgba(232, 180, 76, 0.18);
}
.hero h1 em { font-style: normal; color: var(--hot); }

.hero .lede {
  max-width: 60ch;
  margin: 0 auto;
  color: #D6CBE0;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
}
.hero .lede strong { color: var(--ivory); font-weight: 700; }

/* O leque de cartas viradas — a assinatura da página, e a navegação */
.fan {
  --n: 12;
  list-style: none;
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding: 0 0 4rem;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 300px;
  perspective: 1400px;
}

.fan li {
  --i: 0;
  --rot: calc((var(--i) - (var(--n) - 1) / 2) * 5.2deg);
  --lift: calc(pow(calc(var(--i) - (var(--n) - 1) / 2), 2) * 1.1px);
  margin-inline: -22px;
  transform-origin: 50% 130%;
  transform: rotate(var(--rot)) translateY(var(--lift));
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  animation: deal 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) backwards;
  animation-delay: calc(var(--i) * 55ms + 150ms);
}
@keyframes deal {
  from { transform: translateY(90px) rotate(0deg) scale(0.8); opacity: 0; }
}
.fan li:hover, .fan li:focus-within {
  transform: rotate(var(--rot)) translateY(calc(var(--lift) - 34px)) scale(1.06);
  z-index: 5;
}

.fan a {
  display: block;
  width: 108px;
  height: 156px;
  border-radius: 9px;
  text-decoration: none;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.3, 0.8, 0.3, 1.1);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
}
.fan li:hover a, .fan li:focus-within a { transform: rotateY(180deg); }

.fan .face {
  position: absolute;
  inset: 0;
  border-radius: 9px;
  backface-visibility: hidden;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.5);
}

/* Verso: guilhoché desenhado no CSS */
.fan .back {
  background:
    repeating-linear-gradient(45deg,  rgba(244,237,224,0.09) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-45deg, rgba(244,237,224,0.09) 0 2px, transparent 2px 7px),
    radial-gradient(circle at 50% 50%, var(--hot) 0 14%, transparent 14.5%),
    linear-gradient(160deg, #3B2247, #241732);
  display: grid;
  place-items: center;
}
.fan .back span {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: rgba(244, 237, 224, 0.5);
  background: var(--felt);
  border: 1px solid rgba(244, 237, 224, 0.2);
  border-radius: 999px;
  padding: 2px 8px;
}

/* Frente: a arte real do jogo */
.fan .front {
  transform: rotateY(180deg);
  background: var(--ivory);
}
.fan .front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fan .front b {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  font-family: var(--display);
  font-size: 0.58rem;
  line-height: 1.25;
  color: var(--ivory);
  padding: 14px 6px 6px;
  background: linear-gradient(transparent, rgba(10, 6, 14, 0.94) 55%);
  text-align: center;
}

@media (max-width: 780px) {
  .fan { flex-wrap: wrap; perspective: none; min-height: 0; gap: 8px; }
  .fan li { --rot: 0deg; --lift: 0px; margin-inline: 0; transform: none; animation: none; }
  .fan li:hover, .fan li:focus-within { transform: none; }
  .fan a { width: 84px; height: 120px; }
  .fan li:hover a, .fan li:focus-within a { transform: none; }
  .fan .back { display: none; }
  .fan .front { transform: none; }
}

/* ============================ VEREDITO ============================ */

.verdict {
  margin: clamp(2rem, 6vw, 4rem) 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 4px;
  background: linear-gradient(100deg, rgba(232, 180, 76, 0.08), transparent 60%);
  padding: clamp(1.4rem, 4vw, 2.2rem);
}
.verdict h2 { font-size: 1.1rem; margin: 0 0 0.8rem; color: var(--gold); }
.verdict p { margin: 0 0 0.9rem; max-width: 78ch; }
.verdict p:last-child { margin-bottom: 0; }
.verdict strong { color: var(--ivory); }

/* ============================= TABELA ============================= */

.section-head { margin: clamp(3.5rem, 9vw, 6rem) 0 1.6rem; }
.section-head h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0 0 0.5rem; }
.section-head p { color: var(--mute); margin: 0; max-width: 72ch; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }

table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 0.9rem; }
thead th {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  text-align: left;
  font-weight: 400;
  padding: 0.9rem 1rem;
  background: var(--felt-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 0.85rem 1rem; border-bottom: 1px solid rgba(244, 237, 224, 0.06); vertical-align: middle; }
tbody tr:hover { background: rgba(244, 237, 224, 0.035); }
tbody tr.is-ref { background: rgba(255, 61, 110, 0.05); }
tbody tr.is-ref td { color: var(--mute); }
tbody tr.is-ref a { color: var(--mute); }
td.name a { font-family: var(--display); font-size: 0.78rem; color: var(--ivory); text-decoration: none; }
td.name a:hover { color: var(--gold); }
td .num { font-family: var(--mono); font-size: 0.85rem; color: #CBBFD6; }

.pips { display: inline-flex; gap: 3px; }
.pip { width: 8px; height: 8px; border-radius: 2px; background: rgba(244, 237, 224, 0.16); transform: rotate(45deg); }
.pip.on { background: var(--jade); }
.pip.on.warn { background: var(--gold); }
.pip.on.bad { background: var(--hot); }

/* ============================== JOGOS ============================== */

.game {
  border-top: 1px solid var(--line);
  padding: clamp(2.5rem, 7vw, 4.5rem) 0;
  scroll-margin-top: 1rem;
}

.game-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.rank {
  font-family: var(--display);
  font-size: 0.85rem;
  color: var(--felt);
  background: var(--gold);
  width: 30px; height: 30px;
  border-radius: 5px;
  display: grid; place-items: center;
  flex: none;
}
.game.low .rank { background: var(--mute); }
.game h3 { font-size: clamp(1.5rem, 4.5vw, 2.4rem); margin: 0; }
.game .meta { font-family: var(--mono); font-size: 0.74rem; color: var(--mute); }
.tagline { color: var(--gold); font-size: 1.02rem; margin: 0.3rem 0 1.8rem; max-width: 70ch; }

.game-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 900px) { .game-grid { grid-template-columns: 1fr; } }

/* Vitrine de imagens reais */
.shots { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.shot {
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--felt-2);
  border: 1px solid var(--line);
  position: relative;
}
.shot.wide { grid-column: 1 / -1; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 4 / 3; transition: transform 0.4s ease; }
.shot.wide img { aspect-ratio: 16 / 9; }
.shot:hover img { transform: scale(1.04); }
.shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.05em;
  color: rgba(244, 237, 224, 0.82);
  padding: 18px 8px 6px;
  background: linear-gradient(transparent, rgba(10, 6, 14, 0.9));
}

.prose h4 {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 1.8rem 0 0.6rem;
  font-weight: 400;
}
.prose h4:first-child { margin-top: 0; }
.prose p { margin: 0 0 0.8rem; }
.prose ul { margin: 0 0 0.8rem; padding-left: 1.1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose strong { color: var(--ivory); }
.prose code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--felt-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  color: var(--gold);
}

/* Encaixe na engine: o ponto da página */
.fit { border: 1px solid var(--line); border-radius: 6px; background: var(--felt-2); padding: 1.1rem 1.2rem; margin-top: 1.4rem; }
.fit dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; font-size: 0.88rem; }
.fit dt { font-family: var(--mono); font-size: 0.72rem; color: var(--jade); white-space: nowrap; padding-top: 0.15rem; }
.fit dd { margin: 0; color: #D6CBE0; }
.fit dt.warn { color: var(--hot); }

/* ============================== DEMO ============================== */

.demo { margin-top: 1.6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--felt-2); overflow: hidden; }
.demo-bar {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  padding: 0.7rem 1rem;
  background: var(--felt-3);
  border-bottom: 1px solid var(--line);
}
.demo-bar b { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ivory); font-weight: 400; }
.demo-bar .hint { font-family: var(--mono); font-size: 0.66rem; color: var(--mute); }
.demo-bar .spacer { flex: 1; }

.btn {
  font-family: var(--body);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--felt);
  background: var(--ivory);
  border: none;
  border-radius: 5px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:hover { background: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ivory); border: 1px solid var(--line); }
.btn.ghost:hover { background: rgba(244, 237, 224, 0.1); color: var(--ivory); }
.btn.danger { background: var(--hot); color: var(--ivory); }
.btn.danger:hover { background: #ff6b8c; }

.demo-body { padding: 1rem; display: grid; gap: 1rem; }
.demo-seats { display: grid; gap: 0.5rem; }
.seat {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.2);
}
.seat.active { border-color: var(--gold); background: rgba(232, 180, 76, 0.08); }
.seat.out { opacity: 0.4; }
.seat .who { font-weight: 700; min-width: 78px; }
.seat .who.me { color: var(--gold); }
.seat .tag { font-family: var(--mono); font-size: 0.68rem; color: var(--mute); }

.minicards { display: flex; gap: 4px; flex-wrap: wrap; }
.mini {
  font-family: var(--mono);
  font-size: 0.66rem;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--felt-3);
  color: #CBBFD6;
  white-space: nowrap;
}
.mini.hidden { color: transparent; background: repeating-linear-gradient(45deg, #3B2247 0 3px, #2A1836 3px 6px); width: 26px; }
.mini.dead { text-decoration: line-through; color: var(--hot); border-color: rgba(255, 61, 110, 0.4); }
.mini.pick { cursor: pointer; background: var(--ivory); color: var(--ink); border-color: var(--ivory); font-weight: 700; }
.mini.pick:hover { background: var(--gold); }

.demo-ask { border: 1px dashed var(--line); border-radius: 6px; padding: 0.8rem; background: rgba(232, 180, 76, 0.05); }
.demo-ask p { margin: 0 0 0.6rem; font-size: 0.9rem; }
.demo-ask .opts { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.demo-log {
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.7;
  max-height: 190px;
  overflow-y: auto;
  padding: 0.7rem 0.8rem;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--line);
}
.demo-log div { color: #B5A8C2; }
.demo-log div::before { content: "› "; color: var(--mute); }
.demo-log .hot { color: var(--hot); }
.demo-log .gold { color: var(--gold); }
.demo-log .jade { color: var(--jade); }

/* ============================= RODAPÉ ============================= */

.note {
  margin: clamp(3rem, 8vw, 5rem) 0 0;
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
  font-size: 0.85rem;
  color: var(--mute);
}
.note h4 { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ivory); margin: 0 0 0.6rem; font-weight: 400; }
.note p { margin: 0 0 0.7rem; max-width: 82ch; }

footer { padding: 2.5rem 0 4rem; font-family: var(--mono); font-size: 0.68rem; color: var(--mute); }
