:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #10110f;
  color: #f5f2e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #10110f;
}

button,
input,
select {
  font: inherit;
}

[data-ui-dwell-target-id] {
  --ui-dwell-progress: 0;
}

.ui-dwell-armed {
  outline: 2px solid rgba(98, 219, 132, 0.95);
  outline-offset: 3px;
  box-shadow:
    0 0 0 calc(2px + (8px * var(--ui-dwell-progress))) rgba(98, 219, 132, 0.16),
    0 0 22px rgba(98, 219, 132, 0.22);
}

.shell {
  min-height: 100vh;
  display: block;
  background: #10110f;
}

.stage {
  position: relative;
  min-height: 100vh;
  width: 100vw;
  overflow: hidden;
  isolation: isolate;
}

#camera,
#pianoCanvas,
.cursor-layer,
.zone-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#camera {
  object-fit: cover;
  opacity: 0.32;
  transform: scaleX(-1);
  background: #181b17;
}

#pianoCanvas {
  z-index: 2;
  touch-action: none;
  cursor: crosshair;
}

.cursor-layer,
.zone-layer {
  pointer-events: none;
  z-index: 4;
}

.start-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(12, 13, 12, 0.58), rgba(12, 13, 12, 0.78)),
    rgba(12, 13, 12, 0.64);
  backdrop-filter: blur(8px);
}

.start-overlay.hidden {
  display: none;
}

.load-mark {
  min-height: 22px;
  color: #d8cfaa;
  font-size: 14px;
  letter-spacing: 0;
}

.launch-panel {
  width: min(720px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  padding: 26px;
  border: 1px solid rgba(245, 242, 232, 0.14);
  border-radius: 8px;
  background: rgba(18, 20, 18, 0.84);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
}

.launch-panel h1 {
  font-size: clamp(34px, 8vw, 72px);
  line-height: 0.95;
}

.launch-kicker,
.launch-footnote {
  color: #d8cfaa;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.launch-copy {
  max-width: 52ch;
  margin: 0;
  color: #f5f2e8;
  font-size: 17px;
  line-height: 1.45;
}

.launch-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.launch-preset {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 14px;
  border: 1px solid rgba(245, 242, 232, 0.2);
  border-radius: 8px;
  background: rgba(245, 242, 232, 0.06);
  color: #f5f2e8;
  text-align: left;
  cursor: pointer;
}

.launch-preset span:last-child {
  color: #c9c9bc;
  font-size: 13px;
  line-height: 1.4;
}

.launch-preset.selected {
  border-color: #f0c75e;
  background: rgba(240, 199, 94, 0.14);
}

.launch-preset-name {
  font-size: 18px;
  font-weight: 850;
}

.start-button {
  appearance: none;
  border: 1px solid #f0c75e;
  color: #17130a;
  background: #f0c75e;
  border-radius: 8px;
  min-height: 52px;
  padding: 0 24px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.cursor {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 999px;
  border: 2px solid #f0c75e;
  background: rgba(13, 18, 14, 0.35);
  box-shadow: 0 0 0 6px rgba(240, 199, 94, 0.14);
}

.cursor.raw {
  border-color: #ffffff;
}

.cursor.kinematic {
  border-color: #6de6ff;
}

.cursor.filtered {
  border-color: #68f096;
}

.cursor.lookahead {
  border-color: #ff7ab8;
}

.activation-zone {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 242, 232, 0.34);
  background: rgba(16, 17, 15, 0.46);
  border-radius: 8px;
  color: #f5f2e8;
  font-weight: 800;
  text-align: center;
}

.activation-zone.active {
  border-color: #f0c75e;
  background: rgba(240, 199, 94, 0.18);
}

.panel {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  width: min(360px, calc(100vw - 24px));
  min-height: 0;
  padding: 18px;
  background: rgba(21, 23, 21, 0.88);
  border: 1px solid rgba(245, 242, 232, 0.14);
  border-radius: 8px;
  overflow-y: auto;
  box-shadow: 0 18px 64px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
}

.panel[data-ready="false"] {
  display: none;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.status-pill {
  min-width: 84px;
  text-align: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #2c332b;
  color: #d8f5ca;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.meters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.meters div {
  border: 1px solid rgba(245, 242, 232, 0.12);
  border-radius: 8px;
  padding: 10px;
  background: rgba(245, 242, 232, 0.05);
}

.meters span,
.settings span {
  display: block;
  color: #a9aa9e;
  font-size: 12px;
}

.meters strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.preset-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.preset-switch button {
  min-height: 42px;
  border: 1px solid rgba(245, 242, 232, 0.18);
  border-radius: 8px;
  background: #20251f;
  color: #f5f2e8;
  cursor: pointer;
}

.preset-switch button.selected {
  border-color: #f0c75e;
  color: #17130a;
  background: #f0c75e;
}

.settings {
  display: grid;
  gap: 12px;
}

.settings label {
  display: grid;
  gap: 6px;
}

.settings input,
.settings select {
  width: 100%;
  border: 1px solid rgba(245, 242, 232, 0.18);
  border-radius: 8px;
  min-height: 38px;
  color: #f5f2e8;
  background: #151815;
  padding: 0 10px;
}

.settings input[type="range"] {
  padding: 0;
}

.settings output {
  color: #d8cfaa;
  font-size: 12px;
}

.receipt {
  margin: 16px 0 0;
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid rgba(245, 242, 232, 0.12);
  border-radius: 8px;
  background: #0b0d0b;
  color: #d7f5cf;
  padding: 12px;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .stage {
    min-height: 100vh;
  }

  .panel {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    width: auto;
    max-height: 44vh;
  }

  .launch-panel {
    padding: 18px;
  }

  .launch-presets {
    grid-template-columns: 1fr;
  }
}
