:root {
  --bg: #0b1418;
  --panel: #12242a;
  --panel-2: #18313a;
  --ink: #f9f1e3;
  --muted: #b8ccd0;
  --line: rgba(184, 204, 208, 0.18);
  --line-strong: rgba(184, 204, 208, 0.34);
  --green: #6f7f45;
  --green-deep: #33452c;
  --red: #cc7352;
  --gold: #95afb9;
  --blue: #7d98a5;
  --sand: #fcebce;
  --shadow: rgba(0, 0, 0, 0.45);
  --font-nes: "Press Start 2P", "Courier New", monospace;
  --font-dialogue: "DotGothic16", "Courier New", monospace;
  --font-home-title: "Averia Serif Libre", Georgia, "Times New Roman", serif;
  --font-home-body: "TASA Explorer", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(125, 152, 165, 0.16), transparent 35%),
    linear-gradient(180deg, #13242a 0%, #0b1418 42%, #071014 100%);
  font-family: var(--font-dialogue);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.44), transparent 12%, transparent 88%, rgba(0, 0, 0, 0.44)),
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.06), transparent 2px),
    radial-gradient(circle at 80% 26%, rgba(255, 255, 255, 0.05), transparent 2px),
    radial-gradient(circle at 58% 10%, rgba(255, 255, 255, 0.05), transparent 1.5px);
  background-size: auto, 320px 320px, 360px 360px, 280px 280px;
  opacity: 0.7;
}

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

button {
  font: inherit;
  color: inherit;
}

body.home-page {
  --paper: #f6efdf;
  --paper-strong: #efe5cf;
  --paper-soft: #faf6ee;
  --home-ink: #2b2219;
  --home-muted: #665643;
  --home-line: rgba(67, 50, 33, 0.14);
  --home-line-strong: rgba(67, 50, 33, 0.24);
  --home-accent: #92653a;
  --home-accent-deep: #5c4127;
  --home-shadow: rgba(34, 24, 15, 0.08);
  color: var(--home-ink);
  background: var(--paper);
  font-family: var(--font-home-body);
}

body.home-page::before {
  content: none;
}

body.home-page img {
  max-width: 100%;
}

body.home-page .eyebrow {
  color: var(--home-accent);
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-home-body);
}

.home-shell {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 22px 0 54px;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(28px, 6vw, 72px);
}

.home-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.home-brand-mark {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(34, 24, 15, 0.12));
}

.home-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
}

.home-nav a {
  color: var(--home-muted);
  font-family: var(--font-home-body);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

.home-nav a:hover {
  color: var(--home-ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.94fr);
  gap: clamp(26px, 5vw, 60px);
  align-items: center;
}

.home-hero-copy {
  display: grid;
  gap: 18px;
}

.hero-wordmark {
  width: min(100%, 420px);
  height: auto;
}

body.home-page h1 {
  margin: 0;
  max-width: 820px;
  color: var(--home-ink);
  font-size: clamp(2.35rem, 5.6vw, 5.8rem);
  line-height: 1.02;
  letter-spacing: 0;
  font-family: var(--font-home-title);
  font-weight: 700;
  text-wrap: balance;
}

.home-hero-lead,
.vision-card p,
.home-section p,
.closing-band p,
.home-footer p {
  margin: 0;
  color: var(--home-muted);
  font-size: clamp(1.02rem, 1.75vw, 1.2rem);
  line-height: 1.62;
  font-family: var(--font-home-body);
}

.home-hero-actions,
.closing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 18px;
  border: 1px solid var(--home-line-strong);
  border-radius: 999px;
  color: var(--home-ink);
  font-family: var(--font-home-body);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.home-button.primary {
  background: var(--home-ink);
  color: var(--paper);
}

.home-button.secondary {
  background: transparent;
}

.home-note {
  color: var(--home-muted);
}

.home-hero-note {
  margin: 2px 0 0;
  color: var(--home-muted);
  font-size: 0.94rem;
  line-height: 1.55;
  font-family: var(--font-home-body);
}

.home-hero-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.home-hero-card {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--home-line);
  border-radius: 12px;
  background: var(--paper-soft);
  box-shadow: 0 16px 34px var(--home-shadow);
}

