/* GLIDE · Crafted worlds. Static production artwork; transform-only movement. */
body[data-theme="play"] {
 color-scheme:light;--bg:#f4eedf;--surface:#fffaf0;--surface-2:#e9e1d1;--ink:#282e40;--muted:#5d6272;--line:#c7bdac;
 --board:#182f35;--tile:#244149;--tile-2:#244149;--floor-edge:inset 0 0 0 1px #37545b;--floor-radius:14%;--board-radius:24px;--floor-texture:none;
 --ui-accent:#a23e2b;--ui-lilac:#55428f;--ui-peach:#885017;--ui-pink:#885017;--warm:#ffc957;--danger:#f28185;--shadow:rgba(6,13,29,.16);
 --primary:#34395d;--primary-text:#fffaf0;--primary-edge:#202540;--nav:#34395d;--nav-text:#fffaf0;--button-radius:15px;--ui-round:15px;
 --frame:#d3b88d;--frame-size:2px;--frame-depth:color-mix(in srgb,#d3b88d,black 25%);--scene-rgb:244,238,223;--trail-color:#eed390;--piece-size:64%;--player-size:90%;
 --button:#fffaf0;--button-text:#282e40;--button-edge:#c7bdac;--reset:#fffaf0;--reset-text:#282e40;--reset-edge:#c7bdac;--hint:#34395d;--hint-text:#fffaf0;--hint-edge:#202540;
 --tracker-bg:#e9e1d1;--tracker-edge:#c7bdac;--tracker-filled:#182f35;--tracker-filled-edge:#d3b88d;--tracker-petal:#182f35;--tracker-petal-edge:#d3b88d;--tracker-radius:50%;
 --world-wall:url("assets/crafted-play-wall-1-v31.webp");--world-wall-alt:url("assets/crafted-play-wall-2-v31.webp");--world-wall-third:url("assets/crafted-play-wall-3-v31.webp");
 --material-nova:url("assets/crafted-play-nova-v31.webp");--material-pearl:url("assets/crafted-play-pearl-v31.webp");--material-prism:url("assets/crafted-play-prism-v31.webp");--material-pearl-filter:none;--material-prism-filter:none;
 --material-spark:url("assets/crafted-play-spark-v31.webp");--material-petal:url("assets/crafted-play-petal-v31.webp");
 --world-portal:url("assets/crafted-play-portal-v31.webp");--world-gate:url("assets/crafted-play-gate-v31.webp");--world-gate-ready:url("assets/crafted-play-gate-ready-v31.webp");
}
body[data-theme="midnight"] {
 color-scheme:light;--bg:#e8f2f2;--surface:#f7fbf8;--surface-2:#d1e6e7;--ink:#153b47;--muted:#476672;--line:#96b6bf;
 --board:#06303e;--tile:#114451;--tile-2:#114451;--floor-edge:inset 0 0 0 1px #255865;--floor-radius:22%;--board-radius:30px;--floor-texture:none;
 --ui-accent:#146270;--ui-lilac:#6c447a;--ui-peach:#a34344;--ui-pink:#a34344;--warm:#ffe1a0;--danger:#fc8daa;--shadow:rgba(6,13,29,.16);
 --primary:#155463;--primary-text:#f7fbf8;--primary-edge:#0b3947;--nav:#155463;--nav-text:#f7fbf8;--button-radius:22px;--ui-round:22px;
 --frame:#33768c;--frame-size:2px;--frame-depth:color-mix(in srgb,#33768c,black 25%);--scene-rgb:232,242,242;--trail-color:#a0dde6;--piece-size:64%;--player-size:90%;
 --button:#f7fbf8;--button-text:#153b47;--button-edge:#96b6bf;--reset:#f7fbf8;--reset-text:#153b47;--reset-edge:#96b6bf;--hint:#155463;--hint-text:#f7fbf8;--hint-edge:#0b3947;
 --tracker-bg:#d1e6e7;--tracker-edge:#96b6bf;--tracker-filled:#06303e;--tracker-filled-edge:#33768c;--tracker-petal:#06303e;--tracker-petal-edge:#33768c;--tracker-radius:50%;
 --world-wall:url("assets/crafted-midnight-wall-1-v31.webp");--world-wall-alt:url("assets/crafted-midnight-wall-2-v31.webp");--world-wall-third:url("assets/crafted-midnight-wall-3-v31.webp");
 --material-nova:url("assets/crafted-midnight-nova-v31.webp");--material-pearl:url("assets/crafted-midnight-pearl-v31.webp");--material-prism:url("assets/crafted-midnight-prism-v31.webp");--material-pearl-filter:none;--material-prism-filter:none;
 --material-spark:url("assets/crafted-midnight-spark-v31.webp");--material-petal:url("assets/crafted-midnight-petal-v31.webp");
 --world-portal:url("assets/crafted-midnight-portal-v31.webp");--world-gate:url("assets/crafted-midnight-gate-v31.webp");--world-gate-ready:url("assets/crafted-midnight-gate-ready-v31.webp");
}
body[data-theme="moon"] {
 color-scheme:dark;--bg:#101822;--surface:#1b2939;--surface-2:#2a3d51;--ink:#edf2f7;--muted:#b8c9dc;--line:#597087;
 --board:#101f30;--tile:#203247;--tile-2:#203247;--floor-edge:inset 0 0 0 1px #3d5268;--floor-radius:9%;--board-radius:18px;--floor-texture:none;
 --ui-accent:#ffd29b;--ui-lilac:#a0deee;--ui-peach:#ffd29b;--ui-pink:#ffd29b;--warm:#ffca73;--danger:#7adadf;--shadow:rgba(6,13,29,.16);
 --primary:#ffc78a;--primary-text:#392b1e;--primary-edge:#b18044;--nav:#ffc78a;--nav-text:#392b1e;--button-radius:10px;--ui-round:10px;
 --frame:#8295aa;--frame-size:2px;--frame-depth:color-mix(in srgb,#8295aa,black 25%);--scene-rgb:16,24,34;--trail-color:#f4c897;--piece-size:64%;--player-size:90%;
 --button:#1b2939;--button-text:#edf2f7;--button-edge:#597087;--reset:#1b2939;--reset-text:#edf2f7;--reset-edge:#597087;--hint:#ffc78a;--hint-text:#392b1e;--hint-edge:#b18044;
 --tracker-bg:#2a3d51;--tracker-edge:#597087;--tracker-filled:#101f30;--tracker-filled-edge:#8295aa;--tracker-petal:#101f30;--tracker-petal-edge:#8295aa;--tracker-radius:50%;
 --world-wall:url("assets/crafted-moon-wall-1-v31.webp");--world-wall-alt:url("assets/crafted-moon-wall-2-v31.webp");--world-wall-third:url("assets/crafted-moon-wall-3-v31.webp");
 --material-nova:url("assets/crafted-moon-nova-v31.webp");--material-pearl:url("assets/crafted-moon-pearl-v31.webp");--material-prism:url("assets/crafted-moon-prism-v31.webp");--material-pearl-filter:none;--material-prism-filter:none;
 --material-spark:url("assets/crafted-moon-spark-v31.webp");--material-petal:url("assets/crafted-moon-petal-v31.webp");
 --world-portal:url("assets/crafted-moon-portal-v31.webp");--world-gate:url("assets/crafted-moon-gate-v31.webp");--world-gate-ready:url("assets/crafted-moon-gate-ready-v31.webp");
}
body[data-theme="prism"] {
 color-scheme:dark;--bg:#211338;--surface:#302044;--surface-2:#423059;--ink:#fff7fc;--muted:#ddcce8;--line:#846799;
 --board:#170d27;--tile:#2e1b44;--tile-2:#2e1b44;--floor-edge:inset 0 0 0 1px #4e3769;--floor-radius:11%;--board-radius:18px;--floor-texture:none;
 --ui-accent:#e5f38a;--ui-lilac:#a1e9f1;--ui-peach:#ffa8ce;--ui-pink:#ffa8ce;--warm:#f8d768;--danger:#ff729e;--shadow:rgba(6,13,29,.16);
 --primary:#e5f38a;--primary-text:#30361e;--primary-edge:#939f46;--nav:#e5f38a;--nav-text:#30361e;--button-radius:12px;--ui-round:12px;
 --frame:#9062b4;--frame-size:2px;--frame-depth:color-mix(in srgb,#9062b4,black 25%);--scene-rgb:33,19,56;--trail-color:#82dde5;--piece-size:64%;--player-size:90%;
 --button:#302044;--button-text:#fff7fc;--button-edge:#846799;--reset:#302044;--reset-text:#fff7fc;--reset-edge:#846799;--hint:#e5f38a;--hint-text:#30361e;--hint-edge:#939f46;
 --tracker-bg:#423059;--tracker-edge:#846799;--tracker-filled:#170d27;--tracker-filled-edge:#9062b4;--tracker-petal:#170d27;--tracker-petal-edge:#9062b4;--tracker-radius:50%;
 --world-wall:url("assets/crafted-prism-wall-1-v31.webp");--world-wall-alt:url("assets/crafted-prism-wall-2-v31.webp");--world-wall-third:url("assets/crafted-prism-wall-3-v31.webp");
 --material-nova:url("assets/crafted-prism-nova-v31.webp");--material-pearl:url("assets/crafted-prism-pearl-v31.webp");--material-prism:url("assets/crafted-prism-prism-v31.webp");--material-pearl-filter:none;--material-prism-filter:none;
 --material-spark:url("assets/crafted-prism-spark-v31.webp");--material-petal:url("assets/crafted-prism-petal-v31.webp");
 --world-portal:url("assets/crafted-prism-portal-v31.webp");--world-gate:url("assets/crafted-prism-gate-v31.webp");--world-gate-ready:url("assets/crafted-prism-gate-ready-v31.webp");
}
/* Immersive scenery stays behind solid, readable controls. */
body[data-theme] .app { background:var(--bg); }
body[data-theme="play"] .app[data-chapter] { --accent:#ffe2a0;--accent-rgb:255,226,160;--accent-2:#ddb7ef;--accent2-rgb:221,183,239; }
body[data-theme="midnight"] .app[data-chapter] { --accent:#9be4ec;--accent-rgb:155,228,236;--accent-2:#e7acd5;--accent2-rgb:231,172,213; }
body[data-theme="moon"] .app[data-chapter] { --accent:#ffd08b;--accent-rgb:255,208,139;--accent-2:#80d6e9;--accent2-rgb:128,214,233; }
body[data-theme="prism"] .app[data-chapter] { --accent:#69e3ee;--accent-rgb:105,227,238;--accent-2:#ff80bc;--accent2-rgb:255,128,188; }
body[data-theme] .app::before,body[data-theme] .app::after { content:none; }
body[data-theme] .world-art { display:block;opacity:1;background:var(--scene) center/cover no-repeat;z-index:-2; }
body[data-theme] .world-art>i { display:none; }
body[data-theme] .world-art::after { content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(var(--scene-rgb),.68),rgba(var(--scene-rgb),.62) 30%,rgba(var(--scene-rgb),.08) 55%,rgba(var(--scene-rgb),.3) 75%,rgba(var(--scene-rgb),.6)); }
body[data-theme="play"] .world-art::after { background:rgba(246,228,197,.15); }
body[data-theme] .ambient-canvas { z-index:-1;opacity:.4; }
body[data-theme="play"] .ambient-canvas { opacity:.22; }
body[data-theme] .topbar { background:rgba(var(--scene-rgb),.91);border-bottom:1px solid var(--line); }
body[data-theme] .brand b { color:var(--ui-accent);font-weight:800; }
body[data-theme="play"] .brand b { color:#a34e35;font-size:1.6rem;letter-spacing:-.065em;transform:rotate(-4deg); }
body[data-theme="midnight"] .brand b { color:#c5f0ef;font-size:1.55rem;letter-spacing:-.055em;transform:none; }
body[data-theme="moon"] .brand b { color:#ffc18c;font-size:1.35rem;letter-spacing:.02em;text-transform:uppercase;transform:none; }
body[data-theme="prism"] .brand b { color:#edfa85;font-size:1.5rem;letter-spacing:-.065em;text-transform:uppercase;transform:skewX(-8deg); }
body[data-theme] .score-hud b { color:var(--ink); }
body[data-theme] .round-button { border-radius:var(--button-radius);background:var(--surface-2);color:var(--ink);box-shadow:none; }
body[data-theme] .rooms-button { background:var(--nav);color:var(--nav-text);box-shadow:0 2px 0 var(--frame-depth); }
body[data-theme] .round-button.sound { background:var(--surface-2); }
body[data-theme] .sound[data-level="1"],body[data-theme] .sound[data-level="2"] { color:var(--ui-accent); }
body[data-theme] .chapter-line { gap:6px;font-weight:600; }
body[data-theme] #chapter-name { color:var(--ink);background:var(--surface);border-radius:var(--button-radius);padding:4px 8px;font-size:.65rem; }
body[data-theme] .chapter-sigil { color:var(--ui-accent); }
body[data-theme] .mode-label { color:var(--ui-accent); }
body[data-theme] .heading h1 { color:var(--ink);font-weight:700;letter-spacing:-.035em; }
body[data-theme] .heading p { color:var(--muted);text-shadow:0 1px 3px var(--bg); }
body[data-theme="play"] .heading h1 { font-weight:750; }
body[data-theme="midnight"] .heading h1 { font-family:var(--ui);font-weight:750;letter-spacing:-.055em; }
body[data-theme="moon"] .heading h1 { font-weight:600;letter-spacing:-.025em; }
body[data-theme="prism"] .heading h1 { font-weight:800;letter-spacing:-.035em; }

/* Physical puzzle tables: felt / reef / lunar console / arcade matrix. */
body[data-theme] .board {
  border:var(--frame-size) solid var(--frame);border-radius:var(--board-radius);background:var(--board);
  box-shadow:0 5px 0 var(--frame-depth),0 9px 15px var(--shadow);
}
body[data-theme] .board.aligned,body[data-theme] .board.win {
  box-shadow:0 5px 0 var(--frame-depth),0 9px 15px var(--shadow),0 0 0 2px var(--warm);
}
body[data-theme="play"] .board { background:repeating-linear-gradient(6deg,rgba(75,34,10,.08) 0 1px,transparent 1px 7px),#bc8751; }
body[data-theme="midnight"] .board { background:radial-gradient(ellipse at 20% 0,#175a75,transparent 60%),#06314e; }
body[data-theme="moon"] .board { background:repeating-linear-gradient(90deg,#c4ccd8 0 7px,#bbc4d1 7px 8px); }
body[data-theme="prism"] .board { box-shadow:0 5px 0 #74265a,inset 0 0 0 3px #49c7df,0 9px 15px var(--shadow); }
body[data-theme] .cell { background:var(--floor-texture) center/100% 100%,var(--tile);border-radius:var(--floor-radius);box-shadow:var(--floor-edge); }
body[data-theme] .cell.wall { border-radius:0;background:transparent var(--world-wall) center/100% 100% no-repeat;box-shadow:none; }
body[data-theme] .cell.wall:nth-child(3n+1) { background-image:var(--world-wall-alt); }
body[data-theme] .cell.wall:nth-child(5n) { background-image:var(--world-wall-third); }
body[data-theme] .cell.item .piece-symbol { width:var(--piece-size);height:var(--piece-size); }
body[data-theme] .cell.item::after { width:73%;height:73%;border-color:var(--pickup-socket);border-radius:var(--tracker-radius); }
body[data-theme] .cell.item.paint::after { border-color:var(--petal-socket); }
body[data-theme="play"] .cell.item::after { border-radius:50%;border-style:dashed;border-color:rgba(255,225,151,.35); }
body[data-theme="midnight"] .cell.item::after { border-radius:50%;border-color:rgba(185,228,239,.3); }
body[data-theme="moon"] .cell.item::after { border-radius:8%;border-color:rgba(245,196,120,.4); }
body[data-theme="prism"] .cell.item::after { border-radius:3%;border-color:rgba(255,215,121,.4); }
body[data-theme] .cell.portal::before,body[data-theme] .cell.exit::before {
  width:80%;height:80%;border:0;border-radius:0;background:transparent var(--world-portal) center/contain no-repeat;
  transform:translate(-50%,-50%);clip-path:none;box-shadow:none;
}
body[data-theme] .cell.portal::after,body[data-theme] .cell.exit::after { content:none; }
body[data-theme] .cell.exit::before { background-image:var(--world-gate); }
body[data-theme] .cell.exit.ready::before { background:transparent var(--world-gate-ready) center/contain no-repeat;border:0;box-shadow:none; }
body[data-theme] .turn-marker::before { inset:9%;background:transparent var(--world-plaque) center/contain no-repeat;border:0;border-radius:0;clip-path:none;box-shadow:none; }
body[data-theme] .turn-marker span { width:52%;height:52%;color:var(--plaque-text); }
body[data-theme] .cell.arrow { box-shadow:var(--floor-edge); }
body[data-theme] .cell.item.sequence::before { width:68%;height:68%;border-radius:0;background:transparent var(--world-plaque) center/contain no-repeat;clip-path:none;box-shadow:none; }
body[data-theme] .cell.item.sequence::after { width:58%;height:58%;border:0;border-radius:0;color:var(--plaque-text);font-weight:750; }
body[data-theme] .cell.item.sequence.listening { background:var(--floor-texture) center/100% 100%,var(--tile);box-shadow:var(--floor-edge),inset 0 0 0 2px var(--warm); }
body[data-theme] .player::before { width:var(--player-size);height:var(--player-size); }
body[data-theme] .player::after { inset:15%;border:0;box-shadow:0 3px 4px rgba(0,0,0,.16); }
body[data-theme="prism"] .player::after { border-radius:3px; }
body[data-theme] .cell.collected .piece-symbol,body[data-theme] .cell.collected.paint .piece-symbol { opacity:.08; }
body[data-theme] .gesture { background:var(--surface);color:var(--ink);border-radius:var(--button-radius); }
body[data-theme] .fit-callout b,body[data-theme] .flow-flash span { color:var(--warm); }
body[data-theme] .flow-flash b { color:var(--accent); }

/* Four movement signatures; all use the existing pooled, lightweight trails. */
body[data-theme="play"] .trail-dot::before { left:42%;right:42%;top:42%;height:16%;border-radius:50%;background:#ffe7a3;box-shadow:0 0 0 1px rgba(255,240,206,.3); }
body[data-theme="midnight"] .trail-dot::before { inset:30%;height:auto;border:1.5px solid #95dce9;background:none;border-radius:50%;box-shadow:none; }
body[data-theme="moon"] .trail-dot::before { left:35%;right:35%;top:46%;height:8%;border-radius:1px;background:#ffce8c;box-shadow:-7px 0 0 rgba(255,206,140,.3),7px 0 0 rgba(255,206,140,.3); }
body[data-theme="prism"] .trail-dot::before { left:29%;right:29%;top:43%;height:14%;border-radius:0;background:#69e3ee;box-shadow:none; }
body[data-theme] .objective i { background:var(--tracker-bg);background-image:none;border-radius:var(--tracker-radius);box-shadow:inset 0 0 0 1px var(--tracker-edge); }
body[data-theme] .objective i.done { background:var(--tracker-filled);box-shadow:inset 0 0 0 1px var(--tracker-filled-edge); }
body[data-theme] .objective[data-mode="paint"] i.done { background:var(--tracker-petal);box-shadow:inset 0 0 0 1px var(--tracker-petal-edge); }
body[data-theme] .objective .ui-icon { opacity:.28; }
body[data-theme] .objective i.done .ui-icon,body[data-theme] .objective i.next .ui-icon { opacity:1; }
body[data-theme] .objective[data-mode="sequence"] i.done { color:var(--warm); }
body[data-theme] .objective[data-mode="sequence"] i.next { background:var(--hint);color:var(--hint-text);box-shadow:0 2px 0 var(--hint-edge); }
body[data-theme] .snap-piece.sequence { background:transparent var(--world-plaque) center/contain no-repeat;border-radius:0;clip-path:none;box-shadow:none; }
body[data-theme] .snap-piece.sequence::before { color:var(--plaque-text); }
body[data-theme] .flow-meter i { background:var(--surface-2); }
body[data-theme] .flow-meter i.on { background:var(--ui-accent); }
body[data-theme] .flow-meter i.on:nth-child(3),body[data-theme] .flow-meter i.on:nth-child(4) { background:var(--ui-lilac); }
body[data-theme] .flow-meter i.on:nth-child(5) { background:var(--ui-peach); }
body[data-theme] .room-status,body[data-theme] .move-data { text-shadow:0 1px 3px var(--bg); }
body[data-theme] .under-board { background:rgba(var(--scene-rgb),.94);border-radius:4px;box-shadow:0 0 0 3px rgba(var(--scene-rgb),.94); }
body[data-theme] .flow-title b { color:var(--ui-accent); }

/* The same navigation, with very different visual personalities. */
body[data-theme] .controls button { background:var(--button);color:var(--button-text);border:0;border-radius:var(--button-radius);box-shadow:0 4px 0 var(--button-edge); }
body[data-theme] #reset-button { background:var(--reset);color:var(--reset-text);box-shadow:0 4px 0 var(--reset-edge); }
body[data-theme] .controls .hint,body[data-theme] #exit-hard-button { background:var(--hint);color:var(--hint-text);box-shadow:0 4px 0 var(--hint-edge); }
body[data-theme] .controls .control-icon,body[data-theme] .controls .hint .control-icon { color:inherit; }
body[data-theme] .controls button:disabled { box-shadow:none; }
body[data-theme] .controls button:active:not(:disabled) { box-shadow:0 1px 0 var(--button-edge); }
body[data-theme] .assist { background:var(--surface);border-radius:var(--ui-round);border-left-color:var(--ui-accent); }
body[data-theme] .assist-orb { color:var(--ui-accent); }
body[data-theme] .quiet-tip { color:var(--muted);background:rgba(var(--scene-rgb),.94);padding:3px 8px;border-radius:var(--button-radius); }
body[data-theme] .toast,body[data-theme] .chapter-arrival { background:var(--surface);color:var(--ink);border-radius:var(--ui-round);box-shadow:0 3px 8px var(--shadow); }
body[data-theme] .chapter-arrival small { color:var(--ui-accent); }
body[data-theme] .complete,body[data-theme] .run-summary,body[data-theme] .dashboard { background:rgba(4,11,23,.53); }
body[data-theme] .complete-card,body[data-theme] .run-card,body[data-theme] .dashboard-card { background:var(--surface);color:var(--ink); }
body[data-theme] .dashboard-card { border-radius:calc(var(--ui-round) + 8px) calc(var(--ui-round) + 8px) 0 0; }
body[data-theme] .close-dashboard { background:var(--surface-2);color:var(--ink);border-radius:var(--button-radius); }
body[data-theme] .profile-progress>i { background:conic-gradient(var(--ui-accent) calc(var(--p)*1%),var(--surface-2) 0); }
body[data-theme] .profile-stat-icon { color:var(--ui-peach); }
body[data-theme] .section-label span { color:var(--ink); }
body[data-theme] .chapter-card { background:var(--surface-2);border-radius:var(--ui-round); }
body[data-theme] .chapter-badge,body[data-theme] .chapter-card:nth-child(3n+1) .chapter-badge,body[data-theme] .chapter-card:nth-child(3n+2) .chapter-badge { background:var(--surface);color:var(--ui-accent);border-radius:var(--button-radius); }
body[data-theme] .room-grid button { background:var(--surface);color:var(--ink);border-radius:var(--button-radius); }
body[data-theme] .room-grid button.playing { background:var(--hint);color:var(--hint-text);box-shadow:0 3px 0 var(--hint-edge); }
body[data-theme] .constellation i { background:var(--line); }
body[data-theme] .constellation i.done { background:var(--ui-accent); }
body[data-theme] .constellation i.current { background:var(--surface);border-color:var(--ui-accent); }
body[data-theme] .restoration-strip span { color:var(--ui-accent); }
body[data-theme] .mode-card,body[data-theme] .mode-card.rush,body[data-theme] .daily-card,body[data-theme] .hard-card { background:var(--surface-2);border-radius:var(--ui-round); }
body[data-theme] .mode-card.rush .mode-icon,body[data-theme] .mode-card.rush em,body[data-theme] .daily-card>i,body[data-theme] .daily-card em { color:var(--ui-peach); }
body[data-theme] .hard-card strong { background:var(--surface); }
body[data-theme] .settings { background:var(--surface-2);border-radius:var(--ui-round); }
body[data-theme] .segmented,body[data-theme] .skin-picker button { background:var(--surface);border-radius:var(--button-radius); }
body[data-theme] .segmented button.active { background:var(--hint);color:var(--hint-text); }
body[data-theme] .switch { background:var(--surface); }
body[data-theme] .switch::after { background:var(--muted); }
body[data-theme] .setting input:checked+.switch { background:var(--ui-accent); }
body[data-theme] .setting input:checked+.switch::after { background:var(--bg); }
body[data-theme] .primary-button { background:var(--primary);color:var(--primary-text);border-radius:var(--button-radius);box-shadow:0 4px 0 var(--primary-edge); }
body[data-theme] .primary-button>.button-arrow { color:inherit; }
body[data-theme] .primary-button:active { box-shadow:0 1px 0 var(--primary-edge); }
body[data-theme] .reward-score em,body[data-theme] .run-score em { color:var(--ui-peach); }
body[data-theme] .run-score>b { color:var(--ui-accent); }
body[data-theme="play"] .star-mark .ui-icon,body[data-theme="play"] .room-stars .ui-icon,body[data-theme="play"] .stars .ui-icon { filter:brightness(.65); }
body[data-theme="moon"] .star-mark .ui-icon,body[data-theme="moon"] .room-stars .ui-icon,body[data-theme="moon"] .stars .ui-icon { filter:none; }

/* A world can be recognized before you enter it. No extra menu or controls. */
body[data-theme] .theme-picker { gap:9px; }
body[data-theme] .theme-picker button { display:grid;grid-template-columns:1fr;grid-template-rows:66px auto;gap:0;height:122px;padding:0 0 8px;border:0;border-radius:12px;overflow:hidden;background:var(--surface-2);color:var(--ink);text-align:left;box-shadow:inset 0 0 0 1px var(--line); }
body[data-theme] .theme-picker button[aria-checked="true"] { box-shadow:inset 0 0 0 2px var(--ui-accent); }
body[data-theme] .theme-picker button>i { position:relative;width:100%;height:66px;border:0;border-radius:0;background-size:cover;background-position:center 85%;box-shadow:none; }
body[data-theme] .theme-picker button>i::after { content:"";position:absolute;width:39px;height:39px;left:12px;top:14px;background:var(--preview-player) center/contain no-repeat; }
body[data-theme] .theme-picker button>span { padding:7px 12px 0; }
body[data-theme] .theme-picker button b { display:block;font:700 .86rem var(--display); }
body[data-theme] .theme-picker button small { display:block;color:var(--muted);font:400 .61rem/1.4 var(--ui);margin-top:2px; }
body[data-theme] .theme-picker [data-theme="play"] i { background-image:url("assets/world-play-v30.webp");--preview-player:url("assets/world-player-play-nova.svg"); }
body[data-theme] .theme-picker [data-theme="midnight"] i { background-image:url("assets/world-midnight-v30.webp");--preview-player:url("assets/world-player-midnight-nova.svg"); }
body[data-theme] .theme-picker [data-theme="moon"] i { background-image:url("assets/world-moon-v30.webp");--preview-player:url("assets/world-player-moon-nova.svg"); }
body[data-theme] .theme-picker [data-theme="prism"] i { background-image:url("assets/world-prism-v30.webp");--preview-player:url("assets/world-player-prism-nova.svg"); }
.world-change .world-art { animation:world-arrive .5s ease both; }
@keyframes world-arrive { from{opacity:.35}to{opacity:1} }
@media(hover:hover) {
  body[data-theme] .controls button:hover:not(:disabled):not(:active),body[data-theme] .primary-button:hover,body[data-theme] .rooms-button:hover { filter:brightness(1.05); }
  body[data-theme] .controls button:hover:not(:disabled):not(:active) { background:var(--button); }
  body[data-theme] #reset-button:hover:not(:disabled):not(:active) { background:var(--reset); }
  body[data-theme] .controls .hint:hover:not(:disabled):not(:active) { background:var(--hint); }
}
@media(prefers-reduced-motion:reduce) { .world-change .world-art { animation:none; } }

/* Art direction: the board is the illustration, with quieter surrounding chrome. */
body[data-theme] .world-art { display:none; }
body[data-theme] .ambient-canvas { opacity:.08; }
body[data-theme="play"] .ambient-canvas,body[data-theme="midnight"] .ambient-canvas { opacity:.045; }
body[data-theme] .topbar { background:var(--bg);border:0; }
body[data-theme] .brand b { color:var(--ink);font:800 1.55rem/1 var(--display);letter-spacing:-.065em;transform:none;text-transform:lowercase; }
body[data-theme="prism"] .brand b { color:var(--ui-accent);letter-spacing:-.04em; }
body[data-theme="moon"] .brand b { color:var(--ink);letter-spacing:-.04em; }
body[data-theme] .score-hud b { font-weight:650;color:var(--ink); }
body[data-theme] .round-button { background:var(--surface-2);color:var(--ink);border:1px solid var(--line); }
body[data-theme] .rooms-button { border-color:var(--nav);box-shadow:0 2px 0 var(--primary-edge); }
body[data-theme] .round-button.sound { color:var(--ink);background:var(--surface); }
body[data-theme] #chapter-name { font:600 .67rem var(--ui);color:var(--muted);letter-spacing:.025em;background:none;padding:0; }
body[data-theme] .heading h1,body[data-theme] .app[data-difficulty="hard"] .heading h1 { font-family:var(--display);font-weight:650;letter-spacing:-.035em;color:var(--ink); }
body[data-theme] .heading p { text-shadow:none; }
body[data-theme="prism"] .heading h1 { font-weight:750; }
body[data-theme="play"] .app[data-chapter] { --accent:#ffcc7b;--accent-rgb:255,204,123;--accent-2:#ab98eb;--accent2-rgb:171,152,235;--warm-rgb:255,201,87; }
body[data-theme="midnight"] .app[data-chapter] { --accent:#a0dde6;--accent-rgb:160,221,230;--accent-2:#ffc2d8;--accent2-rgb:255,194,216;--warm-rgb:255,225,160; }
body[data-theme="moon"] .app[data-chapter] { --accent:#ffd29b;--accent-rgb:255,210,155;--accent-2:#a0deee;--accent2-rgb:160,222,238;--warm-rgb:255,202,115; }
body[data-theme="prism"] .app[data-chapter] { --accent:#a1e9f1;--accent-rgb:161,233,241;--accent-2:#ffa8ce;--accent2-rgb:255,168,206;--warm-rgb:248,215,104; }

/* Quiet paths, solid square walls, clear pickups and an outlined moving piece. */
body[data-theme] .board { background:var(--board);border:2px solid var(--frame);box-shadow:0 4px 0 var(--frame-depth),0 12px 22px var(--shadow); }
body[data-theme] .board.aligned,body[data-theme] .board.win { border-color:var(--warm);box-shadow:0 4px 0 var(--frame-depth),0 12px 22px var(--shadow); }
body[data-theme] .cell { background:var(--tile);box-shadow:var(--floor-edge); }
body[data-theme] .cell.wall { background:transparent var(--world-wall) center/100% 100% no-repeat; }
body[data-theme] .cell.wall:nth-child(3n+1) { background-image:var(--world-wall-alt); }
body[data-theme] .cell.wall:nth-child(5n) { background-image:var(--world-wall-third); }
body[data-theme] svg[data-art] { background-position:center;background-size:contain;background-repeat:no-repeat;stroke:none; }
body[data-theme] svg[data-art="spark"] { background-image:var(--material-spark); }
body[data-theme] svg[data-art="petal"] { background-image:var(--material-petal); }
body[data-theme] svg[data-art] use { opacity:0; }
body[data-theme] .cell.item .piece-symbol,body[data-theme] .cell.item.paint .piece-symbol { width:64%;height:64%;transform:translate(-50%,-50%); }
body[data-theme] .cell.item::after { width:78%;height:78%;border:1px solid rgba(255,225,172,.17);border-radius:50%; }
body[data-theme] .cell.item.paint::after { border-color:rgba(255,161,193,.24);border-radius:50%; }
body[data-theme] .cell.collected { background:color-mix(in srgb,var(--tile),var(--warm) 12%);box-shadow:inset 0 0 0 1px rgba(var(--warm-rgb),.26); }
body[data-theme] .cell.collected .piece-symbol,body[data-theme] .cell.collected.paint .piece-symbol { opacity:0; }
body[data-theme] .cell.collected::after { width:24%;height:24%;border:0;border-radius:50%;background:var(--warm);opacity:.42; }
body[data-theme] .cell.portal::before,body[data-theme] .cell.exit::before { width:88%;height:88%; }
body[data-theme] .cell.exit { box-shadow:inset 0 0 0 1.5px rgba(var(--warm-rgb),.45); }
body[data-theme] .cell.exit.ready { background:color-mix(in srgb,var(--tile),var(--warm) 20%);box-shadow:inset 0 0 0 2px var(--warm); }
body[data-theme] .turn-marker::before { inset:10%;background:#ffcc69;border:1px solid #ffedb6;border-radius:17%;box-shadow:0 2px 0 #a9792e;clip-path:none; }
body[data-theme] .turn-marker span { width:64%;height:64%;color:#29273c; }
body[data-theme] .turn-marker svg { stroke-width:0; }
body[data-theme] .cell.item.sequence::before { width:68%;height:68%;background:#ffcc69;border:1px solid #ffedb6;border-radius:24%;clip-path:none;box-shadow:0 2px 0 #a9792e; }
body[data-theme] .cell.item.sequence::after { width:64%;height:64%;border:0;border-radius:0;background:none;color:#29273c;font:750 clamp(.8rem,3vw,1.1rem) var(--display); }
body[data-theme] .cell.item.sequence.listening { background:var(--tile);box-shadow:inset 0 0 0 2px var(--warm); }
body[data-theme] .cell.item.sequence.collected::before { opacity:0; }
body[data-theme] .cell.item.sequence.collected::after { background:none;opacity:.42;color:var(--warm);width:60%;height:60%; }
body[data-theme] .player::before { width:90%;height:90%;background:transparent var(--material-nova) center/contain no-repeat;border-radius:0;box-shadow:none;filter:none; }
body[data-theme] .app[data-skin="pearl"] .player::before { background:transparent var(--material-pearl) center/contain no-repeat;filter:none;box-shadow:none; }
body[data-theme] .app[data-skin="prism"] .player::before { background:transparent var(--material-prism) center/contain no-repeat;filter:none;box-shadow:none; }
body[data-theme] .player::after { inset:6%;border:1.5px solid #f3f6ef;border-radius:50%;background:none;box-shadow:none;opacity:.88;z-index:-1; }
body[data-theme] .player.in-motion::after { opacity:.2; }
body[data-theme] .skin-picker i { background:transparent var(--material-nova) center/contain no-repeat;border-radius:0;box-shadow:none; }
body[data-theme] .skin-picker [data-skin="pearl"] i { background-image:var(--material-pearl);filter:none; }
body[data-theme] .skin-picker [data-skin="prism"] i { background-image:var(--material-prism);filter:none; }
body[data-theme] .hint-path { stroke:var(--accent);stroke-width:3; }
body[data-theme] .hint-start { stroke:var(--accent);fill:var(--accent); }
body[data-theme] .hint-end { fill:var(--warm); }
body[data-theme] .hint-path-glow { opacity:.15; }
body[data-theme] .gesture { background:var(--board);color:#eff2f0;border:1px solid var(--frame);border-radius:12px; }
body[data-theme] .objective { gap:7px;background:var(--surface-2);padding:4px 7px;border-radius:22px;box-shadow:inset 0 1px rgba(0,0,0,.06); }
body[data-theme] .objective i { width:30px;height:30px;background:var(--surface);border:0;border-radius:50%;box-shadow:inset 0 0 0 1px var(--line); }
body[data-theme] .objective .ui-icon { width:24px;height:24px;opacity:.28; }
body[data-theme] .objective[data-mode="sequence"] i.next { color:#29273c;background:#ffcc69;box-shadow:0 2px 0 #a9792e; }
body[data-theme] .snap-piece.sequence { background:#ffcc69;border-radius:24%;box-shadow:0 2px 0 #a9792e;clip-path:none; }
body[data-theme] .snap-piece.sequence::before { color:#29273c; }
body[data-theme] .trail-dot::before { left:43%;right:43%;top:43%;height:14%;border-radius:50%;background:var(--trail-color);box-shadow:none; }
body[data-theme="midnight"] .trail-dot::before { inset:32%;height:auto;border:1px solid var(--trail-color);background:none; }
body[data-theme="moon"] .trail-dot::before { left:36%;right:36%;top:46%;height:8%;border-radius:1px; }
body[data-theme="prism"] .trail-dot::before { border-radius:2px; }
body[data-theme] .under-board { background:none;box-shadow:none; }
body[data-theme] .room-status,body[data-theme] .move-data { text-shadow:none;color:var(--muted); }
body[data-theme] .move-data b { color:var(--ink); }
body[data-theme] .flow-meter { height:6px; }
body[data-theme] .controls button,body[data-theme] #reset-button { border:1px solid var(--line);box-shadow:0 2px 0 var(--line); }
body[data-theme] .controls .hint,body[data-theme] #exit-hard-button { border-color:var(--primary);box-shadow:0 2px 0 var(--primary-edge); }
body[data-theme] .controls button:disabled { box-shadow:none; }
body[data-theme] .controls button:active:not(:disabled) { transform:translateY(2px);box-shadow:none; }
body[data-theme] .assist { border:1px solid var(--line);border-left:3px solid var(--ui-accent); }
body[data-theme] .quiet-tip { background:none; }
body[data-theme] .chapter-card { background:var(--surface);border:1px solid var(--line); }
body[data-theme] .chapter-card.expanded { border-color:var(--ui-accent); }
body[data-theme] .room-grid button { background:var(--surface-2);border-radius:12px;box-shadow:none; }
body[data-theme] .room-grid button.playing { background:var(--primary);color:var(--primary-text);box-shadow:0 2px 0 var(--primary-edge); }
body[data-theme] .primary-button { box-shadow:0 3px 0 var(--primary-edge); }
body[data-theme] .primary-button>.button-arrow { background:none;border:0; }
body[data-theme] .primary-button:active { box-shadow:none;transform:translateY(2px); }
body[data-theme] .section-label span { font-size:.62rem;letter-spacing:.085em; }

/* Recognizable previews made from the actual game pieces. */
body[data-theme] .theme-picker { gap:10px; }
body[data-theme] .theme-picker button { position:relative; }
body[data-theme] .theme-picker button[aria-busy="true"]::after { content:"";position:absolute;right:8px;top:8px;width:16px;height:16px;border:2px solid white;border-right-color:transparent;border-radius:50%;animation:art-loading .8s linear infinite; }
@keyframes art-loading { to{transform:rotate(360deg)} }
body[data-theme] .theme-picker button { grid-template-rows:90px auto;min-height:144px;height:auto;padding:0 0 10px;border:1px solid var(--line);border-radius:15px;background:var(--surface);box-shadow:none; }
body[data-theme] .theme-picker button[aria-checked="true"] { border-color:var(--ui-accent);box-shadow:0 0 0 1px var(--ui-accent); }
body[data-theme] .theme-picker button>i { height:90px;background:var(--preview-bg); }
body[data-theme] .theme-picker button>i::before,body[data-theme] .theme-picker button>i::after { content:"";position:absolute;width:66px;height:66px;top:12px;background:var(--preview-player) center/contain no-repeat; }
body[data-theme] .theme-picker button>i::before { left:calc(50% - 63px);background-image:var(--preview-wall);transform:rotate(-8deg); }
body[data-theme] .theme-picker button>i::after { left:calc(50% - 2px);transform:rotate(8deg); }
body[data-theme] .theme-picker button b { font:650 .95rem var(--display); }
body[data-theme] .theme-picker [data-theme="play"] i { --preview-bg:#e9dcbf;--preview-player:url("assets/crafted-play-nova-v31.webp");--preview-wall:url("assets/crafted-play-wall-1-v31.webp"); }
body[data-theme] .theme-picker [data-theme="midnight"] i { --preview-bg:#154454;--preview-player:url("assets/crafted-midnight-nova-v31.webp");--preview-wall:url("assets/crafted-midnight-wall-2-v31.webp"); }
body[data-theme] .theme-picker [data-theme="moon"] i { --preview-bg:#1c2a3f;--preview-player:url("assets/crafted-moon-nova-v31.webp");--preview-wall:url("assets/crafted-moon-wall-1-v31.webp"); }
body[data-theme] .theme-picker [data-theme="prism"] i { --preview-bg:#321851;--preview-player:url("assets/crafted-prism-nova-v31.webp");--preview-wall:url("assets/crafted-prism-wall-2-v31.webp"); }
.world-change .brand { animation:crafted-arrive .22s ease both; }
@keyframes crafted-arrive { from{opacity:.4;transform:translateY(3px)}to{opacity:1;transform:none} }
@media(hover:hover) {
 body[data-theme] .controls button:hover:not(:disabled):not(:active),body[data-theme] #reset-button:hover:not(:disabled):not(:active) { background:var(--surface-2); }
 body[data-theme] .controls .hint:hover:not(:disabled):not(:active),body[data-theme] #exit-hard-button:hover,body[data-theme] .primary-button:hover,body[data-theme] .rooms-button:hover { background:var(--primary);color:var(--primary-text);filter:brightness(1.07); }
}
@media(max-width:359px) { body[data-theme] .brand b { font-size:1.3rem; } }
@media(prefers-reduced-motion:reduce) { .world-change .brand { animation:none; } }
