/* Front-panel chrome for the winter slice, to sit in the site's dark card. */
:root {
  --bg: #0b0f16;
  --inset: #0e131c;
  --ink: #e4ebf5;
  --muted: #8796ad;
  --led: #5aa8ff;
  --line: #2a3447;
  --line-hi: #3a4760;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; width: 100%; height: 100%;
  width: 100dvw; height: 100dvh;
  overflow: hidden;
  background: var(--inset); color: var(--ink);
  font: 500 14px/1.35 "Space Grotesk", system-ui, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
html.tb-fs-fallback, html.tb-fs-fallback body {
  width: 100dvw; height: 100dvh; overflow: hidden;
}
#view {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; touch-action: none; cursor: crosshair; background: #9bb4cc;
}
.hud {
  position: absolute; inset: 0; pointer-events: none;
  touch-action: none;
}
.dock {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 10px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.tools, .controls { pointer-events: auto; }
.controls, .tools {
  display: flex; flex-direction: column; gap: 8px;
}
.btn {
  appearance: none; border: 1px solid var(--line-hi);
  background: linear-gradient(180deg, #232c3d, #171e2b);
  color: var(--ink); border-radius: 10px;
  min-width: 44px; min-height: 44px;
  padding: 5px 8px; cursor: pointer;
  display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  font: 500 0.58rem/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.1em; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .07), 0 3px 0 #0a0e15;
}
.btn svg {
  width: 18px; height: 18px; display: block;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.btn .lbl { display: block; }
.btn:hover { border-color: var(--led); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgb(255 255 255 / .07), 0 1px 0 #0a0e15; }
.btn[aria-pressed="true"] { border-color: var(--led); color: var(--led); }

.cue {
  position: absolute; left: 50%; top: 18%;
  transform: translate(-50%, 0);
  background: rgb(11 15 22 / .78);
  border: 1px solid var(--line-hi);
  border-radius: 12px; padding: 8px 14px;
  font: 500 0.78rem/1.3 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); pointer-events: none;
  text-align: center;
}
.cue[hidden] { display: none; }

.pedal {
  min-width: 72px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.pedal:active, .pedal.on { border-color: var(--led); color: var(--led); }
#stop svg { fill: currentColor; stroke: none; }

#fs .i-exit { display: none; }
#fs[aria-pressed="true"] .i-enter { display: none; }
#fs[aria-pressed="true"] .i-exit { display: block; }

#mute .i-muted { display: none; }
#mute[aria-pressed="true"] .i-speak { display: none; }
#mute[aria-pressed="true"] .i-muted { display: block; }

body:not(.is-ready) #view { visibility: hidden; }
body:not(.is-ready) .dock, body:not(.is-ready) .hud, body:not(.is-ready) .cue { visibility: hidden; }
body:not(.is-ready) .overlay {
  background: var(--inset);
  place-items: center;
  padding-top: 0;
}

.overlay {
  position: absolute; inset: 0;
  display: grid; place-items: start center;
  padding-top: 18%;
  background: rgb(11 15 22 / .28);
}
.overlay[hidden] { display: none; }
.loading {
  margin: 0;
  padding: 8px 14px;
  font: 500 0.78rem/1.3 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink);
  background: rgb(11 15 22 / .62);
  border: 1px solid var(--line-hi);
  border-radius: 12px;
}
.loading[hidden] { display: none; }
.start {
  min-width: 160px; min-height: 64px;
  border-radius: 16px; font-size: 0.92rem;
  letter-spacing: 0.14em;
}
.start .key-hint {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  opacity: 0.75;
}
.start:disabled { opacity: 0.6; cursor: wait; }

.dock[hidden], .tools[hidden], .controls[hidden], .hud [hidden] { display: none !important; }

/* Desktop (fine pointer): keys do the driving, so label the pedals W and S
   and hide Stop — letting go of the key is enough. Touch keeps latch + Stop. */
.lbl-desk { display: none; }
@media (hover: hover) and (pointer: fine) {
  #stop { display: none !important; }
  .lbl-touch { display: none; }
  .lbl-desk { display: block; }
}

html.fine-ui #stop { display: none !important; }
html.fine-ui .lbl-touch { display: none; }
html.fine-ui .lbl-desk { display: block; }
html.touch-ui #stop { display: inline-flex !important; }
html.touch-ui .lbl-touch { display: block; }
html.touch-ui .lbl-desk { display: none; }
