/* ═══════════════════════════════════════════════════════════════
   TERMO LAND — Design System
   Mobile-first · Vanilla CSS · Single source of truth
   ═══════════════════════════════════════════════════════════════ */

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, button, textarea, select { font: inherit; }

/* ── TOKENS ──────────────────────────────────────────────────── */
:root {
  /* Fundos */
  --bg:    #06060f;
  --bg2:   #0b0b18;
  --bg3:   #101021;
  --bg4:   #16162a;
  --bg5:   #1d1d35;

  /* Bordas */
  --border:   rgba(255,255,255,.07);
  --border-2: rgba(255,255,255,.12);
  --border-3: rgba(255,255,255,.22);

  /* Texto */
  --text:     #eeeeff;
  --text-dim: #9898c0;
  --muted:    #58587a;

  /* Cores do jogo */
  --correct:    #27c96b;
  --correct-bg: rgba(39,201,107,.12);
  --present:    #f0b429;
  --present-bg: rgba(240,180,41,.12);
  --absent-bg:  rgba(255,255,255,.04);
  --absent-fg:  #404060;

  /* Accent */
  --accent:     #00d4ff;
  --accent-dim: rgba(0,212,255,.13);
  --danger:     #ff4e6a;
  --danger-bg:  rgba(255,78,106,.12);

  /* Categorias (cards na index) */
  --chip-blue:    var(--accent);
  --chip-green:   var(--correct);
  --chip-red:     var(--danger);
  --chip-yellow:  var(--present);

  /* Forma */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Sombras / glows */
  --shadow-sm:    0 2px 8px rgba(0,0,0,.4);
  --shadow-md:    0 4px 24px rgba(0,0,0,.5);
  --shadow-lg:    0 12px 48px rgba(0,0,0,.6);
  --glow-accent:  0 0 24px rgba(0,212,255,.2);
  --glow-correct: 0 0 20px rgba(39,201,107,.25);

  /* Fontes */
  --f-display: "Barlow Condensed", system-ui, sans-serif;
  --f-body:    "Barlow", system-ui, sans-serif;
  --f-mono:    "Azeret Mono", ui-monospace, monospace;

  /* Layout */
  --tile-size: 58px;
  --tile-font: 22px;
  --gap-tile:  6px;
  --key-h:     52px;
  --header-h:  56px;
}

@media (max-width: 380px) {
  :root { --tile-size: 46px; --tile-font: 17px; --gap-tile: 5px; --key-h: 46px; }
}
@media (min-width: 381px) and (max-width: 520px) {
  :root { --tile-size: 52px; --tile-font: 20px; }
}
@media (min-width: 680px) {
  :root { --tile-size: 60px; --tile-font: 24px; --header-h: 64px; }
}

/* ── BASE ────────────────────────────────────────────────────── */
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Atmospheric backdrop on every page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 12% 0%,  rgba(0,212,255,.10), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 12%, rgba(240,180,41,.06), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(39,201,107,.06), transparent 60%);
}

body > * { position: relative; z-index: 1; }

::selection { background: var(--accent); color: var(--bg); }

/* ── HEADER ──────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: rgba(6,6,15,.72);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 680px) { .site-header { padding: 0 24px; } }

.header-left  { display: flex; justify-content: flex-start; gap: 8px; }
.header-right { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }

.header-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 24px;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.header-title span { color: var(--accent); }
@media (min-width: 680px) { .header-title { font-size: 28px; } }

.brand-logo {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .02em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: baseline;
}
.brand-logo .brand-land { color: var(--text-dim); margin-left: 6px; font-weight: 800; }
.brand-logo .brand-dot  { color: var(--accent); }

.header-info {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 6px 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}
.header-info:empty { display: none; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .02em;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: transform .12s ease, background .15s, border-color .15s, color .15s;
  text-transform: uppercase;
  touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: var(--glow-accent);
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-secondary {
  background: var(--bg2);
  color: var(--text);
  border-color: var(--border-2);
}
.btn-secondary:hover { background: var(--bg3); border-color: var(--border-3); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border-2);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-3); }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 18px;
  background: var(--bg2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--f-mono);
  font-weight: 700;
}
.btn-icon:hover { background: var(--bg3); border-color: var(--border-3); }

/* ── MAIN LAYOUT ─────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px 24px;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────────────
   INDEX — Landing
   ───────────────────────────────────────────────────────────── */

.hero {
  width: 100%;
  max-width: 980px;
  padding: 36px 8px 28px;
  text-align: center;
  position: relative;
}
@media (min-width: 680px) { .hero { padding: 72px 16px 48px; } }

