/* Theme scenes: same ink-and-paper art direction; no external images or fonts. */
body,[data-theme]{--sky:#e4eee4;--floor:#d4dfc5;--cabinet:#e96953;--cap:#324744;--scene-ink:#45665d;--scenery:#8ead9c;--orb:#f2c56c;--wall-edge:#c2d3c6;--accent:#bb684e}
body[data-theme=night],[data-theme=night]{--paper:#eaeaf0;--mint-soft:#e4e6ee;--coral:#816b95;--coral-soft:#ece5f0;--mint:#bdc3d5;--sky:#343d5d;--floor:#b7bfd0;--cabinet:#777492;--cap:#333b51;--scene-ink:#f7e5b7;--scenery:#7885aa;--orb:#ffe4aa;--wall-edge:#58657e;--accent:#78678e}
body[data-theme=candy],[data-theme=candy]{--paper:#f9ede9;--mint-soft:#f5e6e5;--coral:#cc6c89;--coral-soft:#f7dfe6;--mint:#d1b9c8;--sky:#f6e3e8;--floor:#e8cecf;--cabinet:#d5849c;--cap:#785b6c;--scene-ink:#886270;--scenery:#d9a6b8;--orb:#f4c770;--wall-edge:#e5becd;--accent:#b36785}
body[data-theme=ocean],[data-theme=ocean]{--paper:#edf3f1;--mint-soft:#e1eeeb;--coral:#367f88;--coral-soft:#ddeded;--mint:#a8cbd0;--sky:#c8e9e8;--floor:#dfddbf;--cabinet:#72b0b4;--cap:#335e66;--scene-ink:#3a7380;--scenery:#80babb;--orb:#f0d59a;--wall-edge:#a5d1d3;--accent:#347e87}
body[data-theme=space],[data-theme=space]{--paper:#f0edf6;--mint-soft:#e9e5f2;--coral:#88689d;--coral-soft:#f0e0ed;--mint:#c8bbd8;--sky:#3e365f;--floor:#bcb5d1;--cabinet:#9c88b6;--cap:#37304d;--scene-ink:#f4dba6;--scenery:#8276a4;--orb:#e2bc84;--wall-edge:#655881;--accent:#816399}
body[data-theme=forest],[data-theme=forest]{--paper:#eef1e7;--mint-soft:#e1e8d6;--coral:#688669;--coral-soft:#e2ebda;--mint:#b4c8a4;--sky:#dce7cf;--floor:#bccfa4;--cabinet:#91ab84;--cap:#415b46;--scene-ink:#44644d;--scenery:#8ca779;--orb:#f4d58b;--wall-edge:#b6cba3;--accent:#607b52}
body[data-theme=snow],[data-theme=snow]{--paper:#eef2f6;--mint-soft:#e2eaf1;--coral:#6d8eaa;--coral-soft:#e5eaf4;--mint:#bdccd8;--sky:#dcebf4;--floor:#d0deec;--cabinet:#9fbacb;--cap:#47667a;--scene-ink:#537489;--scenery:#a8c2d2;--orb:#ffefc8;--wall-edge:#c0d5e0;--accent:#5d829c}
body[data-theme=sunset],[data-theme=sunset]{--paper:#f9f0e6;--mint-soft:#f0e4d5;--coral:#c9775a;--coral-soft:#fae2d0;--mint:#d8c2a0;--sky:#f5dac3;--floor:#e5c7ae;--cabinet:#dc9b7d;--cap:#775c53;--scene-ink:#99634f;--scenery:#d6a184;--orb:#e69761;--wall-edge:#e8bda2;--accent:#b57551}
body .hero-cabinet{background:var(--cabinet);box-shadow:7px 8px 0 var(--wall-edge)}
body .hero-window,body .arena-interior,body[data-theme] .back-wall{background:var(--sky)}
body .hero-floor{background:var(--floor);border-color:var(--wall-edge)}
body .hero-window:after{box-shadow:inset 9px 0 var(--wall-edge),inset -9px 0 var(--wall-edge)}
body .cabinet-cap{background:var(--cap);border-bottom-color:var(--ink)}
body .cabinet-cap span{color:#fff4d8}
body .cabinet-bottom>span{color:var(--ink)}
body .wall-note{color:var(--scene-ink);border-color:var(--wall-edge);background:var(--sky);z-index:2;font-size:12px;opacity:.9;left:20px;top:64px}
body .wall-note span{color:var(--scenery)}
body .art-bubble{z-index:8}
body .back-wall{border-color:var(--wall-edge)}
body .wall-stamp{color:var(--scene-ink);z-index:1;opacity:.83}
body .wall-stars{display:none}
body .hero-rail{z-index:2}
body .arena-top{background:var(--cap)}
body[data-theme] .arena-lip{background:var(--floor);color:var(--ink)}
/* Lane colours have semantic meaning, and intentionally do not change with themes. */
body[data-theme] .stage-lane:not(.safe){background:#f1d6c5}
body[data-theme] .stage-lane.safe{background:#d8e6c3}
body[data-theme] .lane-label{color:#794d42}
body[data-theme] .safe .lane-label{color:#3f6340}
body .button.primary:hover{background:var(--accent)}
body .theme-scene{position:absolute;inset:0;overflow:hidden;pointer-events:none;color:var(--scene-ink);background:var(--sky)}
.theme-scene i{display:block;position:absolute;font-style:normal}
.scene-orb{width:64px;height:64px;border-radius:50%;background:var(--orb);top:22%;right:17%;border:2px solid color-mix(in srgb,var(--scene-ink) 20%,transparent)}
.scene-horizon{width:86%;height:42%;bottom:-24%;right:-22%;background:var(--scenery);border-radius:50% 50% 0 0;opacity:.75;transform:rotate(-12deg)}
.scene-hill{width:75%;height:32%;bottom:-20%;left:-15%;border-radius:50% 50% 0 0;background:var(--scenery);opacity:.5;transform:rotate(8deg)}
.scene-mark{width:36px;height:16px;border:2px solid var(--scene-ink);opacity:.35;border-radius:50%}
.mark-a{left:17%;top:26%;transform:rotate(-12deg)}.mark-b{right:8%;top:61%;transform:rotate(20deg)}.mark-c{left:46%;top:14%;transform:scale(.65)}
.scene-dot{width:5px;height:5px;background:var(--scene-ink);border-radius:50%;opacity:.3}
.dot-a{left:40%;top:40%}.dot-b{right:9%;top:27%}.dot-c{left:18%;top:70%}
.scene-day .scene-mark{border:0;background:#fffdf0;border-radius:25px;opacity:.8;box-shadow:8px -7px 0 -1px #fffdf0,-7px -4px 0 -2px #fffdf0}
.scene-night .scene-orb{box-shadow:12px -8px 0 2px var(--sky);width:56px;height:56px;border:0}
.scene-night .scene-mark,.scene-space .scene-mark{width:14px;height:14px;border:0;background:var(--orb);clip-path:polygon(50% 0,61% 38%,100% 50%,61% 62%,50% 100%,39% 62%,0 50%,39% 38%);opacity:.75}
.scene-night .scene-horizon{border-radius:4px;transform:none;bottom:-5%;height:26%;width:27%;right:10%;background:repeating-linear-gradient(90deg,#53607e 0 22px,transparent 22px 30px);opacity:.7}
.scene-night .scene-dot,.scene-space .scene-dot{background:#fff5d2;opacity:.7;box-shadow:37px 15px 0 -1px #fff5d2,-27px 23px 0 0 #fff5d2}
.scene-candy{background-image:repeating-linear-gradient(90deg,transparent 0 32px,#eac5d044 32px 65px)}
.scene-candy .scene-orb{border:3px solid #fff3e3;background:repeating-radial-gradient(circle at center,#ed9cad 0 5px,#ffeadb 6px 11px);box-shadow:0 0 0 2px var(--scenery)}
.scene-candy .scene-orb:after{content:'';position:absolute;top:100%;width:6px;height:52px;background:#fff5e2;left:25px;border:1px solid var(--scenery);border-top:0}
.scene-candy .scene-mark{border-radius:4px;background:var(--orb);border-color:#c99966;width:24px;height:18px;opacity:.65;transform:rotate(-20deg)}
.scene-candy .scene-mark:before,.scene-candy .scene-mark:after{content:'';position:absolute;border:7px solid transparent;border-right-color:var(--orb);right:100%;top:0}
.scene-candy .scene-mark:after{left:100%;border-right-color:transparent;border-left-color:var(--orb)}
.scene-ocean{background-image:linear-gradient(165deg,#ffffff40 0 12%,transparent 12% 32%,#ffffff33 32% 36%,transparent 36% 65%,#ffffff26 65% 68%,transparent 68%)}
.scene-ocean .scene-orb{background:transparent;border:2px solid #fff9dca6;width:26px;height:26px;right:14%;top:18%;box-shadow:12px 64px 0 -7px #fff9dc78,-34px 36px 0 -10px #fff9dc99}
.scene-ocean .scene-mark{width:33px;height:17px;opacity:.7;background:var(--scenery);border:0}
.scene-ocean .scene-mark:before{content:'';position:absolute;left:-8px;top:1px;border:8px solid transparent;border-left-color:var(--scenery);border-right:0}
.scene-ocean .scene-mark:after{content:'';position:absolute;right:7px;top:5px;width:3px;height:3px;border-radius:50%;background:var(--scene-ink)}
.scene-ocean .mark-c{top:48%;left:64%;transform:scale(.65) rotate(180deg)}
.scene-ocean .scene-horizon{height:35%;bottom:-20%;background:#bdcdad;border-radius:50% 50% 0 0}
.scene-space .scene-orb{width:59px;height:59px;transform:rotate(-20deg);background:linear-gradient(180deg,var(--orb) 0 38%,#cd976e 38% 49%,var(--orb) 49% 64%,#cd976e 64% 72%,var(--orb) 72%)}
.scene-space .scene-orb:after{content:'';position:absolute;inset:18px -20px;border:6px solid #cabbda;border-radius:50%;box-shadow:0 1px 0 1px #4e3f6c;transform:rotate(-6deg)}
.scene-space .scene-horizon{opacity:.3;height:50%;bottom:-38%;width:100%;border:2px solid #a295bd}
.scene-forest .scene-orb{width:36px;height:36px;filter:none;opacity:.8}
.scene-forest .scene-horizon,.scene-forest .scene-hill{border-radius:50% 50% 0 0;bottom:-27%;height:70%;opacity:.55}
.scene-forest .scene-mark{background:var(--scenery);border:1px solid #688364;width:33px;height:52px;border-radius:0 70% 0 70%;opacity:.65;transform:rotate(-38deg)}
.scene-forest .mark-b{transform:rotate(35deg)}
.scene-forest .scene-dot{background:#ffffc4;opacity:1;box-shadow:0 0 8px 3px #f7eaad66}
.scene-snow .scene-horizon{width:72%;height:90%;right:-10%;bottom:-24%;clip-path:polygon(50% 0,100% 100%,0 100%);border-radius:0;transform:none;background:#fffef2;opacity:.95}
.scene-snow .scene-hill{width:75%;height:60%;left:-15%;bottom:-10%;clip-path:polygon(48% 0,100% 100%,0 100%);border-radius:0;transform:none;background:#c0d0dd;opacity:1}
.scene-snow .scene-mark{border:0;opacity:.7}
.scene-snow .scene-mark:after{content:'❄';font:24px system-ui;color:#fff;position:absolute;left:0;top:0}
.scene-snow .scene-dot{background:#fff;opacity:.9;box-shadow:42px -16px 0 -1px #fff,-24px 28px 0 1px #fff}
.scene-sunset{background-image:linear-gradient(180deg,#f1cbd1 0%,#f5dac3 68%,#f5e7c8 100%)}
.scene-sunset .scene-orb{top:39%;width:77px;height:77px;border:0;background:#e7a078}
.scene-sunset .scene-horizon{height:55%;bottom:-28%;right:-18%;background:#c8a292;opacity:1}
.scene-sunset .scene-hill{background:#c69888}
.scene-sunset .scene-mark{border:0;border-top:2px solid var(--scene-ink);border-radius:50%;width:19px;height:11px;opacity:.4}
.scene-sunset .scene-mark:after{content:'';width:19px;height:11px;border-top:2px solid var(--scene-ink);border-radius:50%;position:absolute;left:16px;top:-2px}
/* Slow environmental motion only; previews remain still and gameplay geometry is untouched. */
.hero-window>.theme-scene .scene-mark,.back-wall>.theme-scene .scene-mark{animation:ambience-drift 9s ease-in-out infinite alternate}
.hero-window>.theme-scene .mark-b,.back-wall>.theme-scene .mark-b{animation-delay:-4s}
.hero-window>.theme-scene .scene-dot,.back-wall>.theme-scene .scene-dot{animation:ambience-glow 5s ease-in-out infinite alternate}
@keyframes ambience-drift{from{translate:0 0}to{translate:8px -5px}}
@keyframes ambience-glow{from{opacity:.3}to{opacity:.85}}
.no-ambient-motion .theme-scene *,.reduce-motion .theme-scene *{animation:none!important}
@media(prefers-reduced-motion:reduce){.theme-scene *{animation:none!important}}
.ambience-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:19px 0 0;padding:12px 16px;border:1px solid var(--line);border-radius:12px;background:var(--white)}
.ambience-scene-info{display:flex;align-items:center;gap:11px;min-width:0}
.ambience-scene-info>span:first-child{font-size:20px;color:var(--accent)}
.ambience-scene-info>div{min-width:0}.ambience-scene-info strong{font-size:12px;display:block}
.ambience-scene-info small{font-size:10px;color:#687672;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:250px}
.ambience-actions{display:flex;gap:7px;flex-shrink:0}.ambience-actions button{background:transparent;border:1px solid var(--line);border-radius:7px;padding:7px 12px;font-size:11px;min-height:36px;font-weight:700}
.ambience-actions #bgm-toggle[aria-pressed=true]{background:var(--mint-soft);border-color:var(--accent);color:var(--ink)}
body .home{padding-top:42px}
body .preferences-modal{width:790px;max-width:calc(100vw - 28px);padding:32px;max-height:91vh;overflow-y:auto;overscroll-behavior:contain}
.preferences-modal>h2{font-size:31px}.preferences-modal>.modal-description{font-size:12px;margin:10px 0 24px}
.preference-section-title{display:flex;gap:15px;align-items:center;justify-content:space-between;margin:24px 0 13px}
.preference-section-title h3{font-size:16px}.preference-section-title>span{font:9px ui-monospace,monospace;color:var(--accent);letter-spacing:.06em}
.theme-quick{display:flex;align-items:center;gap:12px;justify-content:space-between;font-size:12px;margin:0 0 13px!important}
.theme-quick select{font-size:12px;width:175px;padding:8px 10px;min-height:38px;margin:0}
.theme-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}
.theme-card{display:block;text-align:left;padding:6px 6px 9px;border:1.5px solid var(--line);background:var(--white);border-radius:12px;position:relative;min-width:0}
.theme-card[aria-pressed=true]{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent);background:var(--mint-soft)}
.theme-card:hover{border-color:var(--accent)}
.theme-mini{display:block;height:91px;position:relative;border-radius:7px;overflow:hidden;background:var(--sky)}
.theme-mini .scene-orb{width:33px;height:33px}.theme-mini .scene-space .scene-orb:after{inset:10px -10px;border-width:4px}
.theme-mini .scene-mark{scale:.6}.theme-mini .scene-candy .scene-orb:after{height:24px;left:12px}
.theme-mini .scene-night .scene-orb{box-shadow:7px -5px 0 1px var(--sky)}
.mini-machine{position:absolute;left:28%;right:28%;bottom:-4px;height:69px;border:2px solid var(--ink);border-radius:8px 8px 3px 3px;background:var(--cabinet);display:block;transform:rotate(-3deg)}
.mini-machine i{position:absolute;inset:10px 4px 13px;background:var(--sky);border:1px solid var(--ink);border-radius:3px}
.mini-machine b{position:absolute;top:10px;left:0;width:100%;text-align:center;font-size:23px;color:var(--scene-ink)}
.theme-card-title{display:flex;justify-content:space-between;align-items:center;gap:2px;font-size:11px;font-weight:850;margin:7px 3px 2px;white-space:nowrap}
.theme-tick{color:var(--accent);visibility:hidden;font-size:12px}
.theme-card[aria-pressed=true] .theme-tick{visibility:visible}
.theme-card>small{font:8px ui-monospace,monospace;color:#717b75;margin-left:3px;letter-spacing:.02em}
.theme-description{font-size:11px;color:#65776d;margin:12px 0 8px}
.music-deck{background:var(--mint-soft);border:1px solid var(--line);border-radius:16px;padding:18px;margin:0 0 18px;display:grid;grid-template-columns:58px minmax(0,1fr) auto;align-items:center;gap:14px}
.music-disc{width:58px;height:58px;border-radius:50%;position:relative;background:repeating-radial-gradient(circle at center,#364646 0 2px,#4e5d57 3px 4px);display:grid;place-items:center;color:#f6ddb0;border:2px solid var(--ink);font-size:20px}
.music-disc:before{content:'';position:absolute;width:21px;height:21px;border-radius:50%;background:var(--coral)}
.music-disc span{position:relative;z-index:1;font-size:15px}
.music-info{min-width:0}.music-info strong{display:block;font-size:15px}.music-info small{display:block;font-size:10px;margin-top:4px;color:#596b61;line-height:1.6}
.music-info #bgm-status{font-size:10px;display:block;margin-top:5px;color:#456d59}
#bgm-play{font-size:12px;padding:9px 15px;min-height:39px;box-shadow:none;gap:0}
body[data-music=playing] .music-disc{animation:record-turn 12s linear infinite}
@keyframes record-turn{to{rotate:360deg}}
.no-ambient-motion .music-disc{animation:none!important}
.sound-controls{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.sound-channel{border:1px solid var(--line);padding:15px;border-radius:11px;background:var(--white)}
.sound-channel .check-rule{margin:0!important}.sound-channel .check-rule b{font-size:13px}.sound-channel .check-rule small{font-size:10px}
.sound-channel input[type=range]{width:100%;padding:0;height:22px;accent-color:var(--accent)}
.sound-channel .volume-label{margin:17px 0 8px!important;font-size:11px}
.track-select{display:block;margin:16px 0!important;font-size:12px}.track-select select{display:block;width:100%;font-size:12px;margin-top:8px}
.audio-note{font-size:10px;line-height:1.8;color:#718078;margin:14px 0 22px}
.display-prefs{border-top:1px solid var(--line);margin-top:22px;padding-top:4px}
.display-prefs .preference-grid{grid-template-columns:1fr}.display-prefs .pref-block{font-size:12px}
.display-prefs .rule-toggles{display:grid;grid-template-columns:1fr 1fr;gap:14px!important}
.preferences-modal .settings-done{margin-top:6px;min-height:44px}
@media(max-width:700px){.theme-gallery{gap:8px}.theme-card-title{font-size:10px}.theme-mini{height:78px}.music-deck{grid-template-columns:48px 1fr auto;gap:10px}.music-disc{width:48px;height:48px}.music-info strong{font-size:13px}.sound-controls{gap:12px}.sound-channel{padding:13px}.ambience-scene-info small{max-width:170px}}
@media(max-width:540px){body .preferences-modal{padding:25px 18px}.theme-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.theme-mini{height:84px}.theme-card-title{font-size:12px}.theme-card>small{font-size:9px}.theme-quick{font-size:11px}.theme-quick select{width:157px}.preferences-modal>h2{font-size:27px}.ambience-bar{margin-top:13px;padding:10px;gap:5px}.ambience-scene-info{gap:6px}.ambience-scene-info>span:first-child{display:none}.ambience-scene-info strong{font-size:11px}.ambience-scene-info small{font-size:9px;max-width:130px}.ambience-actions{gap:4px}.ambience-actions button{padding:6px 8px;font-size:10px;min-height:34px}.sound-controls{grid-template-columns:1fr}.display-prefs .rule-toggles{grid-template-columns:1fr}.music-deck{grid-template-columns:42px minmax(0,1fr);gap:10px;padding:14px}.music-disc{width:42px;height:42px}.music-deck #bgm-play{grid-column:1/-1;width:100%}.music-info strong{font-size:13px}.music-info small{font-size:9px}.theme-quick select{min-height:35px}body .home{padding-top:29px}.topbar #settings-open{white-space:nowrap}.nav-right{gap:9px}}
@media(prefers-reduced-motion:reduce){.music-disc{animation:none!important}}
/* The paper notice remains dark ink even in night/space scenes. */
body[data-theme] .wall-stamp{color:#526658}
