:root {
  /* Christmas: pine panels, holly red, ribbon gold, snow white */
  --bg: #0b1a13;
  --panel: #10251b;
  --plot: #06120c;
  --line: #24452f;
  --text: #f4efe2;
  --muted: #a7b8a4;
  --accent: #d93a4b;
  --gold: #f2c35b;
  --re: #ef5b67;
  --im: #f2c35b;
  --prob: #ffffff;
  --v: #5f8f68;
  --button: #173424;
  --button-hover: #1f4430;
  --button-border: #2f5e40;
  /* the frosted UI panels over the background layers */
  --glass-alpha: 0.5;
  --glass-border: #3a6b49;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -120px, rgba(242, 195, 91, 0.10), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 14px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif;
}

body.dropping { outline: 3px dashed var(--accent); outline-offset: -6px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.error { color: #ff8a80; }

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 14px 16px 10px;
  position: relative;
}
/* candy-cane stripe along the top of the page */
header::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: repeating-linear-gradient(135deg, var(--accent) 0 10px, #fbf7ef 10px 20px);
  opacity: 0.85;
}
header h1 { font-size: 19px; font-weight: 650; margin: 0 8px 0 0; letter-spacing: 0.2px; }
header h1 .holly { color: var(--accent); }
header h1 .sub { font-size: 13px; font-weight: 400; color: var(--gold); margin-left: 6px; font-style: italic; }

main { padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 10px; }

button, select, input[type="text"] {
  background: var(--button);
  color: var(--text);
  border: 1px solid var(--button-border);
  border-radius: 5px;
  padding: 5px 10px;
  font: inherit;
}
button { cursor: pointer; }
button:hover { background: var(--button-hover); border-color: var(--gold); }
button.primary { background: #7a1e2a; border-color: var(--gold); color: #fff8ea; }
button.primary:hover { background: #932534; }

.volume { display: inline-flex; align-items: center; gap: 6px; }

.view { display: flex; flex-direction: column; gap: 4px; }
.readout-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 26px; }
.legend { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.readout-row .fade { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.sw { display: inline-block; width: 10px; height: 3px; margin: 0 4px 3px 10px; vertical-align: middle; }
.sw.v { background: var(--v); }
.sw.re { background: var(--re); }
.sw.im { background: var(--im); }
.sw.pr { background: var(--prob); height: 4px; }

#plot { width: 100%; height: 130px; border-radius: 4px; background: transparent; display: block; }

/* See-through panels: the scenery and the road show through the UI, sharp.
   No backdrop-filter blur: re-blurring the animated layers behind a dozen panels
   every frame saturated the laptop's GPU (measured 100% busy) and looked smeary.
   The controls keep their opaque button colours, so they read clearly. */
header, .view, .group, .row, .keys-bar {
  background: rgba(16, 37, 27, var(--glass-alpha));
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
.view, .row, .keys-bar { border: 1px solid var(--glass-border); border-radius: 6px; padding: 6px 10px; }

.groups { display: flex; flex-wrap: wrap; gap: 8px; }
.group {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 10px;
  margin: 0;
  padding: 6px 10px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
}
.group legend { padding: 0 4px; color: var(--gold); font-size: 12.5px; }
.choice { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; min-width: 116px; }
.knob { display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: 110px; font-size: 12.5px; }
.knob label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.knob input[type="range"] { width: 100%; accent-color: var(--accent); }
.knob.inactive, .choice.inactive { opacity: 0.38; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; align-self: center; white-space: nowrap; }
.toggle input { accent-color: var(--accent); }
.knob .value { width: 100%; padding: 2px 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.row { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.section-title { color: var(--muted); margin-right: 6px; }
.presets, .songs, .transpose { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.song-mode { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.song-mode label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.song-mode input { accent-color: var(--accent); margin: 0; }
.choir { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.choir label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.choir input { accent-color: var(--accent); margin: 0; }
.choir input[type="range"] { width: 80px; }
.choir label.inactive { opacity: 0.38; }
#transposeReset { min-width: 116px; }
#presets { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.file { position: relative; overflow: hidden; background: var(--button); border: 1px solid var(--button-border); border-radius: 5px; padding: 5px 10px; cursor: pointer; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.keys { display: flex; flex-direction: column; gap: 4px; }
.keys-bar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.keys-bar button { margin-left: auto; }

.piano {
  position: relative;
  height: 110px;
  min-width: 720px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
#piano { overflow: hidden; }
/* the note highway: a transparent full-screen layer over the scenery and under the UI;
   its road reaches the piano's top edge and runs on under the keys (highway.js reads
   the piano's position) */
#highway { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: -1; }
.keys { overflow-x: auto; }
.key { position: absolute; top: 0; border-radius: 0 0 4px 4px; }
/* keys are a little see-through so the road shows running on under them; lit keys stay solid */
.key.white { height: 100%; background: rgba(251, 247, 239, 0.75); border: 1px solid #3a4a3e; z-index: 1; }
.key.black { height: 62%; background: rgba(20, 36, 26, 0.85); border: 1px solid #000; z-index: 2; }
.key.white.down { background: #f6a3ad; box-shadow: inset 0 -6px 0 var(--accent); }
.key.black.down { background: var(--accent); box-shadow: inset 0 -5px 0 var(--gold); }
.key span { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 10px; font-weight: 600; color: #2a352d; pointer-events: none; }

.layer { padding: 3px 9px; }
.layer[aria-pressed="false"] { opacity: 0.55; }
/* Synth hidden: only the piano stays, pinned to the bottom so the road keeps its length */
body.synth-hidden main > section:not(.keys) { display: none; }
body.synth-hidden .keys { position: fixed; left: 16px; right: 16px; bottom: 16px; }
body.scene-hidden #highway { visibility: hidden; }

/* knobs that do not apply to the current mode (SHOWN_WHEN in params.js) */
[hidden] { display: none !important; }