.home-hero-card:nth-child(2),
.home-hero-card:nth-child(5) {
  transform: translateY(18px);
}

.home-hero-card:nth-child(3),
.home-hero-card:nth-child(6) {
  transform: translateY(6px);
}

.home-hero-card img {
  width: 100%;
  height: 100%;
  aspect-ratio: 0.82;
  object-fit: cover;
  border-radius: 8px;
}

.vision-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(30px, 7vw, 76px);
}

.vision-card,
.home-section,
.closing-band {
  border: 1px solid var(--home-line);
  border-radius: 20px;
  background: var(--paper-soft);
  box-shadow: 0 16px 34px var(--home-shadow);
}

.vision-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: clamp(20px, 3vw, 28px);
}

.vision-card h2,
.section-head h2,
.closing-band h2 {
  margin: 0 0 10px;
  color: var(--home-ink);
  font-size: clamp(1.15rem, 1.9vw, 1.6rem);
  line-height: 1.18;
  font-family: var(--font-home-title);
  font-weight: 700;
}

.home-section {
  display: grid;
  gap: 18px;
  margin-top: 16px;
  padding: clamp(24px, 4vw, 42px);
}

.section-head {
  display: grid;
  gap: 8px;
}

.section-body {
  display: grid;
  gap: 14px;
  max-width: 880px;
}

.compact-section {
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  align-items: start;
}

.home-section > .home-button {
  justify-self: start;
}

.closing-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-top: 16px;
  padding: clamp(22px, 4vw, 34px);
}

.closing-actions {
  justify-content: flex-end;
}

.home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding: 0 4px;
  color: var(--home-muted);
  font-family: var(--font-home-body);
  font-size: 0.82rem;
}

body.home-page .home-footer p {
  font-size: 0.82rem;
  line-height: 1.5;
}

.home-footer p:last-child {
  text-align: right;
}

.app {
  width: min(1220px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.marketing-page {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.marketing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(34px, 7vw, 82px);
}

.marketing-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-nes);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.marketing-nav nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
}

.marketing-nav nav a {
  color: var(--muted);
  font-family: var(--font-nes);
  font-size: clamp(0.52rem, 1.2vw, 0.68rem);
  line-height: 1.8;
  text-decoration: none;
  text-transform: uppercase;
}

.marketing-nav nav a:hover {
  color: var(--red);
}

.marketing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: clamp(26px, 5vw, 68px);
  align-items: center;
}

.hero-copy {
  display: grid;
  gap: 20px;
}

.hero-copy h1 {
  margin: 0;
  max-width: 820px;
  color: var(--ink);
  font-family: var(--font-nes);
  font-size: clamp(2.25rem, 6vw, 5.8rem);
  line-height: 1.04;
  letter-spacing: -0.08em;
  text-transform: uppercase;
  text-wrap: balance;
}

.hero-copy p:not(.eyebrow),
.ecosystem-panel p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.18rem, 2vw, 1.55rem);
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.primary-cta,
.secondary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 18px;
  border-radius: 999px;
  font-family: var(--font-nes);
  font-size: 0.64rem;
  line-height: 1.6;
  text-decoration: none;
  text-transform: uppercase;
}

.primary-cta {
  color: #071014;
  background: linear-gradient(180deg, #fcebce, #95afb9);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

.secondary-cta {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: rgba(18, 36, 42, 0.74);
}

.hero-cartridge {
  display: grid;
  gap: 14px;
  padding: clamp(12px, 2vw, 18px);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(149, 175, 185, 0.2), transparent 42%),
    rgba(18, 36, 42, 0.82);
  box-shadow:
    0 24px 58px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: #fcebce;
  font-family: var(--font-nes);
  font-size: 0.64rem;
  line-height: 1.7;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.hero-cartridge img {
  width: 100%;
  border-radius: 18px;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
}

.marketing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(42px, 8vw, 92px);
}

.marketing-grid article,
.ecosystem-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(24, 49, 58, 0.88), rgba(8, 20, 24, 0.94)),
    radial-gradient(circle at 20% 0%, rgba(204, 115, 82, 0.13), transparent 38%);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
}

