/* ============ GARGANTUA HUD ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --cyan: #7fdcff;
  --amber: #ffb454;
  --dim: rgba(127, 220, 255, 0.45);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

html, body {
  width: 100%; height: 100%;
  background: #000;
  overflow: hidden;
  font-family: var(--mono);
  color: var(--cyan);
  cursor: grab;
  -webkit-font-smoothing: antialiased;
}
body:active { cursor: grabbing; }

#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---- post FX overlay: scanlines + extra vignette ---- */
#fx {
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.025) 0px,
      rgba(255,255,255,0.025) 1px,
      transparent 1px,
      transparent 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
  mix-blend-mode: screen;
  opacity: 0.6;
}

/* ================= HUD ================= */
#hud {
  position: fixed; inset: 0; z-index: 10;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.6s ease;
}
#hud.hidden { opacity: 0; }

/* corner brackets */
.bracket {
  position: absolute; width: 34px; height: 34px;
  border: 1px solid var(--dim);
  opacity: 0.9;
  animation: flicker 6s infinite steps(1);
}
.bracket.tl { top: 22px;    left: 22px;  border-right: none; border-bottom: none; }
.bracket.tr { top: 22px;    right: 22px; border-left: none;  border-bottom: none; }
.bracket.bl { bottom: 22px; left: 22px;  border-right: none; border-top: none; }
.bracket.br { bottom: 22px; right: 22px; border-left: none;  border-top: none; }
@keyframes flicker {
  0%, 97%, 100% { opacity: 0.9; }
  97.5% { opacity: 0.35; }
  98.5% { opacity: 0.9; }
}

/* title */
#title-block {
  position: absolute; top: 30px; left: 42px;
  text-shadow: 0 0 12px rgba(127, 220, 255, 0.35);
}
.title-main {
  font-size: 34px; font-weight: 700; letter-spacing: 0.42em;
  color: #eafaff;
}
.title-sub {
  margin-top: 6px; font-size: 11px; letter-spacing: 0.30em;
  color: var(--amber); text-shadow: 0 0 10px rgba(255, 180, 84, 0.4);
}
.title-tag {
  margin-top: 5px; font-size: 9.5px; letter-spacing: 0.24em; color: var(--dim);
}

/* clock */
#clock-block { position: absolute; top: 32px; right: 44px; text-align: right; }
.clock-label { font-size: 9px; letter-spacing: 0.3em; color: var(--dim); }
.clock-value { font-size: 17px; letter-spacing: 0.18em; margin-top: 4px; color: #eafaff; }

/* telemetry */
#telemetry {
  position: absolute; bottom: 34px; left: 42px;
  font-size: 10.5px; letter-spacing: 0.14em;
  line-height: 1.95;
  text-shadow: 0 0 10px rgba(127, 220, 255, 0.3);
}
.tel-row span { color: var(--dim); display: inline-block; min-width: 190px; }
.tel-row b { color: #eafaff; font-weight: 600; }

/* control deck */
#deck {
  position: absolute; bottom: 30px; right: 40px;
  width: 260px; pointer-events: auto;
  padding: 14px 14px 10px;
  border: 1px solid rgba(127, 220, 255, 0.22);
  background: linear-gradient(160deg, rgba(6, 20, 34, 0.55), rgba(2, 8, 16, 0.35));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.deck-title {
  font-size: 9.5px; letter-spacing: 0.35em; color: var(--dim);
  margin-bottom: 10px;
}
.deck-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cine-btn { width: 100%; margin-bottom: 8px; letter-spacing: 0.2em !important; }
.cine-btn:not(.active) { opacity: 0.75; }
.sound-btn { width: 100%; margin-top: 6px; letter-spacing: 0.2em !important; }
.deck-row { display: flex; gap: 6px; margin-top: 6px; }
#deck button {
  flex: 1; cursor: pointer;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em;
  color: var(--cyan);
  padding: 8px 4px;
  border: 1px solid rgba(127, 220, 255, 0.28);
  background: rgba(127, 220, 255, 0.05);
  transition: all 0.18s ease;
}
#deck button:hover {
  background: rgba(127, 220, 255, 0.16);
  border-color: rgba(127, 220, 255, 0.7);
  color: #eafaff;
  box-shadow: 0 0 14px rgba(127, 220, 255, 0.25);
}
#deck button.active {
  background: rgba(255, 180, 84, 0.15);
  border-color: var(--amber);
  color: var(--amber);
}
.deck-hint {
  margin-top: 10px; font-size: 8.5px; letter-spacing: 0.16em;
  color: rgba(127, 220, 255, 0.3); text-align: center;
}

