/* JevBox 2000: a classic skinned media player. Everything fits one screen.
   The prompt sits top-centre; every other window is feedback: what Jev
   decided, what is playing right now, and ideas for what to type next. */
:root {
  --win: #2b2b3c;
  --win-hi: #6a6a8c;
  --win-lo: #0c0c14;
  --face: linear-gradient(180deg, #3b3b52 0%, #2a2a3a 45%, #22222f 100%);
  --text: #d6d9ec;
  --muted: #8b8fae;
  --lcd-bg: #030603;
  --lcd: #34f034;
  --lcd-mid: #1fa61f;
  --lcd-dim: #0d3b0f;
  --gold: #e0b84c;
  --gold-lo: #6b5316;
  --sel: #1c2fd0;
  --accent: #34f034;
  --ui: 11px/1.3 Tahoma, Verdana, 'Segoe UI', sans-serif;
  --pixel: 'Silkscreen', 'Courier New', monospace;
  --lcdfont: 'VT323', 'Courier New', monospace;
  color-scheme: dark;
}
/* Registered so knobs and meters can slide and animate between values. */
@property --v { syntax: '<number>'; inherits: true; initial-value: 0.5; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    repeating-conic-gradient(#ffffff06 0 25%, transparent 0 50%) 0 0 / 4px 4px,
    radial-gradient(ellipse at 50% -20%, color-mix(in srgb, var(--accent) 26%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse at 15% 0%, #283a7a 0%, transparent 55%),
    radial-gradient(ellipse at 90% 100%, #4a1a5a 0%, transparent 50%),
    #07070f;
  color: var(--text);
  font: var(--ui);
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 1px dotted var(--gold); outline-offset: 1px; }

/* ------------------------------------------------------------ desktop grid */
.desktop {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(400px, 1.3fr) minmax(320px, 1fr);
  grid-template-rows: minmax(min-content, 1.05fr) minmax(0, 1fr);
  grid-template-areas: 'main prompt log' 'eq ideas decisions';
  gap: 10px;
  padding: 10px;
  max-width: 1680px;
  margin: 0 auto;
}
.win-main { grid-area: main; }
.win-eq { grid-area: eq; }
.win-log { grid-area: log; }
.win-prompt { grid-area: prompt; }
.win-ideas { grid-area: ideas; }
.win-decisions { grid-area: decisions; }
/* The player's content sets the top row; these windows fill what they get. */
.win-prompt, .win-log { contain: size; }

/* ------------------------------------------------------------ windows */
.win {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--face);
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 var(--win-hi), inset -1px -1px 0 var(--win-lo), 3px 4px 0 #0008;
}
.desktop.playing .win:not(.win-prompt) { box-shadow: inset 1px 1px 0 var(--win-hi), inset -1px -1px 0 var(--win-lo), 3px 4px 0 #0008, 0 0 22px -12px var(--accent); }
.titlebar {
  flex: none; display: flex; align-items: center; gap: 5px;
  height: 16px; padding: 0 4px; margin: 2px 2px 0;
  background: linear-gradient(180deg, #474763, #26263a);
  border: 1px solid #0a0a12;
}
.titlebar::before, .titlebar::after {
  content: ''; flex: 1; height: 8px;
  background: repeating-linear-gradient(180deg, var(--gold) 0 1px, var(--gold-lo) 1px 2px, transparent 2px 3px);
  opacity: 0.85;
}
.titlebar h1, .titlebar h2 { order: 0; margin: 0; font: 10px/1 var(--pixel); letter-spacing: 1px; color: #efe6c4; white-space: nowrap; text-shadow: 1px 1px 0 #000; }
.titlebar h1 b { color: var(--gold); font-weight: normal; }
.titlebar::after { order: 1; }
.wbtns { order: 2; display: flex; gap: 2px; }
.wbtns i {
  width: 11px; height: 10px; display: grid; place-items: center; font: 8px/1 var(--pixel); font-style: normal; color: #cfd2e8;
  background: linear-gradient(#5a5a78, #33334a); border: 1px solid #000; box-shadow: inset 1px 1px 0 #8686a8;
}
.win-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 6px 7px 7px; }

/* ------------------------------------------------------------ LCD */
.lcd {
  background:
    repeating-linear-gradient(180deg, #ffffff05 0 1px, transparent 1px 3px),
    var(--lcd-bg);
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #3a3a52, 0 0 0 1px #15151f;
  color: var(--lcd);
  font-family: var(--lcdfont);
  text-shadow: 0 0 4px #34f03466;
}

/* ------------------------------------------------------------ player */
.main-lcd {
  flex: 1; min-height: 0; display: grid; gap: 4px 10px; padding: 6px 8px;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto minmax(30px, 1fr) auto;
  grid-template-areas: 'clock info' 'fields fields' 'vis vis' 'foot foot';
}
.lcd-clock { grid-area: clock; display: flex; align-items: center; gap: 4px; }
.play-state { font-size: 18px; line-height: 1; width: 14px; }
.time { font-size: 46px; line-height: 0.9; letter-spacing: 2px; }
.desktop.paused .time { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.15; } }
.lcd-info { grid-area: info; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 3px; }
.marquee { overflow: hidden; white-space: nowrap; font-size: 22px; line-height: 1.1; }
.marquee span { display: inline-block; padding-left: 100%; animation: marquee 18s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }
.lcd-fields {
  grid-area: fields; display: grid; grid-template-columns: auto auto auto minmax(0, 1fr) auto; gap: 0 12px;
  border-top: 1px dotted var(--lcd-dim); padding-top: 3px;
}
.lcd-fields span { display: flex; flex-direction: column; min-width: 0; }
.lcd-fields b { font-weight: normal; font-size: 21px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcd-fields small { font: 7px var(--pixel); color: var(--lcd-mid); letter-spacing: 1px; }
.leds { display: flex; gap: 5px; }
.leds span { font: 8px/1 var(--pixel); padding: 2px 3px; color: var(--lcd-dim); border: 1px solid var(--lcd-dim); text-shadow: none; }
.leds span.on { color: #04140a; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 6px var(--accent); }
#led-load.on { animation: blink 0.6s steps(1) infinite; }
/* contain: size keeps the canvas's own pixel size out of the layout. */
.vis { grid-area: vis; display: block; width: 100%; height: 100%; min-height: 0; contain: size; image-rendering: pixelated; cursor: pointer; border: 1px solid #0d220d; }
.lcd-foot { grid-area: foot; display: flex; gap: 8px; align-items: center; min-width: 0; }
.beats { display: flex; gap: 3px; flex: none; }
.beats i { width: 8px; height: 8px; border: 1px solid var(--lcd-dim); }
.beats i.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 6px var(--accent); }
.beats i.down { background: #fff; box-shadow: 0 0 8px var(--accent); }
.form { flex: 1; display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; min-width: 0; }
.form:empty::before { content: 'SONG FORM · WAITING FOR A PROMPT'; font: 7px/11px var(--pixel); color: var(--lcd-dim); letter-spacing: 1px; text-shadow: none; }
.form li { position: relative; height: 11px; min-width: 0; overflow: hidden; border: 1px solid var(--lcd-dim); }
.form li i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); opacity: 0.55; transition: width 0.4s linear; }
.form li.on i { width: calc(var(--p, 0) * 100%); }
.form li.done i { width: 100%; opacity: 0.18; }
.form li span { position: relative; display: block; padding-left: 2px; font: 7px/9px var(--pixel); color: var(--lcd-mid); text-shadow: none; white-space: nowrap; }
.form li.on { border-color: var(--accent); box-shadow: 0 0 6px -1px var(--accent); }
.form li.on span { color: #fff; }

.info { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.info div { display: grid; grid-template-columns: 48px 1fr; align-items: baseline; min-width: 0; }
.info dt { font: 8px var(--pixel); color: var(--gold); letter-spacing: 1px; }
.info dd { margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info b { font-weight: bold; }
.info small { color: var(--muted); margin-left: 5px; }

.sliders { display: flex; gap: 14px; align-items: center; font: 8px var(--pixel); color: var(--gold); }
.slider { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.slider b { font: 11px Tahoma, sans-serif; color: var(--text); white-space: nowrap; }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 8px; background: linear-gradient(90deg, #104010, #2a8a2a, #c8c020); border: 1px solid #000; box-shadow: inset 1px 1px 0 #000; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 11px; background: linear-gradient(#d8d8e8, #7a7a98); border: 1px solid #000; box-shadow: inset 1px 1px 0 #fff; cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 14px; height: 11px; border-radius: 0; background: linear-gradient(#d8d8e8, #7a7a98); border: 1px solid #000; cursor: pointer; }
.meter { flex: 1; height: 8px; display: block; background: #050805; border: 1px solid #000; box-shadow: inset 1px 1px 0 #000; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 3px, transparent 3px 4px); transition: width 0.6s; }

.transport { display: flex; gap: 3px; align-items: center; }
.btn {
  min-width: 26px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center;
  font: 11px/1 Tahoma, sans-serif; color: #e3e6f7; cursor: pointer;
  background: linear-gradient(180deg, #62627e, #3a3a52 55%, #2e2e42);
  border: 1px solid #000; border-radius: 0;
  box-shadow: inset 1px 1px 0 #9a9abb, inset -1px -1px 0 #1b1b28;
}
.btn:hover:not(:disabled) { color: #fff; background: linear-gradient(180deg, #74749a, #45455f 55%, #34344a); }
.btn:active:not(:disabled), .btn.on { background: linear-gradient(180deg, #1f1f30, #33334a); box-shadow: inset 1px 1px 0 #0a0a10, inset -1px -1px 0 #5c5c7c; color: var(--accent); }
.btn:disabled { opacity: 0.45; cursor: default; }
.toggle-btn { font: 8px var(--pixel); letter-spacing: 1px; margin-left: 6px; }
.logo { display: inline-block; margin-left: auto; font-size: 18px; color: var(--gold); text-shadow: 0 0 6px var(--gold-lo); }
.desktop.playing .logo { color: var(--accent); text-shadow: 0 0 8px var(--accent); }

/* ------------------------------------------------------------ prompt */
/* The one place to type: gold frame, a pulsing call while empty, a label. */
.win-prompt { box-shadow: inset 1px 1px 0 var(--win-hi), inset -1px -1px 0 var(--win-lo), 3px 4px 0 #0008, 0 0 0 1px var(--gold-lo), 0 0 20px -6px var(--gold); }
.desktop.playing .win-prompt { box-shadow: inset 1px 1px 0 var(--win-hi), inset -1px -1px 0 var(--win-lo), 3px 4px 0 #0008, 0 0 0 1px color-mix(in srgb, var(--accent) 40%, #000), 0 0 22px -6px var(--accent); }
.win-prompt .titlebar h2 { color: var(--gold); }
.prompt-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; cursor: text; white-space: nowrap; overflow: hidden; }
.prompt-label b { font: 8px var(--pixel); font-weight: normal; letter-spacing: 1px; color: var(--gold); }
.prompt-label span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.win-prompt.empty .prompt-label b { animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }
.screen { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.screen:focus-within { box-shadow: inset 1px 1px 0 #000, 0 0 0 1px var(--gold); }
.win-prompt.empty .screen { box-shadow: inset 1px 1px 0 #000, 0 0 0 1px var(--gold); }
.vision { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
/* Flashes on every downbeat while music plays. */
.beat-glow { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; box-shadow: inset 0 0 0 1px var(--accent), inset 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent); will-change: opacity; }
/* While the prompt is empty the same layer pulses gold: "type here". */
.win-prompt.empty .beat-glow { box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 26px #e0b84c99; animation: prompt-call 1.8s ease-in-out infinite; }
@keyframes prompt-call { 0%, 100% { opacity: 0.15; } 50% { opacity: 1; } }
/* CRT scanlines over the picture, under the text. */
.screen::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: repeating-linear-gradient(180deg, transparent 0 2px, #0000004d 2px 3px); }
.screen textarea {
  position: relative; z-index: 2; display: block; width: 100%; height: 100%;
  resize: none; padding: 8px 10px; border: 0; outline: none;
  background: linear-gradient(180deg, #000000c4 0%, #0000009a 26%, transparent 55%);
  color: var(--lcd); caret-color: var(--gold);
  font: 22px/1.05 var(--lcdfont);
  text-shadow: 0 0 2px #000, 0 0 6px #000, 0 0 4px #34f03488;
}
.screen textarea::placeholder { color: var(--lcd-mid); text-shadow: 0 0 2px #000; opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 3px; }
.chips:empty { display: none; }
.chips span { font: 8px var(--pixel); padding: 3px 4px; color: #04140a; background: var(--accent); border: 1px solid #000; box-shadow: inset 1px 1px 0 #fff6; }
.chips span.new { animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }
.hint { margin: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint b { color: var(--text); font-weight: normal; }
.statusbar { display: flex; justify-content: space-between; gap: 8px; padding: 2px 5px; background: #16161f; border: 1px solid #000; box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #3a3a52; white-space: nowrap; }
.statusbar #status { overflow: hidden; text-overflow: ellipsis; }
.statusbar #latency { color: var(--muted); }
body.loading #status::before { content: '● '; color: var(--gold); animation: blink 0.6s steps(1) infinite; }
.notice { margin: 0; color: var(--gold); }
.notice:empty { display: none; }

/* ------------------------------------------------------------ jev log */
.log { flex: 1; min-height: 0; overflow: hidden; padding: 6px 8px; font-size: 17px; line-height: 1.05; display: flex; flex-direction: column; gap: 4px; }
.log p { margin: 0; }
.log .dim { color: var(--lcd-mid); }
.boot p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: type-in 0.5s steps(24) both; animation-delay: calc(var(--d, 0) * 0.28s); }
.boot b { font-weight: normal; color: #eaffea; text-shadow: 0 0 6px var(--lcd); }
.boot .err { color: #ff6a5a; white-space: normal; }
@keyframes type-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.cursor { animation: blink 1s steps(1) infinite; }
.asking { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.ask-lines { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; color: var(--lcd-mid); }
.ask-lines p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-lines i { font-style: normal; margin-left: 6px; color: var(--gold); }
.ask-lines p:last-child { color: var(--lcd); }
.spin { color: var(--gold); }
.spin b { font-weight: normal; }
.spin b::after { content: '|'; animation: spin 0.4s steps(1) infinite; }
@keyframes spin { 0% { content: '|'; } 25% { content: '/'; } 50% { content: '-'; } 75% { content: '\\'; } }
.log-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.log-stats div { border: 1px solid var(--lcd-dim); padding: 1px 4px; animation: pop 0.4s ease-out both; }
.log-stats div:nth-child(2) { animation-delay: 60ms; } .log-stats div:nth-child(3) { animation-delay: 120ms; } .log-stats div:nth-child(4) { animation-delay: 180ms; }
.log-stats b { display: block; font-weight: normal; font-size: 20px; color: var(--lcd); }
.log-stats span { font: 8px var(--pixel); color: var(--lcd-mid); }
.wf { display: flex; height: 7px; border: 1px solid var(--lcd-dim); }
.wf i { height: 100%; }
.wf .s-net { background: #1f5f7f; } .wf .s-jev { background: var(--lcd); } .wf .s-cpu { background: #c8c020; } .wf .s-wait { background: #6a3aa0; }
.q { display: grid; grid-template-columns: 58px 1fr; gap: 0 6px; }
.q > span { font: 8px/17px var(--pixel); color: var(--lcd-mid); }
.q .opts { display: flex; flex-direction: column; min-width: 0; }
.opt { display: grid; grid-template-columns: minmax(0, 1fr) 70px 34px; gap: 4px; align-items: center; color: var(--lcd-mid); white-space: nowrap; }
.opt em { font-style: normal; overflow: hidden; text-overflow: ellipsis; }
.opt.chosen { color: var(--lcd); }
.opt i { height: 6px; background: var(--lcd-dim); }
.opt i::before { content: ''; display: block; height: 100%; width: var(--w); background: currentColor; transform-origin: left; animation: grow 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }
.opt b { font-weight: normal; text-align: right; }
.log-lines { color: var(--lcd-mid); }
.log-lines p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-lines b { font-weight: normal; color: var(--lcd); }

/* ------------------------------------------------------------ equalizer */
.eq-top { display: flex; gap: 4px; align-items: center; }
.eq-top .btn { font: 8px var(--pixel); letter-spacing: 1px; height: 16px; cursor: default; }
.eq-curve { flex: 1; height: 16px; }
.eq-curve polyline { fill: none; stroke: var(--accent); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.eq-bands { flex: 1; min-height: 110px; display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; padding: 6px 4px 2px; border: 1px solid #000; box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #45455f; background: #1b1b27; }
.band { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 0; cursor: help; }
.band:first-child { border-right: 1px dotted #45455f; }
.track {
  position: relative; flex: 1; width: 11px; background: #06060a; border: 1px solid #000; box-shadow: inset 1px 1px 0 #000, 1px 1px 0 #45455f;
  transition: --v 0.8s cubic-bezier(0.3, 1.5, 0.5, 1) calc(var(--i, 0) * 45ms);
}
/* An LED ladder: the full-height gradient is revealed up to the value. */
.track .fill {
  position: absolute; inset: 0 1px; background: linear-gradient(0deg, #1fae1f, #b8d01c 60%, #e05a18);
  clip-path: inset(calc((1 - var(--v)) * 100%) 0 0 0);
  -webkit-mask: repeating-linear-gradient(0deg, #000 0 3px, transparent 3px 4px); mask: repeating-linear-gradient(0deg, #000 0 3px, transparent 3px 4px);
  opacity: 0.85;
}
.track .knob { position: absolute; left: -4px; right: -4px; height: 9px; bottom: calc(var(--v) * (100% - 9px)); background: linear-gradient(#e2e2f0, #86869e); border: 1px solid #000; box-shadow: inset 1px 1px 0 #fff; }
/* Lit while the part this decision shapes is playing. */
.track::after { content: ''; position: absolute; inset: -2px; pointer-events: none; box-shadow: 0 0 9px 2px var(--accent); opacity: calc(var(--hit, 0) * 0.9); will-change: opacity; }
.band .led { width: 9px; height: 4px; flex: none; background: var(--accent); border: 1px solid #000; opacity: calc(0.12 + var(--hit, 0) * 0.88); box-shadow: 0 0 6px var(--accent); will-change: opacity; }
.band.s-explicit .knob { background: linear-gradient(#bfe8ff, #4f86c8); }
.band.s-genre .knob { background: linear-gradient(#b8b8c4, #5c5c6c); }
.band.s-variation .knob { background: linear-gradient(#fff0a0, #c8a028); }
.band span { font: 8px var(--pixel); color: var(--gold); letter-spacing: 0; }
.band small { font: 10px var(--lcdfont); color: var(--muted); height: 10px; line-height: 10px; white-space: nowrap; }
/* Before the first prompt the bands wave like a demo mode. */
.eq-bands.idle .track { animation: eq-idle 1.6s steps(16) infinite alternate; animation-delay: calc(var(--i, 0) * -0.2s); }
.eq-bands.idle .fill { opacity: 0.5; }
@keyframes eq-idle { from { --v: 0.12; } to { --v: 0.88; } }

/* ------------------------------------------------------------ ideas */
.tabs { position: relative; flex: none; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; padding: 3px 4px; font: 8px/1 var(--pixel); letter-spacing: 0; color: var(--muted); cursor: pointer; white-space: nowrap;
  background: linear-gradient(#3e3e58, #27273a); border: 1px solid #000; box-shadow: inset 1px 1px 0 #6a6a8c;
}
.tabs button:hover { color: #fff; }
.tabs button[aria-selected=true] { color: #1a1204; background: linear-gradient(#f3d27a, var(--gold)); box-shadow: inset 1px 1px 0 #fff8; }
.tabs button.lit::after { content: ' ●'; color: var(--accent); text-shadow: 0 0 4px var(--accent); }
.tabs button[aria-selected=true].lit::after { color: #1a1204; text-shadow: none; }
.tab-timer { flex: none; display: block; height: 2px; margin-top: -4px; background: #000; overflow: hidden; }
.tab-timer i { display: block; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }
.idea-screen { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; border: 1px solid #000; box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #3a3a52; }
.idea-panel {
  position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none; padding: 4px 6px 10px; margin: 0;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.35s, transform 0.35s, visibility 0s 0.35s;
  -webkit-mask: linear-gradient(transparent, #000 6px, #000 calc(100% - 14px), transparent); mask: linear-gradient(transparent, #000 6px, #000 calc(100% - 14px), transparent);
}
.idea-panel::-webkit-scrollbar { display: none; }
.idea-panel.active { opacity: 1; visibility: visible; transform: none; transition: opacity 0.35s, transform 0.35s; }
.idea-panel.playlist { overflow-y: auto; max-height: none; border: 0; box-shadow: none; background: none; padding: 3px 0 10px; }
.idea-group h3 { margin: 5px 0 3px; font: 8px var(--pixel); font-weight: normal; letter-spacing: 1px; color: var(--gold); }
.idea-group:first-child h3 { margin-top: 1px; }
.idea-group h3 small { color: var(--muted); }
.idea-note { margin: 1px 0 5px; font: 16px/1 var(--lcdfont); color: var(--lcd-mid); }
.tags { display: flex; flex-wrap: wrap; gap: 3px; }
.tag {
  padding: 1px 5px; font: 11px/1.35 Arial, Helvetica, sans-serif; color: #2fe02f; cursor: pointer; white-space: nowrap;
  background: #041204; border: 1px solid #0d3b0f; transition: background 0.15s, color 0.15s;
}
.tag:hover, .tag:focus-visible { color: #021002; background: var(--lcd); border-color: var(--lcd); }
.tag.on { color: #0a0a0a; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px var(--accent); }
.tag.quote { color: #a8e8a8; font-style: italic; white-space: normal; text-align: left; }
.tag.kbd { font: 17px/1 var(--lcdfont); color: var(--lcd); padding: 1px 5px 0; }
.mood-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.mood-list li { display: grid; grid-template-columns: 92px 1fr; gap: 5px; align-items: start; padding-left: 5px; border-left: 3px solid var(--c); }
.mood-list span { display: flex; flex-wrap: wrap; gap: 3px; min-width: 0; }
.tag.mood { font: 8px/15px var(--pixel); text-transform: uppercase; color: var(--c); border-color: color-mix(in srgb, var(--c) 45%, #000); background: color-mix(in srgb, var(--c) 12%, #000); text-align: left; }
.tag.mood:hover, .tag.mood.on { color: #000; background: var(--c); border-color: var(--c); box-shadow: 0 0 8px var(--c); }
.tweaks { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 3px 10px; }
.tweaks div { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tweaks dd { margin: 0; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blink-hint { color: var(--gold); }

/* ------------------------------------------------------------ playlists */
.playlist {
  flex: 1; min-height: 0; margin: 0; padding: 3px 0; list-style: none; overflow: hidden;
  background: #000; border: 1px solid #000; box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #3a3a52;
  font: 11px/1.4 Arial, Helvetica, sans-serif; color: #2fe02f;
}
.playlist li { position: relative; display: flex; gap: 6px; padding: 0 5px; white-space: nowrap; min-width: 0; }
.playlist .n { color: #1fa61f; width: 18px; text-align: right; flex: none; }
.playlist .k { width: 104px; flex: none; overflow: hidden; text-overflow: ellipsis; color: #1fbf1f; }
.playlist .v { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.playlist .s { flex: none; color: #1fa61f; }
.playlist li.s-Jev .v { color: #6aff6a; }
.playlist li.s-genre .v { color: #bfc4bf; }
.playlist li.s-explicit { background: var(--sel); }
.playlist li.s-explicit .v, .playlist li.s-explicit .k, .playlist li.s-explicit .n, .playlist li.s-explicit .s { color: #fff; }
.playlist li.s-variation .v { color: #ffe060; }
.playlist li:hover { background: #10223a; }
/* A row glows while the part it decided is sounding. */
#decision-list li::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, var(--accent), transparent 85%); opacity: calc(var(--hit, 0) * 0.42); will-change: opacity; }
#decision-list li.fresh { animation: row-in 0.35s ease-out both; animation-delay: calc(var(--i, 0) * 30ms); }
#decision-list li.changed { animation: row-flash 1.4s ease-out; }
#decision-list li.changed .v::after { content: ' ◂'; color: #ffe060; animation: fade-out 2s forwards; }
@keyframes row-in { from { opacity: 0; transform: translateX(-10px); } }
@keyframes row-flash { 0%, 25% { background: #ffe06066; } }
@keyframes fade-out { to { opacity: 0; } }
/* Before the first prompt: the slots Jev will fill, scanned top to bottom. */
#decision-list li.idle .v, #decision-list li.idle .s { color: #1a6a1a; }
#decision-list li.idle { animation: idle-scan 3.4s steps(34) infinite; animation-delay: calc(var(--i, 0) * 0.2s - 3.4s); }
@keyframes idle-scan { 0%, 6% { background: #0f3a0f; } 14%, 100% { background: transparent; } }
.examples li { padding: 0; }
.examples button { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0 5px; color: inherit; cursor: pointer; overflow: hidden; text-overflow: ellipsis; font: inherit; counter-increment: track; }
.examples { counter-reset: track; }
.examples button::before { content: counter(track) '. '; }
.examples li > span { padding-right: 6px; color: #1fa61f; }
.examples li.current { background: var(--sel); }
.examples li.current button, .examples li.current span { color: #fff; }
.pl-footer { display: flex; justify-content: space-between; gap: 8px; font: 8px var(--pixel); color: var(--gold); letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; }
.win-eq .pl-footer { color: var(--muted); justify-content: center; }
.legend i { display: inline-block; width: 7px; height: 7px; margin: 0 2px 0 5px; border: 1px solid #000; vertical-align: -1px; }
.legend i.s-Jev { background: #6aff6a; } .legend i.s-genre { background: #bfc4bf; } .legend i.s-explicit { background: var(--sel); } .legend i.s-variation { background: #ffe060; }

/* ------------------------------------------------------------ small screens */
@media (max-width: 1080px), (max-height: 560px) {
  body { overflow-y: auto; overflow-x: hidden; }
  .desktop { height: auto; min-height: 100vh; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: none; grid-template-areas: 'main prompt' 'eq ideas' 'log decisions'; }
  .win-prompt, .win-log { contain: none; }
  .screen { min-height: 190px; }
  .log { min-height: 250px; }
  .idea-screen { min-height: 280px; }
  .eq-bands { min-height: 200px; }
  .playlist { overflow: auto; max-height: 340px; }
  .vis { min-height: 48px; }
}
@media (max-width: 700px) {
  .desktop { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'prompt' 'main' 'ideas' 'log' 'decisions' 'eq'; padding: 8px; }
  .screen { min-height: 170px; }
  .lcd-fields { grid-template-columns: repeat(3, auto) minmax(0, 1fr); }
  .lcd-fields span:last-child { display: none; }
  .info { grid-template-columns: 1fr; }
  .transport { flex-wrap: wrap; }
  .prompt-label span { display: none; }
  .mood-list li { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee span { animation: none; padding-left: 0; }
  .desktop.paused .time, #led-load.on, body.loading #status::before, .win-prompt.empty .prompt-label b,
  .eq-bands.idle .track, #decision-list li, .boot p, .cursor, .chips span.new, .opt i::before, .log-stats div { animation: none; }
  .win-prompt.empty .beat-glow { animation: none; opacity: 1; }
  .track, .idea-panel, .idea-panel.active { transition: none; }
}
