:root {
  --bg: #05060a;
  --surface: rgba(14, 17, 28, 0.62);
  --surface-2: rgba(255, 255, 255, 0.035);
  --line: rgba(130, 160, 255, 0.12);
  --text: #e6ecff;
  --muted: #7d87a8;
  --cyan: #00f0ff;
  --magenta: #ff2bd6;
  --violet: #8b5cff;
  --green: #2bffa3;
  --amber: #ffc94d;
  --red: #ff4d6d;
  --radius: 18px;
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Orbitron', var(--font);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main { flex: 1; position: relative; z-index: 1; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Fundo ---------- */

.bg-grid {
  position: fixed;
  inset: auto -50% -10% -50%;
  height: 55vh;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.14) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(500px) rotateX(62deg);
  transform-origin: bottom;
  mask-image: linear-gradient(to top, black 10%, transparent 85%);
  -webkit-mask-image: linear-gradient(to top, black 10%, transparent 85%);
  animation: grid-move 6s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes grid-move { to { background-position: 0 56px; } }

.bg-glow {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(600px 400px at 10% 6%, rgba(139, 92, 255, 0.18), transparent 70%),
    radial-gradient(500px 380px at 92% 16%, rgba(255, 43, 214, 0.12), transparent 70%),
    radial-gradient(700px 300px at 50% 100%, rgba(0, 240, 255, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Header / footer ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(5, 6, 10, 0.6);
  border-bottom: 1px solid var(--line);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; }
.logo:hover { text-decoration: none; }

.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  color: var(--cyan);
  border: 1px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35), inset 0 0 10px rgba(0, 240, 255, 0.2);
  text-shadow: 0 0 10px var(--cyan);
}

.logo-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.22em;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.55);
}

.logo-text b { color: var(--magenta); font-weight: 700; text-shadow: 0 0 8px rgba(255, 43, 214, 0.7); margin-left: 4px; }

.nav { display: flex; gap: 24px; }
.nav a { color: var(--muted); font-size: 14px; letter-spacing: 0.04em; transition: color 0.2s; }
.nav a:hover { color: var(--text); text-decoration: none; }

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 64px;
  border-top: 1px solid var(--line);
  background: rgba(5, 6, 10, 0.75);
  padding: 40px 0 24px;
  font-size: 14px;
}

.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--text); }
.copyright { margin-top: 32px; font-size: 12px; }

@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > div:first-child { grid-column: 1 / -1; }
}

/* ---------- Botões ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 12px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  color: #001014;
  background: linear-gradient(135deg, var(--cyan), #6ab7ff 55%, var(--violet));
  border: none;
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.35);
}

.btn-primary:hover { box-shadow: 0 0 34px rgba(0, 240, 255, 0.6); }

.btn-ghost { color: var(--text); background: var(--surface-2); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: rgba(255, 43, 214, 0.55); box-shadow: 0 0 16px rgba(255, 43, 214, 0.2); }

.btn.sm { padding: 7px 14px; font-size: 12px; border-radius: 9px; }

/* ---------- Home ---------- */

.hero { padding: 88px 20px 56px; text-align: center; }

.eyebrow {
  display: inline-block;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 6px 14px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 999px;
  margin: 0 0 24px;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.15);
}

.hero-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(44px, 9vw, 96px);
  line-height: 1;
  letter-spacing: 0.02em;
  margin: 0 0 20px;
  color: #fff;
  text-shadow: 0 0 18px rgba(0, 240, 255, 0.45), 0 0 60px rgba(0, 240, 255, 0.2);
}

.hero-title span {
  color: var(--magenta);
  text-shadow: 0 0 14px rgba(255, 43, 214, 0.8), 0 0 50px rgba(255, 43, 214, 0.4);
  animation: flicker 5s infinite;
}

@keyframes flicker {
  0%, 92%, 96%, 100% { opacity: 1; }
  94% { opacity: 0.55; }
}

.hero-sub { max-width: 560px; margin: 0 auto 32px; color: var(--muted); font-size: 18px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.section { padding: 40px 20px; }

.section-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin: 0 0 24px;
}

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }

.game-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  color: var(--text);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.game-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.15), 0 20px 40px -20px rgba(0, 0, 0, 0.8);
}

