:root {
  --bg: #07080a;
  --panel: #0e1116;
  --line: #1e2530;
  --text: #d7dee8;
  --dim: #7d8899;
  --accent: #ff9d2e;
  --accent2: #37b6ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
}

#view {
  display: block;
  width: 100vw;
  height: 100vh;
  outline: none;
  cursor: default;
  background: #000;
}

#view.playing { cursor: none; }

.hidden { display: none !important; }

/* ---------- boot / menu ---------- */

#boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 35%, #16202c 0%, #07080a 70%);
  z-index: 40;
  padding: 24px;
  overflow-y: auto;
}

.boot-inner {
  width: min(720px, 100%);
  text-align: center;
}

#boot h1 {
  font-size: clamp(38px, 9vw, 76px);
  letter-spacing: 0.22em;
  margin: 0 0 6px;
  font-weight: 400;
  text-indent: 0.22em;
}

#boot h1 .o {
  color: var(--accent);
  position: relative;
}

.sub {
  color: var(--dim);
  font-size: 13px;
  margin: 0 0 30px;
  letter-spacing: 0.06em;
}

#progress-wrap { margin: 0 auto 26px; width: min(460px, 100%); }

#progress-bar {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width 0.18s ease-out;
}

#progress-label {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--dim);
  min-height: 1.2em;
  letter-spacing: 0.04em;
}

#map-select {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 7px;
  margin-bottom: 26px;
  text-align: left;
}

.map-btn {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 11px;
  border-radius: 5px;
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  transition: border-color 0.14s, background 0.14s;
}

.map-btn:hover:not(:disabled) { border-color: var(--accent2); background: #131922; }
.map-btn.active { border-color: var(--accent); color: var(--accent); }
.map-btn:disabled { opacity: 0.32; cursor: not-allowed; }
.map-btn .sz { display: block; color: var(--dim); font-size: 10px; margin-top: 3px; }

#launch {
  background: var(--accent);
  color: #10131a;
  border: 0;
  padding: 13px 40px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  border-radius: 5px;
  cursor: pointer;
}

#launch:disabled { background: var(--line); color: var(--dim); cursor: not-allowed; }

#diag {
  margin-top: 26px;
  text-align: left;
  font-size: 11px;
  color: var(--dim);
}

#diag summary { cursor: pointer; padding: 6px 0; }

#diag-body {
  background: #05070a;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 11px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  margin: 0;
}

/* ---------- in-game HUD ---------- */

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border: 1.5px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  mix-blend-mode: difference;
}

#stats {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 11px;
  line-height: 1.55;
  color: #9fe8ff;
  text-shadow: 0 1px 3px #000;
  white-space: pre;
}

#subtitle {
  position: absolute;
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%);
  max-width: min(880px, 88vw);
  text-align: center;
  font-size: clamp(14px, 2.1vw, 19px);
  line-height: 1.42;
  color: #fff;
  text-shadow: 0 2px 7px #000, 0 0 2px #000;
  font-family: system-ui, -apple-system, sans-serif;
}

/* ---------- pause ---------- */

#pause {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 7, 10, 0.82);
  backdrop-filter: blur(3px);
  z-index: 30;
}

.pause-inner { text-align: center; }
.pause-inner h2 { font-weight: 400; letter-spacing: 0.16em; margin: 0 0 8px; }
.pause-inner p { color: var(--dim); font-size: 12px; margin: 0 0 20px; }

kbd {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
}

#resume {
  background: var(--accent);
  color: #10131a;
  border: 0;
  padding: 11px 30px;
  font: inherit;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
}

@media (max-width: 620px) {
  #map-select { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  #stats { font-size: 10px; }
}
