/* =============================================================
   ArcadeLab — Stylesheet
   Phase 02: Design System + Premium Home Experience
   (Phase 01 established the token baseline; this phase formalizes
   and extends it — see .claude/PROJECT-CONTEXT.md §5 for the full
   documented system and .claude/DECISIONS.md for rationale.)

   Design concept: arcade-cabinet materiality rather than generic
   "dark SaaS" styling — a warm, near-black cabinet body with
   backlit marquee-glow accent colors. Each game gets one identity
   color (gold / cyan / rose), used ONLY for that game's own
   elements — never repurposed as decoration elsewhere, so the
   color-coding keeps a consistent meaning across the site. Gold
   doubles as the studio's primary brand accent.

   Breakpoint scale (documented here since plain CSS media queries
   can't reference custom properties without a build step):
     640px  – container gutter increases
     800px  – about-grid / philosophy-grid become multi-column
     900px  – desktop nav appears + hero becomes two-column
   ============================================================= */

/* -------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------- */
:root {
  /* Color — cabinet body */
  --color-bg: #15120f;
  --color-surface: #1e1915;
  --color-surface-raised: #251f19;
  --color-border: rgba(255, 244, 230, 0.1);
  --color-border-strong: rgba(255, 244, 230, 0.18);

  /* Color — marquee glass (text) */
  --color-ink: #f4eee4;
  --color-ink-muted: #b0a493;
  --color-ink-faint: #8b8071;

  /* Color — marquee glow (accents). Gold is also the primary
     studio brand color; cyan and rose are reserved as per-game
     identity colors so they carry meaning, not decoration. */
  --color-gold: #e8a33d;
  --color-gold-ink: #1a1310;
  --color-cyan: #3fd4c7;
  --color-rose: #e8456f;

  /* Type */
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  /* Fluid type scale */
  --text-sm: clamp(0.85rem, 0.82rem + 0.15vw, 0.95rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --text-lg: clamp(1.15rem, 1.08rem + 0.35vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --text-2xl: clamp(2.1rem, 1.7rem + 2vw, 3.25rem);
  --text-3xl: clamp(2.4rem, 1.85rem + 2.6vw, 3.75rem);

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 7rem;

  /* Layout */
  --content-max: 1180px;
  --measure: 62ch;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-badge: 25%;

  /* Motion */
  --transition-fast: 150ms ease;
  --transition-base: 240ms cubic-bezier(0.2, 0.7, 0.3, 1);

  color-scheme: dark;
}

/* -------------------------------------------------------------
   2. Reset + base
   ------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  min-height: 100svh;
  overflow-x: hidden;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-ink);
}

p {
  max-width: var(--measure);
}

a {
  color: inherit;
}

ul {
  list-style: none;
  padding: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Visible keyboard focus everywhere — never suppressed without replacement */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link — hidden until focused */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-3) var(--space-5);
  background: var(--color-gold);
  color: var(--color-gold-ink);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

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

/* -------------------------------------------------------------
   3. Layout helpers
   ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

@media (min-width: 640px) {
  .container {
    padding-inline: var(--space-6);
  }
}

.section {
  padding-block: var(--space-8);
}

.section-head {
  max-width: 40rem;
  margin-bottom: var(--space-6);
}

.section-head p {
  color: var(--color-ink-muted);
  margin-top: var(--space-2);
}

/* -------------------------------------------------------------
   4. Buttons
   ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.85em 1.6em;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color var(--transition-fast),
    border-color var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-gold);
  color: var(--color-gold-ink);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #f2b455;
}

.btn-primary:active {
  background: color-mix(in srgb, var(--color-gold) 82%, black);
}

.btn-secondary {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-border-strong);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.btn-secondary:active {
  background: var(--color-surface);
}

/* -------------------------------------------------------------
   5. Site header / navigation
   ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(21, 18, 15, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--color-gold);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-ink);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
}

.nav-toggle:hover {
  border-color: var(--color-gold);
}

.nav-toggle:active {
  background: var(--color-surface);
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-ink);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.nav-toggle-icon {
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-list a {
  text-decoration: none;
  color: var(--color-ink-muted);
  font-weight: 500;
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--color-ink);
}

.nav-cta {
  display: none;
}

/* Mobile nav: collapsed panel under the header */
@media (max-width: 899px) {
  .site-nav {
    position: fixed;
    inset: 65px 0 0 0;
    height: calc(100svh - 65px);
    background: var(--color-bg);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: var(--space-6) var(--space-5);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-base), transform var(--transition-base),
      visibility var(--transition-base);
  }

  .site-nav[data-open="true"] {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
    width: 100%;
  }

  .nav-list a {
    display: block;
    width: 100%;
    padding: var(--space-4) 0;
    font-size: var(--text-lg);
    color: var(--color-ink);
    border-bottom: 1px solid var(--color-border);
  }

  .nav-cta {
    display: block;
    margin-top: var(--space-6);
    align-self: flex-start;
  }
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .nav-cta {
    display: inline-flex;
  }
}