/* bottom-center usage hints */
#hints {
  position: absolute; bottom: 26px; left: 50%;
  transform: translateX(-50%) scale(0.5);
  transform-origin: bottom center;
  font-size: 9.5px; letter-spacing: 0.20em; white-space: nowrap;
  color: var(--dim);
  padding: 9px 20px;
  border: 1px solid rgba(127, 220, 255, 0.18);
  background: rgba(4, 14, 24, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.9s ease;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(127, 220, 255, 0.3);
}
#hints.show { opacity: 1; }
#hints .hk { color: var(--amber); }
#hints i { font-style: normal; opacity: 0.45; margin: 0 7px; }
@media (max-width: 900px) { #hints { display: none; } }

/* ================= parameters panel ================= */
#params {
  position: fixed; top: 88px; right: 40px; z-index: 15;
  width: 284px; max-height: calc(100vh - 360px); /* refined by fitParams() */
  overflow-y: auto;
  padding: 12px 14px 14px;
  border: 1px solid rgba(127, 220, 255, 0.22);
  background: linear-gradient(160deg, rgba(6, 20, 34, 0.82), rgba(2, 8, 16, 0.72));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 220, 255, 0.35) transparent;
}
#params.hidden { display: none; }
#params::-webkit-scrollbar { width: 5px; }
#params::-webkit-scrollbar-thumb { background: rgba(127, 220, 255, 0.35); }
.params-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 9.5px; letter-spacing: 0.35em; color: var(--dim);
  margin-bottom: 10px;
}
.params-head button {
  cursor: pointer; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.18em;
  color: var(--amber); padding: 3px 8px;
  border: 1px solid rgba(255, 180, 84, 0.35);
  background: rgba(255, 180, 84, 0.06);
}
.params-head button:hover { background: rgba(255, 180, 84, 0.18); }
.param-row { margin-bottom: 9px; }
.param-head {
  display: flex; justify-content: space-between;
  font-size: 8.5px; letter-spacing: 0.14em; margin-bottom: 3px;
}
.param-head span { color: var(--dim); }
.param-head b { color: #eafaff; font-weight: 600; }
.param-row input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 3px; border-radius: 2px;
  background: rgba(127, 220, 255, 0.18);
  outline: none; cursor: pointer;
}
.param-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(127, 220, 255, 0.8);
}
.param-row input[type="range"]::-moz-range-thumb {
  width: 11px; height: 11px; border: none; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(127, 220, 255, 0.8);
}

/* ================= intro ================= */
#intro {
  position: fixed; inset: 0; z-index: 20;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1.6s ease;
}
body.ready #intro { opacity: 0; pointer-events: none; }
#intro-card { text-align: center; opacity: 0; animation: cardIn 5.2s ease forwards; }
.intro-kicker {
  font-size: 10px; letter-spacing: 0.5em; color: var(--dim);
  margin-bottom: 18px;
}
.intro-title {
  font-size: clamp(44px, 9vw, 104px); font-weight: 700;
  letter-spacing: 0.36em; color: #fff;
  text-shadow: 0 0 40px rgba(127, 220, 255, 0.5), 0 0 120px rgba(127, 220, 255, 0.25);
  padding-left: 0.36em;
}
.intro-quote {
  margin-top: 22px; font-size: 12px; font-style: italic;
  letter-spacing: 0.22em; color: rgba(255, 180, 84, 0.75);
}
@keyframes cardIn {
  0%   { opacity: 0; transform: scale(1.06); filter: blur(8px); }
  25%  { opacity: 1; transform: scale(1.0);  filter: blur(0); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: scale(0.99); }
}

@media (max-width: 720px) {
  .title-main { font-size: 22px; }
  #telemetry { font-size: 9px; }
  .tel-row span { min-width: 140px; }
  #deck { width: 210px; right: 20px; }
  .bracket { width: 24px; height: 24px; }
}
