/* ...existing styles... */
:root {
  --bg: #0E0B04;
  --fg: #FBEFE3;
  --muted: #CBB6A1;
  --line: #FFEDD5;
  --accent: #1f4b6e; /* dark cold blue */
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Noto Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: saturate(1.2) blur(4px);
  border-bottom: 1px solid #222;
  z-index: 10;
  gap: 12px;
}

.brand { font-weight: 600; letter-spacing: 0.2px; }

.controls { display: flex; gap: 10px; margin-left: auto; align-items: center; }
button {
  appearance: none;
  border: 1px solid #203040;
  background: #0f1720; /* cold dark blue-gray */
  color: var(--fg);
  padding: 10px 16px;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  cursor: pointer;
}
button:hover { background: #13202b; border-color: #2a3f58; }
button:active { transform: scale(0.98); }
button:focus { outline: 2px solid #fff; outline-offset: 2px; }

.btn-primary { background: #1f4b6e; color: #e8f1ff; border-color: #1f4b6e; }
.btn-primary:hover { background: #23577f; }

#scene {
  position: fixed;
  inset: 0;
  top: 56px;
  width: 100%;
  height: calc(100% - 56px);
  display: block;
  touch-action: none;
}

.hud {
  position: fixed;
  bottom: 12px; left: 12px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(0,0,0,0.6);
  border: 1px solid #222;
  padding: 6px 8px;
  border-radius: 6px;
  user-select: none;
}

.zoom-controls {
  position: fixed;
  right: 12px; bottom: 12px;
  display: flex; gap: 8px;
}
.zoom-controls button {
  width: 36px; height: 36px;
  border-radius: 8px;
  padding: 0;
}

.time-speed { display: flex; align-items: center; gap: 8px; }
.time-label { font-size: 12px; color: var(--muted); }
#time-speed { width: 160px; height: 28px; }
#time-speed-value { width: 44px; text-align: right; color: var(--fg); font-variant-numeric: tabular-nums; }

.lil-gui {
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  background: rgba(10,10,10,0.7);
  border: 1px solid #222;
  border-radius: 10px;
  font-size: 14px;
  backdrop-filter: saturate(1.1) blur(6px);
}

.hidden { display: none !important; }

.menu-overlay {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at center, rgba(20,120,160,0.08), rgba(0,0,0,0.0) 60%);
  z-index: 20;
}
.menu-inner.menu-grid { display:grid; grid-template-columns: 1.2fr 1fr; gap: clamp(16px,4vw,48px); width:min(980px,92vw); align-items:center; }
.menu-col { text-align:left; }
.menu-title {
  font-size: clamp(48px, 10vw, 120px);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  color: hsl(210 30% 98%); /* white with slight blue hint */
  text-shadow: 0 0 24px rgba(255,255,255,0.08);
}
.menu-subtitle { color:#bbb; margin:0 0 14px 0; font-size: clamp(12px, 1.6vw, 16px); }
.menu-blurb { color:#9a9a9a; margin:0 0 18px 0; max-width: 46ch; line-height:1.5; }
.menu-action { width: 100%; text-align: left; font-weight:600; }
.menu-footer { margin-top: 10px; color:#888; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.kbd { padding:4px 8px; border:1px solid #333; border-radius:6px; background:#0c0c0c; color:#ddd; font-size:12px; }
.hint { color:#777; font-size:12px; }

.menu-enter { width:100%; }
.menu-secondary:hover { transform: translateY(-1px); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: grid; place-items: center; z-index: 40; }
.modal-content { width: min(720px, 92vw); max-height: 80vh; overflow: auto; background: #0b0b0b; border: 1px solid #222; border-radius: 12px; padding: 16px; color: #eee; }
.modal-head { display:flex; align-items:center; justify-content: space-between; border-bottom:1px solid #222; padding-bottom:8px; margin-bottom:12px; }
#modal-close { background:#111; border:1px solid #333; color:#eee; border-radius:8px; padding:6px 10px; }

.loading-screen {
  position: fixed; 
  inset: 0; 
  background: #000; 
  z-index: 30;
  display: grid; 
  place-items: center;
  animation: fadeIn 200ms ease forwards;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.loading-inner { 
  width:min(520px, 86vw); 
  text-align:center; 
}
.loading-title { 
  font-size: clamp(18px,4vw,28px); 
  letter-spacing: 0.32em; 
  color:#fff; 
  margin-bottom:16px; 
}
.loading-bar { 
  width:100%; 
  height:12px; 
  background:#111; 
  border:1px solid #222; 
  border-radius:999px; 
  overflow:hidden; 
}
.loading-fill { 
  height:100%; 
  background: var(--accent); 
  transition: width 120ms linear; 
}
.loading-perc { 
  margin-top:10px; 
  font-weight:700; 
  color:#D6E8FF; 
  letter-spacing:0.08em; 
}

.menu-splash {
  display: inline-block; margin: 4px 0 10px 0; padding: 4px 10px;
  font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: #D6E8FF; 
  background: rgba(50,100,160,0.12); 
  border: 1px solid rgba(50,100,160,0.28); 
  border-radius: 999px;
}

/* Pastel Borders */
.pastel-red-border {
  border-color: hsl(350 70% 80%);
}
.pastel-green-border {
  border-color: hsl(120 70% 80%);
}

.pastel-red-border:hover {
  border-color: hsl(350 70% 88%);
}
.pastel-green-border:hover {
  border-color: hsl(120 70% 88%);
}

.loading-tip { color:#CBB6A1; font-size:14px; margin: 0 0 10px 0; }

.warning-overlay {
  position: fixed; inset: 0; background: #000; z-index: 50;
  display: grid; place-items: center; opacity: 1; transition: opacity 400ms ease;
}
.warning-overlay.fade-out { opacity: 0; pointer-events: none; }
.warning-inner { width: min(720px, 92vw); color: #eee; text-align: center; }
.warning-title { font-size: clamp(18px,4vw,28px); letter-spacing: 0.24em; margin-bottom: 12px; }
.warning-text { color:#ccc; line-height:1.6; margin: 0 0 16px 0; }
.warning-accept { width: 100%; }

@media (max-width: 760px){ 
  .menu-inner.menu-grid{ 
    grid-template-columns: 1fr; 
    transform:none; 
  } 
  .menu-col{ 
    text-align:center; 
  } 
  .menu-action{ 
    text-align:center; 
  } 
  .menu-footer{ 
    justify-content:center; 
  } 
}