/* ==========================================================================
   asciilands.online — retro terminal theme
   Palette + glyph language deliberately echoes the Asciilands game UI.
   ========================================================================== */

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-600.woff2') format('woff2');
}
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/vt323-400.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --ink: #0b1110;
  --ink-2: #0e1714;
  --panel: #101a16;
  --panel-2: #0c1411;
  --paper: #efe7cf;
  --muted: #b3b8a4;
  --quiet: #7f887b;
  --gold: #e3c170;
  --gold-hi: #f5da8e;
  --gold-lo: #8d6f31;
  --green: #8fd46a;
  --green-dim: #68a04c;
  --blue: #7bdcff;
  --red: #d9705a;
  --edge: rgba(239, 231, 207, 0.16);
  --edge-strong: rgba(239, 231, 207, 0.3);
  --edge-gold: rgba(227, 193, 112, 0.5);
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, 'Courier New', monospace;
  --display: 'VT323', var(--mono);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  --radius: 4px;
  --wrap: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Ambient scanlines + vignette, kept subtle for readability. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 50% -8%, rgba(143, 212, 106, 0.09), transparent 62%),
    radial-gradient(900px 700px at 105% 100%, rgba(63, 110, 143, 0.12), transparent 60%),
    repeating-linear-gradient(0deg, rgba(239, 231, 207, 0.016) 0 1px, transparent 1px 4px);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(11, 17, 16, 0.35) 100%);
}

::selection {
  background: var(--gold);
  color: #171307;
}

a {
  color: var(--gold);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--gold-hi);
  text-decoration: underline;
  text-decoration-style: dotted;
}

:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 400;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}
p:last-child {
  margin-bottom: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(var(--wrap), 100% - 48px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--gold);
  color: #171307;
  font-weight: 600;
}
.skip-link:focus {
  top: 12px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--edge);
  background: rgba(11, 17, 16, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  align-self: center;
  color: var(--green);
  font-size: 15px;
  line-height: 1;
}
.brand-name {
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: 0.05em;
  line-height: 1;
  color: var(--gold);
}
.brand-tag {
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--quiet);
  border: 1px solid var(--edge);
  padding: 2px 6px 1px;
  line-height: 1.5;
}

.site-nav {
  display: flex;
  gap: 22px;
  margin-left: 8px;
}
.site-nav a {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-nav a:hover {
  color: var(--gold-hi);
  text-decoration: none;
}

.header-inner > .btn {
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid var(--edge-strong);
  border-radius: 2px;
  background: #16211c;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease,
    box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover {
  color: var(--gold-hi);
  border-color: var(--edge-gold);
  text-decoration: none;
}
.btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}
.btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}
.btn--primary {
  background: var(--gold);
  border-color: var(--gold-hi);
  color: #1b1a0f;
  box-shadow: 0 4px 0 var(--gold-lo), 0 10px 26px rgba(227, 193, 112, 0.14);
}
.btn--primary:hover {
  background: var(--gold-hi);
  color: #1b1a0f;
  border-color: var(--gold-hi);
}
.btn--primary:active {
  box-shadow: 0 1px 0 var(--gold-lo);
}
.btn--ghost {
  background: transparent;
  border-color: var(--edge);
  box-shadow: none;
  color: var(--muted);
}
.btn--ghost:hover {
  color: var(--gold-hi);
  border-color: var(--edge-gold);
  background: rgba(227, 193, 112, 0.06);
}
.btn--lg {
  padding: 15px 26px;
  font-size: 14px;
}
.btn--sm {
  padding: 8px 13px;
  font-size: 11px;
}

