@font-face {
  font-family: "Press Start 2P";
  src: url("/assets/press-start-2p-latin-400.afec86997f.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #0d1020;
  --bg-2: #111530;
  --surface: #171c38;
  --surface-2: #1f2547;
  --text: #eef1ff;
  --muted: #b4bcdf;
  --border: #2d3462;
  --yellow: #ffcf33;
  --yellow-dark: #c79a00;
  --pink: #ff7aa2;
  --red: #ff5b4a;
  --sky: #7cc8ff;
  --link: #8fd3ff;
  --focus: #ffcf33;
  --player-bg: #000;
  --radius: 14px;
  --radius-s: 10px;
  --main-max: 880px;
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -120px, rgba(124, 200, 255, 0.14), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4.6vw, 2.6rem); margin: 0.3em 0 0.25em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); margin: 2em 0 0.55em; }
h3 { font-size: 1.12rem; margin: 1.4em 0 0.4em; }
p, ul, ol, dl { margin: 0 0 1em; }
strong { color: #fff; }
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2em; padding: 0.1em 0.5em;
  border: 1px solid #4a5390; border-bottom-width: 3px; border-radius: 6px;
  background: #262d58; color: #fff;
  font: 600 0.85em/1.4 ui-monospace, Consolas, monospace;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--yellow); color: #111; padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { left: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 22px;
  border: 0; border-radius: 999px;
  font: 700 1rem/1.1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 0.08s ease, background-color 0.15s ease, box-shadow 0.08s ease;
}
.btn-primary { background: var(--yellow); color: #14162a; box-shadow: 0 4px 0 var(--yellow-dark); }
.btn-primary:hover { background: #ffdc66; color: #14162a; }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--yellow-dark); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: #283060; }
.btn-small { min-height: 40px; padding: 8px 16px; font-size: 0.95rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 16, 32, 0.88);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1240px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand-mark {
  font: 1rem/1 var(--pixel); color: var(--yellow);
  text-shadow: 2px 2px 0 #c2185b;
  letter-spacing: 0.04em;
}
.brand-sub { font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.main-nav { margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.main-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--muted); text-decoration: none; border-radius: 8px; font-weight: 600; font-size: 0.95rem; white-space: nowrap;
}
.main-nav a:hover { color: var(--text); background: var(--surface); }
.main-nav a[aria-current="page"] { color: var(--yellow); }
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; row-gap: 0; padding-block: 6px; }
  .header-cta { min-height: 38px; padding: 6px 14px; font-size: 0.9rem; box-shadow: 0 3px 0 var(--yellow-dark); }
  .hero { padding-top: 10px; }
  .eyebrow { font-size: 0.55rem; }
  .badges li { font-size: 0.8rem; padding: 4px 10px; }
  .lede { font-size: 1rem; }
  .header-cta { margin-left: auto; }
  .main-nav { order: 3; width: 100%; margin: 0 -4px; }
  .main-nav a { min-height: 40px; padding: 0 10px; }
  .brand-sub { display: none; }
}

/* ---------- Page grid with ad rails ---------- */
.page-grid { max-width: calc(var(--main-max) + 32px); margin: 0 auto; padding: 0 16px; }
.rail { display: none; }
@media (min-width: 1200px) {
  .page-grid.has-rails {
    max-width: none;
    display: grid;
    grid-template-columns: 160px minmax(0, var(--main-max)) 160px;
    justify-content: center;
    gap: 28px;
  }
  .has-rails .rail { display: block; padding-top: 24px; }
  .rails-sticky .rail > .ad-slot { position: sticky; top: 84px; }
}
@media (min-width: 1500px) {
  .page-grid.has-rails { grid-template-columns: 300px minmax(0, var(--main-max)) 300px; gap: 32px; }
}
.main { min-width: 0; padding-bottom: 24px; }

/* ---------- Hero ---------- */
.hero { padding-top: 20px; }
.eyebrow { margin: 0; font: 0.62rem/1.6 var(--pixel); color: var(--pink); letter-spacing: 0.06em; text-transform: uppercase; }
.hero h1 .h1-sub { display: block; font-size: 0.55em; font-weight: 600; color: var(--muted); margin-top: 0.35em; letter-spacing: 0; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 66ch; }
.hero h1 { margin-bottom: 0; }
.hero-meta { margin-top: 18px; }
.hero-meta .lede { margin-bottom: 0; }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0 0; }
.badges li {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.88rem; font-weight: 600; color: var(--text);
}
.badges li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }

/* ---------- Player ---------- */
.player-card {
  /* Keep the whole player + toolbar inside the viewport on desktop. */
  max-width: max(520px, calc((100vh - 250px) * 4 / 3));
  margin: 16px auto 8px;
  padding: 10px;
  background: linear-gradient(180deg, #232a55, #151a36);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.player {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;            /* reserves space: no layout shift while loading */
  background: var(--player-bg);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 700px) and (orientation: portrait) {
  .player-card { max-width: none; padding: 6px; }
  /* Taller frame on portrait phones so the on-screen gamepad sits below the picture. */
  .player { aspect-ratio: 3 / 4; }
}
.player-screen { position: absolute; inset: 0; }
.player-facade { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; cursor: pointer; background: #000; }
.facade-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  image-rendering: pixelated; filter: saturate(1.1) brightness(0.5);
}
.facade-touch { display: none; margin: 0; font-size: 0.85rem; color: #9aa3cc; }
@media (max-width: 700px) and (orientation: portrait) {
  .facade-img { object-fit: contain; object-position: top; filter: saturate(1.1) brightness(0.75); }
  /* Play button sits in the lower black area, where the touch controls will appear. */
  .player-facade { place-items: end center; }
  .facade-overlay { width: 100%; padding-bottom: 12%; }
  .facade-touch { display: block; }
}
.facade-overlay {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 18px; text-align: center;
}
.play-button {
  min-height: 64px; padding: 14px 34px; font-size: 1.3rem;
  box-shadow: 0 6px 0 var(--yellow-dark), 0 0 0 8px rgba(255, 207, 51, 0.18), 0 12px 30px rgba(0, 0, 0, 0.5);
}
.play-button:active { box-shadow: 0 2px 0 var(--yellow-dark), 0 0 0 8px rgba(255, 207, 51, 0.18); }
@media (prefers-reduced-motion: no-preference) {
  .play-button { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes pulse {
    0%, 100% { box-shadow: 0 6px 0 var(--yellow-dark), 0 0 0 8px rgba(255, 207, 51, 0.18), 0 12px 30px rgba(0, 0, 0, 0.5); }
    50% { box-shadow: 0 6px 0 var(--yellow-dark), 0 0 0 16px rgba(255, 207, 51, 0.06), 0 12px 30px rgba(0, 0, 0, 0.5); }
  }
}
.facade-meta { margin: 0; font-size: 0.9rem; color: #dfe4ff; text-shadow: 0 1px 3px #000; }
.facade-keys { margin: 0; font-size: 0.85rem; color: #c9d0f0; }
@media (pointer: coarse) { .facade-keys { display: none; } }

.player-tip {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100% - 24px);
  padding: 8px 8px 8px 14px; border-radius: 12px;
  background: rgba(13, 16, 32, 0.92); border: 1px solid #3a4380;
  font-size: 0.92rem; color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.player-tip button {
  min-height: 36px; padding: 4px 12px; border-radius: 8px; border: 0;
  background: var(--yellow); color: #14162a; font: 700 0.85rem var(--sans); cursor: pointer;
}
.player-status {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3;
  padding: 12px 16px; border-radius: 10px;
  background: rgba(13, 16, 32, 0.94); color: #fff; font-size: 0.95rem; border: 1px solid #3a4380;
}
.player-status.is-error { background: #6d1424; border-color: #b33a4f; }
.player:fullscreen { aspect-ratio: auto; border-radius: 0; }

.player-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 4px 2px;
}
.player-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.key-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; font-size: 0.88rem; color: var(--muted); }
.key-legend li { display: inline-flex; align-items: center; gap: 6px; }
@media (pointer: coarse) { .key-legend { display: none; } }
@media (max-width: 520px) {
  .player-actions { width: 100%; }
  .player-actions .btn { flex: 1 1 0; padding: 8px 10px; }
}

/* ---------- Ads ---------- */
.ad-slot { margin: 28px auto; text-align: center; max-width: 100%; }
.ad-label { margin: 0 0 6px; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: #8a93bd; }
.ad-body { min-height: 100px; }
.ad-below-game { margin-top: 32px; }               /* clear gap from the player buttons */
.ad-below-game .ad-body { min-height: 90px; }
.ad-in-content .ad-body { min-height: 250px; }
.rail .ad-slot { margin: 0; }
.rail .ad-body { min-height: 600px; }
.ad-preview .ad-body {
  display: grid; place-items: center; padding: 12px;
  border: 2px dashed #4a5390; border-radius: 10px; background: repeating-linear-gradient(45deg, #151a36 0 12px, #181e3d 12px 24px);
  color: #8a93bd; font: 0.8rem/1.6 ui-monospace, Consolas, monospace;
}

/* ---------- Content ---------- */
.toc {
  margin: 24px 0; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.toc-title { margin: 0 0 8px; font: 0.62rem/1.6 var(--pixel); color: var(--yellow); text-transform: uppercase; letter-spacing: 0.06em; }
.toc ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 18px; }
.toc a { display: block; padding: 6px 0; text-decoration: none; color: var(--text); font-weight: 600; font-size: 0.95rem; }
.toc a::before { content: "\25B8"; color: var(--pink); margin-right: 8px; }
.toc a:hover { color: var(--yellow); }

.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 0; margin: 20px 0; }
.steps li {
  counter-increment: step; position: relative; padding: 16px 16px 16px 60px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 14px;
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
  background: var(--pink); color: #14162a; font: 0.8rem var(--pixel);
}
.steps strong { display: block; }
.steps span { color: var(--muted); font-size: 0.93rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 16px 0 20px; }
.info-card { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.info-card h3 { margin: 0 0 6px; font-size: 1.02rem; color: var(--yellow); }
.info-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.table-scroll { overflow-x: auto; margin: 8px 0 18px; border-radius: var(--radius-s); border: 1px solid var(--border); }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
thead th { background: var(--surface-2); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

.shot { margin: 20px 0 24px; }
.shot img { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--border); image-rendering: pixelated; background: #000; }
.shot figcaption { margin-top: 8px; font-size: 0.9rem; color: var(--muted); }

.cta-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  margin: 28px 0; padding: 18px 20px;
  background: linear-gradient(120deg, #2a2160, #1b2a5c);
  border: 1px solid #4a3f9a; border-radius: var(--radius);
}
.cta-title { margin: 0; font-weight: 800; font-size: 1.15rem; }
.cta-sub { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; }

.callout { padding: 14px 18px; border-left: 4px solid var(--sky); background: var(--surface); border-radius: 0 var(--radius-s) var(--radius-s) 0; margin: 16px 0; }
.callout p:last-child { margin: 0; }

.trouble dt { font-weight: 700; margin-top: 14px; }
.trouble dd { margin: 4px 0 0; color: var(--muted); }
details { border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface); margin: 8px 0; }
details[open] { background: var(--surface-2); }
summary { cursor: pointer; padding: 14px 16px; font-weight: 700; min-height: 48px; list-style-position: outside; }
summary:hover { color: var(--yellow); }
details p { margin: 0; padding: 0 16px 14px; color: var(--muted); }

.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 18px 0 0; font-size: 0.88rem; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: #5a6399; }
.page-head { padding-top: 4px; }
.page-head .btn { margin-top: 6px; }

.related { margin-top: 40px; }
.related-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 0; }
.related-card {
  position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 16px 44px 16px 18px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.related-card:hover { border-color: var(--yellow); transform: translateY(-2px); }
.related-name { font-weight: 800; }
.related-text { color: var(--muted); font-size: 0.92rem; }
.related-go { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--yellow); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 32px; padding: 36px 0 28px; background: var(--bg-2); border-top: 1px solid var(--border); color: var(--muted); font-size: 0.92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 24px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } .footer-brand { grid-column: 1 / -1; } }
.footer-title { margin: 0 0 8px; font: 0.6rem/1.6 var(--pixel); color: var(--yellow); text-transform: uppercase; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col a { display: inline-block; padding: 5px 0; color: var(--text); text-decoration: none; }
.footer-col a:hover { color: var(--yellow); text-decoration: underline; }
.footer-legal { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 0.82rem; }
.footer-legal a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