.game-thumb {
  aspect-ratio: 5 / 3;
  background:
    radial-gradient(circle at 50% 120%, rgba(0, 240, 255, 0.15), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 20px),
    #070914;
  border-bottom: 1px solid var(--line);
}

.thumb-art { width: 100%; height: 100%; display: block; transition: transform 0.4s; }
.game-card:hover .thumb-art { transform: scale(1.06); }

.game-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.game-card-body h3 { margin: 0; font-family: var(--display); font-size: 16px; letter-spacing: 0.06em; }
.game-card-body p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.play-link { margin-top: 8px; color: var(--cyan); font-size: 13px; font-weight: 600; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }

.feature {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.feature h3 { margin: 0 0 8px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Página de jogo ---------- */

.game-page { padding-top: 24px; }
.breadcrumb { font-size: 13px; margin-bottom: 20px; }
.breadcrumb a { color: var(--muted); }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }

@media (max-width: 960px) {
  .game-layout { grid-template-columns: 1fr; }
}

.game-head h1 {
  font-family: var(--display);
  font-size: clamp(26px, 5vw, 38px);
  letter-spacing: 0.04em;
  margin: 0;
  text-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
}

.game-head p { margin: 4px 0 20px; }

.game-panel {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 0 40px -10px rgba(0, 240, 255, 0.15);
}

.scoreboard { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.scoreboard { flex-wrap: wrap; }
.scoreboard [data-action="mute"] { margin-left: auto; }

.score {
  display: flex;
  flex-direction: column;
  padding: 6px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 88px;
}

.score span { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.score b { font-family: var(--mono); font-size: 18px; color: #fff; }

.stage {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.stage:focus-visible { box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.5); }

.controls-hint { text-align: center; font-size: 13px; margin: 14px 0 0; }

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 5;
  cursor: pointer;
}

.overlay[hidden] { display: none; }
.overlay h2 { margin: 0; font-family: var(--display); font-size: clamp(22px, 5vw, 32px); letter-spacing: 0.08em; color: #fff; text-shadow: 0 0 16px var(--cyan); }
.overlay p { margin: 0; color: var(--muted); }

/* Conteúdo textual */

.prose { margin-top: 40px; max-width: 760px; }
.prose h1 { font-family: var(--display); font-size: clamp(26px, 5vw, 36px); letter-spacing: 0.04em; margin: 0 0 16px; }
.prose h2 { font-family: var(--display); font-weight: 500; font-size: 15px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); margin: 36px 0 12px; }
.prose p, .prose li { color: #c3cbe6; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--magenta); }
.prose .lead { font-size: 18px; color: var(--text); }

.page { padding-top: 56px; }

.contact-card {
  display: inline-flex;
  flex-direction: column;
  padding: 18px 24px;
  margin: 8px 0 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.12);
}

.contact-card:hover { text-decoration: none; box-shadow: 0 0 32px rgba(0, 240, 255, 0.25); }
.contact-card b { font-family: var(--mono); color: #fff; }

/* Barra lateral */

.game-side { position: sticky; top: 88px; }
.side-title { font-family: var(--display); font-weight: 500; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; margin: 0 0 14px; }
.side-list { display: flex; flex-direction: column; gap: 10px; }

.side-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  transition: border-color 0.2s;
}

.side-card:hover { text-decoration: none; border-color: rgba(0, 240, 255, 0.4); }
.side-card b { display: block; font-size: 14px; }
.side-card span { display: block; font-size: 12px; line-height: 1.4; }
.side-thumb { flex: 0 0 80px; height: 52px; border-radius: 10px; background: #070914; overflow: hidden; }

@media (max-width: 960px) {
  .game-side { position: static; }
}

/* ---------- Anúncios ---------- */

.ad { margin: 32px 0; text-align: center; min-height: 90px; }
.ad-side { margin-top: 0; min-height: 250px; }

.ad-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.ad-placeholder {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 201, 77, 0.35);
  border-radius: 12px;
  background: rgba(255, 201, 77, 0.03);
}

.ad-placeholder .ad-label { color: var(--amber); margin: 0; }

/* ---------- Banner de cookies ---------- */

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(14, 17, 28, 0.95);
  border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  font-size: 13px;
}

.cookie-banner[hidden] { display: none; }

.update-toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 12px 10px 18px;
  border-radius: 14px;
  background: rgba(14, 17, 28, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.2), 0 10px 40px rgba(0, 0, 0, 0.6);
  font-size: 13px;
  animation: pop-in 0.25s ease-out;
}

.update-toast p { margin: 0; color: var(--text); }
.cookie-banner p { margin: 0; color: var(--muted); }

/* ---------- Jogo: Snake ---------- */

.stage canvas { display: block; width: 100%; height: 100%; }

/* ---------- Jogo: 2048 ---------- */

.g2048 {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 3%;
  padding: 3%;
  background: #070914;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.cell {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(16px, 6vw, 36px);
  --c: var(--cyan);
}

.cell.v { color: var(--c); border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 40%, transparent), inset 0 0 12px color-mix(in srgb, var(--c) 18%, transparent); text-shadow: 0 0 10px var(--c); }
.cell.big { font-size: clamp(13px, 4.6vw, 28px); }
.cell.huge { font-size: clamp(11px, 3.6vw, 22px); }
.cell.new { animation: pop-in 0.18s ease-out; }
.cell.merged { animation: pop 0.2s ease-out; }