/* --------------------------------------------------------------------------
   Shared typography
   -------------------------------------------------------------------------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.eyebrow .dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(143, 212, 106, 0.8);
}

.section {
  padding-block: 78px;
  scroll-margin-top: 84px;
}
.section + .section {
  border-top: 1px solid var(--edge);
}
.section-head {
  max-width: 780px;
  margin-bottom: 40px;
}
.section-head h2 {
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 56px);
  line-height: 0.98;
  letter-spacing: 0.01em;
  color: var(--paper);
}
.section-head h2 .hl {
  color: var(--gold);
}
.section-lead {
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  max-width: 66ch;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding-block: clamp(48px, 7vw, 84px) clamp(36px, 5vw, 64px);
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--display);
  line-height: 0.86;
}
.hero-word {
  color: var(--gold);
  font-size: clamp(62px, 10.5vw, 126px);
  letter-spacing: 0.015em;
  text-shadow: 0 0 40px rgba(227, 193, 112, 0.18);
}
.hero-line {
  color: var(--paper);
  font-family: var(--display);
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1;
  letter-spacing: 0.01em;
}
.hero-line::after {
  content: '_';
  color: var(--green);
  animation: blink 1.15s steps(1, end) infinite;
}

.hero-lead {
  max-width: 57ch;
  margin-top: 22px;
  color: var(--muted);
  font-size: 15px;
}
.hero-lead strong {
  color: var(--paper);
  font-weight: 600;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: var(--quiet);
  font-size: 12px;
}
.fact-row li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fact-row li::before {
  content: '◆';
  color: var(--gold);
  font-size: 8px;
}

/* Terminal / ASCII art panel */
.hero-art {
  min-width: 0;
}
.terminal {
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0d1713 0%, #080f0c 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateZ(0);
}
.terminal-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.02);
  color: var(--quiet);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.terminal-dots {
  color: var(--gold);
  letter-spacing: 0.2em;
}
.ascii-scene {
  margin: 0;
  padding: 18px 14px;
  overflow: hidden;
  color: var(--green-dim);
  font-family: var(--mono);
  font-size: clamp(9px, 0.86vw, 12px);
  line-height: 1.22;
  white-space: pre;
  text-shadow: 0 0 12px rgba(143, 212, 106, 0.12);
}
.ascii-scene .w {
  color: #3f6e8f;
}
.ascii-scene .t {
  color: var(--green);
}
.ascii-scene .h {
  color: var(--paper);
}
.ascii-scene .q {
  color: var(--gold);
  animation: blink 1.6s steps(1, end) infinite;
}
.terminal-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--edge);
  color: var(--quiet);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(143, 212, 106, 0.9);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Play section
   -------------------------------------------------------------------------- */
.play-section {
  position: relative;
  z-index: 1;
  padding-block: clamp(56px, 7vw, 84px);
  background: linear-gradient(180deg, rgba(14, 23, 20, 0.72) 0%, rgba(10, 16, 14, 0.72) 100%);
  border-block: 1px solid var(--edge);
  scroll-margin-top: 68px;
}

.game-shell {
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 10px;
  box-shadow: var(--shadow);
}

