:root {
  /* S9.2 néon (Main.dc.html): night, rules, magenta = action / logo, cyan = active / open, amber = LCD / ready,
     phosphor = success; text and muted text (≥ 4.5:1 on the night) */
  --bg: #07040f; --panel: #0d0820; --panel2: #120a28; --line: #3a2560; --line-hi: #4a3378;
  --text: #f1e9ff; --muted: #a99cc4; --magenta: #ff2bd6; --cyan: #22e6ff; --amber: #ffb347; --amber-glow: #ff8a00; --green: #39ff88; --red: #ff4f6a;
  --accent: var(--cyan); --c: var(--cyan);
  --lcd-bg: #140a04; --lcd-fg: var(--amber); --lcd-dim: #b38a4f; --lcd-glow: #ff8a0055;
  --radius: 6px; --radius-btn: 4px;
  --f: "Chakra Petch", sans-serif; --f-logo: Monoton, "Chakra Petch", sans-serif;
  /* S6.5 « Ville néon » (the Parcours' scene, js/garden-visual.js reads them once) */
  --city-night: #07040f; --city-sky: #1c0b33; --city-horizon: #6a1f6e; --city-wall: #130c22; --city-ground: #06040b;
  --city-pink: #ff3fa4; --city-cyan: #3ff0ff; --city-violet: #9d6bff; --city-amber: #ffb347; --city-red: #ff3348; --city-rain: #a9b8ff;
  --city-dawn-top: #140a33; --city-dawn-mid: #a8327e; --city-dawn-low: #ff7a4f; --city-sun-top: #ffd36b; --city-sun-low: #ff3f8e;
  font-family: var(--f); font-variant-numeric: tabular-nums;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
.app { max-width: 1400px; margin: 0 auto; padding: 16px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }

.transport { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn, select { padding: 8px 12px; cursor: pointer; }
.btn.primary { min-width: 110px; }
.btn.small { padding: 5px 9px; font-size: 12px; }
.tgrp { display: flex; flex-direction: column; gap: 3px; }
.tgrp > small { text-transform: uppercase; padding-left: 2px; }
.tgrp-row { display: flex; gap: 4px; align-items: center; }
.transport { align-items: flex-end; }
.rec-opts { position: relative; }
.rec-opts summary { list-style: none; padding: 8px 9px; }
.rec-opts summary::-webkit-details-marker { display: none; }
.rec-opts .menu { left: 0; right: auto; min-width: 260px; }
.menu-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.menu-note { font-size: 11px; color: var(--muted); margin: 2px 0 0; }
.recgrp { display: flex; gap: 4px; }
.recgrp .nsel-btn { padding: 8px 6px; }
.more { position: relative; }
.more summary { list-style: none; min-width: 40px; text-align: center; }
.more summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: flex; flex-direction: column; gap: 6px; padding: 10px; min-width: 240px; }
.menu .btn { text-align: left; }
.menu .btn:disabled { opacity: .4; cursor: default; }
.menu .sleep { justify-content: space-between; font-size: 13px; padding: 2px 4px; }
.sleep-left { font-size: 12px; color: var(--accent); }
.sleep-left:not(:empty)::before { content: "☾ "; }
/* wide screens: the bar stays on one row (the ⋯ menu never drops alone to a second line); only the sound picker gives up width */
@media (min-width: 1240px) {
  .transport { flex-wrap: nowrap; min-width: 0; }
  .transport .btn, .transport summary { white-space: nowrap; flex-shrink: 0; }
  .transport .tgrp:has(#preset), .transport .tgrp-row:has(#preset) { min-width: 0; }
  [data-for=preset] { min-width: 110px; flex: 0 1 auto; text-overflow: ellipsis; }
}
.sleep { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 16px; }
#sleepLeft { font-size: 12px; min-width: 40px; }

.stage { position: relative; margin: 16px 0; height: 240px; overflow: hidden; }
#viz { width: 100%; height: 100%; display: block; }
.hud { position: absolute; top: 12px; left: 16px; pointer-events: none; }
.chord { transition: opacity .6s; min-height: 1.2em; } /* (S9.4: empty until the first chord, no « — ») */
.hud-info { font-size: 11px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
body:not(.playing) .chord { opacity: 0.25; }
.big-play { position: absolute; inset: 0; margin: auto; width: 240px; height: 64px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: opacity .4s, transform .4s; }
.big-play:hover { transform: scale(1.04); }
body.playing .big-play { opacity: 0; pointer-events: none; transform: scale(0.9); }
body.game .big-play { display: none; } /* S5.6 Parcours : ▶ Lecture de la barre (ou une note) lance le son ; l'écran reste aux plantes */
.stage-tools { position: absolute; top: 10px; right: 12px; display: flex; gap: 6px; z-index: 2; }
.chip { cursor: pointer; min-height: 36px; }
/* Listening mode: only the stage, fullscreen */
body.listen .app > :not(.stage) { display: none; }
body.listen .app { max-width: none; padding: 0; }
body.listen .stage { height: 100vh; margin: 0; border-radius: 0; border: 0; }
body.listen .hint { font-size: 12px !important; color: #8a90b8 !important; }
body.listen .chord { font-size: 44px; }
body.listen .hud { top: 28px; left: 32px; }
.hint { position: absolute; bottom: 8px; left: 12px; font-size: 11px; color: #555c7c; pointer-events: none; }

.row { display: grid; gap: 12px; margin-bottom: 12px; }
.globals { grid-template-columns: minmax(280px, 1fr) minmax(420px, 2fr); }
.globals .panel[data-sec="mod"] { grid-column: 1 / -1; }
.layers { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.panel { position: relative; }
.panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel h2 { margin: 0; text-transform: uppercase; }
.ctls { display: flex; flex-wrap: wrap; gap: 6px 4px; align-items: flex-start; }

.ctl { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; width: 64px; user-select: none; }
.knob { cursor: ns-resize; touch-action: none; outline: none; }
.knob svg { width: 52px; height: 52px; }
.k-track, .k-arc { fill: none; }
.knob:focus-visible .k-body, .knob.active .k-body { stroke: var(--c); }
.k-val { margin-top: -4px; }
.k-lab { text-align: center; margin-top: 2px; line-height: 1.15; }
.sel { width: auto; min-width: 84px; padding-top: 12px; }
.txt input { width: 92px; padding: 6px 8px; font: inherit; font-size: 13px; }
.sel .nsel-btn { max-width: 150px; }

.tog { padding: 5px 10px; cursor: pointer; align-self: center; margin-top: 12px; }
.panel:not([data-sec=bells]):has(header .tog:not(.on)) .ctls { opacity: 0.4; } /* (S11.4: the Melody's settings are the keys' too: never dimmed) */
.panel .sub { margin-top: 12px; padding: 10px 12px 12px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); border-radius: 6px;
  background: color-mix(in srgb, var(--c) 5%, transparent); }
.panel .sub > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel .sub h3 { margin: 0; font: 700 11px var(--f); letter-spacing: .24em; text-transform: uppercase; color: var(--c); }
.panel .sub > header .tog { margin: 0; padding: 4px 10px; }
.panel .sub > header .tog::before { margin-right: 6px; }
.panel .sub:has(> header .tog:not(.on)) > .ctls { opacity: 0.4; } /* (Auto off: only the improvisation's settings dim) */

.sample-row { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.sample-name { font-size: 11px; color: var(--muted); }

.scenes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 12px; padding: 10px 14px; }
.sc-title { text-transform: uppercase; margin-right: 4px; }
.sc-slot { width: 40px; height: 40px; background: transparent; font-weight: 700; cursor: pointer; }
.sc-morph { flex: 1; min-width: 140px; }
.scenes:not(.ready) .sc-morph { opacity: .35; }
.sc-auto { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

.toast { position: absolute; top: 12px; left: 50%; padding: 8px 14px; opacity: 0; pointer-events: none; } /* (its motion: S7.1) */

.modal { position: fixed; inset: 0; background: #05060bcc; backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { position: relative; max-width: 860px; width: 100%; max-height: 90vh; overflow: auto; padding: 22px 24px; }
.modal-card h3 { margin: 0 0 8px; }
.modal-card h4 { margin: 0 0 6px; text-transform: uppercase; }
.modal-card p, .modal-card li { line-height: 1.5; }
.modal-card ul { margin: 0; padding-left: 18px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 14px 0; }
.modal-x { position: absolute; background: none; border: 0; cursor: pointer; }
kbd { padding: 0 5px; }
.muted { color: var(--muted) !important; }

.journal .moments { flex: 1; display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px; scrollbar-width: thin; min-height: 26px; align-items: center; }
.journal.empty .moments::before { content: "Les moments du paysage apparaîtront ici à chaque changement d'accord…"; font-size: 11px; color: #4c5272; }
.moment { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 35%, hsl(var(--h) 80% 80%), hsl(var(--h) 60% 45%)); box-shadow: 0 0 8px hsl(var(--h) 70% 60% / .5); transition: transform .15s; }
.moment:hover { transform: scale(1.4); }
.moment:last-child { outline: 2px solid #ffffff55; outline-offset: 2px; }

/* ---- modes ---- */
.modes { display: inline-flex; overflow: hidden; }
.mode-btn { border: 0; padding: 8px 16px; cursor: pointer; }
body.mode-sculpt .seqrow { display: none; }
body.mode-compose .macros, body.mode-compose .globals, body.mode-compose .layers, body.mode-compose #scenes, body.mode-compose #journal { display: none; }
/* composition order: song (sections) → chords → written melody → bass → rhythm → automation */
.seqrow .chords-panel { order: 1; } .seqrow [data-sec="seq"] { order: 2; } .seqrow [data-sec="bass"] { order: 3; }
.seqrow [data-sec="perc"] { order: 4; } .seqrow [data-sec="auto"] { order: 5; } .seqrow .song-panel { order: 0; } /* S6.3: the section picked here is what the editors below show */
.macros .ctls { justify-content: space-between; flex-wrap: nowrap; gap: 0; } /* S9.4: the five always on one row */
body.game .macros .panel:not(:has(.ctls > :not(.is-locked))) > header { display: none; } /* Parcours, grands réglages fermés : les couches seules, sans titre */
.macros .ctl { width: auto; flex: 1 1 0; min-width: 0; }
.macros .knob svg { width: clamp(48px, 13cqi, 84px); height: clamp(48px, 13cqi, 84px); }
.macros .k-val { font-size: 13px; }
.macros .k-lab { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
@container (max-width: 470px) { .macros .k-lab { font-size: 10px; letter-spacing: .02em; } }
@container (max-width: 330px) { .macros .k-lab { font-size: 8.5px; letter-spacing: 0; max-width: calc(100% + 4px); } } /* (S9.4: five names side by side, never on each other) */

.knob:focus-visible { outline: none; }

.seqrow { grid-template-columns: minmax(0, 1fr); }
.seqrow > * { min-width: 0; } /* a wide panel (song sections, grids) scrolls inside itself, never widens the page */
.roll-wrap { margin-top: 10px; }
.roll-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.roll-hint { font-size: 11px; color: var(--muted); margin-left: auto; }
.roll-scroll { overflow-x: auto; border-radius: 8px; border: 1px solid var(--line); }
canvas.roll { display: block; cursor: pointer; touch-action: none; }

.pulse-grid { display: grid; grid-template-columns: 86px repeat(16, minmax(14px, 1fr)); gap: 4px; align-items: center; }
.pulse-lab { font-size: 11px; color: var(--muted); }
.pulse-cell { height: 22px; cursor: pointer; padding: 0; }
.pulse-cell.bar { margin-left: 4px; }
.pulse-cell.on[data-lvl="1"] { opacity: .45; }
.pulse-cell.on[data-lvl="3"] { filter: brightness(1.25); box-shadow: 0 0 12px var(--c); }
.pulse-cell.on { background: var(--c); border-color: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 50%, transparent); }
.pulse-cell.now { outline: 1px solid #ffffffaa; }
@media (max-width: 560px) { .pulse-wrap { overflow-x: auto; } .pulse-grid { gap: 2px; --pl: 50px; --pc: 10px; } .pulse-cell.bar { margin-left: 2px; } .pulse-lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

.chords-mode { font-size: 11px; color: var(--muted); }
.chord-slots { display: grid; grid-template-columns: repeat(8, minmax(70px, 1fr)); gap: 6px; }
.chord-slot { padding: 8px 4px; color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; }
.chord-slot b { color: var(--c); }
.chord-slot span { font-size: 11px; color: var(--muted); min-height: 14px; }
.chord-slot.empty b { color: #3d4363; }
.chord-slot.is-sel { border-color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; }
.chord-slot.now { background: color-mix(in srgb, var(--c) 25%, #171a25); }
.chord-palette { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.chord-chip b { color: var(--c); margin-right: 3px; }
@media (max-width: 760px) { .chord-slots { grid-template-columns: repeat(4, 1fr); } }

.slot-tabs { display: inline-flex; gap: 3px; margin-right: 6px; }
.slot-tab { width: 28px; height: 26px; border-radius: 7px; border: 1px dashed #3c4262; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.slot-tab.filled { border-style: solid; color: var(--text); }
.slot-tab.is-sel { border-color: var(--c); color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; }
@keyframes blink { 50% { opacity: .35; } }
.slot-tab.now { background: color-mix(in srgb, var(--c) 25%, transparent); }

canvas.auto-lane { display: block; width: 100%; border-radius: 8px; border: 1px solid var(--line); cursor: crosshair; touch-action: none; }

.song-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.song-empty { font-size: 12px; color: var(--muted); padding: 10px 2px; flex: 1 1 200px; }
.song-rec-why { display: none; font-size: 11px; color: var(--muted); }
.song-none .song-rec-why { display: inline; }
.song-panel .btn:disabled, .song-btns button:disabled { opacity: .4; cursor: default; }
/* S6.3: one chip per section (tap = hear and edit it), the selected one's settings below */
.song-chip { flex: 0 0 auto; min-width: 72px; min-height: 44px; position: relative; display: flex; align-items: baseline; gap: 6px; padding: 6px 10px 9px; background: #171a25; border: 1px solid #2a2f45; border-radius: 10px; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.song-chip b { font-weight: 600; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.song-chip small { font-size: 10px; color: var(--muted); }
.song-chip.sel { border-color: var(--c); color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; }
.song-chip.now { box-shadow: 0 0 0 1px var(--c) inset, 0 0 12px color-mix(in srgb, var(--c) 45%, transparent); }
.song-chip.next { border-style: dashed; border-color: var(--c); } /* (blinks on the beat: S7.2) */
.song-chip.song-add { color: var(--muted); border-style: dashed; align-items: center; }
.song-chip .song-prog { position: absolute; left: 8px; right: 8px; bottom: 4px; height: 2px; background: #262a3d; border-radius: 2px; overflow: hidden; }
.song-chip .song-prog i { display: block; height: 100%; width: 0; background: var(--c); transition: width .3s; }
.song-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 2px 2px 8px; }
.song-edit[hidden] { display: none; }
.song-name { background: #11131b; border: 1px solid #2a2f45; border-radius: 6px; color: var(--c); font: inherit; font-weight: 600; font-size: 14px; width: 9.5em; min-height: 36px; padding: 0 8px; }
.song-bars { font-size: 12px; min-height: 36px; padding: 3px 6px; min-width: 6.5em; }
.song-meta { font-size: 11px; color: var(--muted); flex: 1 1 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-btns { display: flex; gap: 4px; }
.song-btns button { min-width: 40px; min-height: 36px; background: #1d2133; border: 1px solid #2a2f45; color: var(--muted); border-radius: 6px; font-size: 13px; cursor: pointer; }
.song-btns button:hover:not(:disabled) { color: var(--text); }
/* S6.4 looper: one row of the Morceau panel, the selected section's loop layers as chips (tap = mute, ✕ = erase) */
.looper { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 2px 8px; border-top: 1px solid #23273a; }
.loop-label { font-size: 12px; font-weight: 600; color: var(--c); margin-right: 2px; }
.loop-len { font-size: 12px; min-height: 36px; padding: 3px 6px; min-width: 6.5em; }
.looper .btn.small { min-height: 36px; }
.looper .btn:disabled { opacity: .4; cursor: default; }
.loop-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 100%; }
.loop-empty { font-size: 11px; color: var(--muted); padding: 4px 2px; }
.loop-chip { display: inline-flex; border: 1px solid var(--c); border-radius: 8px; overflow: hidden; background: color-mix(in srgb, var(--c) 12%, #12141c); }
.loop-chip button { background: none; border: 0; color: var(--text); font: inherit; font-size: 12px; min-height: 36px; padding: 0 10px; cursor: pointer; white-space: nowrap; }
.loop-chip button b { color: var(--c); margin-right: 4px; }
.loop-chip button[data-x] { color: var(--muted); padding: 0 9px; border-left: 1px solid #2a2f45; }
.loop-chip.mute { border-color: #2a2f45; background: #12141c; opacity: .55; }
.loop-chip.mute button[data-k] { text-decoration: line-through; }
.loop-chip.rec { border-color: #ff5e7a; box-shadow: 0 0 10px rgba(255, 94, 122, .45); }

footer { text-align: center; padding: 20px 0 8px; }

@media (max-width: 760px) {
  .app { padding: 12px; }
  .globals { grid-template-columns: 1fr; }
  .stage { height: 200px; }
  .ctl:not(.sel) { width: 60px; }
  .hint { display: none; }
  .chord { font-size: 20px; }
  .big-play { width: 190px; height: 54px; font-size: 16px; }
  .brand p { display: none; }
  .transport { gap: 6px; }
  .btn, select { padding: 7px 10px; }
  .sc-morph { order: 10; flex-basis: 100%; }
}
@media (hover: none) {
  .hint { display: none; }
  .knob svg { width: 56px; height: 56px; }
}

/* =====================================================================
   S9.2 NÉON — one skin for the whole app (ARCHITECTURE.md « Néon (S9.2) »). Night black around, the colour only in
   the tubes (borders, glows, lettering): never a coloured fill at rest. One font, Chakra Petch (tabular figures);
   Monoton for the logo only. A control: rest = a dim tube (--line-hi); hover = its tube lights up in its --c and
   rises 2 px; press = squashed, filled with light, a spark (the S7.1 motion block below). Tokens: top of the file.
   ===================================================================== */
body { background: var(--bg); }
.logo { margin: 0; font: 400 30px/1 var(--f-logo); letter-spacing: .02em; color: #ffe9fb; white-space: nowrap;
  text-shadow: 0 0 3px #fff, 0 0 10px var(--magenta), 0 0 24px var(--magenta), 0 0 48px #b0129a; }
.top { background: var(--panel); border-radius: var(--radius); padding: 10px 14px; }
.tgrp { padding: 0 8px; }
.tgrp > small { font: 600 10px var(--f); letter-spacing: .24em; color: var(--muted); }

/* panels: a thin tube of their colour, the name lit in it */
.panel { background: var(--panel); border: 1.5px solid color-mix(in srgb, var(--c) 42%, transparent); border-radius: var(--radius); padding: 14px;
  box-shadow: 0 0 18px color-mix(in srgb, var(--c) 12%, transparent); }
.panel::before { display: none; }
.panel h2 { font: 700 12px var(--f); letter-spacing: .3em; color: var(--c); text-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); flex: 1; margin-right: 10px; }
.scenes { background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--radius); }
.sc-title { color: var(--cyan); font: 700 12px var(--f); letter-spacing: .3em; }

/* knobs: a ring of light (track in the dark, arc = the tube lit in its colour), a black cap */
.k-track { stroke: #241640; stroke-width: 4; stroke-linecap: round; }
.k-arc { stroke: var(--c); stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 3px var(--c)) drop-shadow(0 0 7px color-mix(in srgb, var(--c) 55%, transparent)); }
.k-body { fill: var(--bg); stroke: color-mix(in srgb, var(--c) 45%, transparent); stroke-width: 1.5; }
.k-dot { fill: #fff; filter: drop-shadow(0 0 2px var(--c)); }
.k-val { font: 600 12px var(--f); color: var(--text); }
.k-lab { font: 600 10px var(--f); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); width: max-content; max-width: calc(100% + 14px); white-space: nowrap; overflow: hidden; text-overflow: clip; } /* (S9.4: a word never cut in two) */

/* buttons: tubes (rest = dim, .on / primary = lit; hover and press: S7.1 block) */
.btn, select { font: 600 13px/1.15 var(--f); letter-spacing: .08em; background: transparent; color: #e9e1ff; border: 1.5px solid var(--line-hi); border-radius: var(--radius-btn); box-shadow: none; }
.btn.on { --c: var(--cyan); color: #fff; border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, transparent); text-shadow: 0 0 8px var(--c);
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 45%, transparent), inset 0 0 8px color-mix(in srgb, var(--c) 22%, transparent); }
.btn.primary { --c: var(--magenta); color: #fff; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; background: color-mix(in srgb, var(--magenta) 10%, transparent); border-color: var(--magenta);
  text-shadow: 0 0 8px var(--magenta); box-shadow: 0 0 14px color-mix(in srgb, var(--magenta) 47%, transparent), inset 0 0 8px color-mix(in srgb, var(--magenta) 20%, transparent); }
.btn.rec { --c: var(--red); color: #fff; border-color: var(--red); text-shadow: 0 0 8px var(--red); }
.btn.rec::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 6px var(--red); vertical-align: 1px; animation: blink 1s steps(2) infinite; }
.btn.flash { background: color-mix(in srgb, var(--c) 30%, transparent); }
select { appearance: none; -webkit-appearance: none; padding-right: 24px; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0h8L4 5z' fill='%2322e6ff'/%3E%3C/svg%3E") no-repeat right 9px center; }
select option, select optgroup { background: var(--bg); color: var(--text); font-family: var(--f); }
.tog { border-radius: var(--radius-btn); background: transparent; color: var(--muted); font: 600 11.5px var(--f); letter-spacing: .08em; border: 1.5px solid var(--line-hi); }
.tog::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-hi); vertical-align: 0; }
.tog.on { background: color-mix(in srgb, var(--c) 8%, transparent); color: #fff; border-color: var(--c); text-shadow: 0 0 6px var(--c);
  box-shadow: 0 0 10px color-mix(in srgb, var(--c) 40%, transparent), inset 0 0 8px color-mix(in srgb, var(--c) 18%, transparent); }
.tog.on::before { background: var(--c); box-shadow: 0 0 6px var(--c); }
.panel header .tog { padding: 4px 9px; margin: 0; }
.panel header .tog::before { margin-right: 0; }
.chip { border-radius: var(--radius-btn); background: color-mix(in srgb, var(--bg) 80%, transparent); border: 1.5px solid var(--line-hi); color: var(--text); font: 600 12px var(--f); letter-spacing: .08em; padding: 6px 11px; }
/* a switch (Sculpter / Composer): a neon tab, underlined in light */
.modes { border: 1.5px solid var(--line-hi); border-radius: var(--radius-btn); }
.mode-btn { background: transparent; color: var(--muted); font: 600 13px var(--f); letter-spacing: .1em; text-transform: uppercase; padding-inline: 12px; }
.mode-btn + .mode-btn { border-left: 0; }
.mode-btn.on { --c: var(--cyan); color: #fff; font-weight: 700; background: color-mix(in srgb, var(--c) 10%, transparent); box-shadow: inset 0 -3px 0 var(--c); text-shadow: 0 0 8px var(--c); }
.menu { background: var(--bg); border: 1.5px solid var(--line-hi); border-radius: var(--radius); box-shadow: 0 0 24px #22e6ff26, 0 16px 40px #000c; }
.txt input, .song-name { font-family: var(--f); }
.txt input { background: var(--bg); color: var(--text); border: 1.5px solid var(--line-hi); border-radius: var(--radius-btn); }

/* the city behind everything (its CRT: scanlines and vignette) */
.stage { border-radius: 6px; border: 0; background: var(--city-night); }
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: repeating-linear-gradient(0deg, #0000 0 2px, #0004 2px 3px), radial-gradient(ellipse at center, #0000 55%, #0009 100%); }
body.city .stage::after { opacity: var(--crt, .8); /* S6.5 the city's CRT: scanlines, violet vignette; --crt = JUICE (garden-visual.js) */
  background: repeating-linear-gradient(0deg, #0000 0 2px, #0006 2px 3px), radial-gradient(ellipse at center, #0000 50%, color-mix(in srgb, var(--city-night) 85%, transparent) 100%); }
.hud, .stage-tools, .big-play, .toast { z-index: 2; }
.chord { font: 600 30px var(--f); color: var(--amber); text-shadow: 0 0 12px var(--amber-glow); letter-spacing: .06em; }
.hud-info, .hint { font-family: var(--f) !important; font-size: 12px !important; font-weight: 600; color: #e8c79a !important; letter-spacing: .14em; }
.big-play { --c: var(--magenta); border-radius: var(--radius-btn); background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1.5px solid var(--magenta); font: 700 20px var(--f); letter-spacing: .14em; color: #fff;
  text-shadow: 0 0 10px var(--magenta); box-shadow: 0 0 26px color-mix(in srgb, var(--magenta) 47%, transparent), inset 0 0 14px color-mix(in srgb, var(--magenta) 22%, transparent); }
.big-play span { font-size: 13px; }
.toast { background: color-mix(in srgb, var(--bg) 94%, transparent); border: 1.5px solid var(--magenta); color: #fff; font: 600 14px/1.35 var(--f); letter-spacing: .04em; border-radius: var(--radius-btn);
  text-shadow: 0 0 6px #ff2bd680; box-shadow: 0 0 18px #ff2bd655, 0 6px 24px #000c; }

/* grids & slots: dark cells, a lit step is a tube of its colour */
.pulse-cell, .chord-slot { background: #0b0618; border: 1.5px solid #2a1a48; border-radius: var(--radius-btn); }
.pulse-cell.beat { background: #120a26; }
.chord-slot b { font: 700 18px var(--f); letter-spacing: .04em; }
.chord-slot.is-sel { box-shadow: 0 0 0 1px var(--c) inset, 0 0 12px color-mix(in srgb, var(--c) 40%, transparent); }
.slot-tab { border-radius: var(--radius-btn); font-family: var(--f); }
.song-chip { background: #0b0618; border: 1.5px solid #2a1a48; border-radius: var(--radius-btn); }
.song-btns button { background: transparent; border: 1.5px solid var(--line-hi); border-radius: var(--radius-btn); font-family: var(--f); }
.roll-scroll, canvas.auto-lane { border: 1.5px solid var(--line); border-radius: var(--radius-btn); }
.moment { border-radius: 1px; box-shadow: 0 0 6px hsl(var(--h) 70% 55% / .5); }

/* windows */
.modal-card { background: color-mix(in srgb, #0a0618 97%, transparent); border: 1.5px solid var(--line-hi); border-radius: var(--radius); box-shadow: 0 0 40px #22e6ff1f, 0 20px 60px #000c; }
.modal-card h3 { font: 700 22px var(--f); letter-spacing: .14em; text-transform: uppercase; color: #fff; text-shadow: 0 0 14px var(--cyan); }
.modal-card h4 { color: var(--cyan); font: 700 12px var(--f); letter-spacing: .24em; }
.modal-card p, .modal-card li { color: #d9cdf2; font-size: 14px; }
.modal-x { color: var(--muted); font-size: 18px; min-width: 44px; min-height: 44px; top: 6px; right: 6px; }
kbd { background: transparent; border: 1.5px solid var(--line-hi); border-radius: 3px; font: 600 12px var(--f); color: var(--text); }
footer { color: var(--muted); font: 500 10px var(--f); letter-spacing: .14em; text-transform: uppercase; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
/* S8.2 the WebGL pass (js/city-gl.js): a click-through canvas over #viz (its box copied by js), which then goes transparent;
   its CRT (scanlines, curvature, vignette) replaces the css one above, kept for the 2D fallback */
.city-gl { position: absolute; display: block; pointer-events: none; image-rendering: pixelated; }
/* S9.4 the captions under the buildings (garden-visual.js tags): small, sharp, out of the WebGL pass */
.city-tags { position: absolute; pointer-events: none; overflow: hidden; }
body:not(.city) .city-tags { display: none; }
.city-tags span { position: absolute; left: 0; top: 0; font: 600 10px/1 var(--f); letter-spacing: .16em; white-space: nowrap; color: color-mix(in srgb, var(--c) 55%, #fff); text-shadow: 0 0 6px var(--c); will-change: transform; }
.city-tags span.hot { color: #fff; text-shadow: 0 0 6px var(--c), 0 0 12px var(--c); }
.city-tags span[hidden] { display: none; }
.city-gl[hidden] { display: none; }
.stage.gl::after { display: none; }
@media (prefers-reduced-motion: reduce) { .stage::after { display: none; } } /* (every loop stops: .m-still, end of the S7.1 block) */

.sel .nsel-btn { font-size: 12.5px; padding: 6px 8px 6px 10px; min-width: 76px; min-height: 34px; }
.sc-slot { border-radius: var(--radius-btn); border: 1.5px dashed var(--line-hi); color: var(--muted); font-family: var(--f); }
.sc-slot.filled { border-style: solid; background: transparent; color: var(--text); }
.sc-slot.near { border-color: var(--cyan); box-shadow: 0 0 12px #22e6ff66; color: #fff; }
.sc-morph { accent-color: var(--cyan); }
.journal.empty .moments::before, .song-empty, .roll-hint, .menu-note { color: var(--muted); }
.sc-auto, .chords-mode { color: var(--muted); }

.top { flex-wrap: wrap; }

.chord-slot em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.chords-auto .chord-slots, .chords-auto .chord-palette, .chords-auto .chord-durs { opacity: .45; }
.chord-modes, .chord-durs { margin: 0 0 8px; }
/* S6.7: a progression button = its name small, its chords in the key; a slot past the section's end is dimmed */
.chord-mode small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }
.btn.chord-mode.on small { color: inherit; }
.chord-slot.unheard { opacity: .4; }
.chord-slot b { white-space: nowrap; }
@media (max-width: 760px) { .chord-slot b { font-size: 18px; } }

/* ---------- Jardin sonore : parcours ---------- */
body.game .is-locked { display: none !important; }
body.game .tog.is-solo { display: none; } /* S5.6 : la seule couche ouverte n'a pas de coupure (couper = tout couper) */
body.game .macros .panel:not(:has(.ctls > :not(.is-locked))) { display: none; } /* (à la Graine : rien à toucher, pas de boîte vide) */
.welcome-card { max-width: 640px; }
.modal-card.welcome-card h3 { font: 400 clamp(34px, 9vw, 48px)/1.1 var(--f-logo); letter-spacing: .02em; text-transform: none; color: #ffe9fb; text-shadow: 0 0 6px #ff2bd6, 0 0 18px #ff2bd6, 0 0 40px #ff2bd688; } /* S9.4: the name in the logo's neon */
.welcome-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.welcome-choice { --c: var(--cyan); text-align: left; display: grid; gap: 6px; padding: 18px; border-radius: var(--radius); border: 1.5px solid var(--line-hi); background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.welcome-choice[data-choose=path] { --c: var(--magenta); }
.welcome-choice b { font: 700 17px var(--f); color: #fff; letter-spacing: .14em; text-transform: uppercase; text-shadow: 0 0 10px var(--c); }
.welcome-choice span { font-size: 14px; line-height: 1.45; color: #d9cdf2; }
.welcome-choice:hover, .welcome-choice:focus-visible { border-color: var(--c); background: color-mix(in srgb, var(--c) 6%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--c) 45%, transparent), inset 0 0 12px color-mix(in srgb, var(--c) 18%, transparent); }
@media (max-width: 560px) { .welcome-choices { grid-template-columns: 1fr; } }
/* phones: the bar's groups wrap inside the width (sound picker and mood shrink), never past the screen's edge */
@media (max-width: 560px) { .transport .tgrp { max-width: 100%; min-width: 0; } .transport .tgrp-row { flex-wrap: wrap; min-width: 0; } [data-for=preset], [data-for=mood] { min-width: 0; max-width: 100%; flex: 1 1 110px; }
  /* the ⋯ menu opens across the bar, inside the screen (the ⋯ button wraps to the left there) */
  .transport { position: relative; } .more { position: static; } .more > .menu { left: 0; right: 0; } }
.tree-grp { display: none !important; }
body.game .tree-grp { display: flex !important; }

/* S4.6: what a node opens comes in (tree.appear): unfolds from the top, fades and grows in (~0.55 s), then a pulsing halo
   until it is touched (8 s at most); the « Nouveau » tag points at the first one. Generic: any control, panel, button. */
/* (their motion: S7.3, end of the file) */
.is-new { outline: 2px solid var(--lcd-fg); outline-offset: 3px; border-radius: 8px; }
.is-new-rel { position: relative; }
/* (at the control's top-right corner, clear of the panel's name; !important: some controls draw their own ::after) */
.is-new-first::after { content: '◂ Nouveau' !important; display: block !important; position: absolute !important; top: auto !important; right: auto !important; bottom: calc(100% - 4px) !important; left: calc(100% - 16px) !important; width: auto !important; height: auto !important; transform: none !important; font: 700 11px/1.2 var(--f); letter-spacing: .12em; text-transform: uppercase; padding: 2px 7px; border-radius: 3px !important; background: var(--bg) !important; border: 1.5px solid var(--amber) !important; color: var(--amber); text-shadow: 0 0 6px var(--amber-glow); white-space: nowrap; pointer-events: none; z-index: 5; box-shadow: 0 0 10px #ff8a0066 !important; transition: none !important; }
body.jargon-off #chordName, body.jargon-off #hudInfo { visibility: hidden; } /* S4.3: no key / chord names before Tonalité */
@keyframes lcd-bump { 30% { transform: scale(1.25); color: #fff; } }
.tree-btn { position: relative; }
@keyframes ready-pulse { 50% { box-shadow: 0 0 16px var(--amber-glow), inset 0 0 8px #ff8a0055; filter: brightness(1.2); } }
.tree-btn.has-ready::after { content: '✦'; position: absolute; top: -6px; right: -6px; font-size: 13px; color: var(--lcd-fg); text-shadow: 0 0 6px var(--lcd-fg); animation: ready-pulse 2s ease-in-out infinite; }
.goals.lcd-glitch { animation: lcd-glitch .7s steps(2, end); }
.goals.lcd-glitch-big { animation: lcd-glitch 1.4s steps(2, end); }
.goals.lcd-glitch-big .gw-line, .goals.lcd-glitch-big .gw-score { color: #fff; text-shadow: 2px 0 var(--magenta), -2px 0 var(--cyan), 0 0 12px var(--lcd-fg); }
@keyframes lcd-glitch {
  0% { transform: none; filter: none; }
  10% { transform: translate(-3px, 1px) skewX(-8deg); filter: hue-rotate(90deg) saturate(2); }
  20% { transform: translate(3px, -1px) skewX(6deg); filter: invert(1); }
  30% { transform: translate(-2px, 0) scale(1.04); filter: hue-rotate(-120deg) brightness(1.6); }
  45% { transform: translate(2px, 1px) skewX(-4deg); filter: invert(1) hue-rotate(180deg); }
  60% { transform: scale(1.06) rotate(-1deg); filter: brightness(1.8) saturate(3); }
  75% { transform: translate(-1px, 0) rotate(1deg); filter: hue-rotate(60deg); }
  100% { transform: none; filter: none; }
}
.m-still .goals.lcd-glitch, .m-still .goals.lcd-glitch-big { box-shadow: 0 0 0 2px var(--lcd-fg); }

/* S5.9 juice central (garden.js FX): flash, pixel confetti over everything, shakes, punch, hopping buttons, arcade LCD,
   combo text. Individual transform properties (translate, scale, rotate) so nothing fights an element's own transform.
   Never in the way of a click: the layer and the flash are pointer-events: none. */
.fx-layer, .fx-layer *, .fx-flash { pointer-events: none !important; }
.fx-layer { position: fixed; inset: 0; z-index: 70; overflow: hidden; contain: strict; }
/* S10.1: hidden = invisible but still laid out (display: none ↔ block relaid out the page on every party / spark) */
.fx-layer[hidden] { display: block; visibility: hidden; }
.fx-layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.fx-layer canvas[hidden] { display: block; visibility: hidden; }
.fx-flash { position: absolute; inset: 0; z-index: 3; opacity: 0; mix-blend-mode: screen; background: radial-gradient(circle at 50% 60%, #ffffff, #ff2bd6aa 40%, #22e6ff44 70%, transparent); }
.fx-flash.on { animation: fx-flash .55s ease-out; }
.fx-flash.soft { mix-blend-mode: normal; background: #1a0730; }
.fx-flash.soft.on { animation-duration: .9s; }
@keyframes fx-flash { 0% { opacity: var(--a, .6); } 100% { opacity: 0; } }
.stage.fx-shake { animation: fx-shake .45s linear; }
@keyframes fx-shake { 10% { translate: -7px 3px; } 25% { translate: 6px -4px; } 40% { translate: -5px 2px; } 60% { translate: 3px -2px; } 80% { translate: -1px 1px; } 100% { translate: 0 0; } }
.app.fx-quake > :not(.modal) { animation: fx-quake .6s linear; } /* (not .app itself: a transform would pull the fixed dialogs inside it) */
@keyframes fx-quake { 10% { translate: -6px 3px; rotate: -.5deg; } 25% { translate: 7px -3px; rotate: .6deg; } 40% { translate: -5px 2px; rotate: -.35deg; } 60% { translate: 3px -1px; rotate: .2deg; } 80% { translate: -1px 1px; rotate: 0deg; } 100% { translate: 0 0; rotate: 0deg; } }
#viz.fx-punch, .city-gl.fx-punch { animation: fx-punch .45s cubic-bezier(.2, 1.6, .4, 1); }
#viz.fx-punch-big, .city-gl.fx-punch-big { animation: fx-punch-big .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes fx-punch { 30% { scale: 1.06; } 100% { scale: 1; } }
@keyframes fx-punch-big { 25% { scale: 1.14; rotate: -1.2deg; } 55% { scale: .97; rotate: .6deg; } 100% { scale: 1; rotate: 0deg; } }
.fx-bounce .top .btn, .fx-bounce .mode-btn, .fx-bounce .pad, .fx-bounce .chip, .fx-hop { animation: fx-hop .5s cubic-bezier(.3, 1.8, .5, 1) both; }
.fx-bounce .top .btn:nth-child(2n), .fx-bounce .mode-btn:nth-child(2n), .fx-bounce .pad:nth-child(2n), .fx-bounce .chip:nth-child(2n) { animation-delay: 70ms; }
.fx-bounce .top .btn:nth-child(3n), .fx-bounce .mode-btn:nth-child(3n), .fx-bounce .pad:nth-child(3n), .fx-bounce .chip:nth-child(3n) { animation-delay: 140ms; }
@keyframes fx-hop { 0% { translate: 0 0; scale: 1; } 30% { translate: 0 -10px; scale: 1.1 .9; } 55% { translate: 0 0; scale: .92 1.08; } 75% { translate: 0 -3px; scale: 1; } 100% { translate: 0 0; scale: 1; } }
.goals.lcd-arcade .gw-line { animation: lcd-arcade 1.4s steps(18, end); color: #fff; text-shadow: 2px 0 var(--magenta), -2px 0 var(--cyan), 0 0 12px var(--lcd-fg); }
@keyframes lcd-arcade { 0% { translate: 100% 0; } 40% { translate: 0 0; opacity: 1; } 50% { opacity: .15; } 60% { opacity: 1; } 70% { opacity: .15; } 80%, 100% { translate: 0 0; opacity: 1; } }
/* S9.2 a party's word (garden.js fxPop): a neon sign written by a laser letter by letter (each letter flashes white
   and settles in its tube; a white dot = the laser's head runs ahead of it), held, then it crackles and goes out.
   No bubble, no comic font. --k = its colour (by moment), --n = letters, timing from the motion tokens (× JUICE) */
.fx-pop { --k: var(--magenta); position: absolute; translate: -50% -50%; font: 700 1em/1 var(--f); letter-spacing: .3em; padding-left: .3em; white-space: nowrap; color: #fff;
  text-shadow: 0 0 .1em #fff, 0 0 .25em var(--k), 0 0 .7em var(--k), 0 0 1.4em var(--k); display: grid; justify-items: center; gap: .25em; }
.fx-pop .fx-word { position: relative; display: block; }
.fx-pop .fx-word i { font-style: normal; white-space: pre; display: inline-block; opacity: 0; animation: fx-letter calc(var(--m-med) + 60ms) steps(1, end) forwards; animation-delay: calc(var(--d) * (var(--m-stagger) + 10ms)); }
.fx-pop .fx-word::after { content: ""; position: absolute; top: 50%; left: 0; width: .3em; height: .3em; margin: -.15em 0 0 -.15em; border-radius: 50%; background: #fff; box-shadow: 0 0 .3em #fff, 0 0 .8em var(--k);
  opacity: 0; animation: fx-head calc(var(--n) * (var(--m-stagger) + 10ms) + 40ms) linear forwards; }
.fx-pop.fx-out { animation: fx-out var(--m-slow) steps(1, end) forwards; }
@keyframes fx-letter { 0% { opacity: 1; color: #fff; text-shadow: 0 0 .2em #fff, 0 0 .6em #fff, 0 0 1.2em var(--k); } 40% { opacity: .35; } 60% { opacity: 1; } 100% { opacity: 1; } }
@keyframes fx-head { 0% { opacity: 1; left: 0; } 95% { opacity: 1; left: 100%; } 100% { opacity: 0; left: 100%; } }
@keyframes fx-out { 0% { opacity: 1; } 12% { opacity: .2; } 22% { opacity: 1; } 34% { opacity: .1; } 44% { opacity: .8; filter: brightness(1.5); } 58% { opacity: .05; } 70% { opacity: .5; } 100% { opacity: 0; } }
.m-still .fx-pop .fx-word i { opacity: 1; }

/* S5.10 the notebook of discoveries (was G10.1 secrets): folded panel inside the tree screen (path only); found ones, then riddles */
.discoveries { margin: 0 0 4px; border-radius: var(--radius, 4px); background: #0003; }
.discoveries[hidden] { display: none; }
.dc-head { width: 100%; min-height: 40px; text-align: left; background: none; border: 0; color: var(--lcd-fg); font: 700 13px var(--f); padding: 3px 8px; cursor: pointer; letter-spacing: .22em; text-transform: uppercase; text-shadow: 0 0 8px var(--amber-glow); }
.dc-head::before { content: '▾ '; }
.discoveries.min .dc-head::before { content: '▸ '; }
.dc-head.fresh { animation: ready-pulse 1.2s ease-in-out infinite; }
.dc-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; padding: 0 8px 8px; max-height: 30vh; overflow-y: auto; }
.discoveries.min .dc-body { display: none; }
.modal-card .dc-item, .dc-item { margin: 0; display: grid; gap: 2px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.dc-item b { font: 700 13px var(--f); color: var(--muted); letter-spacing: .1em; }
.dc-item.found b { color: var(--lcd-fg); text-shadow: 0 0 6px var(--amber-glow); }
.dc-item.found.combo b { color: var(--cyan); text-shadow: 0 0 6px #22e6ff88; }
.dc-item.riddle b { letter-spacing: .3em; opacity: .7; }
.m-still .dc-head.fresh { text-decoration: underline; }

/* S9.2 the Arbre as a circuit board (Tree.dc.html): a grid in the dark, hexagonal nodes (open = filled with their
   branch's colour, ready = an amber outline that pulses, can open = a dim amber outline), glowing traces at right
   angles and 45° (garden-tree.js linkPath), traces into the unknown in dots; pan / zoom: G11.1; motion: S7.3 */
.tree-card { max-width: 1180px; height: calc(100vh - 32px); max-height: 960px; display: flex; flex-direction: column; padding: 18px 22px 16px; }
.tree-card > * { flex: none; }
.tree-counts { float: right; display: flex; gap: 10px; margin: -4px 46px 0 0; }
.tree-count, .tree-ready { padding: 5px 12px; border: 1.5px solid var(--green); border-radius: var(--radius-btn); font: 700 14px/1.2 var(--f); letter-spacing: .12em; text-transform: uppercase;
  color: var(--green); text-shadow: 0 0 8px var(--green); box-shadow: 0 0 10px #39ff8840; }
.tree-ready { border-color: var(--amber); color: var(--amber); text-shadow: 0 0 8px var(--amber-glow); box-shadow: 0 0 10px #ff8a0040; }
.tree-ready[hidden] { display: none; }
.tree-legend { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 16px; align-items: center; margin: 0; }
.modal-card .tree-legend { font-size: 12.5px; }
.tree-legend > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tree-legend em { font-style: normal; }
.tree-legend .lg-short { display: none; }
.tree-legend i { display: inline-block; flex: none; width: 14px; height: 12px; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background: var(--line-hi); }
.tree-legend i.st-owned { background: conic-gradient(var(--cyan) 0 20%, var(--magenta) 0 40%, var(--green) 0 60%, var(--amber) 0 80%, #8a5cff 0); } /* (a hex of the 5 branch colours) */
.tree-legend i.st-ready { background: var(--amber); }
.tree-legend i.lg-dark { clip-path: none; width: 20px; height: 0; background: none; border-top: 2px dashed #8a7ca8; -webkit-mask: linear-gradient(90deg, #000, transparent); mask: linear-gradient(90deg, #000, transparent); }
.tree-legend > .tree-tip { flex-basis: 100%; font-size: 11.5px; white-space: normal; display: block; }
.tree-tip .tip-short { display: none; }
.tree-body { flex: 1 1 auto; min-height: 0; display: flex; gap: 14px; margin-top: 10px; }
.tree-view { position: relative; flex: 1 1 auto; min-width: 0; min-height: 340px; border-radius: var(--radius-btn); border: 1.5px solid var(--line); overflow: hidden;
  background: linear-gradient(#1d1238b3 1px, transparent 1px) 0 0 / 40px 40px, linear-gradient(90deg, #1d1238b3 1px, transparent 1px) 0 0 / 40px 40px, radial-gradient(ellipse at 45% 100%, #1a0838 0%, var(--bg) 65%); }
.tree-map { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.tree-map.panning { cursor: grabbing; }
.tree-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.tree-links { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.tree-bname { font: 700 13px var(--f); letter-spacing: .2em; text-transform: uppercase; fill: var(--c); opacity: .85; filter: drop-shadow(0 0 6px var(--c)); }
/* traces: unknown = dots that fade, can open = amber dashes that flow, open = its branch's colour, lit */
.tree-link { fill: none; stroke: #5d4a85; stroke-width: 3; stroke-linejoin: round; stroke-linecap: square; transition: stroke .3s, opacity .3s, stroke-width .2s; }
.tree-link.locked { stroke-width: 2; stroke-dasharray: 3 7; stroke-linecap: round; opacity: .55; }
.tree-link.available { stroke: var(--amber); stroke-width: 2.5; opacity: .9; stroke-dasharray: 6 6; stroke-linecap: butt; filter: drop-shadow(0 0 4px var(--amber-glow)); animation: tree-flow 1.4s linear infinite; }
.tree-link.owned { stroke: var(--c); filter: drop-shadow(0 0 5px var(--c)); }
/* S11.8: a secondary prerequisite (not the main parent): a thin dotted trace, discreet — no spaghetti */
.tree-link.x { stroke-width: 1.5; stroke-dasharray: 2 6; stroke-linecap: round; opacity: .55; filter: none; }
.tree-link.x.available { stroke-width: 1.5; stroke-dasharray: 2 6; }
.tree-link.x.locked { opacity: .35; }
/* S9.4: only open and ready nodes are drawn (.dark: everything else) */
.tree-node.dark { display: none; }
/* S9.1: the dark — nodes not reachable yet are not drawn; their links leave in dots that fade out (gradient set by js) */
.tree-node.st-locked, .tree-link.gone, .tree-glow.gone, .tree-glow.dark, .tree-bname.gone { display: none; }
.tree-link.dark { stroke-dasharray: 3 7; stroke-linecap: round; stroke-width: 2; opacity: 1; filter: none; }
.tree-link.x.dark { stroke-width: 1.5; stroke-dasharray: 2 6; opacity: .8; }
.tree-link.is-hl { stroke-width: 4.5; opacity: 1; }
.tree-map:has(.is-focus) .tree-link:not(.is-hl) { opacity: .2; }
@keyframes tree-flow { to { stroke-dashoffset: -12; } }
.tree-glow { fill: none; stroke: #fff; stroke-width: 4; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; opacity: 0; pointer-events: none; }
/* nodes: a hexagon (.led: the tube = its outline, ::before = its inside), the name on a dark plate */
.tree-node { position: absolute; width: 112px; margin: -20px 0 0 -56px; /* (S11.8: width and margin-left set per node by its label) */ padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0;
  color: var(--muted); font: 700 13px/1.15 var(--f); letter-spacing: .04em; text-transform: uppercase; text-align: center; cursor: pointer; transition: opacity .2s; --edge: #3a2560; --core: #0b0618; }
.tree-node .led { position: relative; width: 46px; height: 40px; display: grid; place-items: center; font-style: normal; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background: var(--edge); }
.tree-node .led::before { content: ""; position: absolute; inset: 3px 3.5px; clip-path: inherit; background: var(--core); }
.tree-node.root { margin-top: -25px; }
.tree-node.root .led { width: 58px; height: 50px; }
.tree-node b, .tree-node span { background: #07040fd9; border-radius: 2px; padding: 1px 5px; }
.tree-node b { font-weight: 700; font-size: 13px; line-height: 1.15; white-space: nowrap; } /* (S11.8: one or two lines, split by the layout) */
.tree-node span { font: 600 10.5px var(--f); letter-spacing: .06em; text-transform: none; }
.tree-node.st-locked { color: #8a7ca8; }
.tree-node.st-available { --edge: color-mix(in srgb, var(--amber) 55%, var(--bg)); color: #e8c79a; }
.tree-node.st-ready { --edge: var(--amber); --core: #1a1004; color: var(--amber); filter: drop-shadow(0 0 10px var(--amber-glow)); }
.tree-node.st-ready .led { animation: hex-pulse calc(var(--beat) * 2) ease-in-out infinite; }
.tree-node.st-ready span { color: var(--amber); }
.tree-node.st-owned { --edge: var(--c); --core: var(--c); color: #fff; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c) 70%, transparent)); }
.tree-node.st-owned span { color: var(--c); }
@keyframes hex-pulse { 50% { filter: brightness(1.6); } }
.tree-node:focus { outline: none; }
.tree-node:focus-visible .led, .tree-node.is-sel .led { outline: 2px solid #fff; outline-offset: 4px; }
.tree-node:focus-visible b, .tree-node.is-sel b { color: #fff; box-shadow: 0 0 0 1.5px #fff; }
.tree-map:has(.is-focus) .tree-node:not(.is-focus):not(.is-req):not(.is-dep) { opacity: .35; }
.tree-node.is-req b { box-shadow: 0 0 0 1.5px var(--text); }
.tree-node.is-dep b { box-shadow: 0 0 0 1.5px var(--amber); }
.tree-zoom { position: absolute; bottom: 10px; right: 10px; z-index: 2; display: flex; flex-direction: column; gap: 6px; }
.tree-zoom .btn { min-width: 44px; min-height: 44px; padding: 4px 8px; font-size: 18px; line-height: 1; background: color-mix(in srgb, var(--bg) 85%, transparent); }
/* the selected node's panel: a tube of its branch's colour (amber when it waits on OUVRIR) */
/* S9.4: a side panel beside the map (under it on a phone), never over a node; with nothing selected it says what to do */
.tree-info { --c: var(--line-hi); flex: none; align-self: flex-start; box-sizing: border-box; width: 300px; max-height: 100%; overflow: auto; padding: 16px 18px; background: #07040fe6; border: 1.5px solid var(--c); border-radius: var(--radius);
  box-shadow: 0 0 26px color-mix(in srgb, var(--c) 27%, transparent), 0 10px 30px #000b; }
.tree-info.st-ready { --c: var(--amber); }
.tree-info[hidden] { display: none; }
.tree-info.empty { border-style: dashed; box-shadow: none; }
.modal-card .tree-info.empty .ti-d { color: var(--muted); margin: 0; }
.modal-card .tree-info p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.45; color: #d9cdf2; }
.modal-card .tree-info .ti-h b { display: block; color: #fff; font-size: 22px; font-weight: 700; letter-spacing: .06em; text-shadow: 0 0 12px var(--c); }
.modal-card .tree-info .ti-h small { color: var(--c); font-size: 11px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; }
.modal-card .tree-info .ti-g, .modal-card .tree-info .ti-r { color: var(--muted); font-size: 12.5px; }
.tree-info .ti-r .ok { color: var(--green); }
.tree-info .ti-o span { color: var(--amber); }
.tree-info .ti-open { display: block; width: 100%; margin-top: 10px; min-height: 48px; font-size: 15px; letter-spacing: .24em; color: var(--bg); background: var(--amber); border: 0; text-shadow: none; box-shadow: 0 0 24px var(--amber-glow); }
@media (max-width: 760px) {
  #treeDlg { padding: 6px; }
  .tree-card { padding: 12px 10px 10px; height: calc(100vh - 12px); max-height: none; border-radius: 6px; }
  .tree-card h3 { font-size: 18px; }
  .tree-counts { margin-right: 40px; gap: 6px; }
  .tree-count, .tree-ready { font-size: 12px; padding: 3px 8px; }
  .tree-tip .tip-long { display: none; }
  .tree-tip .tip-short { display: inline; }
  .tree-view { min-height: 200px; }
  .tree-body { flex-direction: column; gap: 8px; }
  .tree-info { width: auto; align-self: stretch; max-height: 48%; padding: 12px 14px; }
  .tree-info.empty { display: none; }
  .tree-zoom { flex-direction: row; top: 6px; bottom: auto; right: 6px; }
}
/* narrow phones: the legend keeps one line (short labels), the hint folds under it; the zoom buttons sit
   inside the map's top-right corner, clear of the legend and of the node card at the bottom */
@media (max-width: 560px) {
  .modal-card .tree-legend { font-size: 11.5px; gap: 2px 10px; flex-wrap: wrap; }
  .tree-legend .lg-long { display: none; }
  .tree-legend .lg-short { display: inline; }
  .tree-legend > .tree-tip { font-size: 11px; }

}

/* S9.4 a phone held sideways (short screen): the Arbre's header shrinks so the map and the card keep the height */
@media (max-height: 520px) {
  #treeDlg { padding: 6px; }
  .tree-card { height: calc(100vh - 12px); max-height: none; padding: 8px 12px 8px; }
  .tree-card h3 { font-size: 16px; margin: 0 0 2px; }
  .tree-counts { margin-top: -2px; }
  .tree-count, .tree-ready { font-size: 11px; padding: 2px 8px; }
  #treeDlg .dc-head { min-height: 30px; font-size: 12px; }
  .modal-card .tree-legend { font-size: 11px; }
  .tree-legend > .tree-tip { display: none; }
  .tree-body { margin-top: 4px; gap: 8px; }
  .tree-view { min-height: 0; }
  .tree-info { width: 250px; padding: 10px 12px; }
  .modal-card .tree-info p { font-size: 12px; margin-bottom: 4px; }
  .modal-card .tree-info .ti-h b { font-size: 17px; }
  .tree-info .ti-open { min-height: 40px; margin-top: 4px; }
  .tree-zoom { flex-direction: row; top: 6px; bottom: auto; right: 6px; }
}

/* S9.2 the keys (Pads.dc.html): one neon tube per note of the landscape's scale (A–L, low to high: violet → magenta),
   its letter and the note's name lit in it. A strike (AMB.keys.hit: mouse, finger, key, MIDI — one and the same) =
   squashed and filled with light (.on), a laser towards the city and sparks; let go = 400 ms brighter (.k-rel); the
   machine's notes (.auto) = the same, softer, never squashed */
.pads { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 12px; margin: -6px 0 14px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pads[hidden] { display: none; }
.pad { position: relative; height: 76px; min-width: 0; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 6px; border: 2px solid var(--c); background: var(--bg); color: var(--c); cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent;
  font: 700 12px var(--f); text-shadow: 0 0 8px var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 40%, transparent), inset 0 0 14px color-mix(in srgb, var(--c) 20%, transparent); }
.pad b { font-size: 22px; line-height: 1; }
.pad small { font-size: 11.5px; font-weight: 600; letter-spacing: .18em; opacity: .85; white-space: nowrap; }
.pad.on { color: var(--bg); background: var(--c); border-color: #fff; text-shadow: none; box-shadow: 0 0 40px var(--c), 0 0 90px color-mix(in srgb, var(--c) 60%, transparent); }
.pad.on small { opacity: 1; }
.pad.chord { box-shadow: 0 0 0 3px var(--amber) inset, 0 0 40px var(--c); }
.pad.k-rel:not(.on) { animation: k-rel calc(400ms * var(--m-t) + 1ms) var(--m-out); }
@keyframes k-rel { from { color: #fff; background: color-mix(in srgb, var(--c) 24%, var(--bg)); text-shadow: 0 0 12px #fff; scale: calc(1 + .03 * var(--m-amp)); translate: 0 calc(-2px * var(--m-amp));
  box-shadow: 0 0 30px var(--c), inset 0 0 26px color-mix(in srgb, var(--c) 55%, transparent); } }
/* S5.2: the machine's note (Mélodie auto): the same strike, softer (lit inside, no squash) */
.pad.auto:not(.on) { color: #fff; background: color-mix(in srgb, var(--c) 22%, var(--bg)); text-shadow: 0 0 10px var(--c); box-shadow: 0 0 26px var(--c), inset 0 0 18px color-mix(in srgb, var(--c) 50%, transparent); }
/* S6.7: the Réponse's phrase, like a Simon: each note's key bright, white-rimmed and raised until the next one */
.pad.call { z-index: 1; color: #fff; border-color: #fff; background: color-mix(in srgb, var(--c) 30%, var(--bg)); translate: 0 calc(-3px * var(--m-amp)); scale: calc(1 + .05 * var(--m-amp));
  box-shadow: 0 0 0 2px #fff inset, 0 0 30px 4px var(--c); }
/* the laser of a strike (a ghost: fixed, click-through, gone when it ends) */
.k-laser { position: fixed; width: 4px; margin-left: -2px; transform-origin: 50% 100%; pointer-events: none; z-index: 46; border-radius: 2px;
  background: linear-gradient(0deg, #fff, var(--c) 30%, transparent); box-shadow: 0 0 16px var(--c), 0 0 40px var(--c); }
.k-ring { position: fixed; pointer-events: none; z-index: 46; border: 2px solid var(--c); border-radius: 12px; box-shadow: 0 0 20px var(--c); }
@media (pointer: coarse) { .pad b { display: none; } .pad small { font-size: 17px; letter-spacing: .06em; opacity: 1; } }
.pad small i { font-style: normal; font-size: .75em; margin-left: .05em; vertical-align: .3em; letter-spacing: 0; } /* (S9.4: the sharp, small and raised) */
@media (pointer: coarse) and (max-width: 560px), (pointer: coarse) and (max-height: 520px) { .pad small { font-size: 13px; letter-spacing: 0; } } /* (S9.4: « SOL♯ » inside a 38 px key) */
/* phones: a 3 × 3 grid (Phone.dc.html), thumb-sized */
@media (max-width: 560px) {
  .pads { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .pad { height: 50px; border-radius: 8px; }
}

/* S5.7 (revues regard neuf) — Parcours seulement, le mode libre ne change pas */
/* no permanent help line on the visual: the first move is a note on the pads */
body.game .stage .hint { display: none !important; }
/* a touch screen: no MIDI button (it said « Nouveau », then « Accès MIDI refusé ») */
body.game.touch #midi { display: none !important; }
/* phones: the pads stay in sight when the bar above grows with the path (they stick to the bottom of the window) */
@media (max-width: 560px) { body.game .pads { position: sticky; bottom: 0; z-index: 4; padding: 6px 0; background: var(--bg, #0d0c0b); border-radius: 10px 10px 0 0; } }
/* a party's quake (rotate) must not widen a phone's page: the shaking children are clipped by the app */
body.game .app { overflow-x: clip; }

/* =====================================================================
   S6.6 « Juice d'arcade » — INSERT COIN, HIGH SCORES (S9.2: in the one neon skin, Parcours and free mode alike)
   ===================================================================== */
:root { --arc-fg: var(--cyan); --arc-hot: var(--magenta); --arc-gold: var(--amber); --arc-bg: #0a0618; --arc-dim: var(--line-hi); --arc-glow: #22e6ff66; --arc-ink: var(--bg); --arc-soft: var(--muted); } /* (S9.2: the arcade tokens are the neon ones) */

/* S11.1 → S11.3 #coin (was « INSERT COIN »): never shown, the power button is the Drone's switch (« S11.3 » at the end) */
.coin { display: none; }
@keyframes pw-standby { 0%, 100% { opacity: .55; text-shadow: none; } 45%, 60% { opacity: 1; text-shadow: 0 0 10px #ff6a3d, 0 0 26px #ff3b1f; } }
@keyframes coin-blink { 50% { opacity: .12; } }

/* the high scores of the Réponse (garden.js hiscores), in the Arbre: top 5, three initials typed arcade-style */
.hiscores { margin: 0 0 6px; padding: 6px 10px 8px; border-radius: var(--radius-btn); border: 1.5px solid var(--line); background: transparent; font-family: var(--f); color: var(--cyan); }
.hiscores[hidden] { display: none; }
.hiscores { padding: 3px 8px; }
.hs-title { width: 100%; min-height: 40px; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; font: 700 13px var(--f); letter-spacing: .24em; color: var(--magenta); text-shadow: 0 0 8px var(--magenta); }
.hs-title::before { content: '▾ '; }
.hiscores.min .hs-title::before { content: '▸ '; }
.hiscores.min .hs-body { display: none; }
.hs-body { padding: 2px 0 6px; }
.modal-card .hiscores li, .modal-card .hiscores p { color: inherit; line-height: 1.3; }
.hs-list { margin: 2px 0 0; padding: 0; list-style: none; display: grid; }
.modal-card .hs-list li { font-size: 15px; font-weight: 600; letter-spacing: .08em; }
.hs-list li { display: grid; grid-template-columns: 2.4em 3.6em 4.5em 1fr; gap: 6px; align-items: center; }
.hs-list li:first-child { color: var(--arc-gold); }
.hs-list li.me { color: var(--arc-hot); text-shadow: 0 0 8px var(--arc-hot); }
.hs-list .hs-s { text-align: right; }
.hs-list .hs-t { color: var(--muted); font-size: 13px; }
.modal-card .hiscores .hs-help { font-size: 13px; color: var(--muted); margin: 0; }
.hs-entry { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--magenta); }
.hs-entry[hidden] { display: none; }
.hs-slots { display: flex; gap: 6px; }
.hs-slot { display: grid; justify-items: center; }
.hs-slot button { background: none; border: 0; color: var(--cyan); font: 600 16px/1 var(--f); cursor: pointer; min-width: 44px; min-height: 30px; padding: 0; }
.hs-slot .hs-l { font-size: 28px; font-weight: 700; min-height: 44px; color: var(--amber); text-shadow: 0 0 10px var(--amber-glow); border-bottom: 2px solid var(--line-hi); }
.hs-slot.cur .hs-l { border-color: var(--arc-hot); animation: coin-blink .8s steps(1, end) infinite; }
.hs-entry .hs-ok { --c: var(--magenta); font: 700 14px var(--f); letter-spacing: .16em; color: #fff; background: #ff2bd61a; border-color: var(--magenta); text-shadow: 0 0 8px var(--magenta); box-shadow: 0 0 14px #ff2bd677; min-height: 44px; }
.hs-help { flex-basis: 100%; font-size: 13px; color: var(--muted); }
.tree-btn.has-hs::before { content: '★'; position: absolute; top: -7px; left: -5px; font-size: 13px; color: var(--arc-hot); text-shadow: 0 0 6px var(--arc-hot); }

/* =====================================================================
   S6.7a « Regards neufs » (enfant de 9 ans au téléphone, musicien au bureau) — Parcours only
   ===================================================================== */
/* the view of the Parcours is the city: no visual chip to cycle (the free mode keeps it) */
body.game #vizMode { display: none; }
/* toasts over the visual's chips and the party flash; readable (opaque, neon) */
.toast { z-index: 6; max-width: min(92%, 560px); white-space: normal; text-align: center; }

/* phones (S8.3: free mode too): a compact bar (no brand, no captions, fixed rows: a control that appears never moves the others), the LCD,
   then the city and the pads together in the window; no chord / tempo / bar over the city */
@media (max-width: 560px) {
  .top { padding: 8px 10px; gap: 8px; }
  .brand, .transport .tgrp > small, body.game [data-for=mood] { display: none; }
  .transport { display: grid; grid-template-columns: auto auto auto 1fr auto auto; grid-template-areas: "play midi rec . tree more" "mode mode mode mode mode mode" "land land land land land land"; gap: 6px; width: 100%; }
  .transport .tgrp { padding: 0; border: 0; }
  .transport .tgrp:has(#play), .transport .tgrp:has(#play) > .tgrp-row { display: contents; }
  #play { grid-area: play; min-width: 0; }
  #midi { grid-area: midi; }
  .transport .tgrp:has(#rec) { grid-area: rec; }
  .transport .tgrp:has(.modes) { grid-area: mode; }
  .transport .tgrp:has(#preset) { grid-area: land; }
  .transport .tree-grp { grid-area: tree; }
  .transport .more { grid-area: more; }
  .transport #sleepLeft { display: none; }
  .transport .tgrp-row { flex-wrap: nowrap; }
  .transport .btn, .transport summary { white-space: nowrap; padding: 7px 9px; }
  body.game .stage { margin: 10px 0; }
  body.game .stage .hud { display: none; }
}

/* =====================================================================
   S7.1 « Mouvement » — ONE motion system for every piece of interface, Parcours and free mode alike (js/motion.js:
   tokens, utilities, particles, wiring). js/motion.js writes --juice (JUICE, the one knob), --m-t (time: 0 = every
   motion off, in reduced motion or at JUICE 0) and --m-amp (amplitude: distances, squash, overshoot, glow = JUICE; 0 in
   reduced motion). Rules: these tokens, never a duration or a curve of your own; transform / opacity (translate, scale,
   rotate: individual properties, they compose with an element's own transform); the state changes at once, the motion
   dresses it. Generic layer: every interactive control (button, summary, [role=button], .knob, select, range…).
   ===================================================================== */
:root {
  --juice: 1; --m-t: 1; --m-amp: 1; --beat: 1s;
  --m-fast: calc(110ms * var(--m-t)); --m-med: calc(220ms * var(--m-t)); --m-slow: calc(420ms * var(--m-t)); --m-stagger: calc(35ms * var(--m-t));
  --m-spring: cubic-bezier(.34, 1.56, .64, 1); /* overshoots then settles: entries, needles, lit keys */
  --m-snap: cubic-bezier(.2, 0, 0, 1); /* quick and dry: presses, beats */
  --m-bounce: linear(0, .55 14%, 1.12 30%, .94 46%, 1.03 62%, .99 80%, 1); /* a ball that lands: toasts */
  --m-out: cubic-bezier(.16, 1, .3, 1); /* decelerates: fades, hovers */
  --m-in: cubic-bezier(.55, 0, .85, .25); /* accelerates away: exits (« aspirée ») */
}
@media (prefers-reduced-motion: reduce) { :root { --m-t: 0; --m-amp: 0; } } /* (before js; js writes the same) */
.app { overflow-x: clip; } /* (a section sliding in never widens the page) */

/* every control: transitions on the motion tokens (no specificity: an element's own transition wins) */
:where(button, summary, select, label.btn, [role=button], .knob svg, input, textarea) {
  transition: translate var(--m-fast) var(--m-out), scale var(--m-fast) var(--m-out), transform var(--m-fast) var(--m-out),
    box-shadow var(--m-med) var(--m-out), filter var(--m-med) var(--m-out);
}
/* --m-sx / --m-sy = the squash of an element (wide and flat for buttons, a plain shrink for knobs and selects) */
:where(button, summary, select, label.btn, [role=button]) { --m-sx: calc(1 + .08 * var(--m-amp)); --m-sy: calc(1 - .2 * var(--m-amp)); }
.knob, .ctl.sel { --m-sx: calc(1 - .07 * var(--m-amp)); --m-sy: calc(1 - .07 * var(--m-amp)); }

/* hover (a fine pointer): it lifts, glows in its own colour (--c) and casts a shadow; js (.m-tilt) leans it in 3D
   towards the pointer. A finger gets the same glow when it presses (.is-pressed). S7.4: stronger, from tokens (every
   wave uses these): --m-lift (rise), --m-z (3D height of the lean), --m-drop (deep cast shadow), --m-glow (neon
   radius, coloured by the element's --c where it is used), --m-bright; motion.LEAN = the lean's angle. */
:root { --m-lift: calc(-2px * var(--m-amp)); --m-z: calc(14px * var(--m-amp)); --m-glow: calc(14px * var(--m-amp)); --m-bright: calc(1 + .12 * var(--m-amp)); /* (S9.2: the tube lights up and rises 2 px) */
  --m-drop: 0 calc(16px * var(--m-amp)) calc(18px * var(--m-amp)) calc(-7px * var(--m-amp)) #000f, 0 calc(4px * var(--m-amp)) calc(4px * var(--m-amp)) #0009; }
@media (hover: hover) {
  /* any other control that leans (text buttons, LCD keys, tree tools…): lifts, its glyphs glow (drop-shadow) */
  :where(button, summary, [role=button]:not(.knob), label.btn).m-tilt:not(:disabled) {
    translate: 0 var(--m-lift); filter: brightness(var(--m-bright)) drop-shadow(0 calc(8px * var(--m-amp)) calc(5px * var(--m-amp)) #000c) drop-shadow(0 0 calc(var(--m-glow) / 3) color-mix(in srgb, var(--c, var(--accent)) 85%, transparent));
  }
  /* S9.2 the tube lights up in its colour (cyan by default), its lettering glows, it rises 2 px */
  :where(.btn, .mode-btn, .tog, .chip, label.btn, .song-chip, .chord-slot, .slot-tab, .sc-slot, .song-btns button, .loop-chip button, select, .nsel-btn):is(:hover, .m-tilt):not(:disabled) {
    translate: 0 var(--m-lift); color: #fff; border-color: var(--c, var(--cyan)); background-color: color-mix(in srgb, var(--c, var(--cyan)) 8%, transparent);
    text-shadow: 0 0 8px var(--c, var(--cyan));
    box-shadow: var(--m-drop), 0 0 var(--m-glow) color-mix(in srgb, var(--c, var(--cyan)) 55%, transparent), inset 0 0 10px color-mix(in srgb, var(--c, var(--cyan)) 27%, transparent);
  }
  /* S7.5: text fields (motif chain, initials, names) light up under the pointer */
  :where(input[type=text], input[type=number], input:not([type]), textarea):is(:hover, :focus):not(:disabled) {
    border-color: var(--cyan); box-shadow: 0 0 calc(var(--m-glow) / 1.5) #22e6ff88, inset 0 0 8px #22e6ff33; }
  /* S7.5: the × of a window spins a quarter turn and glows (it does not lean: css only) */
  .modal-x { transition: rotate var(--m-med) var(--m-spring), scale var(--m-med) var(--m-spring), color var(--m-fast) var(--m-out), text-shadow var(--m-fast) var(--m-out); }
  .modal-x:hover { color: #fff; rotate: calc(90deg * min(1, var(--m-amp))); scale: calc(1 + .25 * var(--m-amp)); text-shadow: 0 0 10px var(--magenta), 0 0 4px #fff; }
  .knob:hover svg { translate: 0 calc(var(--m-lift) * .8); scale: calc(1 + .06 * var(--m-amp));
    filter: drop-shadow(0 calc(10px * var(--m-amp)) 5px #000c) drop-shadow(0 0 calc(var(--m-glow) / 2.5) color-mix(in srgb, var(--c, var(--accent)) 85%, transparent)); }
}
.m-tilt.m-tilt { transform: perspective(380px) rotateX(var(--m-rx, 0deg)) rotateY(var(--m-ry, 0deg)) translateZ(var(--m-z)); }

/* press: sinks and squashes while held, springs back with momentum when let go (and sparks: motion.burst) */
.is-pressed { scale: var(--m-sx) var(--m-sy) !important; translate: 0 calc(2px * var(--m-amp)) !important; filter: brightness(1.3) drop-shadow(0 0 5px color-mix(in srgb, var(--c, var(--accent)) 80%, transparent));
  animation: press-in var(--m-fast) var(--m-snap) !important; } /* (!important: the finger beats a party's hop) */
/* S7.5: pressed beats hovered (the lift, the 3D height and the cast shadow go: it sinks into the panel, lit inside) */
.m-tilt.m-tilt.is-pressed { transform: perspective(380px) rotateX(var(--m-rx, 0deg)) rotateY(var(--m-ry, 0deg)) translateZ(calc(-10px * var(--m-amp))); }
/* S9.2 the strike: the tube is crushed and fills with light (its colour, a white rim), then a spark leaves it (motion.js) */
:is(.btn, .mode-btn, .tog, .chip, label.btn, .song-chip, .chord-slot, .slot-tab, .sc-slot, .song-btns button, .loop-chip button, .pulse-cell, .nsel-btn, select).is-pressed {
  color: var(--bg) !important; background: var(--c, var(--magenta)) !important; border-color: color-mix(in srgb, var(--c, var(--magenta)) 30%, #fff) !important; text-shadow: none !important;
  box-shadow: 0 0 26px var(--c, var(--magenta)), 0 0 60px color-mix(in srgb, var(--c, var(--magenta)) 40%, transparent) !important; }
.is-released { animation: press-out var(--m-slow) var(--m-out) !important; }
@keyframes press-in { from { scale: 1; translate: 0 0; } }
@keyframes press-out {
  0% { scale: var(--m-sx) var(--m-sy); filter: brightness(1.45) drop-shadow(0 0 8px color-mix(in srgb, var(--c, var(--accent)) 80%, transparent)); }
  35% { scale: calc(2 - var(--m-sx)) calc(2 - var(--m-sy)); translate: 0 calc(-2px * var(--m-amp)); }
  65% { scale: calc(.7 + .3 * var(--m-sx)) calc(.7 + .3 * var(--m-sy)); translate: 0 0; }
  100% { scale: 1; translate: 0 0; filter: none; }
}

/* toggles: the LED springs on (and shrinks off); a layer switched off fades its controls */
.tog.on::before { animation: m-led-on var(--m-med) var(--m-spring); }
.tog:not(.on)::before { animation: m-led-off var(--m-fast) var(--m-in); }
@keyframes m-led-on { from { scale: calc(1 + 1.6 * var(--m-amp)); opacity: .3; } }
@keyframes m-led-off { from { scale: calc(1 + .6 * var(--m-amp)); opacity: .7; } }
.panel .ctls { transition: opacity var(--m-med) var(--m-out); }

/* knobs: the needle follows with a light spring (closer while dragged), the arc glows while it turns, each notch
   squashes the cap a little (motion.turn: sparks off the needle's tip), the value rolls */
.k-needle { transform-box: view-box; transform-origin: 30px 30px; transition: transform var(--m-fast) var(--m-spring); }
.knob.active .k-needle { transition-duration: calc(70ms * var(--m-t)); }
.k-glow { fill: none; stroke: var(--c); stroke-width: 9; opacity: 0; filter: blur(2.5px); transition: opacity var(--m-slow) var(--m-out); pointer-events: none; }
.knob.active .k-glow, .knob.m-turning .k-glow { opacity: .85; transition-duration: var(--m-fast); }
.knob.active .k-arc, .knob.m-turning .k-arc { stroke-dasharray: none; }
.knob.m-tick svg { animation: m-tick var(--m-fast) var(--m-snap); }
@keyframes m-tick { from { scale: calc(1 + .05 * var(--m-amp)) calc(1 - .06 * var(--m-amp)); } }

/* a slider's cap: grows under the pointer, squashes and lights up while dragged */
input[type=range] { -webkit-appearance: none; appearance: none; height: 24px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: #241640; }
input[type=range]::-moz-range-track { height: 3px; border-radius: 2px; background: #241640; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 22px; margin-top: -9.5px; border-radius: 3px; border: 2px solid var(--c, var(--cyan));
  background: var(--bg); box-shadow: 0 0 8px color-mix(in srgb, var(--c, var(--cyan)) 60%, transparent); transition: scale var(--m-fast) var(--m-spring); }
input[type=range]::-moz-range-thumb { width: 12px; height: 20px; border-radius: 3px; border: 2px solid var(--c, var(--cyan)); background: var(--bg); box-shadow: 0 0 8px color-mix(in srgb, var(--c, var(--cyan)) 60%, transparent); transition: scale var(--m-fast) var(--m-spring); }
input[type=range]:hover::-webkit-slider-thumb { scale: calc(1 + .25 * var(--m-amp)); translate: 0 calc(-2px * var(--m-amp)); box-shadow: 0 0 calc(var(--m-glow) * 1.2) var(--c, var(--cyan)), inset 0 0 6px var(--c, var(--cyan)); }
input[type=range]:hover::-moz-range-thumb { scale: calc(1 + .25 * var(--m-amp)); box-shadow: 0 0 calc(var(--m-glow) * 1.2) var(--c, var(--cyan)); }
@media (hover: hover) { input[type=range]:hover::-webkit-slider-runnable-track { box-shadow: 0 0 calc(var(--m-glow) / 2) color-mix(in srgb, var(--c, var(--cyan)) 60%, transparent); } } /* (S7.5: the hover was hard to see) */
input[type=range]:active::-webkit-slider-thumb { scale: calc(1 + .25 * var(--m-amp)) calc(1 - .12 * var(--m-amp)); background: var(--c, var(--cyan)); box-shadow: 0 0 18px var(--c, var(--cyan)); }
input[type=range]:active::-moz-range-thumb { scale: calc(1 + .25 * var(--m-amp)) calc(1 - .12 * var(--m-amp)); background: var(--c, var(--cyan)); }

/* a group where one key is lit (Sculpter / Composer; motion.slide): the lit key slides behind the labels.
   .m-placed = the key is in place; until then the buttons keep their own lit look */
.modes { position: relative; }
.m-ind { position: absolute; left: 0; top: 0; bottom: 0; width: 100px; transform-origin: 0 0; pointer-events: none; opacity: 0;
  background: color-mix(in srgb, var(--cyan) 10%, transparent); box-shadow: inset 0 -3px 0 var(--cyan), 0 4px 14px -6px var(--cyan); transition: transform var(--m-med) var(--m-spring), opacity var(--m-fast); }
.m-placed > .m-ind { opacity: 1; }
.modes.m-placed > .mode-btn { position: relative; z-index: 1; background: transparent; box-shadow: none; }
.modes.m-placed > .mode-btn:hover { box-shadow: none; }

/* a view change (motion.swap): a neon scan crosses the window, the sections come in behind it (Web Animations) */
.m-wipe[hidden] { display: none; }
.m-wipe { position: fixed; top: 0; bottom: 0; left: 0; width: 40vw; z-index: 45; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--lcd-fg) 8%, transparent) 55%, color-mix(in srgb, var(--lcd-fg) 30%, transparent) 94%, color-mix(in srgb, #fff 50%, var(--lcd-fg)) 97%, transparent); }

/* one-shot classes (motion.pop): m-pop (springs in), m-glitch (neon jolt), m-type (a cursor types the text in),
   m-nudge (a wobble: a new toast over the last one) */
.m-pop { animation: m-pop var(--m-med) var(--m-spring); }
@keyframes m-pop { from { scale: calc(1 - .25 * min(1, var(--m-amp))); opacity: .3; } }
.menu.m-pop { transform-origin: 50% 0; animation-name: m-drop; }
@keyframes m-drop { from { scale: 1 calc(1 - .7 * min(1, var(--m-amp))); opacity: 0; } }
.m-glitch { animation: m-glitch var(--m-med) steps(1, end); }
@keyframes m-glitch {
  0% { translate: calc(-3px * var(--m-amp)) 0; opacity: .5; }
  20% { translate: calc(3px * var(--m-amp)) calc(-1px * var(--m-amp)); scale: calc(1 + .04 * var(--m-amp)) calc(1 - .08 * var(--m-amp)); opacity: 1; }
  40% { translate: calc(-1px * var(--m-amp)) 0; scale: 1; opacity: .75; }
  60% { translate: calc(1px * var(--m-amp)) 0; opacity: 1; }
  80%, 100% { translate: 0 0; }
}
.goals { --lcd-face: #07040f; } /* (S11.1: the cursor that types a text in covers it with the widget's face) */
/* the cover is anchored on the right and shrinks towards it (its left edge = the cursor walks right): it never pokes
   out of the line (the fit of a long message reads the line's scrollWidth) */
.m-type { animation: m-type-jolt var(--m-med) steps(1, end); }
.m-type::after { content: ""; position: absolute; inset: -1px 0; pointer-events: none; transform-origin: 100% 50%;
  background: linear-gradient(90deg, var(--lcd-fg) 0 .42em, var(--lcd-face, var(--lcd-bg)) .42em); box-shadow: -4px 0 10px var(--lcd-glow);
  animation: m-type var(--m-med) steps(8, jump-end) both; }
@keyframes m-type { from { scale: 1 1; } to { scale: 0 1; } }
@keyframes m-type-jolt { 0% { translate: calc(-2px * var(--m-amp)) 0; } 25% { translate: calc(2px * var(--m-amp)) 0; } 50%, 100% { translate: 0 0; } }
.m-nudge { animation: m-nudge var(--m-med) var(--m-snap); }
@keyframes m-nudge { 35% { rotate: calc(-2deg * var(--m-amp)); scale: calc(1 + .06 * var(--m-amp)); } 70% { rotate: calc(1.2deg * var(--m-amp)); } }

/* toasts: bounce in, sucked away up into the screen's edge on the way out */
.toast { translate: -50% calc(-22px * var(--m-amp)); scale: calc(1 - .65 * min(1, var(--m-amp))); transform-origin: 50% 0;
  transition: opacity var(--m-med) var(--m-in), scale var(--m-med) var(--m-in), translate var(--m-med) var(--m-in); }
.toast.show { translate: -50% 0; scale: 1; opacity: 1; transition: opacity var(--m-fast) linear, scale var(--m-slow) var(--m-bounce), translate var(--m-slow) var(--m-bounce); }

/* ▶ while playing: a discreet pulse on the tempo (--beat, ui.js) */
#play { position: relative; }
body.playing #play { animation: m-beat var(--beat) var(--m-out) infinite; }
body.playing #play::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none; opacity: 0;
  box-shadow: 0 0 10px 1px var(--accent); animation: m-beat-glow var(--beat) var(--m-out) infinite; }
@keyframes m-beat { 0% { scale: calc(1 + .035 * var(--m-amp)); } 40%, 100% { scale: 1; } }
@keyframes m-beat-glow { 0% { opacity: calc(.75 * min(1, var(--m-amp))); } 60%, 100% { opacity: 0; } }
/* S7.5 motion off (reduced motion, JUICE 0; motion.js sets .m-still on <html> at once): ONE rule for every animation and
   transition of the app, older loops included. Each jumps to its end (a loop = its resting look: what is lit, ready,
   queued stays visible, still), nothing moves; the per-module « animation: none » rules it replaced are gone. */
.m-still *, .m-still *::before, .m-still *::after { animation-duration: 0s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
  transition-duration: 0s !important; transition-delay: 0s !important; }

/* =====================================================================
   S7.4 « Barre, Sculpter, fenêtres » — on the S7.1 system (tokens --m-*, AMB.motion: landscape, scene,
   neon, boom, run, card, crt). Parcours and free mode; sound and controls unchanged. The hover tokens are in S7.1 above.
   ===================================================================== */
/* ghosts: temporary click-through elements over everything (motion.ghost), removed when their animation ends */
.m-ghost { position: fixed; pointer-events: none; z-index: 60; }
/* the scene reacts: a bright scan crosses the screen (motion.scene) */
.m-scan { position: absolute; left: 0; right: 0; top: 0; height: 12%; z-index: 2; pointer-events: none;
  background: linear-gradient(transparent, color-mix(in srgb, var(--lcd-fg) 35%, transparent) 70%, #fff8 92%, transparent); mix-blend-mode: screen; }

/* ✦ Nouveau paysage: the die rolls (two turns, it bounces and lands) */
.m-die { display: inline-block; font-style: normal; }
.m-dice { animation: m-dice calc(var(--m-slow) + 200ms * var(--m-t)) var(--m-out); }
@keyframes m-dice {
  0% { rotate: 0deg; scale: 1; translate: 0 0; }
  30% { rotate: calc(360deg * min(1, var(--m-amp))); scale: calc(1 + .6 * var(--m-amp)); translate: 0 calc(-6px * var(--m-amp)); color: #fff; }
  70% { rotate: calc(690deg * min(1, var(--m-amp))); scale: calc(1 - .15 * var(--m-amp)); translate: 0 0; }
  100% { rotate: calc(720deg * min(1, var(--m-amp))); scale: 1; }
}
/* a landscape's name comes in like a slot-machine reel (blurred streak from above, lands with a bounce) */
.m-reel { animation: m-reel var(--m-slow) var(--m-bounce); }
@keyframes m-reel {
  0% { translate: 0 calc(-14px * var(--m-amp)); filter: blur(calc(2px * var(--m-amp))) brightness(2); opacity: .3; }
  45% { translate: 0 calc(3px * var(--m-amp)); filter: none; opacity: 1; }
  100% { translate: 0 0; }
}

/* ● Rec: pulses red while it records (a ring that keeps leaving it), explodes when it stops (motion.boom) */
#rec { position: relative; }
#rec.rec { animation: m-rec 1s var(--m-out) infinite; color: #ffd0d8; border-color: #ff4f6a;
  box-shadow: 0 0 calc(14px * var(--m-amp)) #ff4f6a99; }
#rec.rec::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none; border: 2px solid #ff4f6a;
  animation: m-rec-ring 1s var(--m-out) infinite; }
@keyframes m-rec { 0% { scale: calc(1 + .07 * var(--m-amp)); } 35%, 100% { scale: 1; } }
@keyframes m-rec-ring { 0% { scale: 1; opacity: calc(.9 * min(1, var(--m-amp))); } 100% { scale: calc(1 + .5 * var(--m-amp)) calc(1 + .9 * var(--m-amp)); opacity: 0; } }
.m-boom { animation: m-boom var(--m-slow) var(--m-spring); }
@keyframes m-boom { 0% { scale: calc(1 + .35 * var(--m-amp)); filter: brightness(2.5); } 40% { scale: calc(1 - .1 * var(--m-amp)); } }
.m-ring { border-radius: 50%; border: 3px solid currentColor; box-shadow: 0 0 18px currentColor, inset 0 0 12px currentColor; }

/* ⋯ the menu springs out of its key (from the corner, slightly turned) */
.more > .menu.m-pop { transform-origin: 100% 0; animation: m-spring-out var(--m-slow) var(--m-spring); }
@keyframes m-spring-out { from { scale: calc(1 - .8 * min(1, var(--m-amp))); rotate: calc(-6deg * var(--m-amp)); opacity: 0; } }

/* MIDI: a flash when a note comes in from the keyboard */
#midi { position: relative; }
#midi.m-flash { animation: m-flash var(--m-med) var(--m-out); }
@keyframes m-flash { 0% { filter: brightness(2.4); box-shadow: 0 0 calc(22px * var(--m-amp)) 4px #22e6ff; color: #fff; scale: calc(1 + .08 * var(--m-amp)); } }

/* a knob turned hard (motion.turn → m-hot): a shockwave in its colour, its panel flares (m-heat) — seen from afar */
.knob { position: relative; }
.knob.m-hot::after { content: ""; position: absolute; left: 50%; top: 26px; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  pointer-events: none; border: 2px solid var(--c, var(--accent)); box-shadow: 0 0 16px var(--c, var(--accent)); animation: m-shock var(--m-slow) var(--m-out); }
.knob.m-hot svg { filter: drop-shadow(0 0 calc(14px * var(--m-amp)) var(--c, var(--accent))) brightness(1.3); }
@keyframes m-shock { from { scale: .8; opacity: 1; } to { scale: calc(1 + 1.6 * var(--m-amp)); opacity: 0; } }
.panel.m-heat { animation: m-heat var(--m-slow) var(--m-out); }
@keyframes m-heat { 0% { box-shadow: 0 0 calc(28px * var(--m-amp)) 2px color-mix(in srgb, var(--c, var(--accent)) 70%, transparent); } }

/* a layer cut: its neon goes out with a crackle; back on: it lights up (flicker, then full) */
.m-neon-off { animation: m-neon-off calc(var(--m-slow) + 120ms * var(--m-t)) steps(1, end); }
@keyframes m-neon-off {
  0% { filter: brightness(1.8); } 15% { filter: brightness(.4); } 25% { filter: brightness(1.5); } 40% { filter: brightness(.3); }
  52% { filter: brightness(1.2); } 70% { filter: brightness(.5); } 100% { filter: none; }
}
.m-neon-on { animation: m-neon-on calc(var(--m-slow) + 120ms * var(--m-t)) steps(1, end); }
@keyframes m-neon-on {
  0% { filter: brightness(.3); } 12% { filter: brightness(2.2); } 22% { filter: brightness(.4); } 35% { filter: brightness(2); }
  45% { filter: brightness(.7); } 60% { filter: brightness(1.8) drop-shadow(0 0 10px var(--c, var(--accent))); } 100% { filter: none; }
}
.panel.m-neon-on h2, .panel.m-neon-off h2 { text-shadow: 0 0 12px var(--c, var(--accent)); }

/* Scènes A/B: the fader shows the blend (A's light left, B's right, --morph), the slots glow by their share, the morph
   runs along the track while Auto plays; a recall sends a comet along it (motion.run) */
.scenes { --morph: 0; }
.scenes.ready .sc-morph::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--accent) 0, color-mix(in srgb, var(--accent) 25%, #1a1918) calc(var(--morph) * 100%), #22e6ff55 calc(var(--morph) * 100%), #22e6ff);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 40%, transparent); }
.scenes.ready.auto .sc-morph::-webkit-slider-runnable-track {
  background-image: repeating-linear-gradient(90deg, #fff5 0 6px, transparent 6px 18px), linear-gradient(90deg, var(--accent), #22e6ff);
  animation: m-run calc(900ms * var(--m-t) + 1ms) linear infinite; }
@keyframes m-run { to { background-position: 18px 0, 0 0; } }
.scenes.ready .sc-slot[data-slot=A].filled { box-shadow: 0 0 calc(18px * (1 - var(--morph)) * var(--m-amp)) var(--accent); }
.scenes.ready .sc-slot[data-slot=B].filled { box-shadow: 0 0 calc(18px * var(--morph) * var(--m-amp)) #22e6ff; }
.m-comet { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 3px var(--accent), -14px 0 12px #22e6ff88; }

/* Journal: a kept moment falls as a card (motion.card) */
.m-card { padding: 8px 12px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 600 13px var(--f); letter-spacing: .06em;
  color: #fff; background: var(--bg); border: 1.5px solid var(--magenta); border-radius: var(--radius-btn); text-shadow: 0 0 8px var(--magenta); box-shadow: 0 10px 22px #000c, 0 0 18px #ff2bd688; }

/* windows: the backdrop darkens with scan lines (a scan rolls down once as it opens); the card switches on like a CRT
   (motion.crt, Web Animations) and is sucked into a dot when it closes (a ghost). The Arbre (#treeDlg):
   its own motion, S7.3 */
.modal:not(#treeDlg)::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, #0000 0 2px, #0006 2px 4px); }
.modal.m-crt-on:not(#treeDlg)::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 18vh; pointer-events: none;
  background: linear-gradient(transparent, color-mix(in srgb, var(--lcd-fg) 22%, transparent) 80%, #fff6 96%, transparent);
  animation: m-roll-down calc(var(--m-slow) + 300ms * var(--m-t)) var(--m-in) both; }
@keyframes m-roll-down { from { translate: 0 -100%; } to { translate: 0 600%; opacity: .2; } }
.m-ghost-bg { inset: 0; z-index: 49; background: #05060bcc; }
.m-ghost-card { z-index: 51; border-radius: var(--radius); background: var(--bg); border: 1.5px solid var(--cyan);
  box-shadow: 0 0 30px var(--cyan), inset 0 0 40px #22e6ff55; }

/* reduced motion / JUICE 0: what loops stops (one-shots do not play: motion.on() is false) */
/* =====================================================================
   S7.3 « Parcours en mouvement » — the Arbre, its cards, the carnet, HIGH SCORES, INSERT COIN, what comes in « Nouveau »,
   the LCD of the asks and of the Réponse, the pads. On the S7.1 system only (tokens --m-*, AMB.motion): durations × --m-t,
   amplitudes × --m-amp; loops that breathe follow the tempo (--beat). js: garden-tree.js (treeIn, crtOff, sparkRun, boom),
   garden.js (suck, coinFx, rollN, hiscores.drum), discoveries.js (reveal), tree.js (landing sparks), play.js (pads).
   ===================================================================== */
/* the Arbre opens: a neon line unrolls into the screen (CRT), a scan sweeps it; the nodes pop in level by level (js) */
.tree-card.m-tree-in { animation: m-tree-in calc(var(--m-slow) + var(--m-fast)) var(--m-out) both; }
.tree-card.m-tree-in::after { content: ""; position: absolute; inset: 0; z-index: 9; pointer-events: none; border-radius: inherit;
  background: linear-gradient(transparent 86%, color-mix(in srgb, var(--arc-fg) 25%, transparent) 96%, #e9fdff 99%, transparent);
  animation: m-scan calc(var(--m-slow) + var(--m-med)) var(--m-out) var(--m-fast) both; }
@keyframes m-tree-in { 0% { scale: .04 .006; filter: brightness(4); } 30% { scale: 1.02 .006; filter: brightness(3); } 65% { scale: 1 1.02; filter: brightness(1.4); } 100% { scale: 1 1; filter: none; } }
@keyframes m-scan { from { translate: 0 -100%; opacity: 1; } 90% { opacity: 1; } to { translate: 0 0; opacity: 0; } }
/* a screen that closes (garden-tree.js crtOff): the ghost of its frame collapses to a line, then a dot (under the windows) */
.m-crt-off { position: fixed; z-index: 49; pointer-events: none; border-radius: 6px; background: linear-gradient(#e9fdff, var(--arc-fg)); box-shadow: 0 0 30px var(--arc-fg), 0 0 60px var(--arc-hot); }
/* a card sucked away (garden.js suck): its ghost, under the windows, inert */
.m-ghost { position: fixed !important; z-index: 49; margin: 0 !important; max-height: none !important; overflow: hidden !important; pointer-events: none; transform-origin: 50% 50%; }
.m-ghost, .m-ghost * { animation: none !important; transition: none !important; }

/* nodes: hover = the LED swells and glows, the name lifts (clearly); ready = it levitates on the tempo, a ring pulses out */
.tree-node .led { position: relative; transition: scale var(--m-fast) var(--m-spring), filter var(--m-fast) var(--m-out); }
.tree-node b { transition: translate var(--m-fast) var(--m-spring), box-shadow var(--m-fast) var(--m-out), color var(--m-fast); }
@media (hover: hover) {
  .tree-node:hover .led { scale: calc(1 + .2 * var(--m-amp)); filter: brightness(1.35); }
  .tree-node:hover b { translate: 0 calc(-3px * var(--m-amp)); color: #fff; box-shadow: 0 calc(5px * var(--m-amp)) 10px -3px #000d, 0 0 calc(12px * var(--m-amp)) -2px var(--c); }
}
.tree-node.st-ready { animation: m-levitate calc(var(--beat) * 2) ease-in-out infinite; }
/* S9.2 rings shaped like the hexagon (an outline cut by clip-path: path, at the node's hexagon) */
.tree-node::before, .tree-node.is-born::after { content: ""; position: absolute; left: 50%; top: 0; width: 46px; height: 40px; margin-left: -23px; pointer-events: none; opacity: 0;
  clip-path: path(evenodd, 'M11.5 0H34.5L46 20L34.5 40H11.5L0 20ZM13.2 3H32.8L42.6 20L32.8 37H13.2L3.4 20Z'); background: var(--amber); }
.tree-node.root::before, .tree-node.root.is-born::after { width: 58px; height: 50px; margin-left: -29px; scale: 1.26; }
.tree-node.st-ready::before { animation: m-ring calc(var(--beat) * 2) var(--m-out) infinite; }
@keyframes m-levitate { 50% { translate: 0 calc(-6px * var(--m-amp)); } }
@keyframes m-ring { from { scale: .9; opacity: .9; } to { scale: calc(1 + 1.1 * var(--m-amp)); opacity: 0; } }
/* the unlock sequence: the link traces itself (a spark runs along it, js), the node charges up, shakes, is born in an
   explosion (js boom) with a shock ring, the children it reaches blink */
.tree-glow.lit { opacity: 1; filter: drop-shadow(0 0 6px var(--c)); animation: tree-lit var(--m-slow) var(--m-out) forwards; }
.tree-glow.hint { opacity: 1; stroke: var(--lcd-fg); stroke-width: 4; stroke-dasharray: none; animation: tree-hint var(--m-med) steps(2) 4 alternate; }
@keyframes tree-lit { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes tree-hint { from { opacity: 1; } to { opacity: .15; } }
.tree-node.is-buying .led { animation: led-charge var(--m-slow) var(--m-in) forwards; }
.tree-node.is-born .led { animation: led-born calc(var(--m-slow) * 1.5) var(--m-spring); }
.tree-node.is-born::after { background: var(--c); animation: m-shock calc(var(--m-slow) * 1.5) var(--m-out) both; }
.tree-node.is-blink .led { animation: led-blink var(--m-med) steps(2) 4 alternate; }
@keyframes led-charge { 20% { translate: calc(-1px * var(--m-amp)) 0; } 40% { translate: calc(1px * var(--m-amp)) 0; } 60% { translate: calc(-1.5px * var(--m-amp)) 0; } 80% { translate: calc(1.5px * var(--m-amp)) 0; }
  to { translate: 0 0; scale: calc(1 - .2 * var(--m-amp)); filter: brightness(1.8); } }
@keyframes led-born { 0% { scale: .8; } 35% { scale: calc(1 + .8 * var(--m-amp)); filter: brightness(2.6); } 100% { scale: 1; } }
@keyframes m-shock { from { scale: 1; opacity: 1; } to { scale: calc(1 + 3 * var(--m-amp)); opacity: 0; border-width: 1px; } }
@keyframes led-blink { from { filter: brightness(2.2); } to { filter: brightness(.6); } }

/* the Arbre's ✦ / ★ bob and spin on the tempo */
@keyframes m-breathe { 50% { scale: calc(1 + .07 * var(--m-amp)); filter: brightness(1.25); box-shadow: 0 0 calc(16px * var(--m-amp)) var(--arc-hot), 0 0 4px var(--arc-gold); } }
.tree-btn.has-ready::after, .tree-btn.has-hs::before { animation: m-star calc(var(--beat) * 2) ease-in-out infinite; }
@keyframes m-star { 50% { scale: calc(1 + .5 * var(--m-amp)); rotate: calc(25deg * var(--m-amp)); filter: brightness(1.6); } }

/* the carnet: riddles « ??? » crackle like a bad signal; a discovery found is revealed in a glitch (js dc-reveal) */
.dc-item.riddle b { animation: m-crackle calc(var(--m-slow) * 7) steps(1, end) infinite; }
.dc-item.riddle:nth-child(2n) b { animation-delay: calc(var(--m-slow) * -2.3); }
.dc-item.riddle:nth-child(3n) b { animation-delay: calc(var(--m-slow) * -4.1); }
@keyframes m-crackle { 0%, 86%, 100% { translate: 0 0; text-shadow: none; }
  88% { translate: calc(2px * var(--m-amp)) 0; text-shadow: -2px 0 #ff2bd6, 2px 0 #22e6ff; opacity: 1; } 90% { translate: calc(-2px * var(--m-amp)) calc(1px * var(--m-amp)); opacity: .2; }
  92% { translate: calc(1px * var(--m-amp)) 0; text-shadow: 2px 0 #ff2bd6, -2px 0 #22e6ff; opacity: .9; } 95% { opacity: .35; } }
.dc-item.dc-reveal { animation: m-reveal calc(var(--m-slow) * 2) steps(1, end); }
.dc-item.dc-reveal b { color: #fff; text-shadow: 3px 0 #ff2bd6, -3px 0 #22e6ff, 0 0 12px #fff; }
@keyframes m-reveal { 0% { opacity: 0; clip-path: inset(45% 0 45% 0); translate: calc(-8px * var(--m-amp)) 0; } 8% { opacity: 1; clip-path: inset(0 0 60% 0); translate: calc(8px * var(--m-amp)) 0; }
  16% { clip-path: inset(55% 0 0 0); translate: calc(-4px * var(--m-amp)) 0; } 24% { clip-path: inset(0 0 0 0); translate: 0 0; scale: calc(1 + .08 * var(--m-amp)); } 34% { opacity: .4; scale: 1; } 44% { opacity: 1; translate: calc(3px * var(--m-amp)) 0; } 54%, 100% { translate: 0 0; clip-path: none; } }
.dc-head, .hs-title { transition: translate var(--m-fast) var(--m-spring), filter var(--m-fast) var(--m-out); }
@media (hover: hover) { .dc-head:hover, .hs-title:hover { translate: calc(5px * var(--m-amp)) 0; filter: brightness(1.4) drop-shadow(0 0 calc(8px * var(--m-amp)) var(--arc-hot)); } }

/* HIGH SCORES: lines come up like a cabinet's attract screen (js stagger), the score being signed blinks, a new one
   flashes in; the initials roll like a drum (js drum); ▲ ▼ swell under the pointer */
.hs-list li { border-radius: 3px; padding: 0 4px; }
.hs-list li.pend { animation: m-hs-blink calc(var(--m-slow) * 2) steps(1, end) infinite; }
@keyframes m-hs-blink { 50% { color: var(--arc-gold); text-shadow: 0 0 10px var(--arc-gold); opacity: .55; } }
.hs-list li.hs-new { animation: m-hs-new calc(var(--m-slow) * 3) steps(1, end); }
@keyframes m-hs-new { 0%, 32%, 64% { background: var(--arc-hot); color: var(--arc-ink); text-shadow: none; } 16%, 48%, 80%, 100% { background: transparent; } }
.hs-slot button { transition: scale var(--m-fast) var(--m-spring), color var(--m-fast), text-shadow var(--m-fast); }
@media (hover: hover) { .hs-slot button:hover { scale: calc(1 + .3 * var(--m-amp)); color: #fff; text-shadow: 0 0 10px var(--arc-fg), 0 0 2px #fff; } }

/* the power button: hover = it swells and burns brighter; the press = sparks (js), a CRT line opens out on the stage,
   and the machine wakes up (body.waking, « S11.1 » at the end). The button itself is already gone: this dresses it */
.coin-fx { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; border-radius: inherit; }
.cf-coin { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px; border-radius: 50%; display: grid; place-items: center; font: 700 26px/1 var(--f); font-style: normal;
  color: #7a4d00; background: radial-gradient(circle at 35% 30%, #fffbe0, #ffd23f 45%, #b8860b); box-shadow: 0 0 0 3px #7a5200, 0 0 26px #ffb347; opacity: 0;
  animation: m-coin-drop var(--m-slow) var(--m-in) both; }
@keyframes m-coin-drop { 0% { opacity: 1; translate: 0 calc(-150px * min(1, var(--m-amp))); rotate: y 0deg; } 78% { opacity: 1; translate: 0 0; rotate: y 900deg; scale: 1; }
  88% { opacity: 1; scale: 1.35 .55; rotate: y 900deg; } 100% { opacity: 0; translate: 0 0; scale: .1 0; rotate: y 900deg; } }
.cf-crt { position: absolute; inset: 0; background: linear-gradient(#ffffff, #c8f9ff); mix-blend-mode: screen; opacity: 0; animation: m-crt-on var(--m-slow) var(--m-out) var(--m-fast) both; }
@keyframes m-crt-on { 0% { opacity: 1; scale: 0 .01; } 30% { opacity: 1; scale: 1 .012; } 55% { opacity: .55; scale: 1 1; } 100% { opacity: 0; scale: 1 1; } }

/* « Nouveau »: what a node opens drops in and bounces (sparks when it lands, tree.js), then a halo on the tempo */
.is-appearing { animation: m-appear calc(var(--m-slow) + var(--m-fast)) var(--m-bounce) both; transform-origin: 50% 0; }
@keyframes m-appear { from { opacity: 0; scale: calc(1 - .25 * min(1, var(--m-amp))); translate: 0 calc(-26px * var(--m-amp)); clip-path: inset(0 0 100% 0); }
  35% { opacity: 1; clip-path: inset(0 0 0 0); } to { opacity: 1; scale: 1; translate: 0 0; clip-path: inset(0 0 0 0); } }
.is-new { animation: m-new-glow calc(var(--beat) * 2) ease-in-out infinite; }
.is-new.is-appearing { animation: m-appear calc(var(--m-slow) + var(--m-fast)) var(--m-bounce) both, m-new-glow calc(var(--beat) * 2) ease-in-out calc(var(--m-slow) + var(--m-fast)) infinite; }
.is-new-first::after { animation: m-new-tag var(--beat) ease-in-out infinite; }
@keyframes m-new-glow { 50% { outline-color: #fff; box-shadow: 0 0 calc(20px * var(--m-amp)) color-mix(in srgb, var(--lcd-fg) 65%, transparent); } }
@keyframes m-new-tag { 50% { translate: 0 calc(-4px * var(--m-amp)); scale: calc(1 + .06 * var(--m-amp)); } }

/* the Objectifs widget: a new objective is typed in (m-type), counts roll (motion.roll), RATÉ (a missed Réponse)
   lands on its head line like a rubber stamp. */
#goals .gw-line.m-stamp { transform-origin: 30% 50%; animation: m-stamp var(--m-slow) var(--m-snap); }
@keyframes m-stamp { 0% { scale: calc(1 + 1.5 * var(--m-amp)); rotate: calc(-10deg * var(--m-amp)); opacity: 0; } 30% { scale: calc(1 - .1 * var(--m-amp)); rotate: calc(-3deg * var(--m-amp)); opacity: 1; filter: brightness(1.8); }
  50% { scale: calc(1 + .05 * var(--m-amp)); rotate: calc(-1deg * var(--m-amp)); } 100% { scale: 1; rotate: 0deg; filter: none; } }

/* the pads: hover = lifted in their colour (a mouse), press = squashed hard, a ring of their colour flashes out, sparks
   of their colour (js: at once, and when let go: motion.js) */
/* S9.2: held = crushed 6 % (scale .94, down 4 px); the ring and the laser: AMB.keys.hit (play.js) */
.pad { --m-sx: calc(1 - .06 * var(--m-amp)); --m-sy: calc(1 - .06 * var(--m-amp)); transition: translate var(--m-fast) var(--m-spring), scale var(--m-fast) var(--m-spring), box-shadow var(--m-fast) var(--m-out), background-color var(--m-fast) var(--m-out), color var(--m-fast); }
.pad.on { scale: var(--m-sx) var(--m-sy); translate: 0 calc(4px * var(--m-amp)); transition-duration: 0s; }
@media (hover: hover) { .pad:not(.on):not(.auto):not(.call):hover { translate: 0 calc(-4px * var(--m-amp)); color: #fff; background: color-mix(in srgb, var(--c) 9%, var(--bg)); text-shadow: 0 0 10px var(--c);
  box-shadow: 0 0 22px var(--c), 0 calc(10px * var(--m-amp)) 24px #8a5cff55, inset 0 0 18px color-mix(in srgb, var(--c) 33%, transparent); } }

/* =====================================================================
   S7.2 « Composer en mouvement » — the Composer's pieces on the S7.1 system (tokens --m-*, AMB.motion: fx, shatter,
   flip, burst). What plays on the tempo is light (classes on a few cells, composited opacity / scale) and follows the
   beat HEARD: --beat-ph (seq.beatPhase) puts an infinite --beat animation on it; the grids light the step heard.
   ===================================================================== */
/* hover, clearly: higher, brighter, a wide glow of the piece's colour and a deep shadow */
@media (hover: hover) {
  .seqrow :is(.song-chip, .chord-slot, .slot-tab, .song-btns button, .btn, .loop-chip):is(:hover, .m-tilt):not(:disabled) {
    position: relative; z-index: 2; translate: 0 calc(-5px * var(--m-amp)); filter: brightness(1.35) saturate(1.15);
    box-shadow: 0 calc(12px * var(--m-amp)) calc(18px * var(--m-amp)) -6px #000, 0 0 calc(26px * var(--m-amp)) calc(3px * var(--m-amp)) color-mix(in srgb, var(--c, var(--accent)) 85%, transparent);
  }
  .seqrow :is(.song-chip.sel, .chord-slot.is-sel, .slot-tab.is-sel):is(:hover, .m-tilt) { box-shadow: 0 0 0 1px var(--c) inset, 0 calc(12px * var(--m-amp)) calc(18px * var(--m-amp)) -6px #000, 0 0 calc(30px * var(--m-amp)) calc(4px * var(--m-amp)) var(--c); }
  .loop-chip { transition: translate var(--m-fast) var(--m-out), box-shadow var(--m-med) var(--m-out), filter var(--m-med) var(--m-out); }
  .pulse-cell:is(:hover, .m-tilt) { z-index: 2; scale: calc(1 + .3 * var(--m-amp)); filter: brightness(1.5);
    box-shadow: 0 0 calc(14px * var(--m-amp)) calc(2px * var(--m-amp)) color-mix(in srgb, var(--c, var(--accent)) 80%, transparent), 0 calc(6px * var(--m-amp)) 8px -3px #000; }
}

/* the grids (Pulsations, Basse): a lit step that plays flashes white and spills its glow; the step jumps */
.pulse-cell { position: relative; }
.pulse-cell.beat.on { background: var(--c); } /* (a lit step on a beat was drawn dark by the skin's .beat) */
.pulse-cell.on.now { animation: s72-hit var(--m-med) var(--m-snap); }
.pulse-cell.on.now::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0;
  background: #fff; box-shadow: 0 0 10px 2px var(--c); animation: s72-flash var(--m-slow) var(--m-out); }
@keyframes s72-hit { from { scale: calc(1 + .3 * var(--m-amp)) calc(1 + .45 * var(--m-amp)); } }
@keyframes s72-flash { from { opacity: calc(.85 * min(1, var(--m-amp))); scale: calc(1 + .15 * var(--m-amp)); } to { opacity: 0; scale: 1; } }

/* on the beat heard: the section playing, the chord playing (a glow that falls each beat, a bump), the take (red) */
.chord-slot { position: relative; }
.song-chip.now, .chord-slot.now b, .loop-chip.rec, .looper .btn.rec { animation: s72-bump var(--beat) var(--m-out) infinite; animation-delay: var(--beat-ph, 0s); }
.song-chip.now::after, .chord-slot.now::after, .loop-chip.rec::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0;
  box-shadow: 0 0 18px 3px var(--c), inset 0 0 12px var(--c); animation: s72-glow var(--beat) var(--m-out) infinite; animation-delay: var(--beat-ph, 0s); }
.loop-chip { position: relative; }
.loop-chip.rec { --c: #ff5e7a; }
.loop-chip.rec { box-shadow: 0 0 calc(14px * var(--m-amp)) #ff5e7a; }
.loop-chip.rec::after { inset: 0; background: color-mix(in srgb, #ff5e7a 55%, transparent); box-shadow: inset 0 0 16px 3px #ff9aac; }
@keyframes s72-bump { 0% { scale: calc(1 + .09 * var(--m-amp)); } 45%, 100% { scale: 1; } }
@keyframes s72-glow { 0% { opacity: calc(.95 * min(1, var(--m-amp))); } 70%, 100% { opacity: 0; } }
/* queued for the next bar: blinks on the beat (was a fixed .5 s) */
.song-chip.next, .slot-tab.queued { animation: s72-blink var(--beat) steps(1, end) infinite; animation-delay: var(--beat-ph, 0s); }
@keyframes s72-blink { 50% { border-color: transparent; opacity: .55; } }

/* the looper's giant count-in, over the row (nothing under it moves); REC in red */
.looper { position: relative; }
.loop-count { position: absolute; left: 50%; top: 50%; translate: -50% -55%; z-index: 6; pointer-events: none; opacity: 0; white-space: nowrap;
  font: 700 64px/1 var(--f); color: var(--lcd-fg); letter-spacing: .08em;
  text-shadow: 0 0 10px var(--lcd-fg), 0 0 34px var(--lcd-fg), 4px 4px 0 #000, -2px -2px 0 #000; }
.loop-count.is-rec { color: #ff5e7a; text-shadow: 0 0 10px #ff5e7a, 0 0 38px #ff2a4a, 4px 4px 0 #000, -2px -2px 0 #000; }
@media (max-width: 560px) { .loop-count { font-size: 60px; } }

/* a ghost (motion.shatter: a section, a loop layer that goes) plays only its own squash */
.m-ghost, .m-ghost::after, .m-ghost * { animation: none !important; transition: none !important; }

/* =====================================================================
   S8.3 « Plein écran responsive » — the CITY fills the window on every screen, the instrument floats over it (Parcours
   and free mode alike; sound and controls unchanged). Size rules (ARCHITECTURE.md « Mise en page S8.3 »): .stage is
   fixed over the whole window, #viz = 100 % of it (visual.js resize × devicePixelRatio): the canvas size follows the
   window only, never a mode, a drawer or a panel. The page never scrolls: .app is a fixed grid of floating pieces —
   bar + LCD on top (smoked glass), the pads at the bottom, Sculpter / Composer in .drawer (right
   side; a bottom sheet on a portrait screen) that scrolls inside itself. ui.js layoutWatch measures what is left of
   the city (--free-t / -r / -b / -l, AMB.gardenVisual.safe); the stage's own overlays sit inside that free window.
   ===================================================================== */
:root { --glass: color-mix(in srgb, #07040f 76%, transparent); --glass-hi: color-mix(in srgb, #07040f 88%, transparent); --glass-line: #3a2560;
  --glass-blur: blur(14px) saturate(1.35); --free-t: 0px; --free-r: 0px; --free-b: 0px; --free-l: 0px; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.app { position: fixed; inset: 0; max-width: none; margin: 0; overflow: clip; pointer-events: none;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px 10px;
  grid-template-areas: "top top" "free drawer" "pads drawer"; }
.app > * { pointer-events: auto; }
/* the city: behind everything, edge to edge (no bezel; its CRT scanlines and vignette stay) */
.app > .stage { position: fixed; inset: 0; z-index: 0; height: auto; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.app > .top, .app > .pads, .app > .drawer { position: relative; z-index: 2; }
.app > .top { z-index: 3; } /* (S9.4: the bar's menus ⋯ and Rec open over the drawer, not under it) */
@media (max-width: 560px) { #dice .dl-long { display: none; } } /* (S9.4: « ✦ Nouveau » on a phone: the landscape keeps its name) */
/* the bar: compact smoked glass; the LCD keeps its own screen */
.app > .top { grid-area: top; background: linear-gradient(180deg, #07040fee, #07040fb3); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid #ff2bd655; border-radius: 6px; box-shadow: 0 1px 18px #ff2bd633, 0 8px 28px #0009; padding: 8px 14px; gap: 8px 16px; align-items: center; }
.brand p { display: none; }
/* the pads: the bottom row (thumbs), over the city */
.app > .pads { grid-area: pads; margin: 0; }
body.game .app > .pads { position: relative; bottom: auto; padding: 0; background: none; border-radius: 0; } /* (was sticky under the page) */
/* the drawer: Sculpter / Composer panels on glass; the city shows through and beside it */
.drawer { grid-area: drawer; display: none; min-height: 0; overflow: hidden auto; overscroll-behavior: contain; overflow-anchor: none; /* (S11.10: a piece opening above never scrolls the drawer away) */ container-type: inline-size; scrollbar-width: thin;
  padding: 10px; border-radius: 6px; background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: 0 10px 34px #000a; }
body.mode-sculpt .drawer, body.mode-compose .drawer { display: block; animation: s8-in-side var(--m-slow) var(--m-spring) both; }
body.mode-sculpt .drawer { width: clamp(330px, 40vw, 640px); }
body.mode-compose .drawer { width: clamp(340px, 56vw, 940px); }
.drawer > * { margin: 0 0 10px; }
.drawer > :last-child { margin-bottom: 0; }
.drawer .panel, .drawer .scenes { background: color-mix(in srgb, var(--panel) 84%, transparent); }
.drawer footer { padding: 4px 2px 0; }
@container (max-width: 720px) { .drawer .globals { grid-template-columns: minmax(0, 1fr); } }
@keyframes s8-in-side { from { translate: calc(70px * var(--m-amp)) 0; opacity: 0; } }
@keyframes s8-in-sheet { from { translate: 0 calc(90px * var(--m-amp)); opacity: 0; } }
/* the stage's overlays live in the free window (what the floating pieces leave of the city) */
.stage .hud { top: calc(var(--free-t) + 10px); left: calc(var(--free-l) + 16px); }
.stage-tools { top: calc(var(--free-t) + 10px); right: calc(var(--free-r) + 12px); }
.stage .toast { top: calc(var(--free-t) + 12px); left: calc(var(--free-l) + (100% - var(--free-l) - var(--free-r)) / 2); }
.stage .hint { bottom: calc(var(--free-b) + 8px); left: calc(var(--free-l) + 12px); }
.stage .big-play { inset: var(--free-t) var(--free-r) var(--free-b) var(--free-l); }
/* Plein écran: only the city (the instrument hides; Échap or ✕ Quitter brings it back) */
body.listen .app { padding: 0; }
body.listen .app > .stage { height: auto; }
/* below a wide screen: no group captions; the logo (smaller) heads the bar's first row, then the LCD */
/* (S9.2: no group captions — Header.dc.html: the tubes say what they are) */
.transport .tgrp > small { display: none; }
@media (max-width: 1239px) { .logo { font-size: 22px; } }
/* (tablet, phone on its side) two fixed rows: logo · play · rec · tree · ⋯ / landscape · modes */
@media (min-width: 561px) and (max-width: 1239px) {
  .app > .top { display: grid; grid-template-columns: auto minmax(0, 1fr) repeat(5, auto); align-items: center;
    grid-template-areas: "logo . play rec sleep tree more" "land land mode mode mode mode mode"; }
  .brand { grid-area: logo; }
  .transport { display: contents; }
  .transport .tgrp { padding: 0; border: 0; }
  .transport .tgrp:has(#play) { grid-area: play; } .transport .tgrp:has(#rec) { grid-area: rec; } #sleepLeft { grid-area: sleep; }
  .transport .tree-grp { grid-area: tree; } .transport .more { grid-area: more; }
  .transport .tgrp:has(#preset) { grid-area: land; min-width: 0; } .transport .tgrp:has(#preset) > .tgrp-row { min-width: 0; }
  [data-for=preset], [data-for=mood] { min-width: 0; flex: 1 1 120px; }
  .transport .tgrp:has(.modes) { grid-area: mode; justify-self: end; }
}
/* a portrait screen (phone, tablet upright): the drawer is a bottom sheet over the pads, the city above it */
@media (orientation: portrait) and (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "top" "free" "drawer" "pads"; }
  body.mode-sculpt .drawer, body.mode-compose .drawer { width: auto; height: 40dvh; animation-name: s8-in-sheet; border-radius: 12px 12px 6px 6px; }
  body.mode-compose .drawer { height: 46dvh; }
}
/* a phone with a sheet open: the pads on one row (thumb-wide), the city keeps a window above the sheet */
@media (orientation: portrait) and (max-width: 560px) {
  body.mode-sculpt .drawer { height: 36dvh; } body.mode-compose .drawer { height: 42dvh; }
  .pads { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
  .pad { height: 46px; }
}
/* phones: smaller knobs (the five on one row), tighter glass */
@media (max-width: 560px) {
  .app { gap: 6px; padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
  .app > .top { padding: 6px 8px; }
  .macros .ctls { flex-wrap: nowrap; gap: 0; }
  .macros .ctl { width: auto; flex: 1 1 0; min-width: 0; }
  .macros .knob svg { width: 54px; height: 54px; }
  .macros .k-lab { font-size: 10px; letter-spacing: .02em; }
  .modes { display: flex; width: 100%; } .modes .mode-btn { flex: 1; }
  .rec-opts { position: static; } .rec-opts > .menu { left: 0; right: 0; min-width: 0; } /* (like ⋯: across the bar, inside the screen) */
  .drawer { padding: 8px; }
}
/* a short screen (phone on its side): the bar on two rows at most, small knobs, the drawer on the side */
@media (max-height: 520px) {
  .app { gap: 6px; padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  .app > .top { padding: 4px 8px; gap: 4px 8px; }
  .brand, .transport .tgrp > small { display: none; }
  .transport { gap: 4px; }
  .transport .tgrp { padding: 0 4px; }
  .transport .btn, .transport summary, .transport .nsel-btn, .mode-btn { padding-top: 5px; padding-bottom: 5px; }
  .transport .btn.primary { min-width: 0; } /* (the LCD keeps the width: a challenge stays on one line) */
  #dice { font-size: 0; white-space: nowrap; } #dice .m-die { font-size: 16px; } /* ✦ alone (its name stays for screen readers and in its title) */
  .pad { height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .drawer { animation: none !important; } }

/* S8.8: a short window (phone on its side) keeps the city for the city: no keyboard hint over it */
@media (max-height: 520px) { .stage .hint { display: none; } }

/* =====================================================================
   S9.2 « Néon » — the pieces the skin above does not cover: the neon list (widgets.js neonSelect, in place of every
   <select>), the bar (Header.dc.html: 44 px tubes, the logo that crackles on), the 44 px targets under a finger.
   ===================================================================== */
/* the native select stays in the page, hidden (the source of truth); its button shows it */
.nsel-native { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important;
  opacity: 0 !important; pointer-events: none !important; clip-path: inset(50%) !important; }
.nsel-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; max-width: 100%; min-height: 36px; padding: 6px 10px 6px 12px; cursor: pointer;
  font: 600 13px/1.15 var(--f); letter-spacing: .08em; color: #fff; background: transparent; border: 1.5px solid var(--line-hi); border-radius: var(--radius-btn); text-align: left; }
.nsel-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nsel-car { font-style: normal; color: var(--c, var(--cyan)); text-shadow: 0 0 6px var(--c, var(--cyan)); flex: none; transition: rotate var(--m-fast) var(--m-spring); }
.nsel-btn.open { --c: var(--cyan); border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, transparent); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 40%, transparent); }
.nsel-btn.open .nsel-car { rotate: 180deg; }
.nsel-btn:disabled { opacity: .45; cursor: default; }
.nsel-list { --c: var(--cyan); position: fixed; z-index: 80; margin: 0; padding: 0; list-style: none; overflow: hidden auto; overscroll-behavior: contain; scrollbar-width: thin;
  background: #05030c; border: 1.5px solid var(--c); border-radius: var(--radius-btn); box-shadow: 0 0 24px color-mix(in srgb, var(--c) 33%, transparent), 0 16px 40px #000d; font-family: var(--f); outline: none; }
.nsel-opt { min-height: 42px; display: flex; align-items: center; padding: 9px 14px; font: 500 14.5px/1.2 var(--f); letter-spacing: .06em; color: #c9bde6; cursor: pointer; white-space: nowrap; }
.nsel-opt.act { color: #fff; background: #ff2bd614; box-shadow: inset 3px 0 0 color-mix(in srgb, var(--magenta) 70%, transparent); }
.nsel-opt[aria-selected=true] { color: #fff; font-weight: 700; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 22%, transparent), transparent); box-shadow: inset 3px 0 0 var(--c); text-shadow: 0 0 8px var(--c); }
.nsel-opt[aria-disabled=true] { opacity: .45; cursor: default; }
.nsel-opt.has-hint { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding-top: 6px; padding-bottom: 6px; }
.nsel-hint { font: 400 11.5px/1.2 var(--f); letter-spacing: .02em; color: var(--muted); text-shadow: none; }
.nsel-opt.act .nsel-hint, .nsel-opt[aria-selected=true] .nsel-hint { color: #d8cdf0; }
.nsel-grp { padding: 10px 14px 4px; font: 700 11px var(--f); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.nsel-grp:not(:first-child) { border-top: 1px solid var(--line); margin-top: 4px; }
.menu-row .nsel-btn, .sleep .nsel-btn { min-width: 120px; }

/* the bar (Header.dc.html): Chakra Petch tubes, 44 px high; ▶ LECTURE lit in magenta; the Arbre's count in phosphor */
.top .btn, .top summary.btn, .top .nsel-btn, .top .mode-btn { min-height: 44px; }
.top .btn, .top summary.btn { text-transform: uppercase; letter-spacing: .1em; }
.tree-btn { --c: var(--green); }
.modes { min-height: 44px; }
.menu .btn { text-transform: none; letter-spacing: .06em; min-height: 40px; }
/* the logo: a Monoton tube that crackles as it switches on (once; still in reduced motion / JUICE 0) */
.logo { animation: logo-on calc(900ms * var(--m-t) + 1ms) steps(1, end) calc(200ms * var(--m-t)) both; }
@keyframes logo-on { 0% { opacity: .15; text-shadow: none; } 8% { opacity: 1; } 14% { opacity: .2; text-shadow: none; } 22% { opacity: .9; } 30% { opacity: .35; text-shadow: 0 0 3px #fff; }
  46% { opacity: 1; } 52% { opacity: .5; } 60%, 100% { opacity: 1; } }
/* a finger: every target at least 44 px */
@media (pointer: coarse) {
  .btn, .tog, .chip, .nsel-btn, .mode-btn, .song-chip, .slot-tab, .sc-slot, .song-btns button, .loop-chip button, .chord-slot, kbd + .btn { min-height: 44px; }
  .slot-tab, .sc-slot, .song-btns button { min-width: 44px; }
}
/* a phone: the bar's first row (▶ · MIDI · ● · ▾ · ARBRE · ⋯) holds in 390 px */
@media (max-width: 560px) { .top .btn, .top summary.btn { padding-inline: 8px; letter-spacing: .04em; font-size: 12px; } .top .mode-btn { padding-inline: 8px; letter-spacing: .06em; } }

/* =====================================================================
   S10.1 « Fluide sur téléphone » — AMB.quality, end of js/motion.js puts q-haut | q-moyen | q-bas on <html>. q-haut = the look above,
   untouched (desktop). q-moyen / q-bas (phone): no backdrop-filter (the glass is simply darker), and the neon loops
   that repainted every frame (box-shadow, text-shadow, filter in an infinite animation) become transform / opacity
   only: their glow stays, still. Plus the fps counter (?fps=1, ⋯ « Afficher les images/s ») and the warm-up box.
   ===================================================================== */
:is(.q-moyen, .q-bas) .app > .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: linear-gradient(180deg, #07040ff7, #07040fe6); }
:is(.q-moyen, .q-bas) .drawer { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--glass-hi); }
:is(.q-moyen, .q-bas) .modal { backdrop-filter: none; -webkit-backdrop-filter: none; background: #05060be6; }
@keyframes q-breathe { 50% { scale: calc(1 + .05 * var(--m-amp)); } }
@keyframes q-blink { 50% { opacity: .55; } }
@keyframes q-star { 50% { scale: calc(1 + .5 * var(--m-amp)); rotate: calc(25deg * var(--m-amp)); } }
@keyframes q-crackle { 0%, 86%, 100% { translate: 0 0; opacity: 1; } 88% { translate: calc(2px * var(--m-amp)) 0; } 90% { opacity: .2; } 92% { opacity: 1; } }
:is(.q-moyen, .q-bas) :is(.goals .gw-ready, .dc-head.fresh) { animation-name: q-breathe; }
:is(.q-moyen, .q-bas) :is(.tree-btn.has-ready::after, .tree-btn.has-hs::before) { animation-name: q-star; }
:is(.q-moyen, .q-bas) .tree-node.st-ready .led, :is(.q-moyen, .q-bas) .hs-list li.pend { animation-name: q-blink; }
:is(.q-moyen, .q-bas) .dc-item.riddle b { animation-name: q-crackle; }
:is(.q-moyen, .q-bas) .is-new, :is(.q-moyen, .q-bas) .is-new.is-appearing { animation-name: q-breathe; outline-color: #fff; }
:is(.q-moyen, .q-bas) .is-new.is-appearing { animation-name: m-appear, q-breathe; }
:is(.q-moyen, .q-bas) .tree-link.available { filter: none; }
/* the counter: a small neon box at the bottom-left of the free city (above the keys and the drawer), click-through */
.fps-meter { position: fixed; z-index: 95; left: calc(var(--free-l) + 8px); bottom: calc(var(--free-b) + 8px); pointer-events: none; opacity: .85;
  contain: strict; width: 16ch; height: 3.1em; padding: 3px 7px; box-sizing: content-box; white-space: pre; font: 600 11px/1.4 var(--f); letter-spacing: .04em;
  color: var(--cyan); background: #05030cd9; border: 1px solid var(--cyan); border-radius: 4px; }
.fps-meter.slow { color: var(--magenta); border-color: var(--magenta); }
/* the warm-up box (quality.warm): two frames, out of sight */
.q-warm { --c: #22e6ff; position: fixed; left: 0; top: 0; z-index: 99; opacity: .01; pointer-events: none; }
.q-warm .w1 { display: block; font: 700 40px/1 var(--f); letter-spacing: .3em; text-shadow: 0 0 .2em #fff, 0 0 .6em #fff, 0 0 1.2em #ff2bd6; }
.q-warm .w2 { display: block; font: 400 30px/1 var(--f-logo); }
.q-warm .k-laser, .q-warm .k-ring { position: absolute; left: 10px; top: 10px; height: 40px; }
.q-warm .k-ring { width: 40px; }
/* the key let go (k-rel: colour, background, shadows animated = a repaint per frame per key): its spring only */
@keyframes q-krel { from { scale: calc(1 + .03 * var(--m-amp)); translate: 0 calc(-2px * var(--m-amp)); } }
:is(.q-moyen, .q-bas) .pad.k-rel:not(.on) { animation-name: q-krel; }

/* Tout recommencer: armed after the first tap (magenta tube until the second tap or 4 s) */
.more .menu .reset-btn.armed { color: #fff; border-color: var(--magenta); box-shadow: 0 0 14px #ff2bd677; }

/* =====================================================================
   S11.1 « Objectifs » — the bar's LCD is gone; the Objectifs widget (#goals, garden.js renderContracts) heads the right
   column, above the drawer (desktop, tablet, phone on its side); on a portrait screen a compact card under the bar that
   unfolds over the city. Neon panel: Chakra Petch, phosphor = done, amber = ready, cyan = counts. And the machine
   asleep (body.game before the first sound): greyed, dark, dusty, only the power button blinks; body.waking = the
   wake-up cascade (dust off, the neons crackle on one after the other).
   ===================================================================== */
.app { grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: "top top" "free goals" "free drawer" "pads drawer"; }
.app > .top { z-index: 4; }
.goals { grid-area: goals; position: relative; z-index: 3; contain: inline-size; justify-self: stretch; align-self: start; min-width: 0; display: flex; flex-direction: column;
  max-height: min(46vh, 440px); padding: 8px 10px 10px; border-radius: 6px; font-family: var(--f); color: var(--text);
  background: var(--glass-hi); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1.5px solid color-mix(in srgb, var(--green) 45%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--green) 18%, transparent), 0 10px 30px #000a; }
.goals[hidden], body:not(.game) .goals, body.listen .goals { display: none; }
.gw-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 0 2px; margin: 0;
  background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.gw-title { font: 700 12px var(--f); letter-spacing: .3em; text-transform: uppercase; color: var(--green); text-shadow: 0 0 8px color-mix(in srgb, var(--green) 60%, transparent); }
.gw-line { position: relative; min-width: 0; font: 700 14px/1.2 var(--f); letter-spacing: .06em; color: #fff; text-shadow: 0 0 8px var(--amber-glow);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.goals.msg .gw-line { color: var(--amber); }
.gw-car { font-style: normal; color: var(--muted); transition: rotate var(--m-fast) var(--m-spring); }
.goals.open .gw-car { rotate: 180deg; }
.gw-body { min-height: 0; overflow: hidden auto; overscroll-behavior: contain; scrollbar-width: thin; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.goals:not(.open) .gw-body { display: none; }
.gw-body [hidden] { display: none !important; }
.gw-readyrow { display: flex; gap: 8px; }
.gw-readyrow:not(:has(:not([hidden]))) { display: none; }
.gw-ready { flex: 1 1 auto; min-height: 44px; padding: 8px 12px; text-align: left; cursor: pointer; font: 700 14px/1.25 var(--f); letter-spacing: .06em; color: #fff;
  border: 1.5px solid var(--amber); border-radius: 4px; background: #ffb3471f; box-shadow: 0 0 14px #ff8a0055, inset 0 0 10px #ff8a0033; text-shadow: 0 0 8px var(--amber-glow);
  transform-origin: 0 50%; animation: m-breathe calc(var(--beat) * 2) ease-in-out infinite; }
.gw-ready:hover { background: var(--amber); color: var(--bg); text-shadow: none; }
.gw-no { min-height: 44px; padding: 6px 12px; cursor: pointer; font: 600 13px var(--f); color: var(--muted); background: none; border: 1.5px solid var(--line-hi); border-radius: 4px; }
.gw-for, .gw-sub { margin: 0 0 4px; font: 700 11px var(--f); letter-spacing: .22em; text-transform: uppercase; color: var(--cyan); }
.gw-sub { color: var(--muted); }
.gw-list, .gw-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.gw-obj { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px 8px; padding: 6px 4px 6px 8px;
  border-radius: 4px; background: #ffffff08; border-left: 2px solid var(--cyan); }
.gw-txt { position: relative; display: flex; gap: 8px; align-items: baseline; min-width: 0; padding: 0; margin: 0; background: none; border: 0; cursor: pointer; text-align: left;
  font: 600 15px/1.25 var(--f); letter-spacing: .03em; color: var(--text); }
.gw-box { font-style: normal; color: var(--cyan); }
.gw-n { display: inline-block; font: 700 14px var(--f); color: var(--cyan); white-space: nowrap; font-variant-numeric: tabular-nums; text-shadow: 0 0 8px #22e6ff66; }
.gw-skip { min-width: 34px; min-height: 34px; padding: 0; cursor: pointer; font: 400 18px var(--f); color: var(--muted); background: none; border: 1px solid transparent; border-radius: 4px; }
.gw-skip:hover { color: #fff; border-color: var(--line-hi); }
.gw-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: #ffffff14; overflow: hidden; }
.gw-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); box-shadow: 0 0 8px var(--green); transform-origin: 0 50%;
  scale: var(--p, 0) 1; transition: scale var(--m-med) var(--m-out); }
.gw-hint { grid-column: 1 / -1; margin: 2px 0 0; font: 500 13.5px/1.4 var(--f); color: #d8cdf0; }
.gw-obj.done { border-left-color: var(--green); background: #39ff880a; }
.gw-obj.done .gw-box, .gw-obj.done .gw-n { color: var(--green); text-shadow: 0 0 8px #39ff8866; }
.gw-obj.done .gw-t { color: var(--muted); text-decoration: line-through 2px color-mix(in srgb, var(--green) 80%, transparent); }
/* a laser strikes the objective through (motion.pop 'gw-strike'), then it rests struck */
.gw-obj.gw-strike .gw-txt::after { content: ""; position: absolute; left: 0; right: 0; top: 55%; height: 3px; border-radius: 2px; pointer-events: none;
  background: #fff; box-shadow: 0 0 8px var(--green), 0 0 18px var(--green); transform-origin: 0 50%; animation: gw-laser calc(var(--m-slow) + var(--m-med)) var(--m-out) both; }
.gw-obj.gw-strike { animation: m-pop var(--m-med) var(--m-spring); }
@keyframes gw-laser { from { scale: 0 1; opacity: 1; } 70% { scale: 1 1; opacity: 1; } to { scale: 1 1; opacity: 0; } }
.gw-score { margin: 0; font: 600 12.5px var(--f); letter-spacing: .08em; color: #e8c79a; }
.gw-score.bump { animation: lcd-bump calc(var(--m-slow) + var(--m-fast)) var(--m-spring); transform-origin: 0 50%; }
.gw-h { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; font: 500 13px/1.3 var(--f); color: var(--muted); padding: 1px 8px; }
.gw-h s { text-decoration-color: color-mix(in srgb, var(--green) 70%, transparent); text-decoration-thickness: 1.5px; }
.gw-to { color: var(--amber); font-weight: 600; white-space: nowrap; }
.gw-h.opened .gw-to { color: var(--green); }
.gw-h.gw-in { animation: gw-in var(--m-slow) var(--m-spring) both; }
@keyframes gw-in { from { opacity: 0; translate: 0 calc(-8px * var(--m-amp)); } }
.gw-all { align-self: start; margin-top: 4px; padding: 4px 8px; min-height: 32px; cursor: pointer; font: 600 12px var(--f); letter-spacing: .1em; color: var(--cyan); background: none; border: 1px solid var(--line-hi); border-radius: 4px; }
@media (pointer: coarse) { .gw-skip, .gw-all { min-width: 44px; min-height: 44px; } .gw-head { min-height: 44px; } }
:is(.q-moyen, .q-bas) .goals { backdrop-filter: none; -webkit-backdrop-filter: none; background: #07040ff2; }
/* compact: a portrait screen (the drawer is a bottom sheet) or a phone on its side — the card shows the current
   objective (or the message, the ask, the piece ready); a tap unfolds the list over the city */
@media (orientation: portrait) and (max-width: 900px) {
  .app { grid-template-rows: auto auto minmax(0, 1fr) auto auto; grid-template-areas: "top" "goals" "free" "drawer" "pads"; }
}
@media (orientation: portrait) and (max-width: 900px), (max-height: 520px) {
  .goals { max-height: none; padding: 4px 10px; }
  .gw-line { font-size: 13.5px; }
  .goals.open .gw-body { position: absolute; left: -1.5px; right: -1.5px; top: calc(100% + 4px); max-height: min(62dvh, 520px); margin: 0; padding: 10px;
    background: #07040ff5; border: 1.5px solid color-mix(in srgb, var(--green) 45%, transparent); border-radius: 6px; box-shadow: 0 16px 40px #000d; }
}
@media (max-height: 520px) { .gw-title { display: none; } .goals { padding: 2px 8px; } }

/* the machine asleep: the drone alone, switched off and dusty — only the power button blinks */
.dust { display: none; }
body.game .dust { display: block; position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .78 0 0 0 0 .72 0 0 0 0 .62 0 0 0 1.4 -.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 45%, #2a221a33 0, #000b 100%); }
body.game:not(.playing):not(.coined) .dust { opacity: .9; }
body.game:not(.playing):not(.coined) .app > :is(.top, .goals, .pads),
body.game:not(.playing):not(.coined) .drawer > :not(#layers),
body.game:not(.playing):not(.coined) #layers > :not([data-sec=drone]),
body.game:not(.playing):not(.coined) [data-sec=drone] > :not(header),
body.game:not(.playing):not(.coined) [data-sec=drone] > header > :not(.tog),
body.game:not(.playing):not(.coined) .stage > :not(.dust, .coin, .toast, .coin-fx) { filter: grayscale(.92) brightness(.42) contrast(.9) sepia(.15); }
body.game:not(.playing):not(.coined) .app > :is(.top, .goals, .drawer) { box-shadow: none; }
/* the wake-up, in stages (garden.coinFx sets body.waking + w1…w5 on timers, × the motion tokens): w1 a CRT line flashes
   across the stage and the dust starts to lift; w2 the bar and the logo crackle on; w3 the Objectifs widget; w4 the
   editors and the keys; w5 the city lights up (the drone's tower), the last dust blows away. Each piece crackles once
   (m-wake-crackle) when its stage comes. Reduced motion / a slow phone: no stages, the final state at once */
body.waking .dust { display: block; opacity: .9; transition: opacity var(--m-slow) var(--m-in), translate var(--m-slow) var(--m-out), scale var(--m-slow) var(--m-out); }
body.waking.w1 .dust { opacity: .7; translate: 0 calc(-24px * var(--m-amp)); scale: 1.04; }
body.waking.w3 .dust { opacity: .35; translate: 0 calc(-70px * var(--m-amp)); scale: 1.12; }
body.waking.w5 .dust { opacity: 0; translate: 0 calc(-140px * var(--m-amp)); scale: 1.2; }
body.waking .app > :is(.top, .goals, .pads),
body.waking .drawer > :not(#layers),
body.waking #layers > :not([data-sec=drone]),
body.waking [data-sec=drone] > :not(header),
body.waking [data-sec=drone] > header > :not(.tog),
body.waking .stage > :not(.dust, .coin, .toast, .coin-fx) { filter: grayscale(.92) brightness(.42) contrast(.9) sepia(.15); }
body.waking:not(.w2) .logo { opacity: .12; text-shadow: none; animation: none; }
/* (the drawer keeps its own slide-in animation: swapping it for the crackle and back replayed the slide, the panels
   seemed to close and reopen; its children crackle instead) */
body.waking.w2 .app > .top, body.waking.w3 .app > .goals,
body.waking.w4 .app > .pads,
body.waking.w4 .drawer > :not(#layers),
body.waking.w4 #layers > :not([data-sec=drone]),
body.waking.w4 [data-sec=drone] > :not(header),
body.waking.w4 [data-sec=drone] > header > :not(.tog) { filter: none; }
body.waking.w2 .app > .top, body.waking.w3 .app > .goals, body.waking.w4 .app > .drawer > *, body.waking.w4 .app > .pads { animation: m-wake-crackle calc(var(--m-med) * 2) steps(6, end) both; }
body.waking.w5 .stage > :not(.dust, .coin, .toast, .coin-fx) { filter: none; }
body.waking.w5 .stage > :is(canvas, .city-gl) { animation: m-wake-city calc(var(--m-slow) * 3) var(--m-out) both; }
@keyframes m-wake-crackle { 0% { filter: brightness(2.4) saturate(1.5); } 18% { filter: grayscale(.8) brightness(.3); } 36% { filter: brightness(1.9); }
  54% { filter: grayscale(.5) brightness(.5); } 72% { filter: brightness(1.5); } 100% { filter: none; } }
@keyframes m-wake-city { 0% { filter: brightness(2.2) saturate(1.6); } 100% { filter: none; } }
/* w1: the CRT line, held across the stage; w2: it opens out (m-crt-on) */
body.waking.w1:not(.w2) .cf-crt { animation: none; opacity: .9; scale: 1 .012; box-shadow: 0 0 30px #c8f9ff; }

/* S11.3 the power button IS the Drone's switch (its panel header, never hidden): asleep, or the drone off in the
   Parcours, it blinks like a standby LED (amber / red); the big button in the middle of the stage is gone (#coin stays
   only as the target of Space / Entrée, never shown) */
body.game .panel[data-sec=drone] > header .tog.is-solo { display: inline-block; }
body.game:not(.playing):not(.coined) .panel[data-sec=drone] > header .tog,
body.game .panel[data-sec=drone] > header .tog:not(.on) { color: #ffb347; border-color: #ff6a2b; background: #1a0a04; padding: 6px 12px; text-shadow: 0 0 8px #ff8a00;
  box-shadow: 0 0 12px #ff3b1f66; animation: pw-standby 2.6s ease-in-out infinite; }
body.game:not(.playing):not(.coined) .panel[data-sec=drone] > header .tog::before,
body.game .panel[data-sec=drone] > header .tog:not(.on)::before { background: #ff3b1f; box-shadow: 0 0 8px #ff3b1f, 0 0 16px #ff3b1f88; }
body.game:not(.playing):not(.coined) .panel[data-sec=drone] > header .tog::after { content: "⏻ ALLUMER"; margin-left: 8px; font-weight: 700; letter-spacing: .18em; }
:is(.q-moyen, .q-bas) .panel[data-sec=drone] > header .tog { animation-name: q-blink; }

/* S11.6 the help bubble (widgets.js tip): a control's name and what it does; mouse resting on it, or a tap on its name */
.tip { position: fixed; z-index: 60; pointer-events: none; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; --c: var(--accent, #22e6ff);
  border: 1.5px solid var(--c); border-radius: 6px; background: #07040ff2; color: #e9e1ff; font: 500 13.5px/1.4 var(--f);
  box-shadow: 0 0 18px color-mix(in srgb, var(--c) 45%, transparent), 0 8px 24px #000c; }
.tip[hidden] { display: none; }
.tip b { font-weight: 700; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: #fff; text-shadow: 0 0 8px var(--c); }
.tip small { font-size: 11.5px; color: #a99cc4; }
.ctl .k-lab { cursor: help; }
@media (hover: none) { .ctl[data-hint] .k-lab { text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; } }
