:root {
  --bg: #0b0d12;
  --bg-2: #12151d;
  --bg-3: #1a1f2c;
  --ink: #f4f6fb;
  --muted: #a8b0c2;
  --line: rgba(255, 255, 255, 0.1);
  --coral: #ff5d3a;
  --coral-2: #ff7a58;
  --gold: #ffc857;
  --violet: #8b7cff;
  --mint: #3ee0c5;
  --lime: #b6ff4a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  --radius: 22px;
  --font: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --display: "Fredoka", "Trebuchet MS", sans-serif;
  --header: 68px;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 0% -10%, rgba(255, 93, 58, 0.18), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(139, 124, 255, 0.16), transparent 50%),
    radial-gradient(700px 480px at 80% 110%, rgba(62, 224, 197, 0.08), transparent 45%),
    var(--bg);
}

body.nav-open { overflow: hidden; }

img { max-width: 100%; display: block; }

button, input, textarea { font: inherit; color: inherit; }

a { color: var(--gold); }

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

p { margin: 0; }

[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

::selection { background: var(--coral); color: white; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: white;
  color: #111;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 80;
}
.skip:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.wrap-wide { width: min(1220px, calc(100% - 28px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--header);
  padding: 10px 22px;
  background: rgba(11, 13, 18, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}

.logo-mark {
  width: 36px;
  height: 36px;
  flex: none;
}

.logo-type {
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}
.logo-type span {
  background: linear-gradient(120deg, var(--coral) 10%, var(--gold) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: rgba(255, 255, 255, 0.05); }

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}

.ad-slot {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 0 10px, transparent 10px 18px),
    rgba(255, 255, 255, 0.02);
  overflow: hidden;
}
.ad-slot:not(.is-placeholder) { border-style: solid; background: rgba(0, 0, 0, 0.2); }
.ad-ph { text-align: center; padding: 12px; }
.ad-ph span {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 3px 8px;
  margin-bottom: 6px;
}
.ad-ph strong { display: block; font-size: 0.92rem; font-weight: 650; }
.ad-ph em { display: block; margin-top: 2px; font-style: normal; font-size: 0.78rem; color: var(--muted); }

.ad-leaderboard { min-height: 90px; width: min(970px, 100%); margin: 14px auto; }
.ad-sidebar { min-height: 250px; }
.ad-banner { min-height: 90px; width: 100%; margin-top: 14px; }
.ad-interstitial { width: min(300px, 100%); min-height: 250px; margin: 8px auto 0; }
.ad-ingrid { min-height: 220px; height: 100%; }

.band { padding: 8px 0 28px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 36px;
  align-items: center;
  padding: 18px 0 8px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 { margin: 0; font-size: clamp(2.6rem, 6vw, 4.6rem); max-width: 11ch; }
.lede { margin-top: 14px; color: var(--muted); font-size: 1.08rem; max-width: 48ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.stat-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.stat {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.hero-stage {
  position: relative;
  height: 440px;
  overflow: hidden;
  border-radius: 28px;
}
.fan {
  position: absolute;
  width: min(76%, 340px);
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  background: #151821;
}
.fan-a { left: 6%; top: 22px; transform: rotate(-8deg); }
.fan-b { right: 4%; top: 108px; width: min(66%, 300px); transform: rotate(7deg); }
.fan-c { left: 18%; bottom: 18px; width: min(56%, 250px); transform: rotate(-2deg); }

.hero-play {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) rotate(-2deg);
  text-decoration: none;
  background: #111;
  color: white;
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.hero-play small { color: var(--gold); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.68rem; }
.hero-play strong { font-family: var(--display); font-size: 1.25rem; }

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  line-height: 1;
}
.btn-primary {
  background: linear-gradient(180deg, var(--coral-2), var(--coral));
  color: white;
  box-shadow: 0 10px 24px rgba(255, 93, 58, 0.28);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 22px 0 16px;
  scroll-margin-top: calc(var(--header) + 12px);
}
.search { position: relative; flex: 1 1 220px; min-width: min(100%, 220px); }
.search input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px 12px 42px;
}
.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  fill: none;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}
.chip.is-on { color: #14110a; background: var(--gold); border-color: var(--gold); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 6px 0 12px;
}
.section-head h2 { margin: 0; font-size: 1.7rem; }
.section-head p { color: var(--muted); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
.layout.is-solo { grid-template-columns: minmax(0, 1fr); }
.sidebar { position: sticky; top: calc(var(--header) + 16px); }
.side-note { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.game-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.game-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent, var(--gold)) 70%, white); }
.thumb { position: relative; aspect-ratio: 16 / 10; background: #151821; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.pill {
  position: absolute;
  left: 10px;
  top: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #14110a;
  background: var(--c, var(--gold));
  border-radius: 999px;
  padding: 4px 8px;
}
.card-body { padding: 12px 12px 14px; display: grid; gap: 4px; }
.card-body h2, .card-body h3 { margin: 0; font-size: 1.25rem; }
.card-body p { color: var(--muted); font-size: 0.92rem; }
.best-badge {
  justify-self: start;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #14200a;
  background: var(--lime);
  border-radius: 999px;
  padding: 3px 8px;
}
.ad-card { min-height: 100%; display: flex; }
.ad-card .ad-slot { flex: 1; border-radius: 20px; }

.empty {
  margin: 8px 0 0;
  padding: 22px;
  border-radius: 18px;
  background: var(--bg-2);
  color: var(--muted);
}

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 0.9rem; margin: 8px 0 12px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

.game-head h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 3.4rem); }
.game-head .lede { margin-top: 8px; }