.hero-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 18px;
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,255,.25);
  border-radius: 999px;
}

.hero-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(52px, 12vw, 88px);
  line-height: .92;
  letter-spacing: -.01em;
  text-transform: uppercase;
  margin: 0 0 8px;
  animation: hero-float 4s ease-in-out infinite;
}
.hero-title .word-land {
  display: inline-block;
  font-weight: 800;
  color: var(--text-dim);
}
.hero-title .dot { color: var(--accent); }

.hero-sub {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-dim);
  max-width: 520px;
  margin: 14px auto 22px;
  line-height: 1.5;
  text-wrap: pretty;
}
@media (min-width: 680px) { .hero-sub { font-size: 18px; } }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  background: var(--bg2);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  color: var(--text-dim);
}
.hero-badge .dot-green {
  width: 8px; height: 8px;
  background: var(--correct);
  border-radius: 50%;
  box-shadow: var(--glow-correct);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Decorative example tiles behind the hero */
.hero-demo {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 28px auto 0;
  pointer-events: none;
}
.hero-demo .demo-tile {
  width: 52px; height: 52px;
  border-radius: var(--r-sm);
  border: 2px solid var(--border-2);
  background: var(--bg3);
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  animation: demo-reveal 6s ease-in-out infinite;
}
.hero-demo .demo-tile:nth-child(1) { animation-delay: .0s; }
.hero-demo .demo-tile:nth-child(2) { animation-delay: .35s; }
.hero-demo .demo-tile:nth-child(3) { animation-delay: .70s; }
.hero-demo .demo-tile:nth-child(4) { animation-delay: 1.05s; }
.hero-demo .demo-tile:nth-child(5) { animation-delay: 1.40s; }
@media (max-width: 380px) {
  .hero-demo .demo-tile { width: 42px; height: 42px; font-size: 18px; }
}

@keyframes demo-reveal {
  0%, 8%   { background: var(--bg3); border-color: var(--border-2); color: transparent; transform: rotateX(0); }
  18%      { transform: rotateX(-90deg); }
  20%, 65% { background: var(--demo-color, var(--correct)); border-color: var(--demo-color, var(--correct)); color: var(--demo-fg, #03200e); transform: rotateX(0); }
  78%, 100%{ background: var(--bg3); border-color: var(--border-2); color: transparent; transform: rotateX(0); }
}
.hero-demo .demo-tile:nth-child(1) { --demo-color: var(--correct); --demo-fg: #03200e; }
.hero-demo .demo-tile:nth-child(2) { --demo-color: var(--present); --demo-fg: #2d1a00; }
.hero-demo .demo-tile:nth-child(3) { --demo-color: var(--correct); --demo-fg: #03200e; }
.hero-demo .demo-tile:nth-child(4) { --demo-color: #2a2a48; --demo-fg: var(--absent-fg); }
.hero-demo .demo-tile:nth-child(5) { --demo-color: var(--correct); --demo-fg: #03200e; }

/* Modes grid */
.modes-section {
  width: 100%;
  max-width: 980px;
  padding: 0 8px 48px;
}
.modes-heading {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 16px;
  text-align: center;
}

.modes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 560px) {
  .modes-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
}

.mode-card {
  display: block;
  position: relative;
  padding: 22px 22px 60px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: card-appear .55s ease-out forwards;
  transition: transform .25s ease, border-color .25s, background .25s;
  min-height: 180px;
}
.mode-card:nth-child(1) { animation-delay: .05s; }
.mode-card:nth-child(2) { animation-delay: .10s; }
.mode-card:nth-child(3) { animation-delay: .15s; }
.mode-card:nth-child(4) { animation-delay: .20s; }

.mode-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px transparent, 0 0 60px -10px var(--mode-color, var(--accent));
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--mode-color, var(--border-2));
  background: linear-gradient(180deg, var(--bg2), rgba(11,11,24,.6));
}
.mode-card:hover::after { opacity: .35; }
.mode-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.mode-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 16px;
  display: inline-flex;
  width: 56px; height: 56px;
  align-items: center; justify-content: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.mode-name {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 30px;
  letter-spacing: .01em;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: var(--text);
}
.mode-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.45;
  max-width: 28ch;
  text-wrap: pretty;
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  bottom: 22px;
  left: 22px;
  padding: 5px 10px;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: color-mix(in oklab, var(--mode-color) 14%, transparent);
  color: var(--mode-color);
  border: 1px solid color-mix(in oklab, var(--mode-color) 28%, transparent);
  border-radius: 999px;
}
.mode-arrow {
  position: absolute;
  bottom: 22px;
  right: 22px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3);
  border: 1px solid var(--border-2);
  border-radius: 50%;
  font-size: 16px;
  color: var(--text-dim);
  transition: transform .25s, background .25s, color .25s, border-color .25s;
}
.mode-card:hover .mode-arrow {
  transform: translate(2px, -2px) rotate(-8deg);
  background: var(--mode-color);
  color: var(--bg);
  border-color: var(--mode-color);
}

/* ─────────────────────────────────────────────────────────────
   GAME PAGE — Boards, tiles, keyboard
   ───────────────────────────────────────────────────────────── */

.game-toolbar {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 8px 0 18px;
}

/* Pill tabs (Dueto/Quarteto, Tema selector) */
.tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg2);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  touch-action: manipulation;
  transition: all .15s;
}
.tab-pill:hover { color: var(--text); border-color: var(--border-3); }
.tab-pill.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}
.tab-pill .tab-emoji { font-size: 14px; }