/* -------------------------------------------------------------
   6. Hero
   ------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: var(--space-9) var(--space-8);
  overflow: hidden;
}

/* Ambient background glow — extended from a single gold blob (Phase 01)
   into a soft triptych using all three real game colors, foreshadowing
   the games showcase just below rather than decorating for its own sake. */
.hero-glow {
  position: absolute;
  top: -220px;
  left: 50%;
  width: 1100px;
  height: 900px;
  transform: translateX(-46%);
  background: radial-gradient(
      circle at 28% 30%,
      rgba(232, 163, 61, 0.22) 0%,
      rgba(232, 163, 61, 0.07) 35%,
      transparent 60%
    ),
    radial-gradient(
      circle at 62% 55%,
      rgba(63, 212, 199, 0.15) 0%,
      transparent 55%
    ),
    radial-gradient(
      circle at 82% 20%,
      rgba(232, 69, 111, 0.13) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.35fr 0.65fr;
  }
}

.hero-inner {
  max-width: 46rem;
  min-width: 0;
}

.hero-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-5);
  overflow-wrap: break-word;
}

.hero-lede {
  font-size: var(--text-lg);
  color: var(--color-ink-muted);
  margin-bottom: var(--space-6);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* Marquee visual — a studio-identity graphic, not gameplay art. Hidden
   below 900px on purpose: on a phone this space belongs to the headline
   and CTAs, not to decoration (ArcadeLab's games are primarily mobile). */
.hero-visual {
  display: none;
}

@media (min-width: 900px) {
  .hero-visual {
    display: block;
    max-width: 340px;
    justify-self: end;
  }
}

.hero-marquee {
  width: 100%;
  height: auto;
}

.marquee-face {
  fill: var(--color-surface-raised);
  stroke: var(--color-border-strong);
  stroke-width: 1.5;
}

.marquee-frame {
  fill: none;
  stroke: var(--color-border);
}

/* One deliberate load-in moment: each bar rises in turn (gold, cyan,
   rose — the same order the games are listed in below). The global
   prefers-reduced-motion rule above already collapses this to an
   instant, final-state render for anyone who has asked for less motion. */
.marquee-bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: marqueeRise 720ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: var(--bar-delay, 0ms);
}

.marquee-bar--gold {
  fill: var(--color-gold);
}

.marquee-bar--cyan {
  fill: var(--color-cyan);
}

.marquee-bar--rose {
  fill: var(--color-rose);
}

@keyframes marqueeRise {
  from {
    opacity: 0;
    transform: scaleY(0.35);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* -------------------------------------------------------------
   7. Game cards
   ------------------------------------------------------------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
}

.game-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--card-accent, var(--color-gold));
  border-radius: var(--radius-md);
  padding: var(--space-6) var(--space-5) var(--space-5);
  transition: background-color var(--transition-base),
    transform var(--transition-base), box-shadow var(--transition-base);
}

