/* AETHER — HUD styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --glass: rgba(10, 16, 26, 0.62);
  --glass-strong: rgba(8, 13, 22, 0.82);
  --stroke: rgba(255, 255, 255, 0.14);
  --ink: #eef3fa;
  --ink-dim: #a7b4c6;
  --accent: #8fd3e8;
  --warn: #ffb454;
  --good: #9fd68a;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --radius: 14px;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #0a0f18;
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene:active { cursor: grabbing; }

/* ---------------- loader ---------------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 50% 20%, #16233a 0%, #0a0f18 70%);
  transition: opacity 0.7s ease;
}
#loader.done { opacity: 0; pointer-events: none; }
.loader-card { text-align: center; }
.loader-mark {
  font-size: 30px;
  letter-spacing: 0.42em;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 26px;
}
.loader-bar {
  width: 210px;
  height: 3px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
.loader-fill {
  width: 40%;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  animation: slide 1.1s ease-in-out infinite alternate;
}
@keyframes slide { from { transform: translateX(-60%); } to { transform: translateX(260%); } }
.loader-note { margin-top: 16px; font-size: 12px; color: var(--ink-dim); letter-spacing: 0.08em; }

/* ---------------- HUD scaffolding ---------------- */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; }

.topbar {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: 0.34em; text-shadow: 0 1px 12px rgba(0,0,0,0.5); }
.brand-sub { font-size: 10.5px; color: var(--ink-dim); letter-spacing: 0.12em; margin-top: 3px; }

