:root {
  --bg: #100b12;
  --ink: #f2e9da;
  --muted: #a3968a;
  --brass: #c8a25a;
  --brass-hi: #ecd29a;
  --gas: #b8c94e;
  --felt: #6d0f1c;
  --rule: rgba(200, 162, 90, .22);
  --serif: "Didot", "Bodoni 72", "Bodoni MT", "Playfair Display", "Libre Bodoni", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background: var(--bg); color: var(--ink);
  font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gas); outline-offset: 2px; }

/* ── Curtain and programme plaque ─────────────────────────────── */
.curtain {
  position: fixed; top: 0; bottom: 0; width: 51vw; z-index: 20;
  background:
    linear-gradient(rgba(0, 0, 0, .15), rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .55)),
    repeating-linear-gradient(90deg, #3e0810 0, #8a1a2a 22px, #5a0d19 40px, #3e0810 64px);
  transition: transform 1.3s cubic-bezier(.7, 0, .2, 1);
}
.curtain.l { left: 0; }
.curtain.r { right: 0; }
body.open .curtain.l { transform: translateX(-102%); }
body.open .curtain.r { transform: translateX(102%); }

.gate {
  position: fixed; inset: 0; z-index: 21; display: grid; place-items: center;
  text-align: center; padding: 16px; transition: opacity .45s;
}
.gate[hidden] { display: none; }
body.open .gate { opacity: 0; pointer-events: none; }
.plaque {
  width: min(520px, 100%); padding: 44px 32px 34px; background: #0f0a11;
  border: 1px solid var(--brass); outline: 1px solid rgba(200, 162, 90, .35); outline-offset: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
}
.eyebrow { margin: 0; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--brass); }
.plaque h1 { margin: 14px 0 10px; font: 400 clamp(46px, 11vw, 76px)/1 var(--serif); }
.sub { margin: 0 0 28px; font: italic 18px/1.4 var(--serif); color: #d8ccba; text-wrap: balance; }
.go {
  padding: 15px 30px; border: 0; border-radius: 2px; cursor: pointer;
  font-size: 14px; letter-spacing: .18em; text-transform: uppercase; color: #1a1208;
  background: linear-gradient(var(--brass-hi), var(--brass));
}
.go:hover { filter: brightness(1.08); }
.go:disabled { opacity: .6; cursor: default; }
.fine { margin: 22px 0 0; font-size: 13px; color: var(--muted); text-wrap: balance; }
.fine.err { color: #ff9d8a; }

/* ── "Funded by dumb.vc" stamp: same ink as the one on dumb.vc ── */
.stamp {
  position: absolute; z-index: 3; display: block; white-space: nowrap; text-align: center; text-decoration: none;
  font: 400 26px/1 Impact, "Arial Black", sans-serif; letter-spacing: .03em; text-transform: uppercase;
  color: #ff5fa2; background: rgba(11, 11, 16, .86);
  border: 4px solid #ff5fa2; border-radius: 10px; padding: 9px 14px 10px;
  outline: 1.5px solid #ff5fa2; outline-offset: -8px;
  transform: rotate(-9deg); transition: transform .15s;
}
.stamp::before {
  content: "FUNDED BY"; display: block; margin: 0 -.4em 3px 0;
  font: 800 8px system-ui, sans-serif; letter-spacing: .4em;
}
.stamp:hover { transform: rotate(-5deg) scale(1.05); }
.plaque { position: relative; }
.plaque .stamp { right: -16px; top: -28px; animation: stamp .45s cubic-bezier(.2, 1.4, .4, 1) .5s backwards; }
.stage .stamp { right: 18px; top: 20px; }
body.open .stage .stamp { animation: stamp .45s cubic-bezier(.2, 1.4, .4, 1) 1.15s backwards; }   /* slams once the curtain is clear */
@keyframes stamp { from { transform: rotate(-9deg) scale(2.6); opacity: 0; } }

/* ── Header ───────────────────────────────────────────────────── */
.top {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 10px 16px; padding: 14px clamp(16px, 3vw, 36px);
}
.word { font: 400 clamp(26px, 3.2vw, 38px)/1 var(--serif); }
.tag { margin-left: 12px; font: italic 15px var(--serif); color: var(--muted); }
.status { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border: 1px solid rgba(200, 162, 90, .35); border-radius: 999px;
  font-size: 12px; letter-spacing: .03em; color: var(--muted);
}
.pill b { font-weight: 500; color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #6b6159; transition: transform .08s; }
.pill.live .dot { background: var(--gas); box-shadow: 0 0 8px var(--gas); }
.pill.blip .dot { transform: scale(1.7); }

/* ── Stage ────────────────────────────────────────────────────── */
.stage {
  position: relative; height: clamp(230px, 44vh, 520px); overflow: hidden;
  background:
    radial-gradient(ellipse 70% 90% at 50% 0%, rgba(255, 210, 140, .16), transparent 70%),
    linear-gradient(#17101c, #0d090f);
}
#air { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.hint {
  position: absolute; left: 16px; right: 16px; top: 36%; margin: 0; text-align: center;
  font: italic clamp(18px, 2.4vw, 28px)/1.3 var(--serif); color: rgba(242, 233, 218, .6);
  pointer-events: none; transition: opacity .8s; text-wrap: balance;
}
.hint small { display: block; margin-top: 10px; font: 13px var(--sans); color: rgba(163, 150, 138, .85); }
.hint.gone { opacity: 0; }

/* ── Piano ────────────────────────────────────────────────────── */
.piano { position: relative; background: #070506; border-top: 1px solid #4a4245; }
.fallboard {
  display: grid; place-items: center; height: 46px;
  background: linear-gradient(#0b090a, #1c1719 55%, #0a0809);
  border-bottom: 3px solid var(--felt);
}
.maker {
  font: 14px var(--serif); letter-spacing: .34em; text-transform: uppercase;
  background: linear-gradient(var(--brass-hi), #a98441); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.keybed { padding: 0 clamp(8px, 2vw, 28px) 14px; background: linear-gradient(#131011, #070506); }
.keys {
  position: relative; height: clamp(120px, 22vh, 190px);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.key { position: absolute; top: 0; cursor: pointer; }
.key.white {
  height: 100%; border: 1px solid #1a1416; border-top: 0; border-radius: 0 0 4px 4px;
  background: linear-gradient(#fbf6ea, #e9e0cd); box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .09);
}
.key.black {
  z-index: 2; height: 62%; border-radius: 0 0 3px 3px;
  background: linear-gradient(#2c2729, #050405);
  box-shadow: inset 0 -5px 0 #3a3336, 0 2px 3px rgba(0, 0, 0, .5);
}
.key.white.on { background: linear-gradient(#eef3c4, var(--gas)); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); }
.key.black.on { background: linear-gradient(#69752a, #2c330c); box-shadow: inset 0 -2px 0 #4a5320; }
.lab {
  position: absolute; left: 0; right: 0; bottom: 9px; text-align: center; pointer-events: none;
  font-size: 10px; color: #a09382;
}
.lab.hot { color: #5d5142; font-weight: 600; }
.key.black .lab { bottom: 8px; color: #8d8186; }

/* ── Controls ─────────────────────────────────────────────────── */
.controls {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.panel { padding: 22px clamp(16px, 2.4vw, 30px) 26px; border-right: 1px solid rgba(200, 162, 90, .12); }
.panel h2 { margin: 0 0 18px; font: 400 12px var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--brass); }
.name { font: 16px var(--serif); }

.stops { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 6px; }
.stop { display: grid; justify-items: center; gap: 3px; padding: 0; border: 0; background: none; cursor: pointer; text-align: center; }
.knob {
  display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 7px; border-radius: 50%;
  border: 2px solid var(--brass); font: italic 19px var(--serif); color: #4a3b22;
  background: radial-gradient(circle at 34% 28%, #fffdf6, #e9dfc9 55%, #b9ab8c);
  box-shadow: 0 4px 0 #3a2d16, 0 7px 12px rgba(0, 0, 0, .5);
  transition: transform .12s, box-shadow .12s;
}
.stop[aria-pressed="true"] .knob {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #3a2d16, 0 0 0 3px rgba(184, 201, 78, .55), 0 0 18px rgba(184, 201, 78, .35);
}
.nm { font: italic 15px/1.2 var(--serif); }
.sb { font-size: 11px; line-height: 1.25; color: var(--muted); }

.slider, .field { display: grid; gap: 5px; margin-bottom: 16px; }
.slider input { width: 100%; margin: 0; accent-color: var(--brass); }
.ends { display: flex; justify-content: space-between; font: italic 12px var(--serif); color: var(--muted); }
select {
  width: 100%; padding: 9px 10px; border: 1px solid rgba(200, 162, 90, .4); border-radius: 3px;
  background: #1a1318; font: 15px var(--serif);
}
.stepper { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; border: 1px solid rgba(200, 162, 90, .4); border-radius: 3px; }
.stepper button { height: 38px; border: 0; background: rgba(200, 162, 90, .1); cursor: pointer; font-size: 18px; }
.stepper button:hover { background: rgba(200, 162, 90, .22); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { text-align: center; font: italic 15px var(--serif); }

.tunes { display: grid; gap: 8px; margin-bottom: 10px; }
.btn {
  padding: 9px 12px; border: 1px solid rgba(200, 162, 90, .4); border-radius: 3px; cursor: pointer;
  background: rgba(200, 162, 90, .07); text-align: left; font: 15px/1.25 var(--serif);
}
.btn:hover { background: rgba(200, 162, 90, .18); }
.btn:disabled { opacity: .4; cursor: default; }
.btn small { display: block; margin-top: 2px; font: 12px var(--sans); color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.now { margin: 14px 0 0; min-height: 2.6em; font: italic 14px/1.3 var(--serif); color: var(--muted); }
.now.live { color: var(--gas); }

body.drag::after {
  content: "Drop it. We'll sight-read."; position: fixed; inset: 12px; z-index: 30;
  display: grid; place-items: center; border: 2px dashed var(--gas); background: rgba(16, 11, 18, .85);
  font: italic 28px var(--serif); color: var(--gas); pointer-events: none;
}

footer { padding: 22px 16px 34px; text-align: center; font-size: 12px; color: var(--muted); }
footer p { margin: 0 0 6px; }

@media (max-width: 560px) {
  .tag { display: none; }
  .stamp { font-size: 20px; padding: 7px 11px 8px; }
  .plaque .stamp { right: -6px; top: -24px; }
  .stage .stamp { right: 10px; top: 14px; }
  .panel { border-right: 0; border-bottom: 1px solid rgba(200, 162, 90, .12); }
}
@media (prefers-reduced-motion: reduce) {
  .curtain { transition: none; }
  .stamp, body.open .stage .stamp { animation: none; transition: none; }
}