.game-card:hover,
.game-card:focus-within {
  background: var(--color-surface-raised);
  transform: translateY(-4px);
  box-shadow: 0 16px 34px -20px
    color-mix(in srgb, var(--card-accent) 60%, transparent);
}

.game-card--baghchal {
  --card-accent: var(--color-gold);
}

.game-card--neonpath {
  --card-accent: var(--color-cyan);
}

.game-card--chainnova {
  --card-accent: var(--color-rose);
}

.game-card-art {
  height: 140px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-5);
  background: repeating-linear-gradient(
      to bottom,
      rgba(244, 238, 228, 0.035) 0px,
      rgba(244, 238, 228, 0.035) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(
      circle at 25% 20%,
      color-mix(in srgb, var(--card-accent) 35%, transparent) 0%,
      transparent 55%
    ),
    linear-gradient(155deg, var(--color-surface-raised), var(--color-bg));
  display: flex;
  align-items: flex-end;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
}

.game-card-art span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--card-accent);
  opacity: 0.85;
}

.game-card h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.game-card p {
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

/* -------------------------------------------------------------
   8. About
   ------------------------------------------------------------- */
.about-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 800px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.about-body p {
  color: var(--color-ink-muted);
  margin-bottom: var(--space-4);
}

.about-body p:last-child {
  margin-bottom: 0;
}

.building-list {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-5);
}

.building-list h3 {
  font-size: var(--text-sm);
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-ink-faint);
  margin-bottom: var(--space-4);
}

.building-list ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.building-list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-block: var(--space-2);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
}

.building-list li:last-child {
  border-bottom: 0;
}

.building-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--dot-color, var(--color-gold));
}

/* -------------------------------------------------------------
   8b. Philosophy ("How we build") — Phase 02 addition
   Deliberately not color-coded gold/cyan/rose: those colors mean
   "this specific game" elsewhere on the site, and these three
   items are studio-wide values, not tied to any one title.
   ------------------------------------------------------------- */
.philosophy {
  margin-top: var(--space-8);
}

.philosophy h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-5);
}

.philosophy-grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 800px) {
  .philosophy-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.philosophy-item {
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-gold);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-5);
}

.philosophy-item-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
  color: var(--color-ink);
}

.philosophy-item p {
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

/* -------------------------------------------------------------
   9. Footer
   ------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-7);
  margin-top: var(--space-8);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.footer-brand .brand {
  margin-bottom: var(--space-3);
}

.footer-brand p {
  color: var(--color-ink-faint);
  font-size: var(--text-sm);
  max-width: 26rem;
}

.footer-nav {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.footer-nav a {
  text-decoration: none;
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--color-ink);
}

.footer-bottom {
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  color: var(--color-ink-faint);
  font-size: var(--text-sm);
}

/* -------------------------------------------------------------
   10. 404 page
   ------------------------------------------------------------- */
.error-page {
  min-height: 70svh;
  display: flex;
  align-items: center;
}

.error-page .container {
  text-align: left;
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 3rem + 4vw, 6rem);
  color: var(--color-gold);
  margin-bottom: var(--space-3);
}

.error-page h1 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.error-page p {
  color: var(--color-ink-muted);
  margin-bottom: var(--space-6);
}

/* -------------------------------------------------------------
   11. Badges / status labels (Phase 02 addition)
   A reusable primitive for the design system, per the Phase 02
   spec. NOT applied to the game cards above: real status
   (Available / In Development / Coming Soon) for Bagh Chal, Neon
   Path, and Chain Nova is still unconfirmed, and guessing one would
   risk stating something false (see .claude/DECISIONS.md #5). This
   is ready for Phase 03 once real per-game status data exists —
   use `.badge` alone for a neutral label, or with a color modifier
   to match a specific game's identity color.
   ------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3em 0.85em;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface-raised);
  color: var(--color-ink-muted);
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

.badge--gold {
  color: var(--color-gold);
  border-color: color-mix(in srgb, var(--color-gold) 45%, var(--color-border-strong));
}

.badge--cyan {
  color: var(--color-cyan);
  border-color: color-mix(in srgb, var(--color-cyan) 45%, var(--color-border-strong));
}

.badge--rose {
  /* Plain --color-rose is 4.28:1 on this background — below WCAG AA
     for small text. Lightened slightly toward white (verified at
     5.11:1) rather than introducing a separate hardcoded color. */
  color: color-mix(in srgb, var(--color-rose) 85%, white);
  border-color: color-mix(in srgb, var(--color-rose) 45%, var(--color-border-strong));
}

