:root {
  --bg: #07060c;
  --bg-2: #100e18;
  --cabinet: #161018;
  --wood: #3a2418;
  --chrome: #c8c2b4;
  --gold: #e6c15a;
  --neon: #5cffd2;
  --neon-2: #ff5ad9;
  --text: #efe7d6;
  --muted: #9a907c;
  --panel: #12101a;
  --line: #2a2433;
  --danger: #ff5a6a;
  --ok: #7dff8a;
  --font-ui: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --font-pixel: "Press Start 2P", ui-monospace, "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(92, 255, 210, 0.08), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(255, 90, 217, 0.06), transparent 45%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.18) 3px),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.6;
}

a { color: var(--neon); text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; }

.skip {
  position: absolute; left: -999px; top: 0;
}
.skip:focus { left: 8px; top: 8px; background: #000; padding: 8px; z-index: 9; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 6, 12, 0.88);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 1px;
}
.brand:hover { text-decoration: none; color: var(--neon); }
.logo {
  width: 28px; height: 28px;
  image-rendering: pixelated;
}
.nav {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 14px;
}
.nav a { color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--neon); }
.lang {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  font-size: 12px;
}
.lang a {
  padding: 4px 10px;
  color: var(--muted);
  text-decoration: none;
}
.lang a.on { background: var(--neon); color: #04140f; }

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 42px 20px 12px;
  text-align: center;
}
.hero-art {
  max-width: 820px;
  margin: 0 auto 22px;
  border: 3px solid #4a3428;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 0 #09070c, inset 0 0 0 2px #6a4a32;
}
.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.marquee {
  font-family: var(--font-pixel);
  font-size: clamp(16px, 3vw, 28px);
  color: var(--gold);
  text-shadow: 0 0 12px rgba(230, 193, 90, 0.55), 0 0 2px #000;
  margin: 0 0 12px;
  line-height: 1.5;
}
.hero p.lead {
  max-width: 680px;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 17px;
}
.pills { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.pill:hover { border-color: var(--neon); color: var(--neon); text-decoration: none; }

.grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.card {
  background: linear-gradient(180deg, #1a1522, #100d16);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  min-height: 210px;
  box-shadow: 0 10px 0 rgba(0,0,0,.35);
  transition: transform .12s ease, border-color .12s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent, var(--neon)); text-decoration: none; color: inherit; }
.thumb {
  height: 124px;
  background: #000;
  position: relative;
  overflow: hidden;
}
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.thumb .year {
  position: absolute; left: 8px; bottom: 8px;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #04140f;
  background: var(--gold);
  padding: 3px 5px;
  z-index: 1;
}
.card body, .card .meta { padding: 12px 12px 14px; }
.card h2 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; }
.badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: .4px;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}
.wrap.play {
  max-width: none;
  width: 100%;
  min-height: calc(100dvh - 58px);
  padding: 6px 16px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.play-head {
  text-align: center;
  flex: 0 0 auto;
  margin: 0 0 4px;
}
.play-head .crumbs { margin: 0 0 2px; font-size: 12px; }
.wrap.play h1 {
  font-size: clamp(14px, 1.8vw, 20px);
  margin: 0;
  line-height: 1.3;
}
.play-tag { display: none; }
.play-stage {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1480px;
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
  min-height: 0;
}
.ad-slot {
  /* Empty until ADS.enabled is flipped on. Renders nothing: no label,
     no border, no reserved height. */
  display: none;
  margin: 0 auto;
  max-width: 100%;
}
.ad-slot[hidden] { display: none !important; }
.ad-slot.ad-active { display: block; }
.ad-leaderboard.ad-active { width: min(728px, 100%); margin: 14px auto; }
.ad-side.ad-active { width: 160px; justify-self: center; }
.ad-box.ad-active { width: min(300px, 100%); margin: 14px auto; }
.ad-interstitial.ad-active {
  position: relative;
  z-index: 2;
  width: min(320px, 90%);
  margin: 8px auto 0;
}
.how-panel {
  width: min(640px, 100%);
  margin-top: 12px;
}
@media (max-width: 1180px) {
  .play-stage { flex-wrap: wrap; }
  .ad-side.ad-active { display: none; }
}
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; }
  .nav { width: 100%; justify-content: flex-start; font-size: 13px; }
}
.how-panel {
  margin-top: 10px;
  background: rgba(8, 8, 14, 0.55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text);
}
.how-panel summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 14px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.6px;
}
.how-panel summary::-webkit-details-marker { display: none; }
.how-panel summary::after {
  content: " +";
  float: right;
  color: var(--muted);
}
.how-panel[open] {
  background: rgba(6, 6, 12, 0.78);
}
.how-panel[open] summary::after { content: " –"; }
.how-panel ol {
  margin: 0;
  padding: 0 16px 12px 32px;
  color: #d9d0be;
  font-size: 14px;
}
.how-panel .kvs { padding: 0 14px 12px; }

