:root {
  --bg: #0b0a12;
  --bg-2: #12101d;
  --surface: #181527;
  --surface-2: #211d35;
  --line: #2e2948;
  --text: #f1eefb;
  --muted: #aaa4c4;
  --gold: #ffd25e;
  --gold-2: #ffb938;
  --pink: #ff4d8d;
  --cyan: #4fd8ff;
  --focus: #ffd25e;
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 77, 141, 0.13), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(79, 216, 255, 0.09), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.55 var(--font);
  overflow-x: hidden;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #ffe39a; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h2 { font-size: 1.4rem; }
p { margin: 0 0 1em; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.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: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--gold); color: #1a1300; padding: 10px 14px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* header / footer */
.site-header { position: sticky; top: 0; z-index: 5; background: rgba(11, 10, 18, 0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(46, 41, 72, 0.7); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: 0.02em; }
.brand:hover { color: var(--text); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #1a1300; font-weight: 900; background: linear-gradient(135deg, var(--gold), var(--pink)); box-shadow: 0 0 18px rgba(255, 77, 141, 0.35); }
.brand-text span { color: var(--muted); font-weight: 600; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--bg-2); }
.footer-inner { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; }
.footer-inner p { margin: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; font-weight: 800; text-decoration: none; border: 0; cursor: pointer; font: inherit; font-weight: 800; letter-spacing: 0.02em; transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease; }
.btn-play { color: #1a1300; background: linear-gradient(180deg, var(--gold), var(--gold-2)); box-shadow: 0 4px 0 #b97a00, 0 8px 22px rgba(255, 185, 56, 0.25); }
.btn-play:hover { color: #1a1300; transform: translateY(-1px); box-shadow: 0 5px 0 #b97a00, 0 10px 26px rgba(255, 185, 56, 0.35); }
.btn-play:active { transform: translateY(2px); box-shadow: 0 2px 0 #b97a00, 0 4px 12px rgba(255, 185, 56, 0.25); }
.btn-ghost { color: var(--text); background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 2px var(--muted); }
.btn-lg { min-height: 54px; padding: 14px 34px; font-size: 1.15rem; }

/* hero */
.hero { padding: 56px 0 24px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 32px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.78rem; font-weight: 800; color: var(--cyan); margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.2rem, 5.4vw, 4rem); font-weight: 900; margin-bottom: 18px; }
.glow { background: linear-gradient(90deg, var(--gold), var(--pink) 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 1.12rem; color: #d6d1ea; max-width: 38em; }
.stats { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 4px 0 24px; }
.stats li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; color: var(--muted); font-size: 0.92rem; }
.stats strong { color: var(--text); }
.hero-fan { position: relative; height: 360px; }
.fan { position: absolute; width: 38%; max-width: 190px; top: 50%; left: 50%; border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08); transition: transform 0.4s ease; }
.fan-0 { transform: translate(-150%, -46%) rotate(-14deg); }
.fan-1 { transform: translate(-100%, -52%) rotate(-7deg); }
.fan-2 { transform: translate(-50%, -56%) rotate(0deg); z-index: 2; box-shadow: 0 22px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 77, 141, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.12); }
.fan-3 { transform: translate(0%, -52%) rotate(7deg); z-index: 1; }
.fan-4 { transform: translate(50%, -46%) rotate(14deg); }
.fan-1, .fan-3 { z-index: 1; }
.hero-fan:hover .fan-0 { transform: translate(-165%, -46%) rotate(-17deg); }
.hero-fan:hover .fan-4 { transform: translate(65%, -46%) rotate(17deg); }

/* games section */
.games { padding-top: 24px; scroll-margin-top: 72px; }
.games-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.count { color: var(--muted); margin: 0; }
.toolbar { display: flex; gap: 12px; margin: 8px 0 14px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.search svg { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; min-height: 48px; padding: 10px 44px 10px 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.search input::placeholder { color: #8a84a6; }
.search input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(255, 210, 94, 0.35); }
.search kbd { position: absolute; right: 12px; font: 0.8rem ui-monospace, Menlo, monospace; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; }
.sort { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.sort select { min-height: 48px; padding: 8px 36px 8px 14px; border-radius: 12px; border: 1px solid var(--line); background-color: var(--surface); background-repeat: no-repeat; color: var(--text); font: inherit; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px; background-size: 5px 5px; }
.sort select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip { font: inherit; font-size: 0.92rem; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; min-height: 38px; cursor: pointer; transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
.chip span { color: #8a84a6; font-weight: 600; margin-left: 2px; }
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] { color: #1a1300; background: var(--gold); border-color: var(--gold); }
.chip[aria-pressed="true"] span { color: #5a4300; }

/* grid + cards */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.grid-sm { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.card:hover { transform: translateY(-3px); border-color: #4a4270; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 26px rgba(255, 77, 141, 0.12); }
.card[hidden] { display: none; }
.card-link { color: var(--text); text-decoration: none; display: block; }
.card-link:hover { color: var(--text); }
.card-link:focus-visible { outline-offset: -3px; border-radius: var(--radius) var(--radius) 0 0; }
.card-media { display: block; aspect-ratio: 5 / 7; background: var(--bg-2); overflow: hidden; }
.card-media img, .card-media .img-missing { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-title { display: block; padding: 12px 14px 4px; font-family: var(--display); font-weight: 800; font-size: 1.02rem; line-height: 1.25; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px; }
.card .btn-card { margin: 12px 14px 14px; min-height: 40px; padding: 8px 14px; margin-top: auto; }
.card .card-meta { margin-bottom: 12px; }
.tag { display: inline-block; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.tag-group { color: var(--cyan); background: rgba(79, 216, 255, 0.1); }
.tag-ai { color: #ffb3cf; background: rgba(255, 77, 141, 0.14); }
.img-missing { display: grid; place-items: center; padding: 16px; text-align: center; font-weight: 800; color: var(--muted); }
.empty { text-align: center; padding: 40px 0; color: var(--muted); }

/* game page */
.crumbs { margin: 24px 0 18px; }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--text); }
.game { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 40px; align-items: start; }
.game-media img, .game-media .img-missing { width: 100%; border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.game-media .img-missing { aspect-ratio: 5 / 7; background: var(--surface); }
.game-body h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 900; margin-top: 12px; }
.game-body .card-meta { padding: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 26px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.facts dt { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.facts dd { margin: 2px 0 0; font-weight: 700; }
.note { color: var(--muted); font-size: 0.94rem; margin-top: 16px; max-width: 34em; }
.game-credits { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.game-credits h2 { font-size: 1.1rem; }
.credits { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.credits li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
.more { margin-top: 56px; }

/* people */
.page { padding-top: 32px; max-width: 1000px; }
.page h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 900; }
.page h2 { margin-top: 36px; }
.soon { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.soon h2 { margin-top: 18px; }
.steps { padding-left: 1.3em; }
.steps li { margin-bottom: 8px; }
.people { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.person-card a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; height: 100%; }
.person-card a:hover { border-color: #4a4270; color: var(--text); }
.person-card img, .avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; }
.avatar { display: grid; place-items: center; background: linear-gradient(135deg, var(--gold), var(--pink)); color: #1a1300; font: 900 2.2rem var(--display); }
.avatar-lg { width: 128px; height: 128px; font-size: 3rem; }
.person-name { font-weight: 800; }
.person-head { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.person-head img { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; }
.person-head h1 { margin-bottom: 4px; }
.role { color: var(--muted); font-size: 1.1rem; margin-bottom: 8px; }
.links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.links a { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); text-decoration: none; font-weight: 700; }
.bio { font-size: 1.08rem; max-width: 40em; }

/* responsive */
@media (max-width: 860px) {
  .hero { padding-top: 32px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-fan { height: 230px; order: -1; }
  .fan { width: 30%; max-width: 140px; }
  .game { grid-template-columns: 1fr; gap: 24px; }
  .game-media { max-width: 360px; margin: 0 auto; width: 100%; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-title { padding: 10px 10px 4px; font-size: 0.95rem; }
  .card-meta { padding: 0 10px; }
  .card .btn-card { margin: 10px; margin-top: auto; }
  .tag { font-size: 0.68rem; padding: 2px 6px; }
  .brand-text span { display: none; }
  .hero-fan { height: 190px; }
  .search kbd { display: none; }
  .search input { padding-right: 14px; }
  .sort { flex: 1 1 auto; }
  .sort select { flex: 1; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover, .btn-play:hover, .btn-play:active { transform: none; }
  .card:hover .card-media img { transform: none; }
  .hero-fan:hover .fan-0 { transform: translate(-150%, -46%) rotate(-14deg); }
  .hero-fan:hover .fan-4 { transform: translate(50%, -46%) rotate(14deg); }
}
@media (forced-colors: active) {
  .btn, .chip, .tag { border: 1px solid ButtonText; }
}

/* in-page player */
html.player-open { overflow: hidden; scrollbar-gutter: stable; }
.player { width: 95vw; height: 95vh; max-width: none; max-height: none; margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: #07060c; color: var(--text); overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); }
.player[open] { display: flex; flex-direction: column; animation: player-in 0.18s ease-out; }
.player::backdrop { background: rgba(5, 4, 10, 0.82); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@keyframes player-in { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
.player-bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 52px; padding: 0 8px 0 16px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.player-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player-title { margin: 0; font-size: 1.05rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-group { flex: 0 0 auto; }
.player-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.player-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.player-btn:hover { background: var(--surface-2); color: var(--text); }
.player-btn:disabled { opacity: 0.4; cursor: default; background: transparent; }
.player-btn:focus-visible { outline-offset: -2px; }
.player-close { margin-left: 4px; background: var(--surface); }
.player-pos { min-width: 4.5em; text-align: center; color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.player-stage { position: relative; flex: 1 1 auto; min-height: 0; background: #000; }
.player-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }
.player-loading { position: absolute; inset: 0; z-index: 1; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); background: #07060c; pointer-events: none; }
.player-stage.is-loading .player-loading { display: flex; }
.player-spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--gold); animation: player-spin 0.8s linear infinite; }
@keyframes player-spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) {
  .player { width: 100vw; height: 100vh; height: 100dvh; border: 0; border-radius: 0; }
  .player-bar { height: calc(48px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 4px 0 12px; gap: 6px; }
  .player-title { font-size: 0.95rem; }
  .player-group, .player-pos, .player-newtab-label { display: none; }
  .player-btn { min-width: 40px; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .player[open] { animation: none; }
  .player-spinner { animation: none; border-top-color: var(--gold); }
}
