/* Jerica's City V12 — In-Game City Opener (game-opener.css)
   V10 Premium: cyberpunk palette, responsive, keyboard-accessible,
   prefers-reduced-motion respected. No external fonts or CDNs. */

:root {
  --bg: #080b16;
  --panel: #101728;
  --panel-2: #0d1526;
  --text: #f4f8ff;
  --muted: #b9c6de;
  --blue: #008cff;
  --cyan: #00f5ff;
  --purple: #9d4dff;
  --magenta: #ff2daa;
  --lime: #b6ff42;
  --amber: #ffb000;
  --red: #ff365e;
  --border: rgba(0, 245, 255, 0.28);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  overflow: hidden;
}

#stage {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #0a0e24 0%, #101728 55%, #080b16 100%);
}

#scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

/* Static fallback skyline shown only if WebGL/three.js fails to start. */
#fallback-skyline {
  position: absolute;
  inset: auto 0 0 0;
  height: 34vh;
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  pointer-events: none;
  opacity: 0.9;
}
#fallback-skyline span {
  display: block;
  background: #0d1526;
  border-top: 2px solid var(--cyan);
  flex: 1 1 auto;
}
#fallback-skyline span:nth-child(odd) { height: 62%; }
#fallback-skyline span:nth-child(even) { height: 88%; }
#fallback-skyline span.tower { height: 100%; border-top-color: var(--magenta); }
body.no-webgl #fallback-skyline { display: flex; }
body.no-webgl #scene-canvas { display: none; }

.hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(12px, 2.5vw, 28px);
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 11, 22, 0.55) 0%, rgba(8, 11, 22, 0) 22%, rgba(8, 11, 22, 0) 62%, rgba(8, 11, 22, 0.72) 100%);
}

.hud > * { pointer-events: auto; }

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4.5vw, 3rem);
  line-height: 1.05;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}
h1 .accent { color: var(--cyan); }

.phase {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(16, 23, 40, 0.88);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.btn:hover { border-color: var(--cyan); background: #16223d; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}
.btn.primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #04121a;
}
.btn.primary:hover { background: #5ff8ff; }
.btn.ghost { background: rgba(8, 11, 22, 0.55); }

.audio-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 23, 40, 0.88);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px 6px 6px;
}
.audio-group .btn { border: 0; background: transparent; padding: 6px 10px; }
.audio-group label {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.audio-group input[type="range"] { width: 90px; accent-color: var(--cyan); }
.audio-group .track-note { font-size: 0.72rem; color: var(--muted); }

.bottombar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-wrap { max-width: 560px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(244, 248, 255, 0.16);
  overflow: hidden;
  border: 1px solid rgba(244, 248, 255, 0.14);
}
.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--lime));
  transition: width 0.3s linear;
}

.honest-note {
  margin: 0;
  max-width: 640px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
  background: rgba(8, 11, 22, 0.66);
  border: 1px solid rgba(244, 248, 255, 0.12);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  padding: 10px 12px;
}
.honest-note strong { color: var(--text); }

/* End / resume cards */
.card {
  position: absolute;
  left: 50%;
  bottom: clamp(96px, 18vh, 160px);
  transform: translateX(-50%);
  width: min(92vw, 560px);
  background: rgba(16, 23, 40, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
}
.card[hidden] { display: none; }
.card h2 { margin: 0 0 8px; font-size: 1.35rem; }
.card p { margin: 0 0 16px; color: var(--muted); line-height: 1.5; }
.card .row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.card .fineprint { margin: 14px 0 0; font-size: 0.8rem; }

#resume-card { border-color: var(--lime); }

.kbd-hint {
  font-size: 0.78rem;
  color: var(--muted);
}
.kbd-hint kbd {
  font-family: inherit;
  background: #1a2742;
  border: 1px solid rgba(244, 248, 255, 0.25);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text);
}

@media (max-width: 640px) {
  .audio-group input[type="range"] { width: 64px; }
  .audio-group .track-note { display: none; }
  .card { bottom: 118px; padding: 16px; }
  .honest-note { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .progress > span { transition: none; }
  .btn:active { transform: none; }
}