.topmid {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.clock { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.datechip { font-size: 12px; color: var(--ink-dim); letter-spacing: 0.1em; text-transform: uppercase; }

.topright { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.iconbtn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.iconbtn:hover { background: rgba(38, 52, 74, 0.75); }
.iconbtn.active { background: var(--accent); color: #0a1522; border-color: transparent; }
.iconbtn.muted .sound-wave { opacity: 0.25; }
.iconbtn svg { pointer-events: none; }

.qselect {
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: var(--ink);
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}
.qselect option { background: #131c2a; }

/* ---------------- panels ---------------- */
.panel {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.panel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.instruments {
  position: absolute;
  left: 16px;
  bottom: 86px;
  width: 308px;
}
.inst-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.inst.wide { grid-column: 1 / -1; }
.inst-label { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.inst-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.inst.wide .inst-value { font-size: 34px; }
.inst-unit { font-size: 12px; font-weight: 500; color: var(--ink-dim); margin-left: 3px; }
.inst-sub { font-size: 10.5px; color: var(--ink-dim); margin-top: 1px; min-height: 13px; }
.trend { font-size: 11px; margin-left: 8px; font-weight: 600; }
.trend.up { color: var(--good); }
.trend.down { color: #ff9c9c; }

.compass-wrap { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.compass { width: 54px; height: 54px; display: block; }
.compass-ring { fill: none; stroke: rgba(255,255,255,0.22); stroke-width: 1.5; }
.compass-tick { stroke: rgba(255,255,255,0.18); stroke-width: 1; }
.compass-tick.major { stroke: rgba(255,255,255,0.45); stroke-width: 1.6; }
.compass-label { fill: var(--ink-dim); font-size: 9px; font-weight: 700; }
.wind-arrow { transition: transform 0.4s ease; }
.wind-arrow-head { fill: var(--accent); }
.wind-arrow-tail { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; opacity: 0.7; }

.precip-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  color: var(--ink-dim);
}
.precip-badge .dot { width: 9px; height: 9px; border-radius: 50%; background: #6b7688; flex: none; }
.precip-badge.wet { color: #bfe0f5; }
.precip-badge.wet .dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.precip-badge.snowy.wet .dot { background: #eef6ff; box-shadow: 0 0 10px #cfe6ff; }

/* ---------------- controls panel ---------------- */
.controls {
  position: absolute;
  right: 16px;
  top: 76px;
  width: 288px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.controls.collapsed .controls-body { display: none; }
.controls-body::-webkit-scrollbar { width: 6px; }
.controls-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 3px; }
.collapse-btn {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
}
.ctl { margin-bottom: 13px; }
.ctl-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.ctl-val { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(143, 211, 232, 0.55), rgba(143, 211, 232, 0.15));
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -5px;
  border-radius: 50%;
  background: #eef6fb;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.slider::-moz-range-track {
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(143, 211, 232, 0.55), rgba(143, 211, 232, 0.15));
}
.slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #eef6fb;
  border: 2px solid var(--accent);
}

.dial-row { display: flex; align-items: center; gap: 12px; }
.dial-row .ctl-label { flex-direction: column; align-items: flex-start; gap: 2px; }
.wind-dial { width: 92px; height: 92px; flex: none; cursor: grab; touch-action: none; }
.dial-tick { stroke: rgba(255,255,255,0.2); stroke-width: 1; }
.dial-tick.major { stroke: rgba(255,255,255,0.5); stroke-width: 1.6; }
.dial-label { fill: var(--ink-dim); font-size: 9px; font-weight: 700; }
.dial-arrow path { fill: var(--warn); }
.dial-arrow line { stroke: var(--warn); stroke-width: 2.4; stroke-linecap: round; opacity: 0.75; }
.dial-arrow { transition: transform 0.25s ease; }

.chiprow { display: flex; flex-direction: column; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.chip:hover { background: rgba(255, 255, 255, 0.12); }
.chip.active { background: var(--accent); color: #08131f; border-color: transparent; font-weight: 700; }

/* ---------------- scenarios bar ---------------- */
.scenarios {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  max-width: min(92vw, 980px);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 10px 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.scenarios-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  flex: none;
}
.scenario-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.scenario-chips::-webkit-scrollbar { display: none; }
.scenario-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.scenario-chip:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.scenario-chip.active { border-color: rgba(255, 255, 255, 0.65); background: rgba(255, 255, 255, 0.16); }
.sc-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }

/* ---------------- caption & toast ---------------- */
.caption {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 84px;
  max-width: min(80vw, 640px);
  text-align: center;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85), 0 0px 3px rgba(0,0,0,0.9);
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
  font-style: italic;
}
.toast {
  position: absolute;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

/* ---------------- overlays ---------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 9, 16, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.5s ease;
}
.overlay.hidden { opacity: 0; pointer-events: none; }
.card {
  max-width: 480px;
  margin: 20px;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 34px 38px;
  box-shadow: var(--shadow);
}
.card-kicker { font-size: 11px; letter-spacing: 0.4em; color: var(--accent); font-weight: 800; margin-bottom: 10px; }
.card h1 { font-size: 30px; font-weight: 800; margin-bottom: 14px; letter-spacing: -0.01em; }
.card h2 { font-size: 16px; font-weight: 700; margin: 18px 0 8px; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; font-size: 11.5px; }
.card p { color: var(--ink-dim); font-size: 14.5px; line-height: 1.6; margin-bottom: 16px; }
.hints, .helplist { list-style: none; margin-bottom: 20px; }
.hints li, .helplist li {
  color: var(--ink-dim);
  font-size: 13.5px;
  line-height: 1.55;
  padding-left: 18px;
  position: relative;
  margin-bottom: 8px;
}
.hints li::before, .helplist li::before {
  content: '◆';
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 8px;
  color: var(--accent);
}
.hints b, .helplist b { color: var(--ink); }
.btn {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 22px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.15); transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: #08131f; border-color: transparent; }
.btn.primary:hover { background: #a9e1f2; }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
  .controls { width: 258px; }
  .instruments { width: 280px; }
}
@media (max-width: 880px) {
  .controls { top: auto; bottom: 150px; max-height: 42vh; }
  .instruments { bottom: 150px; width: 236px; padding: 10px 12px; }
  .inst-grid { gap: 7px 10px; }
  .inst-value { font-size: 19px; }
  .inst.wide .inst-value { font-size: 26px; }
  .compass-wrap { display: none; }
  .brand-sub { display: none; }
  .caption { bottom: 120px; font-size: 12.5px; }
  .scenarios { bottom: 10px; padding: 8px 10px; }
  .scenarios-label { display: none; }
}
@media (max-width: 620px) {
  .instruments { left: 8px; bottom: 140px; }
  .topmid { padding: 6px 12px; }
  .clock { font-size: 15px; }
  .controls { right: 8px; width: 232px; }
  .card { padding: 26px 24px; }
  .card h1 { font-size: 24px; }
}