/* -------------------------------------------------------------
   12. Game catalog + cross-page nav (Phase 03)
   .game-card is now an <a> (was a plain <article>) so the whole
   card links to that game's page — on both the homepage teaser
   and the standalone /games/ catalog. Augments section 5's nav
   styling with a persistent "current page" indicator, and adds a
   generic page-title utility for standalone pages (catalog today;
   reusable for future standalone pages e.g. Phase 07/08).
   ------------------------------------------------------------- */
.nav-list a[aria-current="page"] {
  color: var(--color-ink);
}

.game-card {
  display: block;
  text-decoration: none;
}

.game-card-status {
  margin-bottom: var(--space-3);
}

.game-card-cta {
  display: inline-block;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink-faint);
  transition: color var(--transition-fast);
}

.game-card:hover .game-card-cta,
.game-card:focus-visible .game-card-cta {
  color: var(--card-accent);
}

.section-cta {
  margin-top: var(--space-6);
  text-align: center;
}

.page-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-3);
}

.page-lede {
  font-size: var(--text-lg);
  color: var(--color-ink-muted);
}

/* -------------------------------------------------------------
   13. Game detail pages (Phase 03)
   Per-game identity color is set inline as --card-accent on the
   <main class="game-page"> wrapper (same custom-property pattern
   already used for --dot-color on the homepage "Currently
   building" list), driven by games/data.php — the color mapping
   lives in one place (data.php's `accent` field), not hardcoded
   per game here.
   ------------------------------------------------------------- */
.game-hero {
  padding-block: var(--space-7) var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.game-hero-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  text-decoration: none;
  margin-bottom: var(--space-5);
  transition: color var(--transition-fast);
}

.game-hero-back:hover,
.game-hero-back:focus-visible {
  color: var(--color-ink);
}

.game-hero-grid {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 800px) {
  .game-hero-grid {
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
  }
}

.game-hero-title {
  font-size: var(--text-3xl);
  color: var(--card-accent, var(--color-ink));
  margin-bottom: var(--space-3);
}

.game-hero-tagline {
  font-size: var(--text-lg);
  color: var(--color-ink-muted);
  margin-bottom: var(--space-5);
}

.game-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.game-hero-genre {
  font-size: var(--text-sm);
  color: var(--color-ink-faint);
}

/* Phase 09: store/download CTA slot in the game hero (partials/game-cta.php).
   Only renders once a game has a real cta_url + cta_label. */
.game-hero-actions {
  margin-top: var(--space-5);
}

.game-hero-art {
  height: 220px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: flex-end;
  padding: var(--space-5);
  background: repeating-linear-gradient(
      to bottom,
      rgba(244, 238, 228, 0.035) 0px,
      rgba(244, 238, 228, 0.035) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(
      circle at 25% 20%,
      color-mix(in srgb, var(--card-accent) 35%, transparent) 0%,
      transparent 55%
    ),
    linear-gradient(155deg, var(--color-surface-raised), var(--color-bg));
}

.game-hero-art span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--card-accent);
  opacity: 0.85;
}

.game-overview p {
  color: var(--color-ink-muted);
  margin-bottom: var(--space-4);
}

.game-overview p:last-child {
  margin-bottom: 0;
}