.marketing-grid article {
  min-height: 220px;
  padding: 20px;
}

.marketing-grid span {
  color: var(--gold);
  font-family: var(--font-nes);
  font-size: 0.62rem;
}

.marketing-grid h2,
.ecosystem-panel h2 {
  margin: 18px 0 10px;
  color: var(--ink);
  font-family: var(--font-nes);
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  line-height: 1.22;
  text-transform: uppercase;
}

.marketing-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.42;
}

.ecosystem-panel {
  margin-top: 16px;
  padding: clamp(24px, 4vw, 42px);
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.32));
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: var(--font-nes);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
  font-family: var(--font-nes);
}

.game-shell {
  display: grid;
  gap: 14px;
}

.stage-frame {
  position: relative;
  width: min(85vh, 85vw, 100%);
  margin: 0 auto;
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(18, 36, 42, 0.9), rgba(7, 16, 20, 0.98)),
    radial-gradient(circle at center, rgba(125, 152, 165, 0.26), transparent 48%);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.52),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
}

.mute-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(184, 204, 208, 0.24);
  background: rgba(7, 16, 20, 0.55);
  color: #f5bf3f;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0.7;
  touch-action: manipulation;
}
.mute-btn:hover { opacity: 1; }
.mute-btn.muted { color: #67767c; }

.stage-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: end center;
  padding: 10px;
}

.story-card {
  width: min(80%, 640px);
  padding: 20px 22px 18px;
  border: 1px solid rgba(184, 204, 208, 0.24);
  border-radius: 16px;
  background: rgba(7, 16, 20, 0.84);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  text-align: center;
  font-family: var(--font-dialogue);
}

/* The chapter/verse citation is NOT shown on screen — it's recorded in the
   player's Scrollbook as they read/collect. Only the words appear in-world. */
.story-chapter {
  display: none;
}

.story-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 0.95;
  text-transform: uppercase;
  font-family: var(--font-dialogue);
  font-weight: 400;
}

.story-card p {
  margin: 0;
  color: #f9f1e3;
  font-size: 1.15rem;
  line-height: 1.5;
  font-family: var(--font-dialogue);
}

.story-card .story-foot {
  margin-top: 10px;
  color: var(--gold);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-nes);
}

.story-card[data-mode="intro-field"] {
  opacity: 0;
  pointer-events: none;
}

/* Pokémon-style dialogue bar: full width, locked flush across the bottom of
   the stage, ~30% smaller text than before. */
.story-card[data-mode="garden-dialogue"] {
  align-self: end;
  width: 100%;
  max-width: none;
  margin-bottom: 0;
  padding: 10px 14px 9px;
  border: 3px solid #f2f0e8;
  border-radius: 10px;
  outline: 2px solid #151515;
  background: #070707;
  box-shadow:
    inset 0 0 0 2px #3e3e3e,
    0 8px 0 rgba(0, 0, 0, 0.28);
  text-align: left;
}

.story-card[data-mode="garden-dialogue"] .story-chapter {
  margin-bottom: 5px;
  color: #95afb9;
  font-size: clamp(0.36rem, 0.95vw, 0.48rem);
  line-height: 1.6;
}

.story-card[data-mode="garden-dialogue"] h2 {
  margin-bottom: 4px;
  color: #f9f1e3;
  font-size: clamp(0.78rem, 1.75vw, 1.2rem);
  line-height: 1.05;
  text-transform: none;
}

.story-card[data-mode="garden-dialogue"] p {
  color: #f9f1e3;
  font-size: clamp(0.95rem, 2.1vw, 1.26rem);
  line-height: 1.45;
}

.story-card[data-mode="garden-dialogue"] .story-foot {
  margin-top: 6px;
  color: #9edaf0;
  font-size: clamp(0.36rem, 0.95vw, 0.46rem);
  line-height: 1.6;
}

.story-card[data-mode="cutscene"] {
  background: rgba(4, 3, 2, 0.86);
  border-color: rgba(195, 58, 47, 0.35);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.42);
}

