@font-face{font-family:Bricolage;src:url(fonts/bricolage-vi.woff2) format("woff2");font-weight:400 800;font-display:swap;unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:Bricolage;src:url(fonts/bricolage-latin.woff2) format("woff2");font-weight:400 800;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
:root{--ink:#252426;--paper:#faf9f2;--cream:#fffef9;--purple:#cfbaf1;--gold:#ffd04c;--soft:#635f61;--line:2px solid var(--ink);--shadow:4px 5px 0 var(--ink);font:16px/1.45 Bricolage,ui-rounded,system-ui,sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}
*{box-sizing:border-box}
body{margin:0;min-width:280px}
button,select{font:inherit;color:inherit}
button{display:inline-flex;align-items:center;justify-content:center;font-weight:700;gap:.55rem;cursor:pointer;-webkit-tap-highlight-color:transparent}
button:focus-visible,canvas:focus-visible,select:focus-visible{outline:3px solid #6045aa;outline-offset:4px}
button:disabled{cursor:default;opacity:.56}
button:active:not(:disabled){transform:translate(1px,2px)}
.wrap{width:min(1192px,calc(100% - clamp(48px,11.5vw,184px)));margin-inline:auto}
.symbols{position:absolute;width:0;height:0;overflow:hidden}
.ico{width:1.25rem;height:1.25rem;flex:none;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.topbar{border-bottom:var(--line);background:#fffef9}
.topbar-inner{height:73px;display:flex;align-items:center;justify-content:space-between}
.brand{display:inline-flex;align-items:center;font-size:1.68rem;font-weight:800;letter-spacing:-.065rem;line-height:1}
.brand-mark{width:37px;height:40px;margin-right:10px;transform:rotate(-6deg)}
.brand-period{color:#ae7415}
.utilities{display:flex;align-items:center;gap:17px}
.help-button{border:0;background:transparent;font-size:.95rem;padding:10px 1px}
.help-button:hover{text-decoration:underline;text-underline-offset:4px}
.nav-divider{width:1px;height:22px;background:#d6d2ca}
.icon-button,.stage-button{width:38px;height:37px;border:var(--line);border-radius:9px;background:var(--cream);box-shadow:1.5px 2px var(--ink);padding:0}
.icon-button:hover,.stage-button:hover,.action:not(.primary):hover{background:#f4efdf}
.intro{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:33px 0 26px}
.title-line{display:flex;align-items:center;gap:17px}
h1,h2,h3,p,fieldset{margin:0}
h1{font-size:clamp(3.4rem,5.2vw,4.9rem);font-weight:800;letter-spacing:-.053em;line-height:1.08}
.dimension{position:relative;top:3px;transform:rotate(-8deg);font-size:1.43rem;line-height:1;padding:5px 9px 6px;border:var(--line);border-radius:8px;background:var(--gold);font-weight:800;letter-spacing:-.045em;box-shadow:2px 3px var(--ink)}
.intro p{color:#5b595b;margin-top:8px;font-size:1.04rem}
.session-status{display:inline-flex;align-items:center;gap:8px;border:1.5px solid #bfbfb2;border-radius:22px;background:#f2f4e8;padding:5px 12px;font-size:.84rem;font-weight:650;white-space:nowrap;margin-top:10px}
.session-status i{width:8px;height:8px;border-radius:100%;background:#589c64;border:1px solid #397546}
.session-status[data-state="lost"] i{background:#ee895e;border-color:#a25b3f}
.game-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(284px,30%);gap:25px;align-items:stretch}
.stage,.control-card,.tip{border:var(--line);border-radius:17px;box-shadow:var(--shadow)}
.stage{position:relative;isolation:isolate;min-width:0;min-height:470px;overflow:hidden;background-color:var(--purple);background-image:radial-gradient(#8066a066 .9px,transparent 1px);background-size:14px 14px;background-position:center}
.stage-shade{position:absolute;inset:0;z-index:-1;background:radial-gradient(ellipse at 50% 47%,#e2d3fb5e 0%,transparent 71%);pointer-events:none}
#cube{display:block;position:absolute;width:100%;height:100%;inset:0;touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none}
#cube:focus-visible{outline-offset:-5px}
.floor-shadow{position:absolute;left:50%;top:83%;width:32%;height:5%;border-radius:50%;background:#79659152;transform:translate(-50%,-50%);filter:blur(5px);pointer-events:none}
.doodle{position:absolute;pointer-events:none}
.sparkle-one{width:7.7%;max-width:58px;left:12%;top:26%;transform:rotate(6deg)}
.sparkle-two{width:5.5%;max-width:39px;right:13%;bottom:27%;transform:rotate(11deg)}
.orbit{width:9%;max-width:72px;bottom:16.5%;left:7%;transform:rotate(-13deg)}
.stage-top{position:absolute;left:20px;right:20px;top:20px;display:flex;align-items:flex-start;justify-content:space-between;pointer-events:none}
.level-tag,.stage-button,.board-message{border:var(--line);background:var(--cream);box-shadow:2px 2px var(--ink)}
.level-tag{display:inline-flex;align-items:center;gap:8px;font-weight:750;padding:6px 12px;font-size:.93rem;line-height:1.3;border-radius:8px;transform:rotate(-2deg)}
.level-tag .ico{width:17px;height:17px}
.stage-button{pointer-events:auto;width:35px;height:35px;border-radius:8px}
.stage-button .ico{width:16px;height:16px}
.board-message{position:absolute;left:50%;bottom:20px;transform:translateX(-50%);pointer-events:none;display:flex;align-items:center;justify-content:center;gap:7px;padding:6px 13px;border-radius:18px;font-size:.83rem;font-weight:650;white-space:nowrap}
.board-message .ico{width:16px;height:16px}
.board-message[data-feedback="bad"]{background:#ffcfbf}
.board-message[data-feedback="good"]{background:#e2f2c9}
.board-message[data-feedback="hint"]{background:#ffe398}
.key-controls{position:absolute;left:2%;bottom:58px;display:flex;gap:.4rem;align-items:center;background:var(--cream);padding:6px;border:var(--line);border-radius:6px}
.key-controls:not(:focus-within){clip-path:inset(50%);width:1px;height:1px;padding:0}
.key-controls button,.key-controls select{border:1px solid var(--ink);border-radius:4px;background:white}
.stage.enlarged{position:fixed;inset:10px;z-index:5;min-height:0;box-shadow:none}
body.enlarged{overflow:hidden}
.sidebar{display:flex;flex-direction:column;gap:17px;min-width:0}
.control-card{background:var(--cream);overflow:hidden}
.control-card h2{display:flex;align-items:center;gap:11px;border-bottom:2px solid var(--ink);padding:15px 19px;font-size:1.34rem;letter-spacing:-.05em;font-weight:800;line-height:1.25}
.panel-icon{width:25px;height:25px;transform:rotate(-9deg);stroke-width:2.1}
.control-body{padding:18px 20px 20px}
.mode-field{padding:0;border:0;min-width:0}
.mode-field legend,.progress-heading>span,.stat-row>span{font-size:.95rem;font-weight:630}
.mode-field legend{padding:0;margin-bottom:8px}
.modes{display:flex;align-items:stretch;gap:7px}
.modes button{border:1.5px solid #b1aca7;background:#fffefa;border-radius:8px;flex:1;padding:8px 5px;font-size:.91rem}
.modes button[aria-pressed="true"]{background:#ffcfb9;border:1.8px solid var(--ink);box-shadow:1.5px 2px var(--ink)}
.modes button .ico{width:16px;height:16px}
.modes #hard[aria-pressed="true"] .ico{fill:#fd9166}
.modes #expert[aria-pressed="true"]{background:#e1ccff}
.modes #expert[aria-pressed="true"] .ico{fill:#c394f8}
.progress-heading,.stat-row,.time-row b{display:flex;align-items:center;justify-content:space-between}
.progress-heading{margin:21px 0 8px}
.progress-heading b,.time-row b{font-variant-numeric:tabular-nums;font-size:1rem;letter-spacing:-.04em;font-weight:750}
.count-slash{font-weight:500;color:#706965;margin:0 1px}
progress{display:block;appearance:none;width:100%;height:12px;border:1.6px solid var(--ink);border-radius:6px;overflow:hidden;background:#eae7de}
progress::-webkit-progress-bar{background:#eae7de}
progress::-webkit-progress-value{background:#f5bf41;border-radius:4px}
progress::-moz-progress-bar{background:#f5bf41}
.stat-row{margin-top:15px;min-height:22px}
.time-row{margin-top:8px}
.time-row b{gap:5px}
.time-row svg{width:16px;height:16px}
.hearts{display:flex;align-items:center;gap:4px}
.hearts svg{width:20px;height:20px;stroke-width:1.7;fill:#ff877e}
.hearts svg.empty{fill:#e8e3d9;stroke:#9a948e}
.actions{display:flex;flex-direction:column;gap:9px;border-top:1px solid #d7d2c7;margin-top:17px;padding-top:16px}
.action{position:relative;min-height:39px;border:1.8px solid var(--ink);border-radius:8px;background:var(--cream);box-shadow:2px 2px var(--ink);font-size:.95rem}
.action .ico{width:17px;height:17px}
.action.primary{background:var(--gold)}
.action.primary:hover:not(:disabled){background:#ffd96a}
.count-badge{border:1.3px solid var(--ink);border-radius:6px;background:#ffea9b;min-width:22px;line-height:19px;text-align:center;font-size:.78rem}
.tip{display:flex;align-items:center;gap:12px;padding:15px 16px;background:#ffedb4;box-shadow:3px 4px var(--ink)}
.tip-art{flex:none;width:47px;line-height:0;transform:rotate(-6deg)}
.tip h3{font-size:1rem;font-weight:800;letter-spacing:-.03em;margin-bottom:2px}
.tip p{font-size:.87rem;line-height:1.42;color:#4e4536}
footer.wrap{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #d9d5c8;margin-top:31px;padding:16px 0 24px;color:#716b65;font-size:.81rem}
footer span{display:inline-flex;align-items:center;gap:7px}
footer .ico{width:14px;height:14px}
.gift-heart{fill:#f79e92;stroke:#5c3835}
dialog{width:min(420px,calc(100% - 34px));border:var(--line);border-radius:16px;background:var(--cream);color:var(--ink);padding:23px;box-shadow:5px 6px var(--ink)}
dialog::backdrop{background:#251e3185}
.dialog-head{display:flex;align-items:center;justify-content:space-between}
.dialog-art{width:45px;height:45px;border:var(--line);border-radius:11px;transform:rotate(-7deg);background:var(--purple);display:grid;place-items:center;box-shadow:2px 2px var(--ink)}
.dialog-art .ico{width:26px;height:26px}
dialog h2{font-size:2.1rem;letter-spacing:-.06em;margin:15px 0 10px}
#dialog-body p,#dialog-body li{font-size:1rem;color:#4b4749}
#dialog-body ol{margin:0;padding-left:23px}
#dialog-body li{padding-left:2px;margin-bottom:8px}
#dialog-actions{display:flex;gap:10px;margin-top:20px}
#dialog-actions button{flex:1;padding:5px}
@media(min-width:1500px){.intro{padding-top:43px;padding-bottom:31px}.stage{min-height:525px}}
@media(max-width:960px){.wrap{width:calc(100% - 52px)}.game-layout{gap:18px;grid-template-columns:minmax(0,1fr) 276px}.control-body{padding:16px}.control-card h2{padding:14px 16px}.stage-top{inset:16px 16px auto}.tip{padding:13px}}
.mobile-brand,.mobile-hud,.mobile-dock{display:none}
.color-row{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:15px 0 0}
.color-row>span{font-size:.95rem;font-weight:630}
.swatches{display:flex;align-items:center;gap:5px}
.swatch{position:relative;width:24px;height:24px;padding:0;border:1.5px solid var(--ink);border-radius:50%;background:var(--swatch)}
.swatch[aria-pressed="true"]::after,.sheet-swatch[aria-pressed="true"] .color-ball::after{content:"";position:absolute;left:50%;top:45%;height:5px;width:9px;border-left:2px solid var(--ink);border-bottom:2px solid var(--ink);transform:translate(-50%,-50%) rotate(-45deg)}
.color-chip,.color-ball{width:19px;height:19px;display:inline-block;flex:none;border-radius:50%;border:1.6px solid var(--ink);background:var(--swatch,#ffcf4c)}
.camera-controls{position:absolute;bottom:18px;left:18px;right:18px;display:flex;justify-content:space-between;align-items:center;gap:7px;pointer-events:none}
.camera-group{display:flex;pointer-events:auto;overflow:hidden;border:1.5px solid var(--ink);border-radius:9px;box-shadow:1.5px 2px var(--ink);background:var(--cream)}
.camera-group button{border:none;min-width:38px;min-height:32px;padding:4px 10px;background:transparent;font-size:.81rem}
.camera-group button .ico{width:15px;height:15px}
.camera-group button+button{border-left:1px solid #bfbab1}
.camera-group button:hover{background:#f5eecb}
#next-face{font-size:1.45rem;line-height:1}
button[hidden]{display:none}
.sheet-swatches{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.sheet-swatch,.mode-choice{border:1.5px solid var(--ink);border-radius:10px;background:var(--cream);padding:10px;min-height:45px;justify-content:flex-start}
.sheet-swatch[aria-pressed="true"],.mode-choice[aria-pressed="true"]{background:#f4edda;box-shadow:2px 2px var(--ink)}
.sheet-swatch .color-ball{position:relative;width:24px;height:24px}
.mode-choices{display:grid;gap:10px}
.mode-choice{padding:12px 14px;gap:12px}
.mode-choice .ico{width:24px;height:24px}
.mode-choice span{display:grid;text-align:left}
.mode-choice small{color:var(--soft);font-weight:500}
@media(min-width:741px) and (max-height:790px){
 .topbar-inner{height:58px}.intro{padding:17px 0 18px}h1{font-size:3.7rem}.intro p{margin-top:3px}.control-body{padding:13px 17px 15px}.control-card h2{padding:12px 17px}.progress-heading{margin-top:14px}.stat-row{margin-top:10px}.time-row{margin-top:5px}.actions{margin-top:12px;padding-top:12px}.tip{padding:11px 14px}.sidebar{gap:13px}.color-row{margin-top:12px}footer.wrap{margin-top:20px}
}
@media(max-width:740px), (max-height:520px) and (pointer:coarse){
 body{display:flex;flex-direction:column;height:100vh;height:100dvh;min-height:360px;overflow:hidden}
 .topbar{flex:none;padding-top:env(safe-area-inset-top);border-bottom:1px solid #dbd7ca}
 .wrap{width:100%;max-width:none}
 .topbar-inner{height:52px;padding:0 max(16px,env(safe-area-inset-left))}
 .desktop-brand,.nav-divider,.help-button span,main .intro,main .sidebar,footer.wrap,.stage-top{display:none}
 .mobile-brand{display:flex;align-items:center;gap:7px;font-size:1.55rem;letter-spacing:-.045em;font-weight:800}
 .mobile-brand b{background:var(--gold);border:1.6px solid var(--ink);font-size:.75rem;letter-spacing:0;transform:rotate(-7deg);padding:3px 4px;border-radius:5px;box-shadow:1px 1px var(--ink)}
 .brand-mark{width:31px;height:33px;margin-right:7px}
 .utilities{gap:3px}.utilities button{width:44px;height:44px;border:0;background:transparent;box-shadow:none;padding:0}.utilities .ico{width:21px;height:21px}
 main.wrap{display:flex;flex-direction:column;flex:1;min-height:0}
 .mobile-hud{display:block;background:var(--cream);padding:9px max(17px,env(safe-area-inset-left)) 13px;flex:none}
 .hud-top,.hud-level,.hud-mode,.hud-progress,.mobile-time{display:flex;align-items:center}
 .hud-top{justify-content:space-between}.hud-level{gap:9px}.hud-level strong{font-size:1.25rem;letter-spacing:-.035em}
 .hud-mode{gap:4px;border:1px solid #b88873;border-radius:15px;background:#ffdcc9;font-size:.82rem;padding:3px 9px;min-height:29px}
 .hud-mode .ico{width:14px;height:14px}.hud-mode .chevron{width:12px}.hud-mode[data-mode="expert"]{background:#e1d0fb;border-color:#977cac}
 .hud-progress{margin-top:7px;gap:10px;font-size:.79rem;white-space:nowrap}.hud-progress strong{margin-left:3px}.hud-progress progress{min-width:22px;height:8px;flex:1}.mobile-time{gap:4px;font-variant-numeric:tabular-nums}.mobile-time .ico{width:13px;height:13px}
 .hearts{gap:4px}.hearts .ico{width:20px;height:20px}
 .game-layout{display:flex;flex:1;min-height:0}
 .stage,.stage.enlarged{inset:auto;position:relative;min-height:0;height:auto;flex:1;border:0;border-top:2px solid var(--ink);border-bottom:2px solid var(--ink);border-radius:0;box-shadow:none;background-size:13px 13px}
 .floor-shadow{width:46%;top:78%}
 .sparkle-one{width:7.5%;left:8%;top:20%}.sparkle-two{width:5%;right:5%;bottom:22%}.orbit{width:9%;bottom:14%;left:5%}
 .board-message{top:12px;bottom:auto;font-size:.8rem;border-width:1px;padding:5px 12px;box-shadow:none;background:#f6f0ffeb;max-width:calc(100% - 26px);white-space:normal;text-align:center}
 .camera-controls{left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));bottom:12px}.camera-group{border-radius:11px;box-shadow:2px 2px var(--ink)}
 .camera-group button{min-width:44px;min-height:42px;padding:6px 11px;font-size:.88rem;gap:5px}.camera-group .ico{width:18px;height:18px}
 .mobile-dock{display:flex;align-items:center;gap:9px;padding:12px max(14px,env(safe-area-inset-right)) max(13px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));background:var(--cream);flex:none}
 .mobile-dock>button{height:47px;border:1.8px solid var(--ink);background:var(--cream);border-radius:10px;box-shadow:2px 2px var(--ink);font-size:.94rem;gap:7px}
 .mobile-dock .dock-primary{flex:1.16;background:var(--gold)}#mobile-color{flex:1}#mobile-restart{width:46px}
 .mobile-dock .ico{width:19px;height:19px}.mobile-dock .count-badge{font-size:.75rem}
 .key-controls{bottom:65px}
 dialog{margin:auto 0 0;width:100%;max-width:100%;max-height:85dvh;border:2px solid var(--ink);border-bottom:0;border-radius:22px 22px 0 0;padding:19px 21px max(24px,env(safe-area-inset-bottom));box-shadow:none}
 dialog h2{font-size:1.85rem;margin:12px 0}
 dialog .action{min-height:45px}
}
@media(max-height:570px) and (pointer:coarse) and (orientation:landscape){
 body{min-height:250px;display:grid;grid-template-columns:1fr 164px;grid-template-rows:50px 1fr}
 .topbar{grid-column:1 / -1}.topbar-inner{height:48px}
 main.wrap{display:grid;grid-column:1 / -1;grid-template-columns:minmax(0,1fr) 164px;grid-template-rows:auto 1fr;min-height:0}
 .game-layout{grid-column:1;grid-row:1/3}.mobile-hud,.mobile-dock{grid-column:2}.mobile-hud{padding:11px}.hud-top,.hud-progress{align-items:flex-start;flex-direction:column;gap:5px}.hud-progress progress{width:100%;min-height:8px;flex:none}
 .mobile-dock{flex-direction:column;align-items:stretch;justify-content:flex-end;padding:10px}.mobile-dock>button,#mobile-color,#mobile-restart{width:100%;min-height:36px;height:38px;flex:none}.stage{border-right:2px solid var(--ink)}
 .board-message{top:5px}.camera-controls{bottom:6px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