.feature-grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 800px) {
  .feature-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

.feature-card {
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--card-accent, var(--color-gold));
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-5);
}

.feature-card h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}

.feature-card p {
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

.feature-empty {
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
  color: var(--color-ink-faint);
  font-size: var(--text-sm);
}

/* FAQ: native <details>/<summary> — keyboard- and AT-accessible
   with zero JS, in keeping with the project's minimal-JS approach.
   No accordion script needed. */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding-inline: var(--space-5);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: var(--text-lg);
  color: var(--card-accent, var(--color-gold));
  transition: transform var(--transition-base);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
  padding-bottom: var(--space-4);
}

.game-cross-links {
  margin-top: var(--space-2);
}

/* -------------------------------------------------------------
   14. Scroll-reveal animation (Phase 04)
   Generic: any element with [data-reveal] starts slightly faded and
   offset, then animates in once scrolled into view (see main.js).
   The global prefers-reduced-motion rule in §2 already collapses the
   transition below to ~instant for anyone who asked for less motion —
   nothing extra needed here for that case. Two separate safety nets
   guard against a [data-reveal] element getting stuck invisible if
   JS never runs at all: the <noscript> override in partials/header.php
   (JS fully disabled), and main.js itself revealing everything
   immediately if IntersectionObserver isn't supported.
   ------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------------------------------------------------
   15. Game gallery + lightbox (Phase 04)
   Mobile: horizontal scroll-snap row (encourages swiping to see
   there are more). ≥800px: a proper grid. Thumbnails are <button>s
   (they trigger an in-page dialog, not navigation) containing real
   <img>s with loading="lazy" and explicit width/height to prevent
   layout shift. The lightbox is a native <dialog> — showModal() gives
   focus-trapping and Escape-to-close for free, so gallery.js doesn't
   hand-roll either.
   ------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--space-2);
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 800px) {
  .gallery-grid {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, 1fr);
    overflow-x: visible;
  }
}

@media (min-width: 1100px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gallery-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: none;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform var(--transition-base), border-color var(--transition-base);
}

.gallery-thumb:hover,
.gallery-thumb:focus-visible {
  transform: translateY(-2px);
  border-color: var(--card-accent);
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.gallery-lightbox {
  margin: auto;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-ink);
  width: min(900px, 92vw);
  max-height: 90vh;
  padding: 0;
  position: relative;
  transition: opacity var(--transition-base);
}

.gallery-lightbox::backdrop {
  background: rgba(10, 8, 6, 0.85);
  backdrop-filter: blur(4px);
}

.gallery-lightbox img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(244, 238, 228, 0.25);
  border-radius: var(--radius-md);
  background: rgba(21, 18, 15, 0.65);
  color: var(--color-ink);
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.lightbox-close:hover,
.lightbox-close:focus-visible,
.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  background: rgba(21, 18, 15, 0.9);
  border-color: var(--card-accent, var(--color-gold));
}

.lightbox-close {
  top: var(--space-3);
  right: var(--space-3);
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: var(--space-3);
}

.lightbox-next {
  right: var(--space-3);
}

.lightbox-counter {
  text-align: center;
  padding: var(--space-3);
  margin: 0;
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

/* -------------------------------------------------------------
   16. Sticky contextual bar (Phase 04, game pages only)
   Pure CSS — position: sticky means it naturally has no on-screen
   presence until the page has scrolled to where it sits in normal
   flow (right after the hero), at which point it sticks below the
   site header. No scroll-listener JS needed for this.
   `top` matches the site header's rendered height — see §5's
   .site-header; measured via Playwright at 76px, not guessed.
   ------------------------------------------------------------- */
.game-sticky-bar {
  position: sticky;
  top: 76px;
  z-index: 40;
  background: rgba(30, 25, 21, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.game-sticky-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-2);
}

.game-sticky-bar-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--card-accent);
}