.story-card[data-mode="cutscene"] .story-chapter,
.story-card[data-mode="cutscene"] .story-foot {
  color: #f18c84;
}

.story-card[data-mode="cutscene"] h2,
.story-card[data-mode="cutscene"] p {
  color: #ffd0c9;
}

.hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(85vh, 85vw, 100%);
  margin: 0 auto;
}

/* Touch-only hint hidden on desktop; desktop hint hidden on touch */
.hud-note.touch-hint {
  display: none;
}

.hud-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 36, 42, 0.78);
  color: var(--muted);
  font-size: 0.78rem;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.22);
  font-family: var(--font-nes);
}

.hud-note.right {
  margin-left: auto;
}

.pill {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--green);
  color: #f7f1e4;
  font-weight: 900;
  line-height: 1;
  font-family: var(--font-nes);
}

.pill.alt {
  background: var(--red);
}

.pill.key {
  width: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.6rem;
}

/* On-screen gameboy controls: hidden by default (desktop uses the keyboard);
   re-enabled for touch devices in the media query below. */
.controls {
  display: none;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  width: min(85vh, 92vw, 100%);
  margin: 6px auto 0;
}

/* Show the on-screen controls on touch devices OR any narrow screen, so mobile
   (and narrow windows) always get thumb controls. */
@media (hover: none) and (pointer: coarse), (max-width: 820px) {
  .controls { display: grid; }
  .hud-note.desktop-hint { display: none; }
}

/* ── Mobile-first game layout ──────────────────────────────────────────────
   Fill the screen with the game, trim the chrome, keep controls in thumb reach. */
@media (max-width: 820px) {
  .app { width: 100%; padding: 8px 0 12px; }
  .topbar { padding: 0 12px; margin-bottom: 8px; }
  .topbar h1 { font-size: clamp(0.9rem, 4.4vw, 1.3rem); }
  .brand-mark { width: 30px; height: 30px; }
  .eyebrow { font-size: 0.62rem; }
  .game-shell { gap: 8px; }
  /* Game fills the width; leave room below for the control bar. */
  .stage-frame { width: min(96vw, 62vh); border-radius: 14px; }
  .hud-row { display: none; }
  .controls {
    width: min(96vw, 100%);
    padding: 0 10px;
    gap: 12px;
  }
  .dpad { grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(3, 58px); gap: 7px; }
  .dpad button { font-size: 1.15rem; }
  .actions button { width: 70px; height: 70px; font-size: 1.2rem; }
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 54px);
  grid-template-rows: repeat(3, 54px);
  gap: 8px;
  justify-content: start;
}