/* Tile grid */
.grid {
  display: grid;
  grid-template-rows: repeat(var(--rows, 6), var(--tile-size));
  gap: var(--gap-tile);
  margin: 0 auto;
}
.grid-row {
  display: grid;
  grid-template-columns: repeat(5, var(--tile-size));
  gap: var(--gap-tile);
}

.tile {
  width: var(--tile-size);
  height: var(--tile-size);
  border: 2px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--bg3);
  font-family: var(--f-mono);
  font-size: var(--tile-font);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  color: var(--text);
  user-select: none;
  transition: transform .24s ease-in-out, border-color .12s;
  perspective: 600px;
  will-change: transform;
}
.tile.filled { border-color: var(--border-3); animation: tile-pop .12s ease-out; }
.tile.correct {
  background: var(--correct);
  color: #03200e;
  border-color: var(--correct);
}
.tile.present {
  background: var(--present);
  color: #2d1a00;
  border-color: var(--present);
}
.tile.absent {
  background: var(--bg4);
  color: var(--absent-fg);
  border-color: transparent;
}
.tile.tile-hidden { color: transparent !important; }

.shake { animation: row-shake .45s ease-in-out; }

/* Single board page */
.board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

/* Multi-board (Dueto / Quarteto) */
.multi-boards {
  display: flex;
  gap: 18px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}
.multi-boards.is-quarteto {
  flex-wrap: wrap;
  max-width: 100%;
}
.board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.board-label {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--muted);
  text-transform: uppercase;
}
.board-inner {
  position: relative;
  padding: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.board-inner.solved { border-color: var(--correct); box-shadow: var(--glow-correct); }
.board-inner.solved .tile:not(.correct):not(.present):not(.absent) { opacity: .35; }

.board-solved-overlay {
  position: absolute;
  inset: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(39,201,107,.16);
  border-radius: var(--r-sm);
  font-size: 56px;
  font-weight: 900;
  color: var(--correct);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
  text-shadow: 0 0 20px rgba(39,201,107,.6);
}
.board-inner.solved .board-solved-overlay { opacity: 1; animation: tile-pop .35s ease-out; }

/* Compact dueto/quarteto tiles when many boards */
.multi-boards.is-dueto  { --tile-size: 46px; --tile-font: 18px; --gap-tile: 5px; }
.multi-boards.is-quarteto { --tile-size: 34px; --tile-font: 14px; --gap-tile: 4px; }
@media (min-width: 560px) {
  .multi-boards.is-dueto  { --tile-size: 52px; --tile-font: 20px; }
  .multi-boards.is-quarteto { --tile-size: 38px; --tile-font: 15px; }
}
@media (min-width: 820px) {
  .multi-boards.is-quarteto { --tile-size: 46px; --tile-font: 18px; --gap-tile: 5px; }
}

/* Attempts HUD */
.att-hud {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.att-hud span { color: var(--text); }

/* ─────────────────────────────────────────────────────────────
   KEYBOARD
   ───────────────────────────────────────────────────────────── */
.keyboard {
  position: sticky;
  bottom: 0;
  width: 100%;
  max-width: 540px;
  margin: 18px auto 0;
  padding: 10px 6px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(180deg, transparent, var(--bg) 30%);
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.key {
  flex: 1 1 0;
  min-width: 0;
  height: var(--key-h);
  padding: 0 6px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 15px;
  background: var(--bg4);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  text-transform: uppercase;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s, transform .08s, color .12s, border-color .12s;
}
.key:hover { background: var(--bg5); }
.key:active { transform: scale(.92); background: var(--bg5); }
.key.key-wide { flex: 1.6 1 0; font-size: 13px; }
.key.correct {
  background: var(--correct);
  color: #03200e;
  border-color: var(--correct);
}
.key.present {
  background: var(--present);
  color: #2d1a00;
  border-color: var(--present);
}
.key.absent {
  background: var(--bg2);
  color: var(--absent-fg);
  border-color: transparent;
}

/* ─────────────────────────────────────────────────────────────
   BLITZ-SPECIFIC HUD
   ───────────────────────────────────────────────────────────── */
.blitz-hud {
  width: 100%;
  max-width: 480px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 14px;
}
.blitz-time-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--f-display);
  font-weight: 900;
}
.blitz-time {
  font-size: 36px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 1.5em;
  text-align: left;
}
.blitz-time.warn { color: var(--danger); animation: pulse-warn 1s ease-in-out infinite; }
.blitz-time-suffix {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.blitz-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.blitz-stat-label {
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.blitz-stat-value {
  font-family: var(--f-mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.blitz-time-bar-wrap {
  grid-column: 1 / -1;
  height: 6px;
  background: var(--bg4);
  border-radius: 999px;
  overflow: hidden;
}
.blitz-time-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--correct), var(--accent));
  border-radius: 999px;
  transition: width .1s linear, background .25s;
}
.blitz-time-bar.warn {
  background: linear-gradient(90deg, var(--danger), var(--present));
  animation: pulse-warn 1s ease-in-out infinite;
}

.blitz-record {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--present);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 12px;
  background: var(--present-bg);
  border: 1px solid color-mix(in oklab, var(--present) 28%, transparent);
  border-radius: 999px;
  margin-bottom: 12px;
}

.combo-popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 56px;
  color: var(--present);
  text-shadow:
    0 0 24px rgba(240,180,41,.6),
    0 0 60px rgba(240,180,41,.3);
  pointer-events: none;
  z-index: 80;
  animation: combo-pop .75s ease-out forwards;
  letter-spacing: .02em;
}

