/* FLX4 Academy — "body + cushions" look.
   Colours come from js/theme.js (CSS variables on :root). The defaults below are
   the default theme, cloud body + volt cushions, so the page looks right even before JS runs.
   Instrument screens (waveforms, controller drawing, MIDI monitor, charts) stay dark
   in every theme. Previous look: css/style.backup.css */

:root {
  --bg: #F3F2EF; --bg2: #E7E5E0; --bg3: #DCD9D3; --line: #D3D0C9;
  --text: #111111; --muted: #5B5953; --soft: #CFCBC2;
  --accent: #D4F534; --accent-ink: #111111; --accent-line: #111111; --accent-ring: inset 0 0 0 2px #111111;
  --good: #13703B; --warn: #8A5200; --bad: #B3261E; --deckA: #1A5FB4; --deckB: #B85410;

  /* fixed instrument screen */
  --screen: #141416; --screen2: #1E1E20; --screen-line: #2E2E32; --screen-text: #E8E8E6; --screen-muted: #9A9AA0;
  --screen-good: #4ADE80; --screen-warn: #FFC94A; --screen-bad: #FF6B6B; --screen-a: #4FA3FF; --screen-b: #FF9A4D;

  --radius: 28px;
  --radius-l: 40px;
  --radius-s: 18px;
  --font: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'Heebo', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 17px; line-height: 1.6; }
body { transition: background-color .4s ease, color .4s ease; overflow-x: hidden; }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 3px; }
h1, h2, h3, h4 { line-height: 1.1; margin: 0 0 .5em; font-weight: 900; letter-spacing: -0.03em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: .95; letter-spacing: -0.045em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
p { margin: 0 0 .8em; }
code, kbd { font-family: var(--mono); }
kbd { background: var(--bg); border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 8px; padding: 0 .45em; font-size: .82em; direction: ltr; display: inline-block; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; border-radius: 8px; }

/* ---------- layout ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 14px 32px; background: var(--bg); flex-wrap: wrap; transition: background-color .4s ease; }
.brand { font-weight: 900; font-size: 1.35rem; letter-spacing: -0.03em; color: var(--text); display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: var(--accent-ring); }
.nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 8px 0; font-size: .95rem; font-weight: 500; text-decoration: none; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); font-weight: 800; text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 3px; text-underline-offset: 8px; }
.status { margin-inline-start: auto; display: flex; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 999px; background: transparent; border: 0; font-size: .82rem; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.chip:hover { background: var(--bg2); color: var(--text); }
.chip .led { width: 8px; height: 8px; border-radius: 50%; background: var(--soft); }
.chip.on { color: var(--text); }
.chip.on .led { background: var(--good); }
.chip.warn .led { background: var(--warn); }
main { max-width: 1280px; margin: 0 auto; padding: 24px 32px 120px; }

.card { background: var(--bg2); border: 0; border-radius: var(--radius-l); padding: 28px 32px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
details.card > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '+'; margin-inline-start: auto; font-size: 1.5rem; font-weight: 500; line-height: 1; }
details.card[open] > summary::after { content: '−'; }
.grid { display: grid; gap: 16px; }
.grid.cols2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 999px; border: 0; background: var(--bg); color: var(--text); font: inherit; font-weight: 800; cursor: pointer; transition: transform .05s, filter .15s, background-color .15s; text-decoration: none !important; }
.card .btn:not(.primary) { background: var(--bg); }
main > .btn:not(.primary), .row > .btn:not(.primary) { background: var(--bg2); }
.card .row > .btn:not(.primary) { background: var(--bg); }
.btn:hover { filter: brightness(.96); }
[data-mode="dark"] .btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--accent-ring); }
.btn.small { min-height: 40px; padding: 0 18px; font-size: .9rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.a { box-shadow: inset 0 0 0 2px var(--deckA); }
.btn.b { box-shadow: inset 0 0 0 2px var(--deckB); }
.btn.lit { background: var(--accent); color: var(--accent-ink); }

input[type=text], input[type=number], select, textarea { background: var(--bg); color: var(--text); border: 1.5px solid var(--line); border-radius: 14px; min-height: 44px; padding: 6px 14px; font: inherit; }
input[type=text]:focus, input[type=number]:focus, select:focus, textarea:focus { border-color: var(--text); outline: none; }
input[type=range] { accent-color: var(--text); }
input[type=checkbox], input[type=radio] { accent-color: var(--text); }

.callout { background: var(--bg); padding: 16px 20px; border-radius: var(--radius-s); border-start-start-radius: 4px; border-end-start-radius: 4px; margin: 14px 0; border-inline-start: 6px solid var(--accent-line); }
.callout.warn { border-inline-start-color: var(--warn); }
.callout.bad { border-inline-start-color: var(--bad); }
.callout.tip { border-inline-start-color: var(--deckA); }

/* ---------- home ---------- */
.hero { padding: 8px 0 0; }
.hero h1 { font-size: clamp(3rem, 7vw, 6.4rem); }
.hero p { font-size: 1.2rem; color: var(--muted); max-width: 760px; }
.course { background: var(--bg2); border-radius: var(--radius-l); padding: 40px 44px 30px; display: flex; flex-direction: column; gap: 28px; margin-top: 8px; }
.course-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }
.course-head h1 { margin: 0; }
.course-head p { margin: 10px 0 0; font-size: 1.15rem; color: var(--muted); }
.course-wave { position: relative; direction: ltr; }
.course-bars { position: relative; height: 160px; display: flex; align-items: center; gap: 4px; }
.course-bars span { flex: 1; border-radius: 99px; background: var(--soft); }
.course-bars span.played { background: var(--accent-line); }
.course-bars .course-here { flex: none; height: auto; position: absolute; top: -20px; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); box-shadow: var(--accent-ring); font-size: .85rem; font-weight: 800; white-space: nowrap; direction: rtl; }
.course-ticks { position: relative; height: 44px; margin-top: 16px; }
.course-ticks a { position: absolute; top: 0; width: 44px; height: 44px; margin-left: -22px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: .85rem; color: var(--muted); text-decoration: none; border-radius: 50%; }
.course-ticks a.done { color: var(--text); font-weight: 600; }
.course-ticks a.current { color: var(--text); font-weight: 600; background: var(--bg); }
.course-ticks a:hover { background: var(--bg); color: var(--text); }
.section-title { margin: 64px 0 20px; font-size: clamp(2.2rem, 4.5vw, 3.8rem); line-height: .95; letter-spacing: -0.04em; }