.stage-wrap { margin-top: 16px; }
.stage {
  position: relative;
  width: min(100%, var(--stage, 640px));
  aspect-ratio: var(--ratio, 1 / 1);
  margin: 0 auto;
  border-radius: 22px;
  overflow: hidden;
  background: #090b10;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  touch-action: none;
  user-select: none;
}
.stage canvas { width: 100%; height: 100%; display: block; touch-action: none; }

.hud {
  width: min(100%, 760px);
  margin: 0 auto 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.hud div {
  flex: 1;
  background: rgba(18, 21, 29, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 6px 10px;
}
.hud span { display: block; color: var(--muted); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.hud strong { font-family: var(--display); font-size: 1.15rem; }

.overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 18px;
  background: linear-gradient(180deg, rgba(9, 11, 16, 0.05) 10%, rgba(9, 11, 16, 0.82) 78%);
}
.overlay-card {
  width: min(100%, 380px);
  text-align: center;
  background: rgba(16, 19, 28, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 18px 18px 16px;
  backdrop-filter: blur(10px);
}
.overlay-card h2 { margin: 0 0 6px; font-size: 2rem; }
.overlay-card p { color: var(--muted); }
.overlay-card .btn { width: 100%; margin-top: 12px; }
.overlay-actions { display: flex; gap: 8px; }
.overlay-actions .btn { flex: 1; }

.game-tools, .pad, .share-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.game-tools { margin-top: 12px; }
.pad { display: none; justify-content: center; margin-top: 12px; touch-action: none; }
.pad button {
  width: 68px;
  height: 54px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: none;
}
.pad button.wide { width: min(100%, 440px); height: 64px; font-size: 1.05rem; }
.pad button:active { transform: translateY(1px); background: #243049; }

.panel {
  margin-top: 22px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}
.panel h2 { margin: 0 0 8px; font-size: 1.4rem; }
.panel li { margin: 6px 0; color: var(--muted); }
.share-row { margin-top: 8px; }

.more { margin-top: 28px; }
.more h2 { margin: 0 0 12px; font-size: 1.6rem; }
.more-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
}
.more-card { flex: 0 0 210px; scroll-snap-align: start; }

.prose { max-width: 70ch; padding-bottom: 20px; }
.prose h1 { margin: 8px 0 10px; font-size: clamp(2.2rem, 5vw, 3.4rem); }
.prose h2 { margin: 1.5em 0 0.4em; font-size: 1.45rem; }
.prose p, .prose li { color: var(--muted); }
.prose p + p { margin-top: 0.8em; }
.prose ul { padding-left: 1.1em; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.form { display: grid; gap: 12px; margin-top: 16px; max-width: 560px; }
.form label { display: grid; gap: 6px; font-weight: 650; }
.form input, .form textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.form textarea { min-height: 140px; resize: vertical; }
.form-note { color: var(--muted); }

.site-footer {
  margin-top: 36px;
  padding: 28px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-brand { color: var(--ink); font-family: var(--display); font-size: 1.3rem; text-decoration: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.footer-links a, .footer-links button {
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 650;
}
.footer-links a:hover, .footer-links button:hover { color: var(--ink); }
.legal-line { margin-top: 14px; font-size: 0.85rem; }

.cookie {
  position: fixed;
  z-index: 45;
  left: 12px;
  right: 12px;
  bottom: 12px;
  width: min(880px, calc(100% - 24px));
  margin: 0 auto;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: #171b26;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.cookie p { color: var(--muted); font-size: 0.92rem; }
.cookie strong { color: var(--ink); }
.cookie-actions { display: flex; gap: 8px; flex: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 6, 10, 0.74);
}
.modal-card {
  width: min(420px, 100%);
  background: #151924;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}
.modal-card h2 { margin: 4px 0 8px; font-size: 1.8rem; }
.modal-card p { color: var(--muted); }
#ad-count { margin-top: 10px; font-weight: 750; color: var(--ink); }

.miss {
  min-height: 50vh;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 40px 0;
}
.miss h1 { margin: 0; font-size: clamp(2.5rem, 6vw, 4rem); }

.pill[data-cat="Arcade"] { --c: #ff5d3a; }
.pill[data-cat="Puzzle"] { --c: #8b7cff; color: white; }
.pill[data-cat="Action"] { --c: #3ee0c5; }
.pill[data-cat="Casual"] { --c: #ffc857; }

@media (min-width: 1020px) {
  .ad-sidebar { min-height: 600px; }
}

@media (max-width: 980px) {
  .layout, .layout.is-solo { grid-template-columns: 1fr; }
  .sidebar { position: static; order: 2; }
  .ad-sidebar { min-height: 250px; }
  .hero { grid-template-columns: 1fr; gap: 12px; }
  .hero-stage { height: 280px; margin-top: 8px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    background: #12151c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav.is-open { display: flex; }
  .fan-b, .fan-c { display: none; }
  .fan-a { position: relative; left: auto; top: auto; transform: none; width: 100%; }
  .hero-stage { height: auto; min-height: 0; overflow: visible; }
  .hero-play { position: static; transform: none; margin-top: 10px; }
  .cookie { flex-direction: column; align-items: stretch; }
  .ad-leaderboard { min-height: 50px; }
  .stage { width: 100%; }
}

@media (max-width: 800px), (pointer: coarse) {
  .pad { display: flex; }
}

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