/* ─────────────────────────────────────────────────────────────
   REVERSO HUD
   ───────────────────────────────────────────────────────────── */
.reverso-hud {
  width: 100%;
  max-width: 540px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 14px;
}
.reverso-hud-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reverso-hud-label {
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.reverso-hud-value {
  font-family: var(--f-mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.reverso-lives {
  display: flex;
  gap: 6px;
  font-size: 22px;
  line-height: 1;
}
.life-icon { color: var(--danger); transition: color .25s, transform .25s; }
.life-icon.lost { color: var(--bg5); transform: scale(.85); }

.reverso-hint {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  text-align: center;
  margin: 8px 0 12px;
  max-width: 480px;
  text-wrap: pretty;
}

.reverso-board {
  display: flex;
  flex-direction: column;
  gap: var(--gap-tile);
  padding: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 18px;
}

.reverso-opts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}
.word-opt {
  padding: 14px 8px;
  font-family: var(--f-mono);
  font-size: 14px;
  font-weight: 700;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  letter-spacing: .04em;
  touch-action: manipulation;
  transition: all .15s;
}
.word-opt:hover {
  border-color: var(--border-3);
  background: var(--bg3);
  transform: translateY(-1px);
}
.word-opt.correct-pick {
  background: var(--correct);
  color: #03200e;
  border-color: var(--correct);
  box-shadow: var(--glow-correct);
}
.word-opt.wrong {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
  opacity: .85;
}
.word-opt.disabled { opacity: .35; pointer-events: none; }
@media (min-width: 480px) {
  .word-opt { font-size: 16px; padding: 16px 10px; }
}

/* ─────────────────────────────────────────────────────────────
   TEMATICO
   ───────────────────────────────────────────────────────────── */
.theme-banner {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  text-align: center;
}
.theme-banner strong { color: var(--present); }
.theme-banner .theme-count { color: var(--muted); }

.hint-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.hint-display {
  max-width: 480px;
  padding: 10px 16px;
  background: var(--present-bg);
  border: 1px solid color-mix(in oklab, var(--present) 28%, transparent);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--present);
  text-align: center;
  text-wrap: pretty;
}

/* ─────────────────────────────────────────────────────────────
   MODALS
   ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,6,15,.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-overlay.open { display: flex; animation: fade-in .2s ease-out; }

.modal-box {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 32px 24px 24px;
  background: var(--bg2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: modal-in .32s cubic-bezier(.2,.8,.2,1.05) both;
}
.modal-box h2 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 32px;
  letter-spacing: .01em;
  text-transform: uppercase;
  margin: 0 0 8px;
  color: var(--text);
}
.modal-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  margin: 0 0 16px;
  text-wrap: pretty;
}
.modal-word {
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: .12em;
  color: var(--accent);
  padding: 12px 16px;
  background: var(--accent-dim);
  border: 1px dashed color-mix(in oklab, var(--accent) 40%, transparent);
  border-radius: var(--r-md);
  margin: 12px 0 20px;
  word-break: break-all;
}
.modal-word:empty { display: none; }

.modal-stats {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.stat-item {
  flex: 1;
  padding: 14px 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.stat-value {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 28px;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 4px;
}

.modal-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.modal-btn-row .btn { flex: 1; }

/* Tutorial modal extras */
.tutorial-intro {
  font-size: 15px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 18px;
  text-wrap: pretty;
}
.tutorial-rules {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
  text-align: left;
}
.tutorial-rule {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.rule-icon { font-size: 22px; line-height: 1; }
.rule-title {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}
.rule-text {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
  text-wrap: pretty;
}
.tutorial-tip {
  padding: 12px 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,255,.25);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 18px;
  line-height: 1.5;
  text-wrap: pretty;
  text-align: left;
}

/* ─────────────────────────────────────────────────────────────
   TOASTS
   ───────────────────────────────────────────────────────────── */
#toasts {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 24px);
}
.toast {
  padding: 10px 18px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  animation: toast-in .22s cubic-bezier(.2,.8,.2,1.05) both, toast-out .3s ease-in 2.1s forwards;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────────────────────
   ABOUT PAGE
   ───────────────────────────────────────────────────────────── */
.about-wrap {
  width: 100%;
  max-width: 720px;
  padding: 32px 12px 48px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.about-hero {
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.about-hero h1 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(48px, 11vw, 76px);
  margin: 0;
  line-height: .92;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.about-hero h1 .dot { color: var(--accent); }
.about-hero .about-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
  display: block;
}

.about-section h2 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 28px;
  text-transform: uppercase;
  margin: 0 0 14px;
  letter-spacing: .01em;
}
.about-section p {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 10px;
  text-wrap: pretty;
}
.about-modes-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (min-width: 560px) {
  .about-modes-list { grid-template-columns: 1fr 1fr; }
}
.about-modes-list li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.about-modes-list .li-icon { font-size: 24px; line-height: 1; }
.about-modes-list .li-name {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 18px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.about-modes-list .li-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
}

.about-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.about-color-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-align: center;
}
.about-color-card .demo-tile {
  width: 56px; height: 56px;
  border-radius: var(--r-sm);
  border: 2px solid;
  display: flex;
  align-items: center; justify-content: center;
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 22px;
}
.about-color-card .label {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.about-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.about-step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.about-step .num {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}
.about-step .h {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}
.about-step .t {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.about-creator-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--bg2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
}
.about-creator-card .avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--correct));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-weight: 900;
  color: var(--bg);
  font-size: 20px;
}
.about-creator-card .name {
  font-weight: 700;
  font-size: 15px;
}
.about-creator-card .role {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.about-creator-card a {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 32%, transparent);
  padding: 8px 12px;
  border-radius: 999px;
  letter-spacing: .05em;
}
.about-creator-card a:hover { background: var(--accent-dim); }

/* ─────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────── */
.site-footer {
  padding: 32px 16px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.site-footer a { color: var(--text-dim); border-bottom: 1px dashed var(--border-3); transition: color .15s; }
.site-footer a:hover { color: var(--accent); }

/* ─────────────────────────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────────────────────────── */
@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes card-appear {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(39,201,107,.45); }
  50%      { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(39,201,107,0); }
}
@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}
@keyframes tile-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes row-shake {
  0%, 100% { transform: translateX(0); }
  16%      { transform: translateX(-10px); }
  33%      { transform: translateX(10px); }
  50%      { transform: translateX(-6px); }
  66%      { transform: translateX(6px); }
  83%      { transform: translateX(-3px); }
}
@keyframes modal-in {
  0%   { opacity: 0; transform: scale(.82) translateY(16px); }
  70%  { transform: scale(1.02) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes combo-pop {
  0%   { opacity: 1; transform: translate(-50%,-50%) scale(.5); }
  55%  { transform: translate(-50%,-65%) scale(1.15); opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,-80%) scale(1.05); }
}
@keyframes toast-in {
  from { opacity: 0; transform: scale(.85) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: scale(.95) translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