@keyframes pop-in { from { transform: scale(0.4); opacity: 0; } }
@keyframes pop { 50% { transform: scale(1.12); } }

/* ---------- Jogo: Memória ---------- */

.memory {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 3%;
  padding: 3%;
  perspective: 800px;
}

.mcard {
  position: relative;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.4s;
}

.mcard.open, .mcard.done { transform: rotateY(180deg); }

.mcard .face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.mcard .back {
  background:
    repeating-linear-gradient(45deg, rgba(139, 92, 255, 0.12) 0 6px, transparent 6px 12px),
    #0b0d1a;
  border: 1px solid rgba(139, 92, 255, 0.4);
}

.mcard .back::after { content: 'N'; font-family: var(--display); color: rgba(139, 92, 255, 0.6); font-size: clamp(14px, 4vw, 22px); }

.mcard .front {
  transform: rotateY(180deg);
  background: #0b0d1a;
  border: 1px solid var(--c);
  color: var(--c);
  font-size: clamp(22px, 8vw, 44px);
  text-shadow: 0 0 12px var(--c);
  box-shadow: 0 0 16px color-mix(in srgb, var(--c) 35%, transparent);
}

.mcard.done .front { background: color-mix(in srgb, var(--c) 12%, #0b0d1a); }

/* ---------- Jogo: Reflexo ---------- */

.reflex {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.1s;
  border: 1px solid var(--line);
  background: #070914;
}

.reflex h2 { margin: 0; font-family: var(--display); font-size: clamp(24px, 6vw, 44px); letter-spacing: 0.06em; }
.reflex p { margin: 0; color: var(--muted); }
.reflex.wait { background: radial-gradient(circle, rgba(139, 92, 255, 0.35), #12082a); }
.reflex.go { background: radial-gradient(circle, rgba(43, 255, 163, 0.5), #03281a); }
.reflex.go h2 { color: #fff; text-shadow: 0 0 20px var(--green); }
.reflex.early { background: radial-gradient(circle, rgba(255, 77, 109, 0.35), #2a0812); }
.rounds { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.rounds span { font-family: var(--mono); font-size: 13px; padding: 4px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); }

/* ---------- Jogador, online e contadores ---------- */

.nav { align-items: center; }

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.2s;
}

.player-chip:hover { border-color: rgba(0, 240, 255, 0.45); }
.player-chip b { color: var(--text); font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-online { display: inline-flex; align-items: center; gap: 4px; padding-right: 8px; border-right: 1px solid var(--line); }
.chip-online .counter { color: var(--green); font-family: var(--mono); }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: live 1.6s ease-in-out infinite;
  flex: none;
}

@keyframes live { 50% { opacity: 0.35; } }

@media (max-width: 560px) {
  .nav > a { display: none; }
}

/* Odômetro: cada dígito é uma fita 0–9 deslocada verticalmente. */
.counter { display: inline-flex; font-variant-numeric: tabular-nums; }
.counter .digit { display: inline-block; height: 1em; line-height: 1; overflow: hidden; }
.counter .strip { display: flex; flex-direction: column; transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.counter .strip span { height: 1em; line-height: 1; }
.counter .sep { line-height: 1; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 8px; }

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.stat-label { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); text-align: center; }

.stat .counter {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 6vw, 44px);
  color: #fff;
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.55);
}

.stat:first-child .counter { color: var(--green); text-shadow: 0 0 14px rgba(43, 255, 163, 0.6); }

@media (max-width: 560px) {
  .stats { gap: 8px; }
  .stat { padding: 16px 6px; }
  .stat-label { font-size: 9px; letter-spacing: 0.1em; }
}

/* Letreiro de últimas partidas */
.ticker {
  position: relative;
  z-index: 1;
  overflow: hidden;
  margin: 24px 0 0;
  padding: 10px 0;
  border-block: 1px solid var(--line);
  background: rgba(5, 6, 10, 0.55);
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}

.ticker[hidden] { display: none; }
.ticker-track { display: flex; width: max-content; animation: ticker 60s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { padding: 0 28px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.ticker-track span::before { content: '◆'; color: var(--magenta); margin-right: 12px; font-size: 9px; vertical-align: 2px; }
.ticker-track b { color: var(--text); font-weight: 600; }
.ticker-track em { font-style: normal; font-family: var(--mono); color: var(--cyan); }

@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Ranking ---------- */

.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }

.rank-card {
  padding: 18px 18px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.rank-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 12px; }
.rank-card header a { font-family: var(--display); font-size: 14px; letter-spacing: 0.06em; color: var(--text); }
.rank-card header b { color: var(--cyan); font-family: var(--mono); }

.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }

.rank-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 14px;
}

.rank-list li:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }
.rank-list li.me { background: rgba(0, 240, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.35); }
.rank-list li.rank-empty { display: block; background: none; font-size: 13px; padding: 10px 0; }

.rank-pos { width: 22px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--muted); flex: none; }
.rank-list li:nth-child(1) .rank-pos { color: var(--amber); text-shadow: 0 0 8px var(--amber); }
.rank-list li:nth-child(2) .rank-pos { color: #d7e1ff; }
.rank-list li:nth-child(3) .rank-pos { color: #ff9f43; }
.rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { font-family: var(--mono); font-weight: 500; color: #fff; }

.side-rank { margin-bottom: 24px; }
.side-rank header { margin-bottom: 12px; }
.side-rank .side-title { margin: 0; }
.side-rank .btn { width: 100%; margin-top: 12px; gap: 6px; }
.side-rank .btn b { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Modal de apelido ---------- */

.name-modal {
  width: min(420px, calc(100% - 32px));
  padding: 28px;
  border-radius: var(--radius);
  background: rgba(10, 12, 22, 0.97);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--text);
  box-shadow: 0 0 60px rgba(0, 240, 255, 0.2), 0 30px 80px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.name-modal::backdrop { background: rgba(3, 4, 8, 0.75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.name-modal .eyebrow { margin-bottom: 16px; }
.name-modal h2 { margin: 0 0 8px; font-family: var(--display); font-size: 22px; letter-spacing: 0.06em; text-shadow: 0 0 14px rgba(0, 240, 255, 0.5); }
.name-modal p.muted { margin: 0 0 20px; font-size: 14px; }

.name-modal input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  text-align: center;
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  outline: none;
}

.name-modal input:focus { border-color: var(--cyan); box-shadow: 0 0 16px rgba(0, 240, 255, 0.3); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* ---------- Controles compartilhados ---------- */

.options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 12px;
  max-width: 520px;
}

.options button {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.options button:hover { color: var(--text); }
.options button.on { color: var(--cyan); border-color: rgba(0, 240, 255, 0.55); box-shadow: 0 0 14px rgba(0, 240, 255, 0.2); }
.options .flag-toggle.on { color: var(--magenta); border-color: rgba(255, 43, 214, 0.55); box-shadow: 0 0 14px rgba(255, 43, 214, 0.2); }
.mines-left { font-family: var(--mono); font-size: 13px; color: var(--amber); padding: 0 6px; }

.touchpad {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  justify-content: space-between;
  padding: 10px;
  z-index: 4;
  pointer-events: none;
}

.touchpad > div { display: flex; gap: 10px; }

.touchpad button {
  pointer-events: auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-size: 20px;
  color: #fff;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.4);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.touchpad button:active { background: rgba(0, 240, 255, 0.3); }

@media (pointer: coarse) {
  .touchpad { display: flex; }
}

/* ---------- Jogo: Campo Minado ---------- */

.mines {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  grid-template-rows: repeat(var(--n), minmax(0, 1fr));
  gap: 2px;
  padding: 6px;
  background: #070914;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.mcell {
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(139, 92, 255, 0.35);
  border-radius: 4px;
  background: linear-gradient(160deg, rgba(139, 92, 255, 0.22), rgba(0, 240, 255, 0.08));
  font-family: var(--display);
  font-weight: 700;
  font-size: calc(min(520px, 90vw) / var(--n) * 0.48);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.mcell:hover { background: linear-gradient(160deg, rgba(139, 92, 255, 0.4), rgba(0, 240, 255, 0.15)); }
.mcell.open { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.05); cursor: default; text-shadow: 0 0 8px currentColor; }
.mcell.flag { color: var(--magenta); text-shadow: 0 0 10px var(--magenta); }
.mcell.mine { color: var(--amber); text-shadow: 0 0 10px var(--amber); }
.mcell.boom { background: rgba(255, 77, 109, 0.55); }
.mcell.wrong { background: rgba(255, 77, 109, 0.2); text-decoration: line-through; }

/* ---------- Jogo: Velha ---------- */

.ttt {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  background: #070914;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.tcell {
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(139, 92, 255, 0.3);
  background: rgba(255, 255, 255, 0.025);
  font-size: clamp(48px, 16vw, 110px);
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.tcell:hover { border-color: rgba(0, 240, 255, 0.5); }
.tcell.x { color: var(--cyan); text-shadow: 0 0 18px var(--cyan); }
.tcell.o { color: var(--magenta); text-shadow: 0 0 18px var(--magenta); }
.tcell.placed { animation: pop-in 0.2s ease-out; }
.tcell.win { background: rgba(255, 201, 77, 0.12); border-color: var(--amber); box-shadow: 0 0 24px rgba(255, 201, 77, 0.35); }

/* ---------- Jogo: Genius ---------- */

.simon {
  position: absolute;
  inset: 4%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4%;
  border-radius: 50%;
  padding: 4%;
  background: #070914;
  border: 1px solid var(--line);
}

.simon.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.spad {
  position: relative;
  padding: 0;
  border: 2px solid var(--c);
  background: color-mix(in srgb, var(--c) 14%, #070914);
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.12s, box-shadow 0.12s, background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.spad span { position: absolute; font-family: var(--display); font-size: 12px; color: var(--c); opacity: 0.7; }
.spad-0 { border-radius: 100% 0 0 0; } .spad-0 span { right: 22%; bottom: 22%; }
.spad-1 { border-radius: 0 100% 0 0; } .spad-1 span { left: 22%; bottom: 22%; }
.spad-2 { border-radius: 0 0 0 100%; } .spad-2 span { right: 22%; top: 22%; }
.spad-3 { border-radius: 0 0 100% 0; } .spad-3 span { left: 22%; top: 22%; }
.spad.lit { opacity: 1; background: color-mix(in srgb, var(--c) 70%, #fff); box-shadow: 0 0 40px var(--c), inset 0 0 30px rgba(255, 255, 255, 0.5); }

.scenter {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 34%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0b0d1a;
  border: 2px solid rgba(139, 92, 255, 0.6);
  box-shadow: 0 0 30px rgba(139, 92, 255, 0.35);
  color: #fff;
  cursor: pointer;
}

.scenter b { font-family: var(--display); font-size: clamp(22px, 7vw, 40px); line-height: 1.1; text-shadow: 0 0 14px var(--violet); }
.scenter small { font-size: clamp(10px, 2.6vw, 13px); color: var(--muted); }

/* ---------- Home: filtros ---------- */

.filters { justify-content: flex-start; max-width: none; margin: -8px 0 24px; }
.game-card[hidden] { display: none; }
.game-thumb { position: relative; }

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(5, 6, 10, 0.75);
  border: 1px solid rgba(0, 240, 255, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