.game-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #000;
  border: 1px solid var(--edge);
  overflow: hidden;
}
.game-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.game-poster {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 8px;
  padding: 20px;
  background:
    radial-gradient(560px 300px at 50% 38%, rgba(143, 212, 106, 0.12), transparent 70%),
    repeating-linear-gradient(0deg, rgba(239, 231, 207, 0.024) 0 1px, transparent 1px 4px),
    #060b09;
  text-align: center;
}
.game-poster[hidden] {
  display: none;
}
.poster-art {
  align-self: end;
  opacity: 0.9;
  max-width: 100%;
  overflow: hidden;
}
.poster-art pre {
  margin: 0;
  color: var(--green-dim);
  font-family: var(--mono);
  font-size: clamp(7px, 1.05vw, 12px);
  line-height: 1.2;
  white-space: pre;
}
.poster-art .w {
  color: #3f6e8f;
}
.poster-art .q {
  color: var(--gold);
}
.poster-copy {
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
}
.poster-kicker {
  margin: 0;
  color: var(--green);
  font-size: 10px;
  letter-spacing: 0.24em;
}
.poster-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1;
  color: var(--gold);
}
.poster-note {
  margin: 0 0 8px;
  color: var(--quiet);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.game-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: rgba(6, 11, 9, 0.92);
}
.game-loading[hidden] {
  display: none;
}
.game-loading-inner {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px 22px;
  border: 1px solid var(--edge);
  background: var(--panel);
  text-align: center;
}
.spinner {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(143, 212, 106, 0.2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.game-loading strong {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  color: var(--gold);
  line-height: 1;
}
.game-loading span {
  color: var(--quiet);
  font-size: 11px;
}

.game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 2px 4px;
}
.game-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.game-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.game-state .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--quiet);
}
.game-state.is-loading .dot {
  background: var(--gold);
  animation: pulse 1.2s ease-in-out infinite;
}
.game-state.is-ready .dot {
  background: var(--green);
  box-shadow: 0 0 8px rgba(143, 212, 106, 0.8);
}
.game-hint {
  color: var(--quiet);
  font-size: 11px;
}
.game-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--edge);
  border-radius: 2px;
  overflow: hidden;
}
.seg-btn {
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.seg-btn + .seg-btn {
  border-left: 1px solid var(--edge);
}
.seg-btn:hover {
  color: var(--gold-hi);
  background: rgba(227, 193, 112, 0.06);
}
.seg-btn[aria-pressed='true'] {
  background: var(--gold);
  color: #1b1a0f;
}

.game-footnote {
  margin: 6px 2px 0;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.6;
}

.game-mobile {
  display: none;
  margin-top: 12px;
  padding: 18px 20px;
  border: 1px solid var(--edge-gold);
  background: rgba(227, 193, 112, 0.06);
}
.game-mobile strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  color: var(--gold);
  line-height: 1;
}
.game-mobile p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.game-mobile a {
  color: var(--gold-hi);
}
body.is-mobile .game-poster {
  display: none;
}
body.is-mobile .game-mobile {
  display: block;
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.about-grid .section-head {
  margin-bottom: 0;
  position: sticky;
  top: 100px;
}
.prose {
  color: var(--muted);
  font-size: 15px;
}
.prose p {
  margin-bottom: 1.15em;
}
.prose strong {
  color: var(--paper);
  font-weight: 600;
}
.prose h3 {
  margin: 1.6em 0 0.5em;
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  color: var(--paper);
}
.prose h3:first-child {
  margin-top: 0;
}
.prose ul {
  margin: 0 0 1.2em;
  padding-left: 1.1em;
}
.prose li {
  margin-bottom: 0.45em;
}
.prose li::marker {
  color: var(--gold);
}

.callout {
  margin: 0 0 1.4em;
  padding: 18px 20px;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--gold);
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
}
.callout .callout-label {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

/* --------------------------------------------------------------------------
   Feature grid
   -------------------------------------------------------------------------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.feature {
  position: relative;
  padding: 24px 22px;
  border: 1px solid var(--edge);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 60%), var(--panel-2);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.feature:hover {
  border-color: var(--edge-gold);
  transform: translateY(-2px);
}
.feature-icon {
  display: block;
  margin-bottom: 14px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.02em;
}
.feature h3 {
  margin-bottom: 8px;
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
  color: var(--gold);
}
.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   How to play
   -------------------------------------------------------------------------- */
.howto-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: start;
}
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding: 0 0 26px 58px;
  counter-increment: step;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--edge-gold);
  color: var(--gold);
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
  background: var(--panel-2);
}
.steps li::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 44px;
  bottom: 6px;
  width: 1px;
  background: var(--edge);
}
.steps li:last-child {
  padding-bottom: 0;
}
.steps li:last-child::after {
  display: none;
}
.steps h3 {
  margin: 4px 0 6px;
  font-family: var(--display);
  font-size: 27px;
  line-height: 1;
  color: var(--paper);
}
.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.controls-card {
  border: 1px solid var(--edge);
  background: var(--panel-2);
  padding: 22px;
}
.controls-card h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
  color: var(--gold);
}
.controls-card .controls-note {
  margin: 0 0 16px;
  color: var(--quiet);
  font-size: 11px;
}
.controls {
  display: grid;
  gap: 0;
  margin: 0;
}
.controls div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px dashed var(--edge);
}
.controls div:first-child {
  border-top: 0;
}
.controls dt {
  color: var(--muted);
  font-size: 12.5px;
}
.controls dd {
  margin: 0;
  text-align: right;
}
kbd {
  display: inline-block;
  min-width: 22px;
  padding: 2px 6px;
  border: 1px solid var(--edge-strong);
  border-bottom-width: 2px;
  border-radius: 2px;
  background: #131d18;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Realms
   -------------------------------------------------------------------------- */
.realm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.realm {
  position: relative;
  padding: 24px;
  border: 1px solid var(--edge);
  background: var(--panel-2);
  overflow: hidden;
}
.realm::after {
  content: attr(data-glyph);
  position: absolute;
  right: 12px;
  bottom: -18px;
  color: rgba(227, 193, 112, 0.07);
  font-family: var(--display);
  font-size: 120px;
  line-height: 1;
  pointer-events: none;
}
.realm-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.realm h3 {
  margin-bottom: 8px;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  color: var(--gold);
}
.realm p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  max-width: 46ch;
}
.realm-meta {
  color: var(--quiet);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.realm .btn {
  margin-top: 16px;
} 

/* --------------------------------------------------------------------------
   Tips
   -------------------------------------------------------------------------- */
.tips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: tip;
}
.tips li {
  position: relative;
  padding: 14px 0 14px 42px;
  border-top: 1px solid var(--edge);
  color: var(--muted);
  font-size: 13.5px;
}
.tips li::before {
  counter-increment: tip;
  content: counter(tip, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 15px;
  color: var(--gold);
  font-family: var(--display);
  font-size: 20px;
  line-height: 1;
}
.tips li strong {
  color: var(--paper);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.faq-list {
  border-top: 1px solid var(--edge);
  max-width: 900px;
}
.faq-item {
  border-bottom: 1px solid var(--edge);
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 4px;
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: '+';
  flex: none;
  color: var(--gold);
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  transition: transform 0.18s ease;
}
.faq-item[open] summary::after {
  content: '−';
}
.faq-item summary:hover {
  color: var(--gold-hi);
}
.faq-answer {
  padding: 0 4px 20px;
  max-width: 72ch;
  color: var(--muted);
  font-size: 13.5px;
}
.faq-answer p {
  margin: 0 0 0.8em;
}
.faq-answer p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 48px 0 40px;
  border-top: 1px solid var(--edge);
  background: #090f0c;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.footer-brand .brand-name {
  font-size: 26px;
}
.footer-brand p {
  margin: 12px 0 0;
  max-width: 44ch;
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.7;
}
.footer-heading {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.footer-links {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a {
  color: var(--muted);
  font-size: 12.5px;
}
.footer-links a:hover {
  color: var(--gold-hi);
}
.footer-legal {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--edge);
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.7;
}
.footer-legal a {
  color: var(--muted);
}
.footer-legal p {
  margin: 0 0 6px;
}

/* --------------------------------------------------------------------------
   404 (rendered by the Worker)
   -------------------------------------------------------------------------- */
body.not-found {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
}
.not-found__card {
  width: min(560px, 100%);
  padding: 40px 32px;
  border: 1px solid var(--edge);
  background: var(--panel-2);
  text-align: center;
  box-shadow: var(--shadow);
}
.not-found__title {
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 52px);
  line-height: 0.98;
  color: var(--paper);
}
.not-found__text {
  margin: 14px 0 22px;
  color: var(--muted);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-art {
    order: 2;
  }
  .ascii-scene {
    font-size: 11px;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-grid .section-head {
    position: static;
  }
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .howto-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .wrap {
    width: calc(100% - 32px);
  }
  .header-inner {
    min-height: 60px;
    gap: 12px;
  }
  .brand-name {
    font-size: 25px;
  }
  .brand-tag,
  .site-nav {
    display: none;
  }
  .header-inner > .btn {
    margin-left: auto;
  }
  .hero {
    padding-top: 32px;
  }
  .hero-word {
    font-size: clamp(54px, 16vw, 82px);
  }
  .section {
    padding-block: 56px;
  }
  .feature-grid,
  .realm-grid,
  .tips {
    grid-template-columns: 1fr;
  }
  .game-bar {
    align-items: flex-start;
  }
  .game-hint {
    display: none;
  }
  .poster-art {
    display: none;
  }
  .game-frame {
    aspect-ratio: 4 / 5;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .controls div {
    align-items: center;
  }
}

@media (max-width: 420px) {
  .hero-cta .btn {
    width: 100%;
  }
  .terminal {
    display: none;
  }
}

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

/* --------------------------------------------------------------------------
   Small additions
   -------------------------------------------------------------------------- */
.noscript-note {
  margin: 0;
  padding: 16px;
  border-top: 1px solid var(--edge);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.realm-label .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(143, 212, 106, 0.8);
}

/* Keep the playable frame usable on short landscape screens. */
@media (max-height: 620px) and (min-width: 761px) {
  .game-frame {
    aspect-ratio: auto;
    height: min(72vh, 620px);
  }
}
