:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #eafaff;
  background: #080b13;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  padding: 16px 8px;
  background: radial-gradient(ellipse at top, #262944, transparent 65%);
}
.machine {
  width: min(100%, 520px);
  margin: auto;
  padding: 8px;
  border: 1px solid #607080;
  border-radius: 19px;
  background: linear-gradient(115deg, #414d5c, #151b26 30%, #1d2737 75%, #48576b);
  box-shadow: inset 0 1px 2px #bdc9dc, 0 20px 55px #000b;
}
.marquee {
  padding: 12px 18px;
  text-align: center;
  border: 1px solid #646390;
  border-radius: 12px 12px 5px 5px;
  background: linear-gradient(90deg, #101327df, #15102d70, #101327df), url("./cover.png") center 38% / cover;
}
.marquee p { margin: 0; font-size: .74rem; color: #e1d3ff; }
.marquee h1 { margin: 3px 0; font-size: clamp(1.25rem, 5vw, 1.8rem); text-shadow: 0 2px 10px #050510; }
.body { padding: 8px clamp(8px, 4vw, 26px) 12px; }
.stats, .keys { display: grid; gap: 4px; text-align: center; }
.stats { grid-template-columns: 1.35fr 1fr 1fr; margin-bottom: 5px; }
.stats span {
  padding: 4px;
  border: 1px solid #435469;
  border-radius: 4px;
  background: #101623;
  color: #b2c7db;
  font-size: .7rem;
}
.stats strong {
  display: block;
  color: #aaf5ff;
  font: 700 1.15rem ui-monospace, monospace;
}
.bezel { position: relative; border: 1px solid #758898; border-radius: 5px; box-shadow: 0 0 0 4px #0a0d14; }
.bezel::before, .bezel::after {
  content: "";
  position: absolute;
  top: 10%;
  bottom: 10%;
  width: 3px;
  background: repeating-linear-gradient(to bottom, #72eafb 0 6px, transparent 6px 11px);
  pointer-events: none;
}
.bezel::before { left: -8px; }
.bezel::after { right: -8px; background: repeating-linear-gradient(to bottom, #f5bf75 0 6px, transparent 6px 11px); }
canvas { display: block; width: 100%; height: auto; border-radius: 4px; }
.keys { grid-template-columns: repeat(4, 1fr); margin-top: 7px; }
kbd {
  padding: 5px 0;
  border: 1px solid #536781;
  border-bottom-width: 3px;
  border-radius: 4px;
  background: linear-gradient(#33445b, #151d2c);
  font: 800 .9rem ui-monospace, monospace;
}
.deck {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  margin-top: 9px;
  padding: 9px;
  border: 1px solid #48576b;
  border-radius: 6px;
  background: #111824;
}
label { min-width: 0; font-size: .72rem; color: #c6d2e0; }
input { font: inherit; max-width: 100%; }
input[type=file] { display: block; }
input[type=number] { width: 59px; }
button {
  grid-column: 1 / -1;
  padding: 7px;
  border: 1px solid #c9f9ff;
  border-radius: 4px;
  background: linear-gradient(#adf3ff, #61bcdf);
  color: #0b2030;
  font: 800 .85rem system-ui;
  cursor: pointer;
}
button:disabled { opacity: .5; cursor: default; }
#status { grid-column: 1 / -1; margin: 0; color: #b4c4d6; font-size: .73rem; }
:focus-visible { outline: 2px solid #fce1aa; outline-offset: 2px; }
@media (max-height: 820px) and (min-width: 560px) {
  .machine { max-width: min(520px, calc(100svh - 270px)); }
}

/* The display and the keys share a single four-lane grid. */
body {
  background: radial-gradient(ellipse at 50% 36%, #33273c, #151520 55%, #080b13 86%);
}
.machine {
  width: min(100%, 610px);
  padding: 12px;
  border-radius: 12px 12px 24px 24px;
  background: linear-gradient(110deg,#44424d,#191a20 24%,#191a20 76%,#49434c);
}
.marquee { border-radius: 5px; border-color: #9c7266; box-shadow: inset 0 0 16px #050407; }
.body { padding: 0 14px 12px; }
.console {
  display: grid;
  grid-template-columns: clamp(24px, 7vw, 48px) minmax(0, 1fr) clamp(29px, 7vw, 48px);
  background: #121316;
  border: 1px solid #555159;
  border-top: 0;
  padding-bottom: 6px;
}
.bezel { grid-column: 2; grid-row: 1; border-radius: 0; border-width: 0 1px; box-shadow: none; }
.bezel::before, .bezel::after { display: none; }
canvas { border-radius: 0; }
.rail {
  grid-row: 1;
  display: grid;
  place-content: center;
  gap: 8px;
  min-width: 0;
  background: linear-gradient(90deg,#282934,#111218 65%,#26262d);
}
.left-rail { grid-column: 1; }
.left-rail::before {
  content: "";
  width: 15px;
  height: 74px;
  background: repeating-linear-gradient(#878183 0 2px, #272832 2px 6px, transparent 6px 11px);
  border-inline: 1px solid #3d3d45;
}
.right-rail { grid-column: 3; }
.meter {
  position: relative;
  width: 9px;
  height: 120px;
  max-height: 19vw;
  margin: auto;
  border: 1px solid #4e4544;
  background: repeating-linear-gradient(#382d31 0 4px,#17161c 4px 6px);
  overflow: hidden;
}
.meter i {
  position: absolute;
  inset: auto 0 0;
  height: var(--progress, 0%);
  background: repeating-linear-gradient(transparent 0 4px,#161419 4px 6px),linear-gradient(#ffda82,#f46c52);
}
#time { color: #ffc99a; font: 700 .6rem ui-monospace, monospace; }
.stats {
  position: absolute;
  top: 6px;
  left: 4px;
  right: 4px;
  margin: 0;
  pointer-events: none;
}
.stats span { background: #080c17db; border-color: #7282986e; }
.stats strong { color: #ffe6a7; }
.keys { grid-column: 2; margin-top: 4px; gap: 4px; padding: 0 2px; }
kbd { border-color: #65525b; color: #ffdbab; background: linear-gradient(#39343d,#211f29); }
kbd.active { background: linear-gradient(#ffe8ae,#e3794b); color: #251923; }
.control-deck {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  height: 77px;
  margin: 0 -9px;
  overflow: hidden;
  border: 1px solid #71636a;
  border-radius: 2px 2px 12px 12px;
  background: linear-gradient(#36353e,#171820);
  box-shadow: inset 0 2px #ffffff26;
}

@media (max-height: 900px) and (min-width: 560px) {
  .machine { max-width: min(610px, max(420px, calc(100svh - 260px))); }
}
@media (max-width: 380px) {
  .body { padding-inline: 4px; }
  .control-deck { margin-inline: 0; }
  .stats strong { font-size: .88rem; }
}

.machine {
  --hardware-grain: repeating-linear-gradient(0deg, #fff0 0 2px, #ffffff0a 2px 3px, #0002 3px 4px);
  border: 1px solid #777b81;
  border-radius: 14px;
  background: var(--hardware-grain), linear-gradient(125deg,#43474d,#24272c 28%,#181b20 72%,#383b41);
  box-shadow: inset 0 1px #b3b7b9, inset 0 -4px #101114, 0 25px 55px #000c;
}
.marquee { margin: 0 7px; border-color: #717678; }
.body { padding-top: 8px; }
.console { border: 1px solid #101216; box-shadow: inset 0 1px #64676a, 0 1px #51545b; }
.rail { background: var(--hardware-grain), linear-gradient(90deg,#2e3136,#181b20); }
.keys { gap: 6px; padding: 2px 4px; }
.keys kbd {
  --pad-light: #d9a5ff;
  position: relative;
  padding: 5px 0 8px;
  border: 1px solid #606269;
  border-bottom: 4px solid #121219;
  border-radius: 6px;
  background: radial-gradient(ellipse at 50% 0%,#3e4149,#23262d 75%);
  box-shadow: inset 0 1px #ffffff23, 0 2px 2px #000b;
  color: #eceff2;
}
.keys kbd:nth-child(2) { --pad-light: #84e8ff; }
.keys kbd:nth-child(3) { --pad-light: #90ffc9; }
.keys kbd:nth-child(4) { --pad-light: #ffc385; }
.keys kbd::after {
  content: "";
  position: absolute;
  inset: auto 25% 3px;
  height: 2px;
  background: var(--pad-light);
  opacity: .45;
}
.keys kbd.active {
  transform: translateY(2px);
  background: var(--pad-light);
  color: #15151b;
  box-shadow: 0 0 10px var(--pad-light);
}
.control-deck {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(10px, 4vw, 26px);
  height: auto;
  min-height: 100px;
  margin: 4px 0 0;
  padding: 8px 12px;
  border: 1px solid #111216;
  border-radius: 6px;
  background: var(--hardware-grain), linear-gradient(#41444a,#272a30);
  box-shadow: inset 0 1px #ffffff3a, inset 0 -2px #0d0e11;
}
.deck-grille {
  height: 44px;
  border: 1px solid #3b3e43;
  border-radius: 5px;
  background: repeating-linear-gradient(0deg,#101217 0 2px,#30333a 2px 5px);
  box-shadow: inset 0 1px 4px #0009, 0 1px #ffffff15;
}
.trim { display: grid; justify-items: center; gap: 2px; color: #e0e2e3; font-size: .68rem; }
.dial-scale {
  display: grid;
  place-items: center;
  width: 56px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-conic-gradient(from -132deg,#c7bda1 0deg 2deg,transparent 2deg 22deg);
}
.dial {
  position: relative;
  width: 45px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid #17181b;
  background: radial-gradient(circle at 36% 28%,#7b7e82,#484c51 60%,#23252a 64%);
  box-shadow: 0 2px 5px #000c, inset 0 1px #d0d0d066;
  transform: rotate(var(--dial-angle, 0deg));
}
.dial::before {
  content: "";
  position: absolute;
  top: 3px;
  left: calc(50% - 1px);
  width: 2px;
  height: 9px;
  background: #ffe1a2;
  box-shadow: 0 0 4px #ffbf6a99;
}
.trim-value { color: #bdebf0; }
.trim-value input { width: 57px; border: 1px solid #656a6b; border-radius: 3px; background: #10181b; color: inherit; font-family: ui-monospace, monospace; text-align: center; }
.deck { grid-template-columns: minmax(0,1fr); margin-top: 6px; background: #181b21; border-color: #52555e; }
