:root {
  --sky-top: #f3dcb8;
  --sky-mid: #e3b98f;
  --sky-low: #c9a98a;
  --panel: #f1e3c6;
  --ink: #2a1a1e;
  --accent: #a3302b;
  --muted: #8c5a34;
  --text: #2a1a1e;
  --pixel-font: 'Press Start 2P', ui-monospace, 'Courier New', monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky-top: #2b2440;
    --sky-mid: #4a3552;
    --sky-low: #6b4a4f;
    --panel: #3a2c36;
    --ink: #120d12;
    --accent: #e0a43c;
    --muted: #b07a48;
    --text: #f1e3c6;
  }
}
:root[data-theme="dark"] {
  --sky-top: #2b2440;
  --sky-mid: #4a3552;
  --sky-low: #6b4a4f;
  --panel: #3a2c36;
  --ink: #120d12;
  --accent: #e0a43c;
  --muted: #b07a48;
  --text: #f1e3c6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--sky-low);
  color: var(--text);
  font-family: var(--pixel-font);
}

/* Contenedor alto que genera el recorrido de scroll; el escenario queda fijo. */
.track {
  height: 1200vh;
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 40% 30% at 50% 78%, rgba(60, 30, 30, 0.25), transparent 70%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 60%, var(--sky-low) 100%);
}

#scene {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 10px 0 rgba(42, 26, 30, 0.22));
}

.title {
  position: absolute;
  top: 24px;
  left: 24px;
  max-width: calc(100% - 120px);
}
.title h1 {
  margin: 0 0 10px;
  font-size: clamp(14px, 2.4vw, 22px);
  line-height: 1.5;
  font-weight: 400;
  text-shadow: 3px 3px 0 color-mix(in srgb, var(--accent) 35%, transparent);
}
.title p {
  margin: 0;
  font-size: 9px;
  opacity: 0.75;
}

.compass {
  position: absolute;
  top: 20px;
  right: 20px;
}
.compass text { font-family: var(--pixel-font); }

.hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 14px;
  font-size: 10px;
  white-space: nowrap;
  background: var(--panel);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.debug {
  position: absolute;
  bottom: 8px;
  right: 10px;
  margin: 0;
  font: 11px ui-monospace, monospace;
  opacity: 0.8;
}

@media (max-width: 520px) {
  .title { top: 16px; left: 16px; }
  .compass { top: 12px; right: 12px; }
  .compass svg { width: 48px; height: 48px; }
  .hint { font-size: 8px; bottom: 16px; }
}
