:root {
  --bg: #f7f4ee;
  --ink: #1f2a1f;
  --muted: #5b6656;
  --accent: #4a6b3a;
  --line: #d6cdbb;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161a15;
    --ink: #e8e6df;
    --muted: #a7ae9f;
    --accent: #9cc285;
    --line: #333b30;
  }
}

* { box-sizing: border-box; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.65 ui-serif, Georgia, "Times New Roman", serif;
}

a { color: var(--accent); }

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100% - 2.5rem, 44rem);
  margin-inline: auto;
  padding-block: 4rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font: 600 0.85rem/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 10vw, 5.5rem);
  line-height: 1;
  font-weight: 600;
}

.lead { margin: 1.5rem 0 0; color: var(--muted); font-size: 1.2rem; }

.site-footer {
  width: min(100% - 2.5rem, 44rem);
  margin-inline: auto;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 0.9rem/1.5 ui-sans-serif, system-ui, sans-serif;
}

/* ---------- flyover homepage ---------- */

body.flyover { display: block; height: 100vh; height: 100dvh; overflow: hidden; background: #bfd4e6; color: #fff; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s; }
body.ready #scene { opacity: 1; }

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  pointer-events: none;
  text-shadow: 0 1px 12px rgb(0 0 0 / 55%), 0 0 2px rgb(0 0 0 / 40%);
}
.overlay button { pointer-events: auto; }

.flyover .eyebrow { color: #fff; opacity: 0.9; }
.flyover h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); }
.flyover .lead { margin-top: 0.75rem; color: #fff; opacity: 0.92; font-size: 1.1rem; }

.place {
  align-self: center;
  margin: auto 0 clamp(1.5rem, 12vh, 6rem);
  font: 600 clamp(1.4rem, 4vw, 2.2rem)/1.2 ui-serif, Georgia, serif;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(0.4rem);
  transition: opacity 0.8s, transform 0.8s;
}
.place.visible { opacity: 1; transform: none; }

.pick { align-self: center; margin: 0; padding: 0.5rem 0.9rem; border-radius: 0.4rem; background: rgb(0 0 0 / 60%); font: 0.95rem/1.4 ui-monospace, monospace; text-shadow: none; pointer-events: auto; user-select: text; }

.controls { display: flex; gap: 0.75rem; align-items: center; min-height: 2.25rem; font: 0.9rem/1 ui-sans-serif, system-ui, sans-serif; }
.controls button {
  padding: 0.55rem 0.95rem;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 999px;
  background: rgb(0 0 0 / 35%);
  color: #fff;
  font: inherit;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.controls button:hover, .controls button:focus-visible { background: rgb(0 0 0 / 55%); }

.credits { margin: 0.75rem 0 0; font: 0.75rem/1.4 ui-sans-serif, system-ui, sans-serif; opacity: 0.85; }

.hint { opacity: 0.9; }
@media (pointer: coarse) { .hint { display: none; } }

.labels { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.labels span {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 45%);
  color: #fff;
  font: 0.75rem/1.3 ui-sans-serif, system-ui, sans-serif;
  white-space: nowrap;
  will-change: transform;
}
.labels span::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 0.9rem; background: rgb(255 255 255 / 70%); }

/* On-screen arrows, touch screens only. */
.pad { display: none; position: fixed; right: 1.25rem; bottom: 5.5rem; grid-template-columns: repeat(3, 3.25rem); grid-template-rows: repeat(2, 3.25rem); gap: 0.35rem; pointer-events: auto; touch-action: none; }
@media (pointer: coarse) { .pad { display: grid; } }
.pad button { border: 1px solid rgb(255 255 255 / 70%); border-radius: 0.6rem; background: rgb(0 0 0 / 35%); color: #fff; font: 1.3rem/1 ui-sans-serif, system-ui, sans-serif; text-shadow: none; }
.pad button:active { background: rgb(0 0 0 / 60%); }
.pad [data-dir="boost"] { grid-column: 1; grid-row: 1; }
.pad [data-dir="land"] { grid-column: 3; grid-row: 1; }
.pad [data-dir="up"] { grid-column: 2; grid-row: 1; }
.pad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.pad [data-dir="down"] { grid-column: 2; grid-row: 2; }
.pad [data-dir="right"] { grid-column: 3; grid-row: 2; }

/* 2D map, bottom right (top right on touch screens, where the arrows sit bottom right). */
.minimap { pointer-events: auto; cursor: crosshair; position: fixed; right: clamp(1.25rem, 4vw, 2.5rem); bottom: clamp(1.25rem, 4vw, 2.5rem); width: clamp(150px, 20vw, 240px); border: 1px solid rgb(255 255 255 / 75%); border-radius: 0.5rem; box-shadow: 0 2px 14px rgb(0 0 0 / 45%); }
@media (pointer: coarse) { .minimap { top: clamp(1.25rem, 4vw, 2.5rem); bottom: auto; width: clamp(120px, 34vw, 180px); } }

/* Logo watermark, top right: the logo drawn in white over the scene. */
.watermark { position: fixed; top: clamp(0.75rem, 3vw, 1.75rem); right: clamp(1.25rem, 4vw, 2.5rem); width: clamp(84px, 11vw, 150px); height: auto; filter: brightness(0) invert(1) drop-shadow(0 1px 6px rgb(0 0 0 / 55%)); opacity: 0.85; pointer-events: auto; cursor: pointer; z-index: 2; }
.watermark:hover { opacity: 1; }
@media (pointer: coarse) { .minimap { top: calc(clamp(0.75rem, 3vw, 1.75rem) + clamp(84px, 11vw, 150px) * 0.72 + 0.5rem); } }

/* Apocalypse view: dusty sky behind the scene while it loads. */
body.doom { background: #c8a070; }

/* Season picker: same look as the buttons. */
.controls select { pointer-events: auto; padding: 0.5rem 0.8rem; border: 1px solid rgb(255 255 255 / 70%); border-radius: 999px; background: rgb(0 0 0 / 35%); color: #fff; font: inherit; cursor: pointer; backdrop-filter: blur(4px); }
.controls select option { color: #111; }
.controls button, .controls select { flex: none; white-space: nowrap; }
.hint { font-size: 0.8rem; line-height: 1.3; }
@media (max-width: 1500px) { .hint { display: none; } }
.credits a { color: inherit; pointer-events: auto; }
