:root {
  color-scheme: dark;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --bg: #0d0a18;
  --panel: #19152b;
  --panel-2: #251e3f;
  --ink: #fff7d6;
  --muted: #c9bedf;
  --line: #5e4d83;
  --accent: #ffe066;
  --accent-2: #87f0d0;
  --danger: #ff8a8a;
  background: var(--bg);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% -10%, #32245c 0, transparent 38rem),
    var(--bg);
  background-size: 16px 16px, 16px 16px, auto, auto;
}

a, button { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }

.world-shell {
  width: min(calc(100% - 1.2rem), 66rem);
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 0 max(1.5rem, env(safe-area-inset-bottom));
}

.hero,
.section-block {
  position: relative;
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 #000;
  background: var(--panel);
}

.hero {
  padding: clamp(1.15rem, 4vw, 2.5rem);
  overflow: hidden;
}

.hero::after {
  content: "★";
  position: absolute;
  right: clamp(0.8rem, 4vw, 2.4rem);
  top: clamp(0.8rem, 3vw, 1.8rem);
  color: var(--accent);
  font-size: clamp(2.5rem, 10vw, 6rem);
  text-shadow: 5px 5px 0 #000;
  transform: rotate(8deg);
}

.pixel-kicker,
.platform,
.world-footer {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 900;
}

.pixel-kicker {
  margin: 0 0 0.6rem;
  color: var(--accent-2);
  font-size: 0.72rem;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 13ch;
  margin-bottom: 0.8rem;
  font-size: clamp(2.35rem, 8vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
  text-wrap: balance;
}
h2 { margin-bottom: 0; font-size: clamp(1.65rem, 5vw, 2.7rem); }
h3 { margin-bottom: 0.6rem; font-size: 1.25rem; }

.hero-copy,
.install-intro {
  max-width: 48rem;
  color: var(--muted);
  line-height: 1.65;
}
.hero-copy { margin-bottom: 1.1rem; padding-right: min(18vw, 8rem); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.pixel-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.85rem;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--panel-2);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 4px 4px 0 #000;
  touch-action: manipulation;
}
.pixel-button.primary { background: var(--accent); color: #17120b; }
.pixel-button:hover, .pixel-button:focus-visible { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #000; }
.pixel-button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }

.connection {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}
.connection[data-offline-ready="true"] { color: var(--accent-2); }
.connection[data-warning="true"] { color: var(--danger); }

.section-block {
  margin-top: 1.25rem;
  padding: clamp(1rem, 3vw, 1.7rem);
}
.section-heading { margin-bottom: 1rem; }

.game-grid,
.install-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.game-card,
.install-card {
  border: 3px solid var(--line);
  background: var(--panel-2);
}

.game-card {
  min-height: 11rem;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.5rem;
  padding: 1rem;
  text-decoration: none;
  box-shadow: 4px 4px 0 #000;
  touch-action: manipulation;
}
.game-card:hover, .game-card:focus-visible {
  border-color: var(--accent);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #000;
}
.game-number { color: var(--accent-2); font-size: 0.7rem; font-weight: 900; }
.game-card strong { font-size: clamp(1.35rem, 4vw, 2rem); }
.game-card > span:not(.game-number):not(.play-label) { color: var(--muted); line-height: 1.45; }
.play-label { color: var(--accent); font-weight: 900; }

.install-intro { margin-bottom: 1rem; }
.install-card { padding: 1rem; }
.platform { display: block; margin-bottom: 0.45rem; color: var(--accent-2); font-size: 0.7rem; }
.install-card ol { margin: 0; padding-left: 1.35rem; color: var(--muted); line-height: 1.6; }
.install-card li + li { margin-top: 0.35rem; }
.install-card strong { color: var(--ink); }

.world-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.2rem;
  padding: 1.5rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.68rem;
}

@media (max-width: 620px) {
  .world-shell { width: min(calc(100% - 0.75rem), 40rem); }
  .hero, .section-block { border-width: 3px; box-shadow: 5px 5px 0 #000; }
  .hero::after { opacity: 0.75; }
  .hero-copy { padding-right: 0; }
  .game-grid, .install-grid { grid-template-columns: 1fr; }
  .game-card { min-height: 9.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pixel-button, .game-card { transition: none; }
  .pixel-button:hover, .pixel-button:focus-visible,
  .pixel-button:active, .game-card:hover, .game-card:focus-visible { transform: none; }
}