.cabinet {
  background: linear-gradient(180deg, #2a1c14, #140e0c 18%, #0c0a10 18%, #0c0a10 100%);
  border: 3px solid #4a3428;
  border-radius: 14px 14px 18px 18px;
  padding: 14px 16px 16px;
  box-shadow: 0 18px 0 #09070c, inset 0 0 0 2px #6a4a32;
  justify-self: center;
  max-width: 100%;
}
.cabinet:fullscreen,
.cabinet:-webkit-full-screen,
.cabinet.is-fs {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: #05040a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 16px;
}
.cabinet:fullscreen .screen,
.cabinet:-webkit-full-screen .screen,
.cabinet.is-fs .screen {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}
body.fs-lock { overflow: hidden; }
.cabinet-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  text-align: center;
  color: var(--gold);
  margin: 0 0 12px;
  letter-spacing: 1px;
}
.screen {
  position: relative;
  background: #000;
  border: 4px solid #222;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(92,255,210,.08);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 240px;
}
.screen canvas {
  display: block;
  width: auto;
  height: auto;
  margin: 0 auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  image-rendering: -moz-crisp-edges;
  background: #000;
}
.scan {
  pointer-events: none;
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.hud {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--ok);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.overlay {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0,0,0,.62);
  color: #fff;
  text-align: center;
  padding: 16px;
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.8;
  cursor: pointer;
}
.overlay .attract {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.38;
  image-rendering: pixelated;
  z-index: 0;
  pointer-events: none;
}
.overlay #overlay-text, .overlay button { position: relative; z-index: 1; }
.overlay.hidden { display: none; }
.overlay button, .btn {
  font-family: var(--font-pixel);
  font-size: 11px;
  background: var(--gold);
  color: #1a1008;
  border: 0;
  padding: 14px 18px;
  cursor: pointer;
  box-shadow: 0 3px 0 #7a5a20;
}
.overlay button:hover, .btn:hover { filter: brightness(1.08); }
.controls-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.controls-bar button {
  font-family: var(--font-ui);
  font-size: 13px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 6px;
}

.touch {
  display: none;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  user-select: none;
  touch-action: none;
}
@media (pointer: coarse), (max-width: 800px) {
  .touch { display: grid; }
}
.dpad {
  display: grid;
  grid-template-columns: 48px 48px 48px;
  grid-template-rows: 48px 48px 48px;
  gap: 4px;
  justify-content: start;
}
.dpad button, .act button {
  background: #2a2430;
  color: #fff;
  border: 1px solid #443c50;
  border-radius: 8px;
  font-size: 16px;
}
.dpad .u { grid-column: 2; grid-row: 1; }
.dpad .l { grid-column: 1; grid-row: 2; }
.dpad .r { grid-column: 3; grid-row: 2; }
.dpad .d { grid-column: 2; grid-row: 3; }
.act { display: flex; gap: 8px; }
.act button { width: 72px; height: 72px; border-radius: 50%; background: #7a2030; font-size: 11px; }

.side {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.side h2 { margin: 0 0 8px; font-size: 15px; }
.side ol, .side ul { margin: 0; padding-left: 18px; color: var(--muted); }
.kvs { font-size: 13px; color: var(--muted); }
.kvs b { color: var(--text); }

.prose {
  max-width: 760px;
  margin: 8px auto 40px;
  padding: 0 20px 40px;
}
.prose h1 { font-size: 28px; margin: 0 0 8px; }
.prose h2 { font-size: 20px; margin: 28px 0 8px; }
.prose p, .prose li { color: #d9d0be; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.faq details {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.faq summary { cursor: pointer; font-weight: 600; }

.related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.related a {
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
}
.related a:hover { border-color: var(--neon); text-decoration: none; }

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 20px 40px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.social {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.social a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--text);
  text-decoration: none;
}
.social a:hover { border-color: var(--neon); color: var(--neon); }
.section-label {
  max-width: 1100px;
  margin: 10px auto 0;
  padding: 0 20px;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--neon);
}
.section-label a { color: inherit; text-decoration: none; }
.section-label a:hover { color: #fff; }

.genre-head {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 0;
}

/* Ad slot ordering: leaderboard above the cabinet on desktop, below it on phones. */
@media (max-width: 900px) {
  .wrap.play .ad-slot[data-ad="gameTop"] { order: 9; }
}