.game-sticky-bar-link {
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.game-sticky-bar-link:hover,
.game-sticky-bar-link:focus-visible {
  color: var(--color-ink);
}

/* -------------------------------------------------------------
   17. Updates / news (Phase 07)
   Follows the same card-grid + detail-page pattern as the game
   catalog/detail sections above, reusing .page-title/.page-lede/
   .section from the shared page conventions rather than duplicating
   them (see updates/index.php).

   The "sample entry" badge deliberately borrows --color-rose, which
   section 1 reserves for per-game identity — a documented, narrow
   exception: this badge exists specifically so a placeholder entry
   can never be mistaken for a real announcement, and visibility wins
   over palette discipline for that one job. It only ever appears on
   the placeholder entries in updates/data.php, not on genuine ones —
   see .claude/DECISIONS.md.
   ------------------------------------------------------------- */

.updates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-6);
}

.update-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.update-card:hover,
.update-card:focus-visible {
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
}

.update-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-ink-faint);
}

.update-card-category {
  font-weight: 600;
  color: var(--color-gold);
}

.update-card h3 {
  font-size: var(--text-lg);
  margin: 0;
}

.update-card p {
  color: var(--color-ink-muted);
  margin: 0;
}

.update-card-cta {
  margin-top: auto;
  padding-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink-faint);
  transition: color var(--transition-fast);
}

.update-card:hover .update-card-cta,
.update-card:focus-visible .update-card-cta {
  color: var(--color-gold);
}

.update-card-sample-badge,
.update-sample-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.3em 0.85em;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px dashed color-mix(in srgb, var(--color-rose) 55%, var(--color-border-strong));
  color: color-mix(in srgb, var(--color-rose) 85%, white);
  background: color-mix(in srgb, var(--color-rose) 12%, transparent);
}

.updates-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  margin-top: var(--space-7);
}

.updates-pagination a {
  font-weight: 600;
  color: var(--color-ink);
}

.updates-pagination a:hover,
.updates-pagination a:focus-visible {
  color: var(--color-gold);
}

.updates-pagination-status {
  color: var(--color-ink-faint);
  font-size: var(--text-sm);
}

/* Article detail page */
.update-detail {
  padding-block: var(--space-7);
}

.update-back-link {
  display: inline-block;
  margin-bottom: var(--space-5);
  color: var(--color-ink-faint);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

.update-back-link:hover,
.update-back-link:focus-visible {
  color: var(--color-gold);
}

.update-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-ink-faint);
  margin: var(--space-4) 0;
}

.update-category-badge {
  font-weight: 600;
  color: var(--color-gold);
}

.update-title {
  font-size: var(--text-2xl);
  max-width: var(--measure);
  margin-bottom: var(--space-6);
}

.update-body {
  max-width: var(--measure);
}

.update-body p {
  color: var(--color-ink-muted);
  margin-bottom: var(--space-4);
  line-height: 1.7;
}

.update-related {
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  max-width: var(--measure);
}