.dpad button,
.actions button,
.start-cover {
  border: 1px solid rgba(184, 204, 208, 0.24);
  background:
    linear-gradient(180deg, rgba(24, 49, 58, 0.98), rgba(7, 16, 20, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 22px rgba(0, 0, 0, 0.34);
}

.dpad button {
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  font-family: var(--font-nes);
}

.dpad button:active,
.actions button:active,
.start-cover:active {
  transform: translateY(1px);
}

.dpad button[data-input="up"] {
  grid-column: 2;
  grid-row: 1;
}

.dpad button[data-input="left"] {
  grid-column: 1;
  grid-row: 2;
}

.dpad button[data-input="down"] {
  grid-column: 2;
  grid-row: 3;
}

.dpad button[data-input="right"] {
  grid-column: 3;
  grid-row: 2;
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
}

.actions button {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  touch-action: manipulation;
  font-family: var(--font-nes);
}

.action.a {
  color: #fef4df;
  background:
    radial-gradient(circle at 28% 26%, rgba(255, 255, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #7d98a5, #18313a);
}

.action.b {
  color: #fff3ee;
  background:
    radial-gradient(circle at 28% 26%, rgba(255, 255, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #cc7352, #6b2f27);
}

.legend {
  width: min(85vh, 85vw, 100%);
  margin: 14px auto 0;
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  font-family: var(--font-dialogue);
}

.legend p {
  margin: 0;
}

.frame {
  position: fixed;
  top: 0;
  bottom: 0;
  width: min(11vw, 148px);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 12px;
  opacity: 0.2;
  mix-blend-mode: screen;
}

.frame-left {
  left: 0;
  align-items: flex-start;
}

.frame-right {
  right: 0;
  align-items: flex-end;
}

.frame img {
  width: min(88px, 100%);
  height: auto;
  object-fit: contain;
  filter: saturate(0.7) brightness(0.95);
}

.frame-left img:last-child,
.frame-right img:first-child {
  opacity: 0.4;
}

.start-cover {
  position: fixed;
  inset: 0;
  z-index: 200;            /* above the HUD, controls, everything */
  display: flex;
  flex-direction: column;
  justify-content: center;
  place-items: center;
  gap: 18px;
  padding: clamp(18px, 4vw, 40px);
  border: 0;
  border-radius: 0;
  /* Fully opaque so nothing behind shows through (was see-through on mobile). */
  background:
    radial-gradient(circle at 50% 42%, rgba(125, 152, 165, 0.22), transparent 30%),
    #0a1216;
  cursor: pointer;
  touch-action: manipulation;
}

.title-screen-art {
  width: min(92vw, 1180px);
  max-height: 74vh;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.32));
}

.start-copy {
  display: grid;
  gap: 6px;
  text-align: center;
}

.start-copy span {
  color: var(--ink);
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: startPulse 1.35s steps(2, end) infinite;
  font-family: var(--font-nes);
}

.start-copy small {
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-nes);
}

.start-cover.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.start-cover.is-hidden .title-screen-art,
.start-cover.is-hidden .start-copy {
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 180ms ease, transform 220ms ease;
}

@keyframes startPulse {
  0%,
  48% {
    opacity: 1;
  }
  49%,
  100% {
    opacity: 0.35;
  }
}

@media (max-width: 980px) {
  .home-shell {
    width: min(100vw, 100%);
    padding: 16px 16px 44px;
  }

  .home-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .vision-grid {
    grid-template-columns: 1fr;
  }

  .closing-band {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .compact-section {
    grid-template-columns: 1fr;
  }

  .closing-actions {
    justify-content: flex-start;
  }

  .home-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-footer p:last-child {
    text-align: left;
  }

  .app {
    width: min(100vw, 100%);
    padding: 14px 14px 26px;
  }

  .marketing-page {
    width: min(100vw, 100%);
    padding: 16px 16px 44px;
  }

  .marketing-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .marketing-hero {
    grid-template-columns: 1fr;
  }

  .marketing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    flex-direction: column;
    align-items: start;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .actions {
    justify-self: center;
  }

  .hud-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hud-note.right {
    margin-left: 0;
  }

  .frame {
    display: none;
  }
}

@media (max-width: 640px) {
  .home-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  body.home-page h1 {
    font-size: clamp(2rem, 11vw, 3.2rem);
  }

  .home-hero-actions,
  .closing-actions {
    width: 100%;
    flex-direction: column;
  }

  .home-button {
    width: 100%;
  }

  .home-hero-gallery {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(72vw, 1fr);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding-bottom: 8px;
  }

  .home-hero-card {
    scroll-snap-align: start;
  }

  .home-hero-card:nth-child(2),
  .home-hero-card:nth-child(5),
  .home-hero-card:nth-child(3),
  .home-hero-card:nth-child(6) {
    transform: none;
  }

  .marketing-nav nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .hero-copy h1 {
    font-size: clamp(2rem, 12vw, 3.25rem);
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-cta,
  .secondary-cta {
    width: 100%;
  }

  .marketing-grid {
    grid-template-columns: 1fr;
  }

  .stage-frame {
    border-radius: 16px;
  }

  .story-card {
    width: min(96%, 360px);
    padding: 14px;
    border-radius: 12px;
  }

  .story-card p {
    font-size: 0.92rem;
  }

  .story-card[data-mode="garden-dialogue"] {
    width: min(98%, 430px);
    margin-bottom: 2px;
    padding: 12px 13px 11px;
    border-width: 3px;
  }

  .dpad {
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(3, 48px);
    gap: 7px;
  }

  .actions button {
    width: 70px;
    height: 70px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .start-cover,
  .dpad button,
  .actions button {
    transition: none !important;
  }
}