.progressbar { height: 10px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.progressbar > div { height: 100%; background: var(--text); border-radius: 99px; transition: width .3s; }
.roadmap { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.stage-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 24px; align-items: center; background: var(--bg2); border-radius: var(--radius); padding: 20px 28px; color: var(--text); text-decoration: none !important; transition: transform .15s; }
.stage-item:hover { transform: translateY(-2px); }
.stage-num { font-family: var(--mono); font-weight: 600; font-size: 1.6rem; line-height: 1; }
.stage-item.done .stage-num { color: var(--muted); }
.stage-item.current { background: var(--accent); color: var(--accent-ink); box-shadow: var(--accent-ring); }
.stage-item h3 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.stage-item p { margin: 2px 0 0; color: var(--muted); font-size: .98rem; }
.stage-item.current p { color: inherit; opacity: .8; }
.stage-meta { text-align: end; font-size: .85rem; font-weight: 600; color: var(--muted); min-width: 120px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.stage-item.current .stage-meta { color: inherit; }
.stage-tag { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: .82rem; font-weight: 800; }
.stage-item.done .stage-tag { background: var(--text); color: var(--bg); }
.stage-item.current .stage-tag { background: var(--accent-ink); color: var(--accent); }
.stage-item .stage-tag.later { color: var(--muted); padding-inline: 0; }

/* ---------- lessons ---------- */
.lesson { font-size: 1.05rem; line-height: 1.75; }
.lesson h2 { margin-top: 0; }
.lesson h3 { margin-top: 1.4em; }
.lesson ul, .lesson ol { padding-inline-start: 1.4em; margin: 0 0 1em; }
.lesson li { margin-bottom: .4em; }
.lesson table { border-collapse: collapse; width: 100%; margin: 12px 0 16px; font-size: .95rem; }
.lesson th, .lesson td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: start; }
.lesson th { font-size: .8rem; font-weight: 700; color: var(--muted); }
.tabs { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; padding: 5px; border-radius: 28px; background: var(--bg); }
.tabs button { background: transparent; border: 0; color: var(--text); min-height: 44px; padding: 0 20px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .95rem; font-weight: 700; }
.tabs button:hover { background: var(--bg2); }
.tabs button.active { background: var(--text); color: var(--bg); }
.tabs button .ok { color: var(--good); }
.tabs button.active .ok { color: inherit; }
.ex-card { display: flex; gap: 20px; align-items: center; border-radius: var(--radius); }
.ex-card .score { font-family: var(--mono); font-weight: 600; font-size: 1.25rem; width: 72px; height: 72px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--muted); }
.ex-card .score.pass { background: var(--text); color: var(--bg); }
.ex-card .score.fail { color: var(--warn); box-shadow: inset 0 0 0 2px var(--warn); }
.score.pass { color: var(--good); }
.score.fail { color: var(--warn); }
.check { display: flex; gap: 16px; align-items: flex-start; padding: 12px 0; cursor: pointer; border-bottom: 1px solid var(--line); }
.check:last-of-type { border-bottom: 0; }
.check input { margin-top: 4px; width: 22px; height: 22px; flex: none; }

