/* Quiet layout; motion and light carry the feedback. */
:root{--muted:#ddd1c9;--mint:#ffc599}
.mission-title{margin:12px 0 24px}.mission-title h1{color:#fff5eb}.mission-title>span,.mission-title p{display:none}
.brand{color:#fff5ec}.header-tools .iconbutton{background:none;border:0;box-shadow:none;color:#f2ddd0}
.board-shell{background:none;border:0;padding:3px;box-shadow:none;border-radius:0;overflow:visible}.board{background:none;padding:0;box-shadow:none;border-radius:0;gap:7px;overflow:visible}.board-halo{inset:-12px;background:radial-gradient(ellipse,#fd874522,transparent 70%)}
.cell{border-color:#ffffff2e;box-shadow:inset 0 1px 2px #ffffff60,inset 0 -2px 4px #0008,0 5px 8px #0005}.cell:after{font-size:11px!important;color:#fff9ed;opacity:.9;right:7px;bottom:6px}.cell[data-state=marked]:after{opacity:1}.cell[data-state=marked]{filter:brightness(.75)}
.session-switch .nav{font-size:15px;color:#d6c9c2}.session-switch .nav.active{color:#fff9f2}.level-button{font-size:18px;color:#fff1e5;background:none;border:0;box-shadow:none}.level-button span{color:#c6b6a9}
.puzzle-status{font-size:15px;color:#f4dfcf;padding:18px 4px}.assist .tool{color:#ead8cc}.assist .tool:disabled{opacity:.45}.assist #how{color:#ddc8bb;font-size:22px}.assist #undo,.assist #restart{border:0;background:none;box-shadow:none}.assist #hint{border-color:#ffdcc780;color:#fff7ec}#hintCount{font-size:12px;width:20px;height:20px;top:10px;left:105px}#announcement,#toast{font-size:16px;line-height:1.5}
.modal-inner{padding:30px}.modal-top h2{font-size:30px;color:#fff3e9}.modal-copy,.victory p{font-size:16px;color:#e3d7ce;line-height:1.65}.setting-row{font-size:17px;color:#fff0e5}.setting-row button:not(.mars-switch){font-size:15px}.setting-row .mars-switch,.native-switch .native-on,.native-switch .native-off{font-size:14px}.native-switch .native-on,.native-switch .native-off{top:16px}
.primary{font-size:17px}.secondary{font-size:16px;color:#e5d4c8}.close{font-size:25px;color:#e8d4c5}.level-tile{background:none!important;box-shadow:none!important;border-color:transparent;font-size:20px}.level-tile small{font-size:12px;color:#d6c1b0}.level-tile.current{border-color:#ffbe8e;background:#ff8a4022!important}.chapter-select button{font-size:15px!important;color:#ded1c7}.collectible{background:none;border:0;box-shadow:none}.collectible strong{font-size:16px}.collectible small{font-size:14px;color:#dbcbc0}.collectible.locked{opacity:.6}.phone-link{padding:0!important;border:0;box-shadow:none;background:none;backdrop-filter:none}.phone-link span{font-size:11px!important;color:#f0ddca}
#trainingPanel{border:0;border-radius:0;background:none;box-shadow:none;padding:12px 0}#trainingPanel small{display:none}#trainingText{font-size:17px;color:#fff0e2}#trainingPanel button{font-size:15px}#trainingContinue{font-size:17px!important}
.rules-simple p{display:flex;justify-content:space-between;gap:22px;padding:17px 0;border-bottom:1px solid #ffffff12;margin:0;font-size:16px}.rules-simple strong{color:#ffe0c4;min-width:105px}.rules-simple span{color:#e1d6cc;text-align:right;line-height:1.5}.more-rules{margin:22px 0;font-size:15px;color:#d8c9bc}.more-rules summary{cursor:pointer;min-height:32px}.rules-simple~.primary{width:100%}
/* The first screen is the identity itself, never a card over a card. */
#modal.launch-screen{position:fixed;inset:0;margin:0;width:100vw;max-width:none;height:100svh;max-height:none;border:0;border-radius:0;padding:0;background:radial-gradient(ellipse at 50% 32%,#65362530,transparent 60%),linear-gradient(#111115b0,#111115c9),url('assets/mars-canyon.webp') center 70%/cover;box-shadow:none;backdrop-filter:none;overflow:auto}
.launch-screen::backdrop{background:#111115;backdrop-filter:none}.launch-screen #modalBody{height:100%;width:100%}.launch-screen .welcome{min-height:100%;padding:50px 24px calc(40px + env(safe-area-inset-bottom));background:none;border:0;border-radius:0;box-shadow:none;display:flex;justify-content:center;gap:0;text-align:center}
.launch-emblem{width:116px;height:116px;fill:none;stroke:#ffc59b;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 0 25px #ff9c4755);animation:emblemFloat 6s ease-in-out infinite}.launch-orbit{stroke:#fff1dc;stroke-dasharray:100;animation:orbitInk 1.8s cubic-bezier(.2,1,.3,1) both}
.launch-screen .welcome h2{font:700 clamp(76px,19vw,140px)/1 Oxanium,sans-serif;letter-spacing:-5px;margin:22px 0 10px;color:#fff4e8;text-shadow:0 4px 35px #0008}.launch-screen .welcome p{font-size:20px;letter-spacing:.3px;color:#f0d8c2;margin:10px 0 48px}.launch-screen .welcome .primary{width:min(280px,85vw);min-height:58px;font-size:17px}.launch-screen .welcome .secondary{font-size:16px;min-height:48px;margin-top:17px}
@keyframes emblemFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}@keyframes orbitInk{from{stroke-dashoffset:100;opacity:0}to{stroke-dashoffset:0;opacity:1}}
dialog:not(.launch-screen)[open]{animation:panelArrive .24s cubic-bezier(.2,1,.3,1)}@keyframes panelArrive{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
.cell.occupied .gem-idle{animation:microbeDrift 7s ease-in-out infinite}.cell.hinted,.training-target{animation:scanBeacon 1.5s ease-in-out infinite;box-shadow:inset 0 0 0 2px #fff4d1,0 0 18px #ffb97766!important}@keyframes scanBeacon{0%,100%{filter:brightness(1.05)}50%{filter:brightness(1.3)}}
button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid #ffe3c8;outline-offset:5px}
@media(hover:hover) and (pointer:fine){@media(hover:hover) and (pointer:fine){.cell:not(.occupied):hover{transform:translateY(-2px);filter:brightness(1.18);box-shadow:inset 0 1px 2px #fff9,0 7px 14px #0006}}@media(hover:hover) and (pointer:fine){.header-tools .iconbutton:hover,.level-button:hover{color:#fff;background:#ffe3c610}}@media(hover:hover) and (pointer:fine){.assist .tool:not(:disabled):hover{transform:translateY(-2px);filter:brightness(1.25)}}@media(hover:hover) and (pointer:fine){.primary:hover{filter:brightness(1.13);transform:translateY(-2px)}}@media(hover:hover) and (pointer:fine){.secondary:hover{color:#fff}}@media(hover:hover) and (pointer:fine){.mars-switch:hover .switch-thumb{filter:brightness(1.15)}}}
.primary,.secondary,.header-tools .iconbutton,.level-button{transition:transform .2s,filter .2s,color .2s,background-color .2s}.primary:active,.secondary:active{transform:scale(.97)}
@media(max-width:850px){.mission-title{display:none}main{padding-top:18px}.puzzle-heading{margin-bottom:24px}.board-stage{margin-top:0}.launch-screen .welcome{padding-top:28px}.launch-emblem{width:100px;height:100px}}
@media(max-width:480px){header{height:74px}.puzzle-status{font-size:14px}.puzzle-heading{height:54px}.board{gap:6px}.cell:after{font-size:12px!important}.modal-inner{padding:25px}.setting-row{min-height:72px}#hintCount{left:103px}.rules-simple p{font-size:16px;gap:12px}}
@media(max-height:740px) and (max-width:850px){header{height:62px}main{padding-top:8px}.puzzle-heading{margin-bottom:19px}.launch-emblem{width:80px;height:80px}.launch-screen .welcome h2{font-size:76px;margin:12px 0}.launch-screen .welcome p{margin-bottom:30px}.puzzle-status{padding:16px 4px}.session-switch .nav{line-height:34px}}
@media(min-width:1050px){main{max-width:min(560px,calc(100svh - 245px))}.mission-title h1{font-size:clamp(90px,12vw,160px)}.mission-title{top:32%}}
@media(prefers-reduced-motion:reduce){.launch-emblem,.launch-orbit,dialog[open],.cell.hinted,.training-target{animation:none!important}}body.reduced .launch-emblem,body.reduced .launch-orbit,body.reduced dialog[open]{animation:none!important}
.primary{color:#24180f;font-weight:700;text-shadow:0 1px 0 #fff0da55}.session-switch .nav.active{color:#26170f;text-shadow:0 1px 0 #ffebda55}
@media(min-width:1050px){main{max-width:min(560px,calc(100svh - 265px))}}

.training .controls,.training .puzzle-heading{display:none}.training .play-area{display:flex;flex-direction:column}.training #trainingPanel{order:0;margin:0 0 18px;padding:0}.training .board-stage{order:1}.training .puzzle-status{order:2}.training #announcement{order:3}.training #trainingPanel p{margin:8px 0;font-size:18px}.training #skipTraining{font-size:15px;min-height:38px}.training #trainingContinue{min-height:44px}.training #guideHand{pointer-events:none}.training .brand{pointer-events:none}

/* Guided spotlight: only the demonstrated sample is active. */
.training .mission-title,.training .phone-link,.training .puzzle-status{display:none}
.training #trainingPanel small{display:block;font:700 13px Oxanium,sans-serif;letter-spacing:2px;color:#ffd29e}
.training #trainingPanel #trainingText{font:700 clamp(23px,5.8vw,30px)/1.2 Oxanium,sans-serif;color:#fff;margin:12px 0 8px}
.training #trainingPanel #trainingHelp{font-size:16px;line-height:1.45;color:#ffe1c8;max-width:370px;margin:0 auto 8px;min-height:46px}
.training #skipTraining{color:#dacbbb!important}
.training .cell.training-muted{opacity:.22;filter:saturate(.2) brightness(.65);cursor:default;transform:none}
.training .cell.training-target{z-index:12;overflow:visible;opacity:1;filter:none!important;animation:tutorialBeacon 1.3s ease-in-out infinite!important;outline:3px solid #fff3d5;outline-offset:3px;box-shadow:0 0 0 9px #ff9a4530,0 0 38px #ff993aaa!important}
.training .cell.training-target:after{content:attr(data-tutorial-action);top:-25px;bottom:auto;right:50%;transform:translateX(50%);white-space:nowrap;opacity:1;color:#1c100a;background:#fff2d7;padding:3px 7px;border-radius:5px;font:800 11px Oxanium,sans-serif;letter-spacing:.6px}
.training #guideHand{width:48px;z-index:20;filter:drop-shadow(0 3px 3px #000)}
.training #trainingContinue{padding:12px 24px;border-radius:30px;background:#ffe3b4;color:#24180e!important;font-weight:700;margin:10px}
@keyframes tutorialBeacon{0%,100%{transform:scale(1)}50%{transform:scale(1.055)}}
@media(prefers-reduced-motion:reduce){.training .cell.training-target{animation:none!important}}body.reduced.training .cell.training-target{animation:none!important}

.training .board,.training .board-shell{overflow:visible}

/* Marsdoku botanical wordmark. */
.mission-title h1{font-size:clamp(38px,9vw,66px);letter-spacing:-2px}.launch-screen .welcome h2{font-size:clamp(38px,11vw,68px);letter-spacing:-2px}.brand{letter-spacing:2px;font-size:15px}.cell.occupied .gem-idle{transform-origin:50% 90%;animation:plantSway 5s ease-in-out infinite}@keyframes plantSway{0%,100%{transform:rotate(-3deg) scale(.97)}50%{transform:rotate(3deg) scale(1.02)}}
@media(prefers-reduced-motion:reduce){.cell.occupied .gem-idle{animation:none!important}}body.reduced .cell.occupied .gem-idle{animation:none!important}

/* Consistent controls: circular tools and precise pill switches. */
button{-webkit-tap-highlight-color:transparent}button:disabled{cursor:default}
.header-tools .iconbutton,.assist .tool,.close{border-radius:50%;display:inline-grid;place-items:center;min-width:44px;min-height:44px}
.modal-actions button,.setting-row>button:not(.mars-switch),.chapter-select button,#trainingContinue,#skipTraining,.welcome button,#cinemaBar button{border-radius:999px;min-height:44px;padding:10px 20px;transition:background .18s,transform .18s,border-color .18s}
.setting-row>button:not(.mars-switch),.secondary,.chapter-select button{background:#ffffff09;border:1px solid #ffffff25;color:#fff0e1;box-shadow:inset 0 1px 0 #ffffff0c}

.primary,#trainingContinue{background:linear-gradient(145deg,#ffebc7,#eeb16e);border:1px solid #ffdfab;color:#24180f!important;font-weight:700;box-shadow:inset 0 1px 0 #ffffff8c,0 4px 18px #0003}
.setting-row .mars-switch{box-sizing:border-box;position:relative;display:block;width:90px;height:46px;min-width:90px;min-height:46px;flex-shrink:0;border-radius:999px;overflow:hidden;padding:0 12px;text-align:right;font:700 13px Oxanium,sans-serif;border:1px solid #ffffff27;background:#18191d;color:#d2c6bb;box-shadow:inset 0 2px 5px #0005;line-height:44px;transition:background .25s,border-color .25s}
.setting-row .mars-switch[aria-checked=true],.setting-row .native-switch:has(input:checked){background:linear-gradient(120deg,#a95025,#d58b52);color:#fff8ee;border-color:#efbb8870;text-align:left}
.setting-row .switch-thumb{box-sizing:border-box;top:4px;left:4px;width:36px;height:36px;border-radius:50%;border:1px solid #fff7;background:linear-gradient(145deg,#fff5e5,#d4c7b6);box-shadow:0 2px 5px #0004,inset 0 1px 0 #fff;transition:transform .25s cubic-bezier(.22,1,.36,1);transform:translateX(0)}
.setting-row .switch-thumb:after,.setting-row .switch-thumb i{display:none}
.setting-row .mars-switch[aria-checked=true] .switch-thumb,.setting-row .native-switch input:checked~.switch-thumb{transform:translateX(44px);background:linear-gradient(145deg,#fff7eb,#e5d1b7);border-color:#fff9;box-shadow:0 2px 5px #0004,inset 0 1px 0 #fff}
.setting-row .native-on,.setting-row .native-off{top:50%;transform:translateY(-50%);font:700 13px Oxanium,sans-serif;line-height:1}.setting-row .native-on{left:12px}.setting-row .native-off{right:12px}
@media(hover:hover){@media(hover:hover) and (pointer:fine){.setting-row>button:not(.mars-switch):hover,.secondary:hover,.chapter-select button:hover{background:#ffffff15;border-color:#ffd2a955}}@media(hover:hover) and (pointer:fine){.mars-switch:hover{border-color:#ffe6bc90}}@media(hover:hover) and (pointer:fine){.close:hover,.assist .tool:not(:disabled):hover{background:#ffffff12}}}
button:active:not(.cell){transform:scale(.96)}.mars-switch:active{transform:none!important}.cell.occupied svg{filter:drop-shadow(0 3px 4px #0005) drop-shadow(0 0 5px #adff7855)}

body:before{background:linear-gradient(#111115e0,#11111565 45%,#11111528),url('assets/mars-valley.webp') center 65%/cover;opacity:.85}.launch-screen .welcome{background:radial-gradient(ellipse at 50% 45%,#11111522,transparent 65%),linear-gradient(#11111555,#11111505 60%,#11111555),url('assets/mars-valley.webp') center/cover}.launch-screen .welcome p{color:#fff1df;text-shadow:0 2px 8px #000}.launch-emblem{filter:drop-shadow(0 0 24px #ffa35b44)}

/* Instructions point; rules preserve the board’s actual colors. */
.training .cell.training-muted{opacity:1;filter:none}.training .cell.training-target{animation:none!important;transform:none!important;outline:3px solid #fff0d0;outline-offset:1px;filter:none!important;box-shadow:0 0 0 4px #111115!important}.training .cell.training-target:after{top:-23px;background:#fff0d0;color:#25170d;font-size:10px}.training .cell[data-state=marked]{filter:none!important}.training .cell .xmark{color:#fff3e1;font-size:32px;font-weight:500}.training .lesson-area{box-shadow:inset 0 0 0 2px #ffe4b9!important}.training #trainingHelp{min-height:68px!important}.training .cell.occupied svg{filter:drop-shadow(0 2px 2px #0005)!important}.training .cell.occupied .gem-idle{animation:none!important}
@media(hover:hover){@media(hover:hover) and (pointer:fine){.cell:not(.occupied):hover{filter:none;box-shadow:inset 0 0 0 1px #fff8,0 5px 10px #0005}}@media(hover:hover) and (pointer:fine){.training .cell:hover{transform:none;filter:none}}}
.cell.hinted{animation:none;filter:none;outline:2px solid #ffe7b9;outline-offset:1px;box-shadow:0 0 0 4px #111115!important}

.training .cell:disabled{opacity:1!important}.training .cell.occupied{background:var(--region-bg);box-shadow:inset 0 1px 0 #ffffff33!important}.training .cell.occupied.lesson-area{box-shadow:inset 0 0 0 2px #ffe4b9!important}

/* Bespoke Marsdoku brand assets, without card framing. */
.brand{gap:9px}.brand-app-icon{width:28px;height:28px;border-radius:7px;flex-shrink:0}.brand-wordmark{display:block;width:144px;height:auto;object-fit:contain}.mission-title .brand-wordmark{width:min(440px,85vw);margin:auto}.launch-screen .welcome h2{width:min(760px,94vw);margin:0 0 12px;font-size:0;line-height:0;text-shadow:none}.launch-wordmark{width:100%;height:auto;display:block;filter:drop-shadow(0 7px 24px #0008);animation:brandArrive .7s cubic-bezier(.22,1,.36,1) both}.launch-screen .welcome p{margin-top:12px}.training .brand-wordmark{width:132px}@keyframes brandArrive{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){.launch-wordmark{animation:none}}body.reduced .launch-wordmark{animation:none}

/* One identity, one lesson, levels only. */
header{position:relative;display:flex;align-items:center;justify-content:center}
header .brand{position:absolute;left:50%;transform:translateX(-50%);z-index:1}
header .brand-wordmark,.training header .brand-wordmark{width:230px}
.header-tools{width:100%;display:flex;justify-content:space-between;align-items:center}
.puzzle-heading{justify-content:center}.level-button{font-size:18px;min-width:132px}
.assist #hint{display:inline-flex;align-items:center;gap:9px;min-width:128px;padding:0 15px;border-radius:999px;font-size:17px;background:#fce1be12}
.assist #hint svg{width:21px;height:21px}
.assist #hintCount{position:static;display:inline;inset:auto;width:auto;height:auto;font-size:16px;line-height:1;background:none;border:0;color:#ffd39e}
.launch-screen .welcome h2{width:min(420px,82vw)}
.launch-stacked-wordmark{max-height:300px;object-fit:contain}
@media(max-width:480px){header .brand-wordmark,.training header .brand-wordmark{width:200px}.launch-stacked-wordmark{max-height:230px}.launch-screen .welcome h2{width:82vw}}
@media(max-height:740px) and (max-width:850px){.launch-stacked-wordmark{max-height:205px}}
.assist #hint:after{content:none}.assist #hintCount{align-self:center;margin:0;box-shadow:none;flex-shrink:0}.assist #hint{justify-content:center;width:auto;flex-shrink:0}

#languageSelect{max-width:62%;min-height:48px;padding:10px 32px 10px 14px;border:1px solid #ffd9c64d;border-radius:15px;background:#241b18;color:#fff1df;font:500 16px system-ui,sans-serif;cursor:pointer}#languageSelect option{background:#241b18;color:#fff1df}#languageSelect:focus-visible{outline:2px solid #ffcc9b;outline-offset:4px}.setting-row{gap:16px}.setting-row>span{min-width:0;overflow-wrap:anywhere}.setting-row .mars-switch{flex-shrink:0}
:lang(ar){font-family:system-ui,sans-serif;letter-spacing:0!important}html[dir=rtl] .board-stage,html[dir=rtl] header,html[dir=rtl] .puzzle-status,html[dir=rtl] .mars-switch{direction:ltr}html[dir=rtl] .modal-top,html[dir=rtl] .setting-row{direction:rtl}html[dir=rtl] #trainingPanel{text-align:center}html[dir=rtl] .setting-row .mars-switch{font-size:14px}html[lang=ja] #trainingText,html[lang=zh-Hans] #trainingText{line-height:1.5;letter-spacing:0}body:not([data-l10n-ready]) header,body:not([data-l10n-ready]) main{visibility:hidden}

/* Keep the playing field aligned with the centered wordmark. */
@media(min-width:851px){main{margin-left:auto;margin-right:auto}}
.cell svg{width:80%;height:80%;left:10%;top:10%}

/* Unbranded video placement preview. */
.ad-slot-preview{width:min(640px,calc(100vw - 32px));max-height:calc(100svh - 32px);padding:0;border-radius:26px;overflow:auto;background:#171416;color:#fff1df}
.ad-slot-preview section{padding:20px}
.ad-slot-preview header{position:static;display:flex;align-items:center;justify-content:space-between;width:100%;height:auto;padding:0;margin:0 0 18px;max-width:none;font-size:16px;font-weight:600}
.ad-slot-preview .iconbutton{font-size:26px;width:44px;height:44px;border-radius:50%}
.ad-slot-stage{aspect-ratio:16/9;position:relative;display:grid;place-items:center;overflow:hidden;border-radius:16px;background:radial-gradient(ellipse at 50% 100%,#f0793333,transparent 70%),#0b0b0d;isolation:isolate}
.ad-slot-stage strong{font:600 clamp(24px,5vw,38px) Oxanium,sans-serif;color:#fff1df;z-index:1}
.ad-slot-orbit{position:absolute;width:220px;height:220px;border:1px solid #f6bd8133;border-radius:50%;box-shadow:0 0 65px #e0732720,inset 0 0 60px #e0732710}
.ad-slot-track{height:5px;border-radius:99px;background:#ffffff24;overflow:hidden;margin-top:20px;direction:ltr}
.ad-slot-track i{display:block;width:100%;height:100%;border-radius:inherit;background:#ffc486;transform:scaleX(0);transform-origin:left}
.ad-slot-preview footer{position:static;display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;padding:0;opacity:1;font-size:15px;color:#ead1bd}
.ad-slot-preview footer .secondary{margin:0;width:auto;min-height:44px;padding:10px 18px}

#analyticsChoice{position:fixed;z-index:12;bottom:max(16px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(540px,calc(100% - 32px));padding:16px 20px;background:#211b18f5;color:#fff1df;border:1px solid #e7b98a55;border-radius:20px;box-shadow:0 8px 40px #0009;backdrop-filter:blur(14px);font-size:16px}
#analyticsChoice p{margin:0 0 12px;line-height:1.5}#analyticsChoice div{display:flex;align-items:center;gap:12px;flex-wrap:wrap}#analyticsChoice button,#analyticsChoice a{font:600 15px Oxanium,sans-serif;min-height:44px;padding:10px 14px;border-radius:99px;color:#fff1df;background:#ffffff0b;border:1px solid #ffffff30;text-decoration:none}#analyticsChoice #analyticsAccept{background:#edc291;color:#24170e;border-color:transparent}@media(hover:hover) and (pointer:fine){#analyticsChoice button:hover{filter:brightness(1.12)}}.setting-row>a{color:#ffdfb4;font-size:16px;padding:12px}.noscript-info{position:relative;z-index:20;margin:40px auto;max-width:600px;padding:24px;background:#171316;color:#fff1df;font-size:18px}

/* Center the primary action independently of the help button. */
.controls{position:relative}
.assist{width:max-content;max-width:100%;margin-inline:auto;grid-template-columns:44px auto 44px;gap:12px;align-items:center}
.assist #undo{grid-column:1;grid-row:1}
.assist #hint{grid-column:2;grid-row:1;width:160px;height:54px;min-height:54px;border-radius:999px;border:1px solid #efc79588;background:linear-gradient(145deg,#f6d3a32b,#4c2e1e73 70%);box-shadow:inset 0 1px 1px #fff0da55,inset 0 -1px 1px #0c090b88,0 6px 18px #0004;color:#fff0d7;font:600 17px Oxanium,sans-serif;justify-content:center;gap:9px;transition:transform .16s ease,background .16s ease,box-shadow .16s ease}
.assist #hint>span{font:inherit;color:inherit}
.assist #hintCount{font:700 16px Oxanium,sans-serif;color:#ffc889;position:static;align-self:center;margin:0;padding:0;background:none;box-shadow:none}
.assist #restart{grid-column:3;grid-row:1}
.assist #how{position:absolute;width:44px;height:44px;left:calc(100% + 8px);top:50%;transform:translateY(-50%)}@media(hover:hover) and (pointer:fine){
.assist #hint:not(:disabled):hover{background:linear-gradient(145deg,#f6d3a344,#7043268c 70%);box-shadow:inset 0 1px 1px #fff0da77,0 8px 22px #0005;filter:none;transform:translateY(-1px)}}
.assist #hint:not(:disabled):active{transform:translateY(1px);box-shadow:inset 0 2px 5px #0004}
.assist #hint:focus-visible{outline:2px solid #fff0d7;outline-offset:4px}@media(hover:hover) and (pointer:fine){
.assist #how:not(:disabled):hover{transform:translateY(-50%)}}
@media(max-width:480px){.assist{gap:10px}.assist #hint{width:128px;height:52px;min-height:52px;font-size:16px}}
@media(max-width:360px){.assist #how{left:50%;top:calc(100% + 5px);transform:translateX(-50%)}@media(hover:hover) and (pointer:fine){.assist #how:not(:disabled):hover{transform:translateX(-50%)}}.controls{padding-bottom:49px}}

/* Landing language control stays available before the first tutorial gesture. */
.launch-screen .welcome{position:relative;padding-top:100px}
.welcome-language{position:absolute;top:max(24px,env(safe-area-inset-top));right:24px;display:flex;align-items:center;gap:9px;padding:0 14px;border:1px solid #efd3ae66;border-radius:999px;background:#1b1514b8;color:#fff0d7;box-shadow:inset 0 1px 0 #fff2;max-width:calc(100% - 48px)}
.welcome-language svg{width:20px;height:20px;flex-shrink:0;pointer-events:none}
.welcome-language select{width:auto;max-width:100%;min-width:0;min-height:48px;border:0;background:transparent;color:inherit;font:500 16px system-ui,sans-serif;padding:8px 4px;cursor:pointer}
.welcome-language select option{background:#241b18;color:#fff1df}
.welcome-language:focus-within{outline:2px solid #ffdab0;outline-offset:4px}
.launch-screen .welcome h2{margin-inline:auto;width:min(440px,82vw)}
.launch-stacked-wordmark{width:100%;height:auto;max-height:300px;object-fit:contain}
@media(max-width:480px){.welcome-language{right:18px;top:max(18px,env(safe-area-inset-top));max-width:calc(100% - 36px)}.launch-stacked-wordmark{max-height:240px}}
@media(max-height:700px){.launch-screen .welcome{padding-top:90px;padding-bottom:24px}.launch-stacked-wordmark{max-height:205px}.launch-screen .welcome p{margin-bottom:24px}}

.welcome-language select{outline:none}

/* Landing audio control mirrors the language pill without competing with the logo. */
.launch-screen .welcome .welcome-sound{position:absolute;top:max(24px,env(safe-area-inset-top));left:24px;display:grid;place-items:center;width:50px;height:50px;min-height:50px;padding:0;margin:0;border:1px solid #efd3ae66;border-radius:50%;background:#1b1514b8;color:#fff0d7;box-shadow:inset 0 1px 0 #fff2;transition:background .18s,border-color .18s,transform .18s}
.welcome-sound svg{width:24px;height:24px;pointer-events:none}@media(hover:hover) and (pointer:fine){
.launch-screen .welcome .welcome-sound:hover{background:#563323;border-color:#ffdab0;transform:translateY(-2px)}}
.launch-screen .welcome .welcome-sound:active{transform:scale(.94)}
.welcome-sound:focus-visible{outline:2px solid #ffdab0;outline-offset:4px}
.launch-screen .welcome h2{margin-bottom:34px}
@media(max-width:480px){.launch-screen .welcome .welcome-sound{left:18px;top:max(18px,env(safe-area-inset-top))}.welcome-language{max-width:calc(100% - 104px)}}

.language-picker{position:relative;color:#fff0d7;font:500 16px system-ui,sans-serif;z-index:12}
.language-picker summary{list-style:none;display:flex;align-items:center;gap:9px;min-height:48px;padding:0 14px;border:1px solid #efd3ae66;border-radius:999px;background:#1b1514e8;box-shadow:inset 0 1px 0 #fff2;cursor:pointer;transition:background .18s,border-color .18s}
.language-picker summary::-webkit-details-marker{display:none}.language-picker summary svg{width:20px;height:20px;flex-shrink:0}.language-picker summary .picker-chevron{width:16px;height:16px;transition:transform .18s}.language-picker[open] .picker-chevron{transform:rotate(180deg)}@media(hover:hover) and (pointer:fine){
.language-picker summary:hover{border-color:#ffdab0;background:#563323}}.language-picker summary:focus-visible{outline:2px solid #ffdab0;outline-offset:4px}
.language-picker.welcome-language{position:absolute;display:block;padding:0;border:0;background:none;box-shadow:none;max-width:calc(100% - 154px)}
.language-menu{position:absolute;inset-inline-end:0;top:calc(100% + 10px);width:244px;max-width:calc(100vw - 36px);max-height:min(430px,60dvh);overflow:auto;padding:8px;border:1px solid #efd3ae55;border-radius:22px;background:linear-gradient(135deg,#39251ff5,#171313fa);box-shadow:0 18px 55px #0009,inset 0 1px 0 #fff2;backdrop-filter:blur(18px);animation:pickerArrive .18s ease-out}
.language-menu button{display:flex!important;align-items:center;justify-content:space-between;width:100%;min-height:44px;margin:0!important;padding:10px 14px!important;border:0!important;border-radius:14px!important;background:none!important;color:#fff0d7!important;font:500 16px system-ui,sans-serif!important;box-shadow:none!important;text-align:start;transition:background .15s}@media(hover:hover) and (pointer:fine){
.language-menu button:hover,.language-menu button:focus-visible{background:#ffffff15!important;outline:0}}.language-menu button[aria-pressed=true]{background:#ffb36b20!important;color:#ffdbac!important}.language-check{color:#ffb970}
.launch-screen .welcome .welcome-settings{position:absolute;left:84px;top:max(24px,env(safe-area-inset-top));display:grid;place-items:center;width:50px;height:50px;min-height:50px;padding:0;margin:0;border:1px solid #efd3ae66;border-radius:50%;background:#1b1514b8;color:#fff0d7;box-shadow:inset 0 1px 0 #fff2;transition:background .18s,border-color .18s,transform .18s}
.welcome-settings svg{width:24px;height:24px;pointer-events:none}@media(hover:hover) and (pointer:fine){.launch-screen .welcome .welcome-settings:hover{background:#563323;border-color:#ffdab0;transform:translateY(-2px)}}.launch-screen .welcome .welcome-settings:active{transform:scale(.94)}.welcome-settings:focus-visible{outline:2px solid #ffdab0;outline-offset:4px}
@keyframes pickerArrive{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@media(max-width:480px){.launch-screen .welcome .welcome-settings{left:78px;top:max(18px,env(safe-area-inset-top))}.language-picker summary{padding:0 11px;gap:7px}.language-picker.welcome-language{max-width:calc(100% - 150px)}}
@media(prefers-reduced-motion:reduce){.language-menu{animation:none}.picker-chevron{transition:none}}

.welcome-language .language-menu{left:auto;right:0}.language-picker summary span{white-space:nowrap}

.language-picker.welcome-language:focus-within{outline:none}

/* Shared secondary action surface: quiet, tangible, and consistently readable. */
.secondary,.launch-screen .welcome .secondary,.setting-row>button.secondary,.setting-row>a.secondary,.chapter-select button,#cinemaBar button.secondary{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:11px 22px;border:1px solid #e8bb8f66;border-radius:999px;background:linear-gradient(145deg,#49362bf2,#241c18f2);box-shadow:inset 0 1px 0 #ffefdb1f,0 3px 8px #0003;color:#fff0d7;font-size:16px;font-weight:500;line-height:1.3;text-decoration:none;transition:background .18s,border-color .18s,box-shadow .18s,transform .18s}@media(hover:hover) and (pointer:fine){
.secondary:not(:disabled):hover,.launch-screen .welcome .secondary:hover,.setting-row>button.secondary:hover,.setting-row>a.secondary:hover,.chapter-select button:hover,#cinemaBar button.secondary:hover{background:linear-gradient(145deg,#634532,#35241df2);border-color:#ffd1a3;box-shadow:inset 0 1px 0 #ffefdb33,0 5px 14px #0004;color:#fff8eb;transform:translateY(-1px)}}
.secondary:not(:disabled):active,.chapter-select button:active{transform:scale(.97);box-shadow:inset 0 2px 6px #0004}
.secondary:focus-visible,.chapter-select button:focus-visible{outline:2px solid #ffe0b6;outline-offset:4px}
.launch-screen .welcome .secondary{width:min(280px,85vw)}
.training #skipTraining{min-height:44px;font-size:16px;color:#fff0d7!important;margin-top:12px}
.setting-row>a.secondary{min-width:78px}.chapter-select button.active{background:#704b32;border-color:#ffc58f;color:#fff5e4}
.level-button.secondary{font-size:16px;min-height:44px;padding:9px 18px}.secondary:disabled{transform:none;opacity:.4}
@media(prefers-reduced-motion:reduce){.secondary,.chapter-select button{transition:none}}

.secondary[hidden]{display:none!important}

/* Keep landing actions clear of the consent banner on short and mobile screens. */
.launch-screen:has(#analyticsChoice) .welcome{padding-bottom:210px}
@media(max-width:480px){.launch-screen:has(#analyticsChoice) .welcome{padding-bottom:240px}.launch-screen:has(#analyticsChoice) .launch-stacked-wordmark{max-height:210px}}

/* Measure and anchor tutorial callouts within the visible browser viewport. */
.training .cell.training-target:after{display:none}
#trainingTooltip{position:fixed;z-index:25;width:max-content;max-width:calc(100vw - 24px);padding:7px 12px;border-radius:10px;border:1px solid #fff6d8;background:#fff0d0;color:#25170d;box-shadow:0 4px 16px #0006;font:700 14px/1.3 Oxanium,sans-serif;text-align:center;overflow-wrap:anywhere;pointer-events:none}
#trainingTooltip[hidden]{display:none!important}

/* Persistent onboarding actions use the same cream primary and copper secondary buttons. */
.training main{padding-bottom:120px}
#trainingActions{position:fixed;left:50%;bottom:max(16px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:24;display:flex;align-items:center;justify-content:center;gap:12px;width:min(520px,calc(100% - 32px));padding:8px 0}
#trainingActions:before{content:'';position:absolute;left:50%;top:-20px;bottom:calc(-1 * max(16px,env(safe-area-inset-bottom)));width:100vw;transform:translateX(-50%);background:linear-gradient(transparent,#130d0bea 45%);z-index:-1;pointer-events:none}
#trainingActions[hidden],body:not(.training) #trainingActions{display:none!important}
.training #trainingActions #trainingContinue{flex:1;min-height:56px;margin:0;padding:14px 22px;border-radius:999px;background:linear-gradient(145deg,#ffebc7,#eeb16e);border:1px solid #ffdfab;color:#24180f!important;font-weight:700;box-shadow:inset 0 1px 0 #ffffff8c,0 4px 18px #0003;font-size:17px!important}
.training #trainingActions #skipTraining{min-height:56px;margin:0;padding:14px 20px;color:#fff0d7!important}@media(hover:hover) and (pointer:fine){
.training #trainingActions #trainingContinue:hover{filter:brightness(1.1);transform:translateY(-1px)}}
.training #trainingActions #trainingContinue:active{transform:scale(.97)}
.training:has(#modal[open]) #trainingActions{visibility:hidden}
@media(max-width:380px){#trainingActions{gap:8px}.training #trainingActions #trainingContinue,.training #trainingActions #skipTraining{padding-inline:14px;font-size:15px!important}}

.training #trainingActions #trainingContinue{min-width:0;overflow-wrap:anywhere}.training #trainingActions #skipTraining{max-width:45%;overflow-wrap:anywhere}

/* Shared Marsdoku control system. */
:root{--control-radius:14px;--control-height:48px;--control-border:#e8bb8f66;--control-text:#fff0d7;--control-surface:linear-gradient(145deg,#49362bf2,#241c18f2);--control-shadow:inset 0 1px 0 #ffefdb1f,0 3px 8px #0003}
:is(button:not(.cell):not(.mars-switch):not([role="switch"]),.secondary,.language-picker summary,input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){border-radius:var(--control-radius)!important;font-family:Oxanium,system-ui,sans-serif;font-size:16px;font-weight:600;line-height:1.3;min-height:var(--control-height);color:var(--control-text);border:1px solid var(--control-border);background:var(--control-surface);box-shadow:var(--control-shadow);transition:background .16s,border-color .16s,box-shadow .16s,transform .16s}
:is(.secondary,.setting-row>button.secondary,.setting-row>a.secondary,.chapter-select button,#cinemaBar button,.language-picker summary,.level-button,#analyticsChoice button,#analyticsChoice a,.launch-screen .welcome .secondary){min-height:48px;padding:12px 18px;border:1px solid var(--control-border);background:var(--control-surface);box-shadow:var(--control-shadow);color:var(--control-text);font:600 16px/1.3 Oxanium,system-ui,sans-serif;border-radius:var(--control-radius)!important}
:is(.primary,.launch-screen .welcome .primary,.training #trainingActions #trainingContinue,#analyticsChoice #analyticsAccept){min-height:56px;padding:14px 22px;border:1px solid #ffdfab;background:linear-gradient(145deg,#ffebc7,#eeb16e);color:#24180f!important;box-shadow:inset 0 1px 0 #ffffff8c,0 4px 18px #0003;font:700 17px/1.3 Oxanium,system-ui,sans-serif;border-radius:var(--control-radius)!important}
:is(.header-tools .iconbutton,.assist .tool,.close,.launch-screen .welcome .welcome-sound,.launch-screen .welcome .welcome-settings){display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;min-width:48px;min-height:48px;padding:0;border:1px solid var(--control-border);background:var(--control-surface);box-shadow:var(--control-shadow);color:var(--control-text);border-radius:var(--control-radius)!important}
.assist #hint{width:160px;height:48px;min-height:48px;padding:0 18px;gap:9px;display:inline-flex;align-items:center;justify-content:center;font:600 16px/1.3 Oxanium,system-ui,sans-serif;border:1px solid var(--control-border);background:var(--control-surface);box-shadow:var(--control-shadow);color:var(--control-text);border-radius:var(--control-radius)!important}
.setting-row>button.secondary,.setting-row>a.secondary{min-width:90px;min-height:48px;padding:12px 18px;font:600 16px/1.3 Oxanium,system-ui,sans-serif}.setting-row>.language-picker{min-width:150px}.setting-row .language-picker summary{justify-content:space-between}.language-menu button{box-shadow:none!important;border-radius:10px!important;min-height:44px;font-size:16px}
:is(button:not(.cell),.secondary,.language-picker summary,input,select,textarea):focus-visible,.native-switch:has(input:focus-visible){outline:2px solid #ffe0b6;outline-offset:4px}
:is(button,.secondary,.language-picker summary):active:not(.cell):not(.mars-switch){transform:scale(.97)}
:is(button,.secondary):disabled{opacity:.4;transform:none;cursor:default}
.setting-row .mars-switch{font:600 14px/44px Oxanium,system-ui,sans-serif;border-color:var(--control-border)}
@media(hover:hover){@media(hover:hover) and (pointer:fine){:is(.secondary,.language-picker summary,.level-button,.header-tools .iconbutton,.assist .tool,.close,.launch-screen .welcome .welcome-sound,.launch-screen .welcome .welcome-settings,#analyticsChoice button):not(:disabled):hover{background:linear-gradient(145deg,#634532,#35241df2);border-color:#ffd1a3;box-shadow:inset 0 1px 0 #ffefdb33,0 5px 14px #0004;transform:translateY(-1px)}}@media(hover:hover) and (pointer:fine){:is(.primary,#analyticsChoice #analyticsAccept):hover{background:linear-gradient(145deg,#fff2d8,#ffc58c);border-color:#fff0cd;filter:none}}}
@media(prefers-reduced-motion:reduce){button,.secondary,.language-picker summary,input,select,textarea{transition:none!important}}

/* Mobile audio prompt stays inside the visual viewport, including browser zoom. */
.sound-prompt{position:fixed;z-index:40;padding:7px 10px;border:1px solid #e8c79b38;background:#241c17f5;color:#f7dfbf;font:500 12px/1.35 system-ui,sans-serif;box-shadow:0 3px 12px #0005;border-radius:6px;white-space:normal;overflow-wrap:anywhere;text-align:center;width:max-content;pointer-events:none}
.sound-prompt[hidden]{display:none!important}
.sound-prompt::before{content:"";position:absolute;left:var(--tooltip-arrow,50%);width:8px;height:8px;background:#241c17;transform:translateX(-50%) rotate(45deg)}
.sound-prompt[data-side="below"]::before{top:-5px;border-top:1px solid #e8c79b38;border-left:1px solid #e8c79b38}
.sound-prompt[data-side="above"]::before{bottom:-5px;border-bottom:1px solid #e8c79b38;border-right:1px solid #e8c79b38}

/* Lucide controls share a quiet, precise 1.75px stroke. */
button svg.lucide,a svg.lucide,summary svg.lucide{width:20px;height:20px;min-width:20px;flex-shrink:0;stroke:currentColor;fill:none;pointer-events:none;vertical-align:middle}
button:has(>svg.lucide):not(.cell):not(.level-tile):not(.mars-switch),a:has(>svg.lucide){display:inline-flex;align-items:center;justify-content:center;gap:9px}
.setting-row>span:has(svg){display:inline-flex;align-items:center;gap:12px}.setting-row>span svg{width:18px;height:18px;flex-shrink:0;color:#edc291}
.language-menu .language-check{display:flex;align-items:center}.language-menu .language-check svg{width:18px;height:18px}
.level-tile small svg{width:13px;height:13px;min-width:13px;display:inline-block;margin:0 1px}.language-picker summary .picker-chevron{width:16px;height:16px;min-width:16px}

/* The desktop handoff belongs exclusively to the landing screen. */
.phone-link{display:none!important}
@media(min-width:900px) and (hover:hover) and (pointer:fine){.launch-screen .welcome>.phone-link:not([hidden]){display:flex!important;position:fixed;right:28px;bottom:28px;gap:10px;align-items:center}.launch-screen .welcome>.phone-link img{width:112px;height:112px}.launch-screen .welcome>.phone-link span{font-size:13px!important;color:#fff0d7;text-shadow:0 2px 6px #000}}

.settings-footer{display:flex;justify-content:center;align-items:center;gap:10px;flex-wrap:wrap;padding-top:24px;margin-top:18px;border-top:1px solid #ffffff18}
.settings-footer button.secondary{font:600 13px/1.3 Oxanium,system-ui,sans-serif!important;min-height:36px!important;padding:8px 12px!important;gap:7px!important}.settings-footer button svg.lucide{width:16px;height:16px;min-width:16px}
.info-content{font-size:17px;line-height:1.65;text-align:start}.info-content h3{font:700 22px/1.3 Oxanium,system-ui,sans-serif;margin:28px 0 10px;color:#fff0d7}.info-content p{margin:0 0 18px;color:#f1e4d5}.info-subtitle{color:#dfc19d!important;font-size:15px}.info-provider-links{display:flex;flex-wrap:wrap;gap:10px;margin:24px 0}.info-provider-links a.secondary{font-size:14px;min-height:44px;padding:10px 12px}.info-view #infoBack{margin-top:24px}
.info-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;min-height:220px;color:#fff0d7;font-size:17px}.info-spinner{width:34px;height:34px;border:2px solid #e8bb8f30;border-top-color:#ffdfab;border-radius:50%;animation:infoSpin 1s linear infinite}@keyframes infoSpin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.info-spinner{animation:none;border-color:#ffdfab}}@media(max-width:480px){.settings-footer button.secondary{min-height:44px!important}}

/* Symmetric wordmark and a quiet, bottom-centered landing language control. */
body>header{height:auto;min-height:76px;padding-top:12px;padding-bottom:12px}
body>header .brand{position:relative;left:auto;transform:none;width:var(--board-width, min(504px,calc(100vw - 42px)));max-width:100%}
body>header .brand-wordmark,.training body>header .brand-wordmark{width:100%;height:auto}
body>header .header-tools{position:absolute;inset-inline:24px;width:auto}
.launch-screen .welcome h2{width:min(560px,94vw);margin:0 0 34px}
.launch-screen .welcome .launch-stacked-wordmark{max-height:none}
.launch-screen .welcome .welcome-settings{left:auto;right:24px}
.launch-screen .welcome .welcome-language{position:relative;order:10;top:auto;right:auto;left:auto;margin:30px auto 0;max-width:100%;width:max-content}
.launch-screen .welcome .welcome-language summary{min-height:40px;padding:8px 12px;font-size:14px;gap:7px}
.welcome-language summary svg{width:16px;height:16px}
.launch-screen .welcome .welcome-language .language-menu{top:auto;bottom:calc(100% + 10px);left:50%;right:auto;transform:translateX(-50%);max-height:min(430px,50dvh);animation:none}
@media(max-width:700px){body>header{display:flex;flex-direction:column;gap:8px;padding:12px 18px 0}body>header .header-tools{position:relative;inset:auto;width:100%;max-width:var(--board-width,100%)}.launch-screen .welcome .welcome-settings{right:18px;left:auto}.launch-screen .welcome{padding-top:85px;padding-bottom:calc(30px + env(safe-area-inset-bottom))}}
.launch-screen .welcome .welcome-language summary{min-height:40px!important;font-size:14px!important;padding:8px 12px!important}

/* Equal landing actions with a compact, consistent gap. */
.launch-screen .welcome #beginTraining,.launch-screen .welcome #skipTraining{width:min(280px,85vw);height:56px;min-height:56px;padding:14px 22px;font-size:17px;line-height:1.3;margin:0}
.launch-screen .welcome #skipTraining{margin-top:8px}

/* The valley supplies the scene; avoid decoding obscured background layers. */
body{background:transparent}
#modal.launch-screen{background:#111115}
/* A botanical discovery, framed by the Martian horizon. */
#modal.victory-screen{width:min(560px,calc(100vw - 28px));max-height:calc(100dvh - 28px);padding:0;overflow:auto;border-radius:28px;border-color:#dbac7866;background:radial-gradient(ellipse at 50% 35%,#dd6b322f,transparent 60%),linear-gradient(#201a17ec,#100e0efa),url('assets/mars-valley.webp') center/cover;box-shadow:inset 0 1px 0 #ffe3bc55,0 30px 100px #000b;backdrop-filter:none}
.victory-success{position:relative;padding:34px 30px 28px;isolation:isolate;overflow:hidden}
.victory-level{font:600 14px Oxanium,system-ui;letter-spacing:2px;color:#f5c996;text-transform:uppercase}
.victory-success h2{font:700 clamp(36px,8vw,50px)/1.08 Oxanium,system-ui;color:#fff0ce;letter-spacing:-2px;margin:12px 0 8px;text-shadow:0 2px 20px #ffaa4025}
.victory-success .victory-caption{font-size:17px;margin:0;color:#dfcbb6}
.discovery-stage{position:relative;height:240px;width:min(360px,100%);margin:12px auto 0;display:grid;place-items:center;isolation:isolate}
.discovery-orbit{position:absolute;width:220px;height:220px;border:1px solid #e7c59628;border-radius:50%;box-shadow:0 0 0 18px #e7c59606,0 0 0 19px #e7c5960d;background:radial-gradient(circle,#afde7030,transparent 65%)}
.discovery-horizon{position:absolute;inset:60px -30px 0;background:linear-gradient(transparent,#130f0f 95%),url('assets/mars-valley.webp') center 80%/cover;mask-image:linear-gradient(transparent,#000 40%,#000 75%,transparent);opacity:.6}
.victory-success .reward-gem{position:relative;width:210px;height:210px;margin:0;z-index:2;animation:discoveryRise .65s cubic-bezier(.2,.8,.2,1) both}
.victory-success .reward-gem svg{animation:none;filter:drop-shadow(0 8px 18px #0008) drop-shadow(0 0 20px #9de76540)}
.discovery-soil{position:absolute;bottom:25px;left:50%;transform:translateX(-50%);width:180px;height:30px;border-radius:50%;background:radial-gradient(ellipse,#d58c5750,#23181190 60%,transparent 75%);z-index:1}
.discovery-rank{display:flex;justify-content:center;gap:12px;margin:0 0 20px}
.earned-leaf{width:46px;height:46px;display:grid;place-items:center;color:#fff1cf26;background:#ffffff03;border:1px solid #e0be8820;border-radius:14px}
.earned-leaf.earned{color:#d9efb7;border-color:#d3c68c70;background:linear-gradient(140deg,#bccc6b30,#c7884320);box-shadow:inset 0 1px 0 #fff6d22b,0 3px 12px #0004;animation:leafEarn .4s ease both;animation-delay:calc(.25s + var(--leaf-order)*.1s)}
.earned-leaf svg{width:26px;height:26px}
.discovery-stats{display:flex;justify-content:center;gap:28px;color:#f3d8b6;font:500 16px Oxanium,system-ui;margin:0 0 26px}
.discovery-stats>span{display:flex;align-items:center;gap:8px}.discovery-stats svg{width:18px;height:18px;color:#c8aa82}.discovery-stats b{font-weight:600}
.victory-success .modal-actions{display:flex;flex-direction:column;gap:8px;margin:0 auto;width:min(300px,100%)}
.victory-success .modal-actions button{width:100%;min-height:54px;margin:0}
@keyframes discoveryRise{from{opacity:0;transform:translateY(18px) scale(.92)}to{opacity:1;transform:none}}
@keyframes leafEarn{from{opacity:0;transform:translateY(7px) scale(.8)}to{opacity:1;transform:none}}
/* Machined dark titanium, warm copper edges and precise inset controls. */
#modal.settings-screen{width:min(590px,calc(100vw - 28px));padding:0;border-radius:24px;border:1px solid #e5bd8d55;background:linear-gradient(115deg,#ffffff09,transparent 25%,#00000030 70%,#ffffff07),repeating-linear-gradient(0deg,#ffffff03 0 1px,transparent 1px 3px),#242221;box-shadow:inset 0 1px 0 #fff2,inset 0 -1px 0 #0008,0 25px 90px #000a;backdrop-filter:none}
.settings-panel{padding:0 28px 22px}
.settings-panel .modal-top{position:sticky;top:0;z-index:3;padding:24px 0 20px;margin:0;background:linear-gradient(#2d2a28,#242221f5);border-bottom:1px solid #e0b78750;box-shadow:0 8px 12px #0002}
.settings-panel .modal-top h2{font:700 30px Oxanium,system-ui;letter-spacing:-1px;color:#fff1d7}
.settings-panel .setting-row{min-height:74px;padding:14px 0;border-bottom:1px solid #eac59915;gap:16px;font-size:17px;color:#f0e4d4}
.settings-panel .setting-row>span{display:inline-flex;align-items:center;gap:12px}.settings-panel .setting-row>span svg{color:#d5ac7d}
.settings-panel .mars-switch{box-shadow:inset 0 3px 9px #0008,inset 0 1px 0 #0007,0 1px 0 #fff2;border-color:#81756566}
.settings-panel .settings-footer{margin-top:0;border-top:none;padding-top:22px}
@media(max-width:480px){.victory-success{padding:26px 20px 22px}.discovery-stage{height:210px}.victory-success .reward-gem{width:185px;height:185px}.discovery-orbit{width:190px;height:190px}.settings-panel{padding:0 20px 18px}.settings-panel .modal-top{padding-top:20px}.settings-panel .setting-row{font-size:16px;gap:10px}}
@media(max-height:700px){.victory-success{padding-top:22px}.discovery-stage{height:170px}.victory-success .reward-gem{width:155px;height:155px}.discovery-orbit{width:160px;height:160px}.discovery-rank{margin-bottom:14px}.discovery-stats{margin-bottom:18px}}
@media(prefers-reduced-motion:reduce){.victory-success .reward-gem,.earned-leaf.earned{animation:none}}
.victory-success .modal-actions button{height:56px;min-height:56px!important}

/* Balanced line wrapping throughout the interface and information pages. */
*,*::before,*::after{text-wrap:balance}
/* Apple install action: black enamel, with Marsdoku's copper edge and geometry. */
button.ios-install,.launch-screen .welcome button.ios-install{display:inline-flex;align-items:center;justify-content:center;gap:11px;width:min(280px,85vw);height:auto;min-height:56px;margin:8px auto 0;padding:13px 18px;background:linear-gradient(145deg,#191919,#060606)!important;border:1px solid #bda07a70!important;border-radius:var(--control-radius)!important;color:#fff2df!important;box-shadow:inset 0 1px 0 #ffffff20,0 5px 16px #0005;font:600 16px/1.3 Oxanium,system-ui;transition:transform .16s,border-color .16s,box-shadow .16s}
button.ios-install .apple-mark{width:20px;height:24px;flex:0 0 20px;color:#fff;pointer-events:none}@media(hover:hover) and (pointer:fine){
button.ios-install:hover,.launch-screen .welcome button.ios-install:hover{border-color:#e7c595!important;box-shadow:inset 0 1px 0 #ffffff30,0 6px 20px #0006;transform:translateY(-1px)}}
button.ios-install:active{transform:scale(.97)}
.settings-panel>button.ios-install{display:flex;margin-top:24px;width:100%;max-width:320px}
#modal.install-screen{width:min(510px,calc(100vw - 28px));padding:0;border-radius:24px;border-color:#e5bd8d55;background:radial-gradient(ellipse at 50% 0,#a0623220,transparent 60%),linear-gradient(140deg,#2d2823,#161413);backdrop-filter:none;box-shadow:inset 0 1px 0 #fff2,0 25px 90px #000b}
.install-guide{padding:26px}.install-guide .modal-top{gap:16px;align-items:flex-start}.install-guide .modal-top h2{font:700 clamp(24px,5.5vw,30px)/1.18 Oxanium,system-ui;text-wrap:balance;max-width:330px;letter-spacing:-.7px}
.install-app{display:flex;align-items:center;justify-content:center;gap:20px;padding:16px 0 24px}.install-app>img:first-child{width:76px;height:76px;border-radius:19px;box-shadow:0 5px 20px #0007;border:1px solid #daba8755}.install-app .install-wordmark{width:min(230px,52%);height:auto}
.install-steps{list-style:none;padding:0;margin:0 0 24px;counter-reset:install}
.install-steps li{display:flex;gap:16px;align-items:flex-start;padding:20px 0;border-top:1px solid #e9c79c22}
.install-step-icon{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;border-radius:12px;background:linear-gradient(140deg,#65452e,#33251d);border:1px solid #d7b08055;color:#ffe3b8;box-shadow:inset 0 1px 0 #fff2}
.install-step-icon svg{width:23px;height:23px}.install-steps h3{margin:0 0 7px;font:600 18px/1.3 Oxanium,system-ui;color:#fff0d7}.install-steps p,.install-browser-note{margin:0;font-size:16px;line-height:1.55;color:#e1cbb2}
.install-browser-note{padding:0 0 18px;text-align:center;color:#ffdbab}
.install-guide #installBack{width:100%;margin:0}
@media(max-width:380px){.install-guide{padding:22px 18px}.install-steps li{gap:12px;padding:17px 0}.install-steps h3{font-size:17px}.install-steps p{font-size:15px}.install-app{gap:14px}}
/* Reserve the landing artwork before decoding, exactly as in the boot shell. */
.launch-screen .welcome h2{flex-shrink:0}
.launch-screen .welcome .launch-stacked-wordmark{aspect-ratio:1000/525}
.launch-screen .welcome .welcome-language{height:40px;flex-shrink:0}
.launch-screen .welcome button.ios-install{height:56px;flex-shrink:0}
/* A quiet level shortcut leaves the board directly beneath the wordmark. */
.puzzle-heading{display:contents}
body>header{padding-bottom:4px}
main{padding-top:10px;padding-bottom:84px}
#levels.level-button{position:fixed;left:max(18px,env(safe-area-inset-left));bottom:max(16px,env(safe-area-inset-bottom));z-index:5;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:0;min-height:44px;height:44px;width:auto;padding:10px 12px;font-size:14px;line-height:1.2;background:linear-gradient(145deg,#342821eb,#1d1714eb);border-color:#e8bb8f40;box-shadow:inset 0 1px 0 #ffefdb14,0 3px 8px #0003;direction:ltr}
#levels svg{width:16px;height:16px}
#levels svg[data-control-icon]{display:none}
.training #levels,.cinema #levels{display:none}
body:not([data-l10n-ready]) #levels{visibility:hidden}
@media(max-width:700px){body>header{gap:6px;padding-bottom:4px}main{padding-top:10px}}
body>header{max-width:none}
body>header .brand{height:calc(var(--board-width,504px) * .22);overflow:hidden}
body>header .brand-wordmark{flex-shrink:0}
/* A small contrast lift: clearer regions and labels over a quieter scene. */
:root{--muted:#e6d9cc;--control-border:#e8bb8f88;--control-text:#fff5e6}
body:before{background:linear-gradient(#111115e5,#11111585 45%,#11111548),url('assets/mars-valley.webp') center 65%/cover;opacity:.9}
.cell{border-color:#ffffff4d}
.cell:before{opacity:.45}
.cell:after{color:#fffaf0;opacity:1;text-shadow:0 1px 3px #000b}
.puzzle-status{color:#fff5e6;text-shadow:0 1px 3px #0009}
.assist :is(#undo,#restart,#how){color:#fff0d7}
#levels.level-button{border-color:#e8bb8f70;color:#fff5e6}
.setting-row,.modal-copy,.install-steps p,.install-browser-note{color:#f2e3d3}
/* A generous cream quiet zone keeps the mobile QR easy to scan. */
.launch-screen .welcome>.phone-link img{box-sizing:content-box;padding:14px;background:#fff0d5;border-radius:14px}
.launch-screen .welcome>.phone-link span{max-width:160px;text-align:center;letter-spacing:.2px}

/* Equal side tracks keep hints centered independently of the other controls. */
.controls{width:100%;padding-bottom:0}
.assist{display:grid;width:100%;max-width:none;grid-template-columns:minmax(0,1fr) 148px minmax(0,1fr);gap:10px;padding:0;margin-inline:auto;direction:ltr}
.assist-left,.assist-right{display:flex;align-items:center;gap:8px;min-width:0}
.assist-left{justify-content:flex-start}.assist-right{justify-content:flex-end}
.assist #hint{grid-column:2;grid-row:1;box-sizing:border-box;width:100%;min-width:0;padding:0 14px;gap:8px;justify-content:center}
.assist #hint>svg{flex:0 0 20px;width:20px;height:20px;margin:0}
.assist #hint>span{position:static;flex:0 0 auto;margin:0;padding:0;width:auto;min-width:0;text-align:center}
.assist #hintCount{height:auto;min-height:0;line-height:1.3}
.assist #how{position:static;inset:auto;transform:none}@media(hover:hover) and (pointer:fine){
.assist #how:not(:disabled):hover{transform:translateY(-1px)}}
.assist #levels.level-button{position:static;inset:auto;z-index:auto;min-width:0;padding:0 10px;min-height:44px;height:44px;flex:0 0 auto;gap:5px}
#levels .level-number{display:none}
.assist .tool-divider{display:none}
@media(max-width:600px){
 .assist{grid-template-columns:minmax(0,1fr) 128px minmax(0,1fr);gap:6px}
 .assist-left,.assist-right{gap:5px}
 .assist :is(#undo,#restart,#how){width:40px;min-width:40px;height:44px;min-height:44px}
 .assist #levels.level-button{padding:0 8px;font-size:14px}
 #levels .level-label{display:none}#levels .level-number{display:inline}
 .assist #hint{font-size:15px;gap:6px;padding:0 12px}
}
@media(max-width:360px){
 .assist{grid-template-columns:minmax(0,1fr) 120px minmax(0,1fr);gap:4px}
 .assist-left,.assist-right{gap:3px}
 .assist :is(#undo,#restart,#how){width:34px;min-width:34px}
 .assist #levels.level-button{padding:0 5px;gap:3px}
}
@media(min-width:601px){.assist{grid-template-columns:minmax(0,1fr) 140px minmax(0,1fr);gap:6px}.assist-left,.assist-right{gap:5px}.assist :is(#undo,#restart,#how){width:40px;min-width:40px;height:44px;min-height:44px}.assist #levels.level-button{padding:0 6px;font-size:13px;gap:4px}}
@media(max-width:360px){.assist #levels svg{display:none}.assist #levels.level-button{padding:0 7px}}

/* Tutorial and game share the exact same board geometry. */
.training main{padding-bottom:84px}
.training .controls,.training .puzzle-status{display:flex;visibility:hidden;pointer-events:none}
.training #levels{display:inline-flex}
.training #trainingPanel{position:absolute;left:0;top:100%;width:100%;margin:18px 0 0;padding:0;z-index:3;pointer-events:none}
.training #trainingPanel #trainingText{font-size:24px;margin:8px 0;line-height:1.2}
.training #trainingPanel #trainingHelp{min-height:0!important;margin:0 auto;font-size:16px;line-height:1.4}
@media(min-width:1000px){.training #trainingPanel{top:50%;left:auto;right:calc(100% + 32px);width:240px;transform:translateY(-50%);margin:0}}
@media(max-width:600px){.training #trainingPanel{margin-top:14px}.training #trainingPanel #trainingText{font-size:22px}.training #trainingPanel #trainingHelp{font-size:15px}}
body.training .play-area{display:block}
body.training>header .brand-wordmark{width:100%;height:auto}

/* WebKit: isolate the landing layer and normalize native control decoration. */
body.landing-open>header,body.landing-open>main,body.landing-open>#atmosphere,body.landing-open>.celebration-canvas{visibility:hidden!important;pointer-events:none!important}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
button,.language-picker summary,select{-webkit-appearance:none;appearance:none}
.language-picker summary{list-style:none;cursor:pointer;touch-action:manipulation}
.language-picker summary::-webkit-details-marker{display:none}
.language-picker summary::marker{content:''}
button,.language-picker summary{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;touch-action:manipulation}
.language-picker .language-menu{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#modal{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#modal.launch-screen{max-width:none;max-height:none;width:100%;height:100%;height:100dvh;inset:0;margin:0;box-sizing:border-box}

/* Game header: controls align with the grid, wordmark fills their shared row. */
body>header{width:var(--board-width,min(504px,calc(100vw - 42px)));max-width:calc(100% - 36px);min-height:72px;height:auto;margin-inline:auto;padding:12px 0 4px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:clamp(12px,3vw,20px)}
body>header .header-tools{display:contents}
body>header #sound{order:1;flex:0 0 48px}
body>header .brand{order:2;position:static;transform:none;flex:1 1 0;min-width:0;width:auto;max-width:none;height:auto;overflow:visible}
body>header #settings{order:3;flex:0 0 48px}
body>header .brand-wordmark,body.training>header .brand-wordmark{display:block;width:100%;height:auto;flex-shrink:1}

/* Center the lettering, rather than the canvas plus the sapling above it. */
body>header .brand-wordmark,body.training>header .brand-wordmark{transform:translateY(-6.2%)}

/* A fixed game stage: centered board, bottom controls, no document scrolling. */
:root{--game-board-size:min(504px,calc(100vw - 42px),calc(100dvh - 360px));--game-controls-width:min(504px,calc(100vw - 42px));--game-bottom:max(16px,env(safe-area-inset-bottom))}
html,body{height:100%;height:100dvh;min-height:0;overflow:hidden;overscroll-behavior:none}
body{padding:0}
body>main,body.training>main{position:fixed;inset:0;width:100%;height:100%;max-width:none;margin:0;padding:0;display:block}
.play-area,body.training .play-area{position:static;width:100%;height:100%;display:block}
.board-stage{position:absolute;left:50%;top:50%;width:var(--game-board-size);transform:translate(-50%,-50%)}
.board-shell{padding:0}
body>header{position:fixed;top:max(16px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:var(--game-controls-width);height:96px;min-height:0;margin:0;padding:0;z-index:4}
.controls,.training .controls{position:absolute;left:50%;bottom:var(--game-bottom);transform:translateX(-50%);width:var(--game-controls-width);height:48px;padding:0}
.puzzle-status,.training .puzzle-status{position:absolute;left:50%;bottom:calc(var(--game-bottom) + 62px);transform:translateX(-50%);width:var(--game-controls-width);padding:0;min-height:20px;align-items:center}
#announcement{position:absolute;left:50%;bottom:calc(var(--game-bottom) + 94px);transform:translateX(-50%);width:var(--game-controls-width);margin:0;height:auto;text-align:center}
.training #trainingPanel{margin-top:12px}
.training #trainingPanel #trainingText{font-size:20px;line-height:1.2;margin:6px 0}
.training #trainingPanel #trainingHelp{font-size:14px;line-height:1.3}
#modal:not(.launch-screen){max-height:calc(100dvh - 32px);overflow-y:auto}
@media(min-width:1000px){:root{--game-board-size:min(504px,calc(100vw - 42px),calc(100dvh - 260px))}.training #trainingPanel{margin-top:0}}
@media(orientation:landscape) and (max-height:600px){
 :root{--game-board-size:min(504px,calc(100vw - 42px),calc(100dvh - 230px))}
 .training #trainingPanel{top:50%;left:auto;right:calc(100% + 24px);width:min(220px,calc((100vw - var(--game-board-size))/2 - 32px));transform:translateY(-50%);margin:0}
 .board{gap:4px}
}

@media(max-width:999px) and (orientation:portrait){
 .training #trainingPanel{left:50%;width:var(--game-controls-width);transform:translateX(-50%)}
}
#trainingActions{box-sizing:border-box}