.update-related h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.update-related-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.update-related-link {
  padding: 0.5em 1.1em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  color: var(--color-ink);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.update-related-link:hover,
.update-related-link:focus-visible {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* -------------------------------------------------------------
   18. Contact, help + legal pages (Phase 08)
   Reuses the existing tokens and primitives (.section, .section-head,
   .page-title/.page-lede, .btn, .badge, .faq-list) — nothing here
   introduces a new color. The one per-game color use is the left
   border on .help-game rows, which reads --card-accent (set inline
   from games/data.php's `accent` field) exactly the way .game-card
   and .feature-card do, so it only ever marks that game's own row.
   Text colors stay on --color-ink / --color-ink-muted / gold; the
   --color-ink-faint token is used only on the page background, where
   its contrast was checked (see .claude/IMPLEMENTATION-LOG.md).
   ------------------------------------------------------------- */

/* Footer: the link row is now two stacked, separately-labelled <nav>
   groups (site pages / support + legal) — see partials/footer.php.
   A tighter row-gap than .footer-nav's default keeps a wrapped group
   (narrow phones) from looking loose. */
.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links .footer-nav {
  gap: var(--space-2) var(--space-5);
}

/* Buttons that JS reveals (e.g. "Copy address"): .btn sets
   display:inline-flex, which would otherwise override the hidden
   attribute's default display:none. */
.btn[hidden] {
  display: none;
}

/* A section that directly follows another one and shouldn't stack its
   own top padding on top of the previous section's bottom padding. */
.section--flush-top {
  padding-top: 0;
}

/* ---- Long-form reading text (privacy / terms) ---- */
.prose {
  max-width: var(--measure);
}

.prose h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-7);
  margin-bottom: var(--space-3);
}

.prose p,
.prose li {
  color: var(--color-ink-muted);
  line-height: 1.7;
}

.prose p {
  margin-bottom: var(--space-4);
}

.prose ul {
  list-style: disc;
  padding-left: var(--space-5);
  margin-bottom: var(--space-4);
}

.prose li {
  margin-bottom: var(--space-2);
}

.prose li::marker {
  color: var(--color-ink-faint);
}

/* :not(.btn) — a button placed inside prose (e.g. "Start a bug report"
   on /help/) must keep its own text color; without this, the link rule
   below (0,1,1) beats .btn-primary's color (0,1,0) and paints gold text
   on the gold button. */
.prose a:not(.btn) {
  color: var(--color-gold);
  text-underline-offset: 0.2em;
}

.prose a:not(.btn):hover,
.prose a:not(.btn):focus-visible {
  color: #f2b455;
}

.prose strong {
  color: var(--color-ink);
  font-weight: 600;
}

.legal-meta {
  color: var(--color-ink-faint);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

/* Shown on legal pages while their text is still a placeholder —
   dashed + neutral, the same "not final yet" treatment as
   .feature-empty above, so it needs no color exception. */
.draft-notice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  max-width: var(--measure);
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.draft-notice p {
  margin: 0;
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

.draft-notice strong {
  color: var(--color-ink);
  font-weight: 600;
}

.draft-notice a {
  color: var(--color-gold);
  text-underline-offset: 0.2em;
}

/* ---- Contact page ---- */
.contact-panel {
  max-width: 44rem;
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-gold);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.contact-panel-label {
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink-muted);
}

.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--color-ink);
  overflow-wrap: anywhere;
  text-decoration-color: var(--color-gold);
  text-underline-offset: 0.2em;
  transition: color var(--transition-fast);
}

.contact-email:hover,
.contact-email:focus-visible {
  color: var(--color-gold);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.contact-note {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
}

.contact-note a {
  color: var(--color-gold);
  text-underline-offset: 0.2em;
}

.contact-note a:hover,
.contact-note a:focus-visible {
  color: #f2b455;
}

.contact-topics {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-6);
}

@media (min-width: 800px) {
  .contact-topics {
    grid-template-columns: repeat(2, 1fr);
  }
}

.contact-topic {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.contact-topic h3 {
  font-size: var(--text-base);
}

.contact-topic p {
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

.contact-topic-link {
  margin-top: auto;
  padding-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-gold);
  text-underline-offset: 0.2em;
  transition: color var(--transition-fast);
}

.contact-topic-link:hover,
.contact-topic-link:focus-visible {
  color: #f2b455;
}

/* ---- Help page ---- */
/* Links inside FAQ answers (used on /help/) */
.faq-item p a {
  color: var(--color-gold);
  text-underline-offset: 0.2em;
}

.faq-item p a:hover,
.faq-item p a:focus-visible {
  color: #f2b455;
}

.help-games {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 44rem;
}

.help-game {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--card-accent, var(--color-gold));
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.help-game-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-ink);
}

.help-game-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
}

.help-game-links a {
  color: var(--color-ink-muted);
  text-underline-offset: 0.2em;
  transition: color var(--transition-fast);
}

.help-game-links a:hover,
.help-game-links a:focus-visible {
  color: var(--color-gold);
}