/* ---------- trainer ---------- */
.trainer-head { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.trainer-head .title { flex: 1; min-width: 260px; }
.trainer-head .title h1 { margin-bottom: .2em; }
.task { font-size: 1.25rem; font-weight: 800; padding: 18px 24px; background: var(--bg2); border-radius: var(--radius); min-height: 60px; line-height: 1.4; }
.wave-wrap { position: relative; background: var(--screen); border-radius: var(--radius); overflow: hidden; direction: ltr; }
.wave-wrap canvas { display: block; width: 100%; }
.deckbar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin: 12px 0; direction: ltr; }
.deckinfo { background: var(--bg2); border-radius: var(--radius-s); padding: 14px 20px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.deckinfo.a { box-shadow: inset 0 4px 0 var(--deckA); }
.deckinfo.b { box-shadow: inset 0 4px 0 var(--deckB); }
.deckinfo .big { font-family: var(--mono); font-size: 1.6rem; font-weight: 600; }
.deckinfo .lbl { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.deckinfo .state { font-size: .8rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: var(--bg); }
.deckinfo .state.play { background: var(--good); color: #FFFFFF; }
[data-mode="dark"] .deckinfo .state.play { color: #0E0E10; }
.phase { background: var(--screen); color: var(--screen-text); border-radius: var(--radius-s); padding: 10px 14px; min-width: 220px; text-align: center; font-size: .85rem; font-weight: 600; }
.phase canvas { width: 200px; height: 26px; display: block; margin: 4px auto 0; }
.feedback { min-height: 120px; max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.fb { padding: 10px 16px; border-radius: 14px; border-start-start-radius: 4px; border-end-start-radius: 4px; background: var(--bg); font-size: .95rem; animation: fbIn .25s ease; border-inline-start: 5px solid var(--soft); }
.fb.good { border-inline-start-color: var(--good); }
.fb.bad { border-inline-start-color: var(--bad); }
.fb.warn { border-inline-start-color: var(--warn); }
.fb.info { border-inline-start-color: var(--deckA); }
@keyframes fbIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; } }
.result { text-align: center; padding: 24px; }
.result .big { font-family: var(--mono); font-size: 5rem; font-weight: 600; line-height: 1; letter-spacing: -0.04em; }
.result.pass .big { color: var(--good); }
.result.fail .big { color: var(--warn); }
.meterbar { height: 10px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.meterbar > div { height: 100%; background: var(--text); width: 0; transition: width .1s linear; }

/* ---------- on-screen controller ---------- */
.osc { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; direction: ltr; }
.osc-deck, .osc-mixer { background: var(--bg); border-radius: var(--radius); padding: 16px; }
.osc-deck.a { box-shadow: inset 0 4px 0 var(--deckA); }
.osc-deck.b { box-shadow: inset 0 4px 0 var(--deckB); }
.osc-deck .btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.osc-deck .pads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.osc-deck .modes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 6px; }
.osc-deck .modes button { font-size: .6rem; padding: 4px 2px; }
.osc-deck .modes button:disabled { opacity: .35; }
.osc-deck .pads button { font-size: .68rem; overflow: hidden; aspect-ratio: 1.6; }
.osc button { background: var(--bg2); color: var(--text); border: 0; border-radius: 10px; padding: 6px 4px; font: inherit; font-size: .75rem; font-weight: 800; cursor: pointer; user-select: none; }
.osc button:hover { background: var(--bg3); }
.osc button.lit { background: var(--accent); color: var(--accent-ink); box-shadow: var(--accent-ring); }
.osc button.play.lit { background: var(--good); color: #FFFFFF; box-shadow: none; }
[data-mode="dark"] .osc button.play.lit { color: #0E0E10; }
.osc button.cue.lit { background: var(--screen-warn); color: #111111; box-shadow: none; }
.osc-mixer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; min-width: 260px; }
.osc-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.knob { display: flex; flex-direction: column; align-items: center; font-size: .68rem; font-weight: 600; color: var(--muted); }
.knob input { width: 90px; }
.vfader { writing-mode: vertical-lr; direction: rtl; height: 110px; width: 26px; }
.xfader { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; font-size: .7rem; font-weight: 600; color: var(--muted); }
.xfader input { width: 100%; }
.tempo-row { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--muted); }
.tempo-row input { flex: 1; }
.vu { width: 8px; height: 110px; background: var(--screen); border-radius: 4px; position: relative; overflow: hidden; }
.vu > div { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, var(--screen-good) 60%, var(--screen-warn) 85%, var(--screen-bad)); }
.keys-help { font-size: .85rem; color: var(--muted); }
.keys-help kbd { margin: 0 1px; }

/* ---------- controller page: the drawing looks like the real DDJ-FLX4 in every theme ---------- */
.flx4 { width: 100%; height: auto; direction: ltr; background: #161618; border-radius: var(--radius); }
.flx4 .body { fill: #262628; stroke: #3A3A3D; stroke-width: 2; }
.flx4 .ctl { fill: #333336; stroke: #57575C; stroke-width: 1.5; transition: fill .08s; }
.flx4 text { fill: #C9C9C5; font-size: 9px; font-family: var(--font); text-anchor: middle; pointer-events: none; }
.flx4 text.on-orange { fill: #1A1A1A; font-weight: 700; }
.flx4 .jogring { fill: #2C2C2F; stroke: #4A4A4F; stroke-width: 2; }
.flx4 circle[fill="#11151d"] { fill: #1E1E20; stroke: #6A6A6E; }
.flx4 rect[fill="#07090d"] { fill: #0E0E10; }
.flx4 circle[fill="#2b3345"] { fill: #1E1E20; stroke: #57575C; }
/* orange buttons and copper-outlined pads, as on the hardware */
.flx4 [data-id$=".loopIn"], .flx4 [data-id$=".loopOut"], .flx4 [data-id="fx.on"] { fill: #F2A35E; stroke: #F2A35E; }
.flx4 [data-id*=".pad"] { fill: #1E1E20; stroke: #E0844E; stroke-width: 2; }
.flx4 rect[fill="#1d2330"] { fill: #262628; stroke: #E0844E; stroke-width: 1; }
.flx4 [data-id$=".pfl"] { fill: #262628; stroke: #E0844E; }
.flx4 [data-id$=".cue"], .flx4 [data-id$=".play"] { fill: #1E1E20; stroke: #6A6A6E; stroke-width: 2.5; }
/* live state stays green / yellow so "detected" and "next" read clearly on the copper */
.flx4 .ctl.active { fill: var(--screen-good); stroke: var(--screen-good); }
.flx4 .ctl.target { stroke: var(--screen-warn); stroke-width: 4; animation: pulse 1s infinite; }
.flx4 .ctl.done { fill: #24563f; stroke: #2F7A57; }
@keyframes pulse { 50% { stroke-opacity: .25; } }
.maptable { width: 100%; border-collapse: collapse; font-size: .92rem; }
.maptable td, .maptable th { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: start; }
.maptable th { font-size: .8rem; font-weight: 700; color: var(--muted); }
.maptable tr.flash td { background: var(--bg3); }
.monitor { font-family: var(--mono); font-size: .82rem; background: var(--screen); color: var(--screen-text); border-radius: var(--radius-s); padding: 14px; height: 200px; overflow: auto; direction: ltr; }

/* ---------- planner ---------- */
.planner canvas { background: var(--screen); border-radius: var(--radius-s); }
.planner table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.planner th, .planner td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: start; }
.planner th { font-size: .8rem; font-weight: 700; color: var(--muted); }
.planner input { width: 100%; padding: 4px 10px; min-height: 40px; }
.planner td.warn { color: var(--warn); font-weight: 700; }
.planner td.bad { color: var(--bad); font-weight: 700; }
.planner td.good { color: var(--good); font-weight: 700; }
.camelot { width: 100%; max-width: 380px; display: block; margin: 0 auto; background: var(--screen); border-radius: 50%; }

/* ---------- settings: theme picker ---------- */
.theme-pick { display: flex; flex-wrap: wrap; gap: 14px; }
.theme-pick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: .88rem; font-weight: 500; cursor: pointer; min-width: 56px; }
.theme-pick button .sw { width: 56px; height: 56px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(128,128,128,.35); }
.theme-pick.cushions button .sw { border-radius: 16px; width: 48px; height: 48px; }
.theme-pick button[aria-checked="true"] { font-weight: 800; }
.theme-pick button[aria-checked="true"] .sw { box-shadow: 0 0 0 3px var(--bg2), 0 0 0 5px var(--text); }
.combo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.combo-grid button { min-height: 72px; border: 0; border-radius: 22px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; font: inherit; text-align: start; }
.combo-grid button .pair { display: flex; gap: 4px; flex: none; }
.combo-grid button .pair span { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(128,128,128,.4); }
.combo-grid button .pair span + span { border-radius: 6px; }
.combo-grid button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg2), 0 0 0 5px var(--text); }

/* ---------- lesson demos ---------- */
.demo { margin: 16px 0; padding: 18px; }
.demo-head { gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.demo-caption { min-height: 3.4em; background: var(--bg); border-radius: var(--radius-s); padding: 12px 16px; font-size: 1.05rem; margin-bottom: 10px; }
.demo-count { display: inline-block; min-width: 1.6em; text-align: center; font-family: var(--mono); color: #111111; background: var(--screen-warn); border-radius: 6px; margin-inline-start: 6px; }
.demo-tlwrap { position: relative; }
.demo-timeline { position: relative; height: 28px; background: var(--screen); border-radius: 10px; overflow: hidden; cursor: pointer; }
.demo-phase { position: absolute; top: 0; bottom: 0; font-size: .75rem; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); font-weight: 700; display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; opacity: .85; }
.demo-playhead { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--screen-text); border-radius: 2px; pointer-events: none; transform: translateX(50%); }
.demo-bar { margin: 4px 0 8px; }
.demo-waves { margin-top: 10px; }

/* ---------- responsive / motion ---------- */
@media (max-width: 820px) {
  .topbar { padding: 12px 16px; gap: 14px; }
  .status { margin-inline-start: 0; }
  main { padding: 16px 16px 72px; }
  .card { padding: 22px 20px; border-radius: var(--radius); }
  .course { padding: 26px 20px 20px; border-radius: var(--radius); }
  .course-ticks a { width: 28px; margin-left: -14px; font-size: .7rem; }
  .course-bars { gap: 2px; height: 120px; }
  .osc { grid-template-columns: 1fr; }
  .deckbar { grid-template-columns: 1fr; }
  .stage-item { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 16px 18px; }
  .stage-num { font-size: 1.2rem; }
  .stage-meta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  body, .topbar { transition: none; }
  .stage-item:hover { transform: none; }
}
