:root{color-scheme:dark;--ink:#f7eee5;--muted:#c5a99b;--outline:rgba(239,190,148,.28);--panel:#191f2b;--orange:#d9945e}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#101522;color:var(--ink);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,select{font:inherit;accent-color:var(--orange)}button{cursor:pointer;color:var(--ink);background:#28303d;border:1px solid var(--outline);padding:9px 13px;border-radius:10px;transition:background .12s ease}
button:hover{background:#41434c}button:active{transform:translateY(1px)}button:focus-visible,select:focus-visible{outline:3px solid #ffcc81;outline-offset:3px}
.panel button:focus-visible{position:relative;box-shadow:0 0 0 3px #ffcc8180,0 0 18px #ffb85f88}
.panel button:focus-visible::after{content:'◆';position:absolute;left:7px;top:50%;transform:translateY(-50%);font-size:11px;color:#ffe2a2;text-shadow:0 0 7px #ff9c4b;pointer-events:none}
.home-scene-target{position:absolute;z-index:5;width:54px;height:54px;padding:0;border:0;background:transparent;color:transparent;pointer-events:none}
.home-scene-astronaut{left:17%;bottom:19%}.home-scene-rover{right:26%;bottom:27%}
.home-scene-target:focus-visible{background:#142637c9;color:#ffdc9a;border:2px solid #ffcd85;border-radius:50%;outline:3px solid #ffcf86;box-shadow:0 0 0 7px #ffbd4d44,0 0 20px #ff9f49;font-size:26px}
.home-3d.keyboard-rover-active>img{transform:rotate(-5deg);filter:drop-shadow(0 0 14px #e5a168)}
button:disabled{opacity:.55;cursor:not-allowed}button.primary{background:#bf6e3b;color:#130e10;border-color:#f3ac78;font-weight:800;padding:12px 24px}
.game{width:100%;height:var(--adaptive-height,100dvh);min-height:220px;padding-top:var(--adaptive-browser-top,0px);display:flex;flex-direction:column;overflow:hidden;overscroll-behavior:none}
.bar{min-height:72px;padding:10px clamp(12px,2vw,28px);padding-top:max(10px,env(safe-area-inset-top));display:flex;align-items:center;justify-content:space-between;gap:12px;background:#141b29;border-bottom:1px solid var(--outline);z-index:2}
.brand{display:flex;gap:10px;align-items:center;min-width:0}.brand img{width:46px;height:46px;object-fit:contain;border-radius:50%;flex:none}.brand strong{display:block;letter-spacing:.035em;font-size:clamp(14px,1.6vw,20px)}.muted{color:#cdb7a8}.eyebrow{font-size:10px;font-weight:800;letter-spacing:.18em;color:#dfa776;display:block;margin-bottom:3px}
.toolbar{display:flex;flex-wrap:wrap;gap:6px}.toolbar button{font-size:12px;padding:8px 10px;white-space:nowrap}
.viewport{position:relative;flex:1;min-height:0;isolation:isolate;overflow:hidden;touch-action:none}
#scene{position:absolute;inset:0;display:block;width:100%;height:100%;outline:none}
.hud{position:absolute;top:max(12px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));display:flex;gap:8px;pointer-events:none;z-index:2}.hud-card{background:#101824b8;backdrop-filter:blur(5px);border:1px solid var(--outline);border-radius:10px;min-width:112px;padding:10px 12px}.hud-card small{font-weight:800;display:block;font-size:9px;letter-spacing:.1em;color:#d7b1a0}.hud-card strong{font-size:21px;font-variant-numeric:tabular-nums;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.hud-card strong span{font-size:12px}
.engine-badge{position:absolute;right:12px;top:12px;font-size:10px;max-width:250px;text-align:right;padding:7px 10px;border-radius:8px;background:#101824cc;border:1px solid var(--outline);color:#f2ceb2;pointer-events:none}
.toast{position:absolute;top:78px;left:50%;transform:translateX(-50%);font-size:12px;background:#131b2bd9;padding:8px 14px;border-radius:10px;border:1px solid #bb845e;opacity:0;pointer-events:none;transition:opacity .25s;max-width:75%;text-align:center;z-index:4}.toast.show{opacity:1}
.overlay{position:absolute;inset:0;display:grid;place-items:center;padding:14px;background:linear-gradient(90deg,#121721bd,#14172065);z-index:5;overflow-y:auto}.overlay.hidden{display:none}
.panel{width:min(440px,96%);max-height:100%;overflow-y:auto;padding:clamp(17px,4vh,30px);border:1px solid #bd7d5c;background:linear-gradient(145deg,#1e2533f5,#2c2528f6);border-radius:18px;box-shadow:0 14px 65px #0008}.panel h1{margin:4px 0 10px;font-size:clamp(25px,4vw,34px);line-height:1.15}.panel p{margin:8px 0 15px;color:#e4d5ca;line-height:1.55;font-size:14px}
.panel label{display:block;color:#e0b28e;font-size:11px;letter-spacing:.1em;font-weight:800;margin-bottom:6px}.panel select{width:100%;min-height:44px;color:#fff;background:#303340;border-radius:10px;border:1px solid #a2765e;padding:10px}.panel .track-desc{color:#bcb8bd;font-size:12px;margin-top:9px}.panel-actions{display:flex;flex-wrap:wrap;gap:9px;margin:16px 0}.panel .fine-print,.fine-print{font-size:11px;color:#b1abb1;line-height:1.4}
.touch{position:absolute;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));bottom:max(8px,env(safe-area-inset-bottom));display:none;justify-content:space-between;gap:12px;pointer-events:none;z-index:3}
.touch-group{display:flex;gap:8px;pointer-events:auto}.touch-btn{width:clamp(60px,10vw,83px);height:clamp(62px,12vh,85px);display:flex;flex-direction:column;align-items:center;justify-content:center;background:rgba(26,36,52,.46);border:1.5px solid rgba(255,226,196,.55);backdrop-filter:blur(4px);border-radius:19px;color:#ffe4c6;font-size:29px;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.touch-btn span{font-size:9px;font-weight:800;letter-spacing:.07em}.touch-btn.gas{background:rgba(154,87,46,.58)}.touch-btn.pressed{background:rgba(245,166,104,.75);border-color:#fff;box-shadow:0 0 0 2px #ffcf9180}
.footer{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:28px;padding:5px 16px;background:#141b29;border-top:1px solid var(--outline);font-size:9px;letter-spacing:.1em;color:#c1a497;z-index:2}
dialog{color:#eae8e5;background:#1d2532;border:1px solid #b87e58;border-radius:16px;width:min(520px,94vw);max-height:88dvh;padding:0;box-shadow:0 20px 90px #000a}dialog::backdrop{background:#0b0e17c7}.help-content{padding:23px;overflow-y:auto}.help-content p{line-height:1.55;font-size:14px}.dialog-top{display:flex;justify-content:space-between;align-items:center;gap:10px}.dialog-top h2{font-size:22px}.key-rows{display:grid;gap:8px;margin:22px 0}.key-row{display:flex;justify-content:space-between;gap:10px;align-items:center;background:#303744;padding:8px 10px;border-radius:10px}.key-row button{min-width:140px;background:#495362;font-size:12px}
#fullscreenGuide{width:min(430px,calc(100vw - 24px));max-height:calc(100dvh - 24px)}#fullscreenGuide .help-content{max-height:calc(100dvh - 24px);box-sizing:border-box}#fullscreenGuide button{min-height:44px}
.confirm-content{padding:clamp(20px,4vw,32px);background:linear-gradient(145deg,#26384a,#1b2535);border-radius:16px}.confirm-content h2{font-size:clamp(24px,4vw,30px);margin:0 0 12px;color:#f5dec1}.confirm-content p{font-size:16px;line-height:1.5;margin:0 0 24px}.confirm-actions{display:flex;gap:12px;flex-wrap:wrap}.confirm-actions button{min-height:48px;flex:1 1 170px}.confirm-actions button:focus-visible{outline:3px solid #f0c28c;outline-offset:3px}#confirmDialog::backdrop{background:#070d19d9;backdrop-filter:blur(3px)}@media(prefers-reduced-motion:no-preference){#confirmDialog[open]{animation:confirm-appear .18s ease-out}@keyframes confirm-appear{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}}
.guide-bindings{display:grid;gap:5px;margin-top:14px}.guide-binding{display:flex;justify-content:space-between;gap:12px;padding:7px 9px;background:#ffffff13;border-radius:7px;font-size:14px}.guide-binding span{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;text-align:right}
@media (pointer:coarse){.touch{display:flex}.engine-badge{top:84px}.viewport .toast{top:118px}}
@media (max-width:720px){.bar{min-height:65px;padding:7px;padding-top:max(7px,env(safe-area-inset-top))}.brand img{width:34px;height:34px}.brand strong{font-size:12px}.brand .eyebrow{font-size:8px;letter-spacing:.08em}.toolbar{justify-content:flex-end}.toolbar button{font-size:10px;padding:7px}.hud{left:max(7px,env(safe-area-inset-left));top:max(7px,env(safe-area-inset-top));gap:4px}.hud-card{min-width:0;padding:6px 8px}.hud-card small{font-size:8px}.hud-card strong{font-size:15px}.engine-badge{font-size:9px;right:7px;top:68px}.footer{font-size:7px;min-height:21px}}
@media (max-width:420px){.bar{flex-wrap:wrap;align-content:center;gap:5px}.toolbar{width:100%;justify-content:space-between}.brand strong{font-size:12px}.brand .eyebrow{font-size:8px}.hud-card.speed{display:none}.touch-btn{width:clamp(58px,17vw,72px)}.engine-badge{top:54px}.footer span:last-child{display:none}}
@media (max-height:430px){.bar{min-height:45px;padding:4px 10px;padding-top:max(4px,env(safe-area-inset-top))}.brand img{width:31px;height:31px}.brand strong{font-size:13px}.brand .eyebrow{font-size:8px}.toolbar button{padding:5px 8px}.hud{top:6px}.hud-card{padding:5px 8px}.hud-card strong{font-size:16px}.engine-badge{top:54px}.touch-btn{height:clamp(56px,19vh,72px)}.footer{display:none}.panel{padding:14px}.panel p{margin:5px 0;font-size:12px}.panel h1{font-size:24px}}

/* Stage 1.1: driving-only controls, clear view of upcoming cliff edges. */
.game:not(.in-drive) .touch{display:none!important}
.physics-meter strong{font-size:15px!important}
.risk-warning{position:absolute;left:50%;top:11px;transform:translateX(-50%);z-index:2;
  font-size:12px;font-weight:900;letter-spacing:.07em;color:#ffe5c0;
  text-shadow:0 1px 5px #17131d;pointer-events:none;text-align:center;white-space:nowrap}
@media(max-width:780px){.physics-meter{display:none}.risk-warning{top:56px;font-size:10px}}
@media(max-height:430px){.risk-warning{top:6px;left:57%;font-size:9px}.physics-meter{display:none}}

/* The game contains no advertisement slots or placeholders. Keep the Canvas and
   multitouch controls inside this isolated stacking context on a dedicated page. */
.game{isolation:isolate;contain:layout paint}
.touch-special{position:absolute;right:0;bottom:calc(100% + 8px);pointer-events:auto;
  width:clamp(60px,10vw,78px);height:clamp(60px,11vh,74px);background:rgba(57,93,104,.65)}
.touch-special.pressed{background:rgba(136,224,216,.78)}
.touch-pickup{position:absolute;right:clamp(68px,11vw,90px);bottom:calc(100% + 8px);pointer-events:auto;width:clamp(60px,10vw,78px);height:clamp(60px,11vh,74px);background:rgba(93,106,66,.82)}
@media(max-height:430px){.touch-special{height:56px;bottom:calc(100% + 4px)}}
@media(max-height:430px){.touch-pickup{height:56px;bottom:calc(100% + 4px)}}
[hidden]{display:none!important}
.debug-panel{position:absolute;z-index:4;left:max(8px,env(safe-area-inset-left));top:96px;
  max-width:min(620px,95vw);padding:9px 11px;white-space:pre-wrap;pointer-events:none;
  background:#07131fe8;border:1px solid #a9cccf;border-radius:8px;color:#e6ffff;
  font:11px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace}
@media(max-width:720px){.debug-panel{top:118px;font-size:9px}}

/* Original Kosmo-fakta instrument: one static SVG dial and one moving needle. */
.hud{align-items:flex-start}.hud-data{display:grid;gap:7px}.hud-card{min-width:145px}
.hud-card .hud-unit{font-size:12px}.route-length{display:block;margin-top:3px;color:#d5b7a3;font:700 9px ui-monospace,SFMono-Regular,monospace;white-space:nowrap}
.speedometer{position:relative;width:126px;height:126px;flex:none;border-radius:50%;border:2px solid #92684e;background:radial-gradient(circle at 50% 42%,#2b3540 0%,#151d28 67%,#0c121c 100%);box-shadow:inset 0 0 0 4px #101824,0 2px 12px #0006;overflow:hidden}
.speedometer svg{position:absolute;inset:0;width:100%;height:100%}.dial-ring{fill:none;stroke:#53606b;stroke-width:1.2}.dial-arc{fill:none;stroke:#b97850;stroke-width:2.5}.dial-ticks{fill:none;stroke:#f4e6d7;stroke-width:2;stroke-linecap:round}#speedNeedle{fill:#efa56a}
.dial-readout{position:absolute;left:0;right:0;top:57%;display:flex;align-items:center;flex-direction:column;line-height:1;text-shadow:0 1px 2px #000}.dial-readout small{font-size:8px;letter-spacing:.1em;font-weight:800;color:#e7c4a9}.dial-readout strong{font:800 22px ui-monospace,SFMono-Regular,monospace;font-variant-numeric:tabular-nums}.dial-readout span{font-size:9px;color:#d5c9be}.dial-readout b{position:absolute;right:21px;top:15px;color:#f7b476;font-size:12px}
@media(max-width:780px){.risk-warning{top:150px}}
@media(max-width:720px){.speedometer{width:91px;height:91px}.hud-card{min-width:106px}.route-length{font-size:9px}.dial-readout strong{font-size:17px}.dial-readout small{font-size:7px}.dial-readout span{font-size:9px}.dial-readout b{right:15px;top:11px;font-size:10px}.risk-warning{top:165px}}
@media(max-width:420px){.hud-card.speed{display:block}.speedometer{width:84px;height:84px}.hud-card{min-width:98px}.hud-card strong{font-size:14px}.engine-badge{display:none}.risk-warning{top:162px;max-width:96vw;white-space:normal}}
@media(max-height:430px){.speedometer{width:78px;height:78px}.hud-card{padding:4px 7px}.hud-card strong{font-size:13px}.route-length{font-size:9px}.risk-warning{top:140px;left:50%;font-size:9px}}
.track-title{position:absolute;z-index:2;top:10px;left:50%;transform:translateX(-50%);
  max-width:45vw;padding:7px 12px;background:#101824db;border:1px solid var(--outline);
  border-radius:9px;color:#ffe3c4;font-size:13px;font-weight:800;letter-spacing:.03em;
  text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
.record-card strong{font-size:17px}.record-line{font-weight:700;color:#f1d3b8!important;margin:4px 0!important}
.ghost-choice{display:flex!important;align-items:center;gap:8px;letter-spacing:0!important;text-transform:none}
.ghost-choice input{width:17px;height:17px}
.footer{justify-content:flex-end}
@media(min-width:781px){.risk-warning{top:51px}}
@media(max-width:780px){.track-title{top:145px;max-width:90vw}.risk-warning{top:182px}}
@media(max-width:720px){.track-title{top:127px;font-size:12px;padding:5px 9px;max-width:96vw}.risk-warning{top:161px}.record-card{display:none}}
@media(max-height:430px){.track-title{top:105px}.risk-warning{top:137px}}

.garage{border:1px solid var(--outline);border-radius:12px;padding:10px;margin:8px 0;background:#111b28}.garage-top{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}.garage label{display:block;margin-top:7px;font-size:11px;font-weight:700}.garage select{width:100%;min-height:38px;background:#28303d;color:#f7eee5;border:1px solid var(--outline);border-radius:8px}.upgrade-rows{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}.upgrade-rows button{padding:6px 4px;font-size:11px;white-space:normal;min-height:48px}.test-badge{display:block;color:#ffe1a6;font-size:12px;margin:3px 0}.panel{max-height:calc(100dvh - 130px);overflow-y:auto}.record-line{margin:3px 0}.ghost-choice{display:block;margin:5px 0;font-size:12px}
@media(max-width:650px){.upgrade-rows{grid-template-columns:repeat(2,minmax(0,1fr))}.panel{max-height:calc(100dvh - 100px)}.garage{padding:7px}}
/* Stage 4 navigation uses the same compact overlay as the driving menu. */
.menu-panel{width:min(520px,calc(100vw - 24px));max-height:min(78dvh,720px);overflow:auto}
.menu-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:15px}
.menu-grid button{min-height:46px;text-align:left;font-weight:750;padding:10px 13px}
.menu-grid button.upgrade-available{position:relative;padding-right:32px}
.menu-grid button.upgrade-available::after{content:'◆';position:absolute;top:8px;right:10px;color:#ffce7b;font-size:15px;text-shadow:0 1px 5px #000}
.menu-grid button:first-child{background:#bf6e3b;color:#140f13;border-color:#f3ac78}
.menu-grid button:last-child{grid-column:1/-1}
.settings-grid{display:grid;gap:12px;margin:16px 0}
.settings-grid label{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:42px;font-weight:700}
.settings-grid select{min-width:148px;max-width:52%;color:var(--ink);background:#28303d;border:1px solid var(--outline);border-radius:8px;padding:8px}
.settings-grid input{width:22px;height:22px}
.menu-panel .panel-actions a{display:inline-flex;align-items:center;justify-content:center;padding:10px 13px;color:var(--ink);background:#28303d;border:1px solid var(--outline);border-radius:10px;text-decoration:none;font-weight:700}
.menu-panel .panel-actions a:hover{background:#41434c}
.menu-panel .panel-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:15px}
#supportPanel p{line-height:1.45;font-size:14px}
@media(max-width:420px){.menu-panel{max-height:calc(100dvh - 138px)}.menu-grid{gap:6px}.menu-grid button{font-size:14px;min-height:42px;padding:8px}.settings-grid select{min-width:122px}}

/* Stage 4 correction: navigation occupies the whole viewport. The canvas is a race surface only. */
.icon-library{position:absolute;width:0;height:0;overflow:hidden}
.ui-icon{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.overlay{padding:0;background:#101722;display:block;overflow:hidden}
.panel,.menu-panel{position:absolute;inset:0;width:100%;max-width:none;max-height:none;min-height:0;overflow:auto;border:0;border-radius:0;box-shadow:none;padding:clamp(22px,4vw,58px) max(clamp(18px,4vw,64px),env(safe-area-inset-left)) max(24px,env(safe-area-inset-bottom));background:radial-gradient(circle at 77% 34%,#443447 0,#242d3b 32%,#151d2a 70%,#101722 100%)}
.panel h1{font-size:clamp(32px,5vw,64px);margin:0 0 12px;line-height:1.04;letter-spacing:-.035em}
.panel h2{font-size:clamp(21px,2.2vw,30px)}.panel p{font-size:clamp(14px,1.1vw,17px)}
.screen-head{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:28px;flex-wrap:wrap}.screen-head h1{margin:0}.back-btn{min-width:86px}
.home-screen{display:grid;grid-template-columns:minmax(290px,1fr) minmax(290px,1fr);grid-template-rows:auto 1fr auto auto;gap:10px 5vw;align-items:center;background:radial-gradient(ellipse at 72% 60%,#754b45 0,#394554 34%,#192433 65%,#101722 100%)}
.home-screen>.eyebrow,.home-screen>h1,.home-rover-name,.home-stats,.hero-play{grid-column:1}.home-screen>h1{align-self:end;font-size:clamp(55px,8vw,126px);margin:0}.home-rover-name{font-size:clamp(22px,3vw,39px);font-weight:800;color:#efc6a4;align-self:start}.home-screen .rover-art{grid-column:2;grid-row:1/5;align-self:center;min-height:280px}.home-stats{display:flex;flex-wrap:wrap;gap:12px;color:#d6c9c2;font-weight:750}.home-stats > span{border-left:3px solid #ce885b;padding:5px 12px}.hero-play{font-size:24px;min-height:62px;width:min(340px,100%);text-align:center}.menu-grid{grid-column:1/-1;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:16px 0 0}.menu-grid button{min-height:65px;text-align:center;background:#273242cc;font-size:14px}.menu-grid button:first-child{background:#273242cc;color:var(--ink);border-color:var(--outline)}.menu-grid button:last-child{grid-column:auto}
.rover-art{width:100%;min-height:190px;display:grid;place-items:center;background:radial-gradient(ellipse at 50% 75%,#936c5a55 0,#27344100 70%);overflow:hidden}.rover-art svg{width:min(100%,640px);height:auto;filter:drop-shadow(0 24px 18px #0009)}.compact-art{min-height:150px}.compact-art svg{width:min(100%,390px)}
.track-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px;padding-bottom:32px}.track-card{display:flex;flex-direction:column;gap:8px;min-height:225px;padding:19px;background:#26303dbd;border:1px solid #95694e66;border-radius:18px}.track-card.current{border-color:#e3a270}.track-card-head{display:flex;align-items:center;gap:10px;color:#e9a975;font-size:18px;font-weight:900}.track-card h2{font-size:20px;margin:3px 0 0}.track-card p{font-size:12px;margin:0;color:#c5bdba}.track-status{color:#e1d7cc;font-size:12px;line-height:1.5;flex:1}.track-card button{align-self:start;min-width:120px}.test-badge{display:inline-block;background:#624b35;color:#ffe1ac;border-radius:999px;padding:10px 15px;font-size:12px;letter-spacing:.07em}
.garage-layout{display:grid;grid-template-columns:minmax(420px,1.5fr) minmax(300px,1fr);gap:clamp(28px,5vw,72px)}.garage-layout .rover-art{min-height:310px}.garage-sidebar{padding:20px 0}.garage-sidebar h2{font-size:36px;margin:0}.rover-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.rover-card{display:flex;flex-direction:column;gap:8px;background:#26303dbb;border:1px solid #8e725e6b;border-radius:16px;padding:12px}.rover-card.selected{border-color:#e6aa7a;background:#35404e}.rover-card strong,.rover-card small{display:block}.rover-card small{font-size:11px;line-height:1.35;color:#d2c3b7;margin-top:4px}.rover-card button{margin-top:auto;min-height:42px}.mini-rover svg{width:100%;height:auto}.stat-list{display:grid;gap:10px;margin:20px 0}.stat-list>div{display:grid;grid-template-columns:95px 1fr 48px;gap:10px;align-items:center}.stat-list meter{width:100%;height:12px}.stat-list b{font-size:12px;text-align:right}.garage-sidebar .panel-actions{margin-top:28px}
.upgrade-rows{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin:15px 0 24px}.upgrade-card{display:flex;flex-direction:column;gap:11px;background:#26303dc4;border:1px solid #95694e70;border-radius:16px;padding:18px;min-height:250px}.upgrade-heading{display:flex;gap:14px;align-items:center}.upgrade-heading .ui-icon{width:35px;height:35px;color:#e5aa78}.upgrade-heading strong,.upgrade-heading small{display:block}.upgrade-heading strong{font-size:18px}.upgrade-heading small{font-size:12px;color:#e0bb9e}.upgrade-card progress{width:100%;height:9px;accent-color:#db9766}.upgrade-card p{font-size:13px;margin:0;flex:1}.upgrade-cost{font-size:12px;color:#e8bd94}.upgrade-card button{min-height:45px}.prepare-layout{display:grid;grid-template-columns:1fr 1fr;gap:7vw;align-items:center;max-width:1200px;margin:auto}.prepare-layout h2{font-size:clamp(28px,4vw,48px)}.prepare-layout .rover-art{min-height:280px}.nickname-label{display:block;margin-top:28px;font-size:14px!important}.nickname-input{width:150px;max-width:100%;font:800 28px ui-monospace,monospace;color:#fff;background:#2b3443;border:1px solid #c18b66;border-radius:10px;padding:8px 12px;letter-spacing:.12em}.prepare-layout small{display:block;margin:6px 0 18px;color:#c6b9af}.ghost-choice{display:flex!important;margin:18px 0!important;align-items:center;gap:8px}.ghost-choice input{flex:none}.result-screen{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;padding-left:clamp(25px,12vw,190px)}.result-screen h1{font-size:clamp(42px,8vw,95px)}.result-grid{font-size:18px;line-height:1.7;max-width:780px}.result-screen .panel-actions{gap:12px;margin-top:30px}.result-screen .panel-actions button{min-height:50px}
@media(max-width:900px){.home-screen{display:block}.home-screen .rover-art{min-height:180px;height:220px}.home-screen>h1{font-size:clamp(55px,11vw,90px);margin-top:20px}.home-stats{margin:14px 0}.menu-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.garage-layout{grid-template-columns:1fr}.garage-layout .rover-art{min-height:200px;height:250px}.garage-sidebar{padding:0}.prepare-layout{gap:20px}}
@media(max-width:600px){.panel,.menu-panel{padding:18px max(14px,env(safe-area-inset-left)) max(24px,env(safe-area-inset-bottom))}.panel h1{font-size:34px}.screen-head{align-items:flex-start;gap:10px;margin-bottom:18px}.screen-head .back-btn{order:-1;width:100%;text-align:left}.screen-head .test-badge{font-size:10px;padding:7px 9px}.home-screen .rover-art{height:160px;min-height:150px}.home-screen>h1{font-size:58px;margin-top:8px}.home-rover-name{font-size:21px}.hero-play{width:100%;min-height:56px}.menu-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.menu-grid button{min-height:48px;font-size:12px;padding:8px}.track-cards{grid-template-columns:1fr;gap:10px}.track-card{min-height:0;padding:15px}.rover-cards{grid-template-columns:1fr}.rover-card{display:grid;grid-template-columns:80px 1fr auto;align-items:center}.rover-card button{margin:0;font-size:11px}.garage-layout .rover-art{height:180px;min-height:160px}.upgrade-rows{grid-template-columns:1fr}.upgrade-card{min-height:0}.prepare-layout{display:flex;flex-direction:column-reverse;align-items:stretch}.prepare-layout .rover-art{height:150px;min-height:130px}.prepare-layout h2{font-size:27px}.result-screen{justify-content:flex-start;padding-top:35px}.result-screen h1{font-size:45px}.result-screen .panel-actions{width:100%}.result-screen .panel-actions button{flex:1 1 44%}}
@media(max-height:500px) and (min-width:650px){.home-screen{display:grid;grid-template-columns:1fr 1fr;gap:5px}.home-screen .rover-art{grid-column:2;grid-row:1/5;height:160px;min-height:0}.home-screen>h1{font-size:50px}.menu-grid{grid-column:1/-1;grid-template-columns:repeat(5,1fr);margin:4px 0}.menu-grid button{min-height:38px}.panel{padding-top:12px}}
.menu-grid button{display:flex;align-items:center;justify-content:center;gap:8px}.menu-grid .ui-icon{width:20px;height:20px;color:#e5aa78}
.upgrade-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px}.upgrade-controls button{font-size:26px;line-height:1;min-height:46px}
.finish-upgrade-hint{display:grid;gap:7px;width:min(100%,480px);margin-top:14px;padding:13px 16px;border:1px solid #d7a6758a;border-radius:14px;background:#213345e8;color:#f7eadb;box-shadow:0 8px 24px #070e1b66}.finish-upgrade-hint[hidden]{display:none}.finish-upgrade-hint strong{font-size:16px}.finish-upgrade-hint span{font-size:13px;color:#e8c8ac}.finish-upgrade-hint>div{display:flex;flex-wrap:wrap;gap:8px}.finish-upgrade-hint button{min-height:44px;padding:8px 14px}.upgrade-card-recommended{outline:2px solid #e7b47f;outline-offset:3px;box-shadow:0 0 0 6px #e7b47f33,0 10px 26px #070e1b78}
@media(max-height:800px){.result-screen{justify-content:flex-start}}
.capsule-hud{position:absolute;z-index:3;top:55px;right:12px;padding:8px 12px;border-radius:10px;background:#233c49e8;border:1px solid #8cc8c1;color:#e8fff9;font-size:12px;font-weight:800;max-width:240px;text-align:right}.capsule-result{color:#bde5df!important;font-weight:700}
.game:not(.in-drive) #menuBtn,.game:not(.in-drive) #helpBtn,.game:not(.in-drive) #pauseBtn,.game:not(.in-drive) #restartBtn{display:none}
@media(max-width:720px){.capsule-hud{top:150px;right:8px;font-size:10px;max-width:150px}}
.skin-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px;margin:26px 0 35px}.skin-card{background:#26303dba;border:1px solid #9a725652;border-radius:16px;padding:17px;display:flex;flex-direction:column;gap:8px}.skin-card.premium{border-color:#bd8b63}.skin-card .rover-art{min-height:145px;height:150px}.skin-card .rover-art svg{width:100%}.skin-card h2{font-size:19px;margin:4px 0}.skin-card p{font-size:13px;margin:0;flex:1}.skin-card strong{color:#e7bb86}.skin-card button{min-height:43px}#shopWallet{display:flex;align-items:center;gap:8px}#shopWallet .ui-icon{color:#e9ad73}#shopWallet small{color:#e2c9ae}.profile-top{display:flex;gap:20px;align-items:center;margin:24px 0}.profile-top strong{font-size:25px}.profile-avatar{width:96px;height:96px;border:2px solid #d4a16e;border-radius:50%;display:grid;place-items:center;background:#263443}.profile-avatar .ui-icon{width:54px;height:54px;color:#e9ad73}.profile-avatars{display:flex;gap:9px;margin:14px 0 25px}.profile-avatars button{width:56px;height:56px}.profile-avatars .ui-icon{color:#e9ad73}.profile-stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px;max-width:1000px;margin:24px 0}.profile-stats span{padding:16px;background:#26303dbd;border-radius:11px}#profileContent label{display:block;margin-bottom:8px}#saveProfileBtn{margin-left:10px;min-height:45px}
.audio-mixer{max-width:700px;display:grid;gap:11px;margin:20px 0;padding:20px;background:#26303db9;border-radius:14px}.audio-mixer h2{font-size:20px;margin:0 0 6px}.audio-mixer label{display:grid!important;grid-template-columns:165px 1fr;gap:14px;align-items:center;margin:0!important}.audio-mixer input{width:100%;accent-color:#db9766}@media(max-width:480px){.audio-mixer label{grid-template-columns:1fr;gap:2px}}
#wallet,#upgradeWallet,#homeWallet{display:inline-flex;align-items:center;gap:7px;flex-wrap:wrap}#wallet .ui-icon,#upgradeWallet .ui-icon,#homeWallet .ui-icon{width:19px;height:19px;color:#83c8c7}#wallet .ui-icon:nth-of-type(2),#upgradeWallet .ui-icon:nth-of-type(2),#homeWallet .ui-icon:nth-of-type(2){color:#dfac75}#wallet small,#upgradeWallet small,#homeWallet small{color:#e0b58e}.currency-help{display:flex;flex-wrap:wrap;gap:12px}.currency-help p{display:flex;align-items:center;gap:9px;margin:0;padding:10px 14px;background:#293848;border-radius:10px;font-size:13px}.currency-help .ui-icon{color:#8bc9c7}
.comic-layout{display:grid;grid-template-columns:minmax(300px,1.6fr) minmax(250px,.8fr);gap:35px;align-items:center;max-width:1300px;margin:30px auto}.comic-frame{position:relative;overflow:hidden;border:4px solid #d5b38f;border-radius:18px;background:#263542;box-shadow:0 20px 60px #0006}#comicArt svg{width:100%;height:auto;display:block}.comic-bubble{position:absolute;left:7%;bottom:7%;max-width:70%;padding:14px 18px!important;border-radius:18px 18px 18px 3px;background:#f5e8d7;color:#172332!important;font-weight:800;font-size:clamp(13px,1.4vw,20px)!important;box-shadow:0 5px 12px #0005}.comic-layout h2{font-size:clamp(29px,4vw,53px)}@media(max-width:750px){.comic-layout{grid-template-columns:1fr}.comic-bubble{max-width:85%;padding:9px 12px!important}#storyCounter{font-size:12px}}
.account-actions{display:flex;flex-wrap:wrap;align-items:center;gap:9px;margin:18px 0}.account-actions span{color:#bde5df;font-weight:750}.account-actions button{font-size:12px}
.record-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px;margin-top:28px}.local-record{display:flex;flex-direction:column;gap:8px;background:#26303dba;border:1px solid #9a725652;border-radius:13px;padding:15px}.local-record strong{font-size:15px}.local-record span{font:700 14px ui-monospace,monospace;color:#edbb92}.achievement-hero{display:flex;align-items:center;gap:20px;margin:28px 0;padding:25px;background:#26303d9c;border-left:4px solid #d38a5a}.achievement-hero .ui-icon{width:60px;height:60px;color:#e9ad73}.achievement-hero p{font-size:clamp(18px,2vw,25px);margin:0}.achievement-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;max-width:850px}.achievement-card{display:flex;align-items:center;gap:18px;background:#273442;padding:20px;border-radius:14px}.achievement-card .ui-icon{width:44px;height:44px;color:#e9ad73}.achievement-card div{display:grid;gap:6px;flex:1}.achievement-card span{color:#edbb92}.achievement-card progress{width:100%;accent-color:#dc9566}.editorial-card{display:flex;gap:25px;align-items:center;max-width:850px;margin-top:30px;padding:35px;background:#26303da8;border-radius:18px}.editorial-card .ui-icon{width:65px;height:65px;color:#e9ad73}.editorial-card p{font-size:clamp(17px,2vw,24px)}.support-copy{columns:2;column-gap:48px;max-width:1100px}.support-copy p{break-inside:avoid}.panel .panel-actions a{display:inline-flex;align-items:center;justify-content:center;padding:10px 18px;color:var(--ink);background:#28303d;border:1px solid var(--outline);border-radius:10px;text-decoration:none;font-weight:700}
@media(max-width:600px){.achievement-cards{grid-template-columns:1fr}.editorial-card{padding:20px;align-items:flex-start}.editorial-card .ui-icon{width:40px;height:40px}.support-copy{columns:1}}

/* v0.6.2 editorial scale: menus use a shared, readable type and spacing system. */
:root{--ui-body:16px;--ui-secondary:14px;--ui-label:16px;--ui-card-title:20px;--ui-section-title:clamp(27px,3vw,42px);--ui-gap:18px}
.panel.game-screen,.panel.menu-panel{font-size:var(--ui-body)}
.panel.game-screen h1,.panel.menu-panel h1{font-size:var(--ui-section-title);line-height:1.12;margin:5px 0 17px}
.panel.game-screen p,.panel.menu-panel p{font-size:var(--ui-body);line-height:1.55}
.panel.game-screen small,.panel.menu-panel small,.panel .fine-print{font-size:var(--ui-secondary)}
.panel.game-screen label,.panel.menu-panel label{font-size:var(--ui-label);letter-spacing:0}
.panel.game-screen button,.panel.menu-panel button,.panel.menu-panel select{font-size:var(--ui-body);min-height:44px}
.panel input:not([type=checkbox]):not([type=range]),.panel select{font-size:16px}
.menu-grid button,.menu-grid button span{font-size:clamp(15px,1.25vw,18px)!important;line-height:1.2}
.menu-grid button{min-height:52px!important;padding:11px 13px!important}
.track-card h2,.rover-card strong,.skin-card h2,.achievement-card strong,.local-record strong{font-size:var(--ui-card-title)}
.track-card p,.rover-card small,.skin-card p,.achievement-card span,.local-record span{font-size:var(--ui-secondary)!important}
.eyebrow{font-size:12px;letter-spacing:.12em}.screen-head{gap:18px}.screen-head .back-btn{font-size:15px}
.settings-grid{max-width:780px;gap:14px}.settings-grid>label{min-height:66px;gap:14px;padding:15px 18px;align-items:center}
.setting-switch{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto;max-width:780px}
.setting-switch input{appearance:none;width:48px;height:28px;border-radius:99px;background:#56616d;border:1px solid #c2a48b;position:relative;cursor:pointer;margin:0}
.setting-switch input::after{content:'';position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#f2e6d8;transition:transform .16s ease}
.setting-switch input:checked{background:#2c8a86}.setting-switch input:checked::after{transform:translateX(20px)}
.setting-switch strong{min-width:72px;text-align:right;font-size:15px;color:#d6eee9}
.setting-explanation{max-width:780px;color:#c8d7d6!important;font-size:14px!important;margin:6px 0 20px!important}
.audio-mixer{max-width:780px}.audio-mixer label{font-size:16px!important}.mix-disabled{opacity:.45}#testSound{justify-self:start}
.about-hero{max-width:1100px;display:grid;grid-template-columns:150px 1fr;gap:30px;align-items:center;margin:18px 0 27px;padding:clamp(22px,4vw,45px);border-radius:22px;background:radial-gradient(circle at 20% 30%,#6b5d6b,#293b50 50%,#1d2636);border:1px solid #b48b70}
.about-orbit{width:140px;height:140px;display:grid;place-items:center;border:2px solid #dfa978;border-radius:50%;font-size:66px;color:#f9d5a5;box-shadow:0 0 0 14px #e9b97c18,inset 0 0 45px #e8b68a55}
.about-hero h2{font-size:clamp(25px,3vw,42px);margin:0 0 10px}.about-hero p{font-size:clamp(17px,1.6vw,23px)!important;max-width:670px}.about-hero small{color:#d8c8c0}
.about-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;max-width:1200px}.about-card{display:grid;grid-template-columns:48px 1fr;gap:18px;padding:25px;border-radius:16px;background:#253242;border:1px solid #bd896552}.about-card .ui-icon{width:42px;height:42px;color:#dea875}.about-card h3{font-size:21px;margin:0 0 8px}.about-card p{font-size:16px!important;margin:0!important}
.rover-story-layout{display:grid;grid-template-columns:minmax(280px,1fr) minmax(300px,1.2fr);gap:28px;align-items:start;max-width:1200px}.rover-story-layout>.rover-art{height:300px;position:sticky;top:0}.rover-story-layout h2{font-size:clamp(25px,3vw,39px)}#roverLore{padding:20px 24px;border-radius:16px;background:#263545;border-left:4px solid #d89462}#roverLore h3{font-size:23px;margin:6px 0}.lore-kicker{font-size:14px;font-weight:800;color:#9cddd7;text-transform:uppercase;letter-spacing:.08em}.lore-feature{font-weight:800;color:#f1c99f!important}.upgrade-lore{max-width:850px;padding:15px 18px;background:#263545;border-radius:12px;margin:16px 0}.upgrade-lore summary{cursor:pointer;font-weight:800}.upgrade-lore div{font-size:16px;line-height:1.6;margin-top:12px}
.shop-spotlight{display:grid;grid-template-columns:minmax(260px,1fr) minmax(250px,1fr);gap:20px;align-items:center;max-width:1100px;min-height:230px;margin:24px 0 35px;padding:20px 30px;background:radial-gradient(circle at 25% 20%,#425568,#253243 70%);border:1px solid #bf9373;border-radius:20px}.shop-spotlight .rover-art{height:230px}.shop-spotlight h2{font-size:clamp(23px,3vw,38px);margin:0 0 10px}.shop-spotlight b{color:#efbe82;font-size:22px}.skin-card{cursor:pointer}.skin-card:hover{border-color:#e9bb85}.skin-card small{color:#a9d9d5}
.comic-header{display:flex;align-items:end;justify-content:space-between;gap:20px;margin:12px 0 18px}.comic-header h2{font-size:clamp(24px,2.7vw,38px);margin:0}.comic-header p{max-width:340px;font-size:14px!important;margin:0!important}.comic-pages{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;max-width:1500px}.comic-panel{height:clamp(390px,53vh,650px);position:relative;overflow:hidden;border:4px solid #e6d5bc;border-radius:7px;background:#26384b;box-shadow:0 14px 25px #0005}.comic-scene{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.comic-shot{position:absolute;top:9px;left:10px;background:#172336d9;color:#f3ddbc;padding:4px 8px;border-radius:5px;font:800 13px ui-monospace,monospace}.comic-dialogue{position:absolute;inset:38px 10px auto;display:grid;gap:12px}.speech{position:relative;width:84%;max-width:350px;padding:13px 16px!important;margin:0!important;border:2px solid #172838;border-radius:20px;background:#fff4e6;color:#172636!important;box-shadow:0 5px 15px #0005;font-size:clamp(14px,1.2vw,18px)!important;line-height:1.3!important}.speech strong{display:block;color:#8e5339;font-size:13px;margin-bottom:4px}.speech span{display:block}.speech::after{content:'';position:absolute;bottom:-14px;left:24px;border:13px solid transparent;border-top-color:#fff4e6;border-bottom:0}.speech-1{justify-self:end;background:#e0f1ee}.speech-1::after{left:auto;right:24px;border-top-color:#e0f1ee}.comic-navigation{display:flex;justify-content:space-between;max-width:1500px;gap:16px;margin:18px 0}.comic-navigation button{min-width:150px}.comic-continued{font-size:clamp(26px,4vw,44px)!important;text-align:center;color:#efc18c!important}
#comicArt .comic-scene{width:100%;height:100%;}
@media(max-width:850px){.about-grid,.rover-story-layout,.shop-spotlight{grid-template-columns:1fr}.rover-story-layout>.rover-art{position:static}.comic-pages{grid-template-columns:1fr}.comic-panel{height:390px}.comic-dialogue{inset:34px 12px auto}.speech{font-size:16px!important}.comic-header{display:block}.about-hero{grid-template-columns:90px 1fr}.about-orbit{width:82px;height:82px;font-size:40px}.shop-spotlight .rover-art{height:170px}}
@media(max-width:480px){.panel.game-screen,.panel.menu-panel{padding:17px 14px}.panel.game-screen h1,.panel.menu-panel h1{font-size:clamp(26px,8vw,34px)}.about-hero{grid-template-columns:1fr;gap:12px}.about-grid{grid-template-columns:1fr}.about-card{grid-template-columns:34px 1fr;padding:18px;gap:10px}.about-card .ui-icon{width:30px;height:30px}.comic-panel{height:350px}.comic-dialogue{gap:9px}.speech{font-size:15px!important;padding:10px 12px!important}.comic-navigation button{min-width:0;flex:1}.setting-switch{grid-template-columns:minmax(0,1fr) auto auto}.setting-switch strong{min-width:65px}.menu-grid button{font-size:15px!important}.shop-spotlight{padding:17px}}
.record-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr));gap:16px;max-width:1500px}.local-record{padding:21px;gap:10px;border-color:#aa866e;background:linear-gradient(155deg,#2a3949,#24303e)}.local-record strong{font-size:22px}.local-record .record-number{color:#e8aa75;font-size:14px;font-weight:800;letter-spacing:.06em}.local-record p{font-size:14px!important;line-height:1.45!important;margin:0!important;min-height:62px}.local-record dl{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:7px 0}.local-record dl div{padding:8px 10px;background:#182636;border-radius:8px}.local-record dt{font-size:13px;color:#b8caca}.local-record dd{margin:3px 0 0;font-size:15px;font-weight:800}.record-identity{font-size:14px;color:#f0c09a}.local-record button{align-self:start;min-width:130px}
.track-stats-screen{max-width:960px}.track-stats-screen h2{font-size:clamp(24px,3vw,36px)}.track-stats-screen h3{margin-top:30px}.track-stats-local dl,.track-stats-public dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:10px}.track-stats-local dl div,.track-stats-public dl div{padding:14px;border:1px solid #a6816255;border-radius:10px;background:#1b2c3bdc}.track-stats-screen dt{font-size:13px;color:#c8beb4}.track-stats-screen dd{margin:6px 0 0;font-size:17px;font-weight:800;overflow-wrap:anywhere}
.track-stats-avatar{display:block;width:56px;height:56px;margin:0 0 8px;border-radius:12px;object-fit:cover}.track-stats-avatar[hidden]{display:none}
.profile-destinations{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:660px;margin:24px 0}.profile-destinations button{display:flex;align-items:center;gap:12px;min-height:68px;padding:12px 16px;text-align:left;border-color:#d4a16e;background:linear-gradient(135deg,#263f52,#233041)}.profile-destinations .ui-icon{width:30px;height:30px;color:#f3bb80;flex:none}@media(max-width:480px){.profile-destinations{grid-template-columns:1fr}.profile-destinations button{min-height:54px}}
/* Stage 6 completion: centered, fluid menus and quest/paint controls. */
:root{--content-width:1480px;--ui-body:16px;--ui-secondary:14px;--ui-label:16px;--ui-card-title:20px}
.panel.game-screen,.panel.menu-panel{width:min(calc(100% - 28px),var(--content-width));margin-inline:auto}
.panel.game-screen>:not(.screen-head),.panel.menu-panel>:not(.screen-head){max-width:100%}
.achievement-cards,.editorial-card,.settings-grid,.audio-mixer,.setting-switch,.setting-explanation,.support-copy,.profile-stats{max-width:none}
.achievement-cards{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr))}
.settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,330px),1fr));gap:18px}
.audio-mixer,.audio-preview{width:100%;max-width:none}
.panel.game-screen p,.panel.menu-panel p{font-size:var(--ui-body)}
.panel.game-screen small,.panel.menu-panel small{font-size:var(--ui-secondary)}
.track-card p,.track-status,.rover-card small,.upgrade-card p,.upgrade-cost,.skin-card p{font-size:var(--ui-secondary)!important}
.eyebrow{font-size:var(--ui-secondary)}
.quest-series{margin:24px 0 34px}.quest-series h2{font-size:clamp(22px,2vw,30px);margin:0 0 16px}
.quest-grid,.paint-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:16px}
.quest-card,.paint-card{display:flex;flex-direction:column;gap:9px;padding:20px;background:#263443;border:1px solid #9c755b;border-radius:15px;min-width:0}
.quest-card h3{font-size:20px;margin:0}.quest-card p{flex:1;margin:0!important}.quest-card strong,.quest-card small{font-size:14px}.quest-card progress{width:100%;accent-color:#d9945e}
.paint-swatch{height:56px;border-radius:9px;border:1px solid #ffffff50}.paint-card strong{font-size:18px}.paint-card button{margin-top:auto}
.audio-preview{margin:22px 0;padding:22px;border:1px solid #8e9e9e;border-radius:15px;background:#253647}.audio-preview h2{margin-top:0}.preview-buttons{display:flex;flex-wrap:wrap;gap:10px}.preview-buttons button{min-height:48px}
.reaction-box{margin:27px 0;padding:22px;border:1px solid #9c755b;border-radius:15px;background:#263443}.reaction-box h3{font-size:22px;margin:0}.reaction-buttons{display:flex;gap:14px}.reaction-buttons button{width:72px;height:72px}.reaction-buttons svg{width:42px;height:42px;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}.reaction-buttons .reacted{background:#568274;transform:scale(1.08)}
@media(max-width:600px){.panel.game-screen,.panel.menu-panel{width:calc(100% - 12px)}.quest-grid,.paint-grid{grid-template-columns:1fr}.preview-buttons button{flex:1 1 100%}.reaction-buttons button{min-width:64px}}
.screen-head{justify-content:flex-start}
.screen-head h1,.screen-head>div{margin-right:auto}
.quest-grid>.quest-card:last-child{grid-column:1/-1;justify-self:center;width:min(100%,340px)}
@media(max-width:600px){.quest-grid>.quest-card:last-child{width:100%}}
.toolbar button{font-size:14px;min-height:42px}
@media(max-width:720px){.toolbar button{font-size:13px;min-height:40px;padding:7px 10px}}
@media(max-height:430px){.toolbar button{font-size:12px;min-height:36px}}
/* Stage 6 correction: compact settings, pause, facts, garage selection, and engineering audio lab. */
.settings-screen{max-width:900px!important}.settings-layout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.setting-group{min-width:0;padding:18px;border:1px solid #8e725e6b;border-radius:14px;background:#253343}.setting-group h2{font-size:22px;margin:0 0 14px}.setting-group p{font-size:15px!important}.setting-row{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:48px}.setting-row span{font-size:16px}.setting-row select{min-width:145px;min-height:44px}.setting-row input[type=checkbox]{width:24px;height:24px;flex:none}.setting-row strong{font-size:15px;min-width:68px}.audio-mixer{display:block;width:100%;max-width:100%;padding:12px;margin:12px 0}.audio-mixer h3{font-size:18px;margin:0 0 10px}.audio-mixer .mix-row{display:grid!important;grid-template-columns:minmax(105px,1fr) minmax(100px,280px) 48px!important;gap:10px!important;min-height:46px!important;align-items:center;font-size:16px!important}.mix-row input[type=range]{width:100%;max-width:280px;min-height:36px}.mix-row output{font-size:15px;text-align:right}.pause-screen{max-width:780px!important}.pause-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.pause-actions button{min-height:50px}.fact-card{padding:18px;margin:18px 0;border:1px solid #c69669;border-radius:14px;background:#273549}.fact-card strong{font-size:19px;color:#f7cda8}.fact-card p{margin:9px 0;font-size:17px!important}.fact-card small{display:block;font-weight:700}.fact-card a{display:inline-block;margin-top:9px;color:#9ce9df;font-size:15px}.mini-fact{padding:12px}.mini-fact p{font-size:15px!important}.garage-quick{display:grid;gap:9px;margin:18px 0;padding:15px;border:1px solid #9d7c61;border-radius:12px}.garage-quick label{font-size:17px}.garage-quick select{min-height:48px;width:100%;background:#243241;color:#fff;border:1px solid #a68b73;border-radius:8px}.stat-list>div{grid-template-columns:25px minmax(95px,1fr) minmax(70px,1fr) 48px}.stat-list .ui-icon{width:22px;height:22px;color:#dfad7b}.pet-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.pet-card{padding:16px;border:1px solid #91765d;border-radius:14px;background:#263648}.pet-icon{display:block;font-size:36px;color:#edba8e}.pet-card h3{font-size:19px;margin:8px 0}.pet-card p{font-size:15px!important}.pet-card strong{color:#a6e7df}.audio-catalog{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:9px}.audio-track{text-align:left;min-height:54px}.audio-track[aria-pressed=true]{border-color:#a9e4d9;background:#345052}.motivation{font-size:17px;color:#e9bb91}
@media(max-width:720px){.settings-layout{grid-template-columns:1fr}.pet-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.pause-actions{grid-template-columns:1fr}}
@media(max-width:480px){.settings-screen{width:calc(100% - 12px)!important}.setting-group{padding:13px}.audio-mixer .mix-row{grid-template-columns:minmax(75px,1fr) minmax(90px,2fr) 44px!important}.pet-cards{grid-template-columns:1fr}}
@media(min-width:721px){.settings-layout{grid-template-rows:repeat(4,auto);align-items:start}.setting-group:nth-child(1){grid-area:1/1}.setting-group:nth-child(2){grid-area:1/2/5/3}.setting-group:nth-child(3){grid-area:2/1}.setting-group:nth-child(4){grid-area:3/1}.setting-group:nth-child(5){grid-area:4/1}}
.settings-layout .setting-switch{display:grid!important;grid-template-columns:minmax(0,1fr) 48px 73px;gap:10px}.settings-layout .setting-switch input[type=checkbox]{width:48px;height:28px}.settings-layout .setting-switch strong{min-width:0;text-align:right}
@media(max-width:720px){.settings-layout{display:grid;grid-template-columns:1fr;grid-template-rows:auto}.setting-group:nth-child(n){grid-area:auto}}
@media(min-width:1000px){.settings-screen{max-width:1100px!important}.settings-layout{grid-template-columns:minmax(0,1fr) minmax(0,1.3fr)}}

/* v0.7.2 garage, capsule and local profile presentation */
.garage-nav,.shop-filters,.quest-filters,.profile-slots,.profile-themes{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 22px}
.garage-nav button,.shop-filters button,.quest-filters button,.profile-slots button,.profile-themes button{min-height:42px}
.shop-filters [aria-pressed="true"],.quest-filters [aria-pressed="true"],.profile-slots [aria-pressed="true"],.profile-themes [aria-pressed="true"],.profile-avatars [aria-pressed="true"]{border-color:#f4c18f;background:#46516a}
.quest-summary{padding:14px 18px;border:1px solid #9c755b;border-radius:12px;background:#263443;margin-bottom:15px}
.profile-avatars{display:grid;grid-template-columns:repeat(3,minmax(90px,1fr));max-width:520px}.profile-avatars button{width:100%;height:82px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}.profile-avatars small{font-size:11px}.profile-avatars .ui-icon{width:27px;height:27px}
.skin-card .rover-art,.shop-spotlight .rover-art,.garage-layout .rover-art{overflow:visible}.skin-card .rover-art svg,.shop-spotlight .rover-art svg{max-width:100%;max-height:100%;object-fit:contain}
.interaction-hud,.dust-hud{position:absolute;z-index:6;left:50%;transform:translateX(-50%);top:18%;padding:9px 15px;border-radius:10px;background:#162638d9;border:1px solid #e6bc90;color:#fff;font-weight:750;text-align:center;pointer-events:none}.dust-hud{top:24%;border-color:#e6a766}
:root[data-profile-theme="kosmo-light"] #profilePanel{background:linear-gradient(150deg,#3e5365,#657e87);color:#fff}
:root[data-profile-theme="martian-spectrum"] #profilePanel{background:linear-gradient(135deg,#403546,#76514d 52%,#263c48);color:#fff}
@media(max-width:600px){.garage-nav,.shop-filters,.quest-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.garage-nav button,.shop-filters button,.quest-filters button{font-size:12px}.interaction-hud,.dust-hud{top:12%;width:max-content;max-width:90%;font-size:12px}.dust-hud{top:19%}}

.paint-preview{min-height:125px;height:135px}.paint-preview svg{width:100%;max-height:100%;object-fit:contain}.paint-card{min-height:260px}

/* Stage 7 production hangar: static art remains available when WebGL fails. */
.home-screen{position:relative;isolation:isolate;background:#151b23 url('./assets/stage7/hangar.webp') center 50%/cover no-repeat}
.home-screen::before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#101722ef 0%,#101722cf 34%,#10172244 67%,#10172222 100%)}
.home-screen>.eyebrow,.home-screen>h1,.home-rover-name,.home-stats,.hero-play,.home-screen>.menu-grid{position:relative;z-index:2}
.home-screen>h1{text-shadow:0 4px 28px #000b}
.home-screen .menu-grid button{background:linear-gradient(145deg,#273445ed,#1a2534e8);border-color:#b68b6a66;box-shadow:inset 0 1px #ffffff13,0 7px 24px #080e18aa}
.home-screen .menu-grid button:hover,.home-screen .menu-grid button:focus-visible{border-color:#e1ab80;background:#344459f2}
.home-3d{grid-column:2;grid-row:1/5;position:relative;z-index:1;align-self:center;width:100%;height:clamp(310px,42vh,560px);min-width:0;touch-action:pan-y;background:transparent;border:0;overflow:visible;transform:translateY(115px)}
.home-3d canvas{width:100%;height:100%;display:block;touch-action:pan-y}
.home-3d-caption{position:absolute;right:14px;bottom:8px;padding:7px 10px;border:1px solid #d3aa7f88;border-radius:7px;background:#16202acb;color:#f4d5b3;font:700 11px/1.3 system-ui;letter-spacing:.08em;pointer-events:none;z-index:2}
.home-3d-caption [lang=en]{display:none}html[lang=en] .home-3d-caption [lang=en]{display:inline}html[lang=en] .home-3d-caption [lang=cs]{display:none}
.home-3d:not(.ready){visibility:hidden;pointer-events:none}
@media(max-width:900px){.home-3d{height:clamp(250px,40vw,390px);margin:0 auto;transform:translateY(45px)}.home-screen{background-position:60% center}.home-screen::before{background:linear-gradient(180deg,#101722dd,#10172299 42%,#101722dd 100%)}}
@media(max-width:600px){.home-3d{height:270px;transform:translateY(55px)}.home-3d-caption{display:none}.home-screen .menu-grid button{font-size:13px;min-height:50px}}
.home-3d img,.home-3d canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.home-3d.ready img{display:none}.home-3d:not(.ready) .home-3d-caption{display:none}
.home-screen #homeRoverArt{display:grid}
.home-screen:has(.home-3d.ready) #homeRoverArt{display:none}
.home-3d .home-astronaut-static{display:none;position:absolute;left:8%;bottom:5%;width:30%;height:74%;filter:drop-shadow(0 8px 8px #0009)}
.home-3d[data-graphics="low"],.home-3d[data-status="fallback"]{display:block;visibility:visible;pointer-events:none}
.home-3d[data-graphics="low"] img,.home-3d[data-status="fallback"] img{inset:auto 0 2% auto;width:64%;height:90%}
.home-3d[data-graphics="low"] .home-astronaut-static,.home-3d[data-status="fallback"] .home-astronaut-static{display:block}
.home-3d[data-graphics="low"] .home-astronaut-static,.home-3d[data-status="fallback"] .home-astronaut-static{pointer-events:auto;cursor:pointer}
.home-3d.astronaut-greeting .home-astronaut-static{transform:rotate(-5deg);transform-origin:50% 80%}
.home-fact-caption{position:absolute;z-index:5;left:2%;top:8%;max-width:min(48%,320px);padding:9px 12px;background:#13283eea;border:1px solid #e1b88d;border-radius:10px;color:#fff4e5;font:700 14px/1.35 system-ui;pointer-events:none}
.home-fact-caption[hidden]{display:none}
.home-screen:has(.home-3d[data-graphics="low"]) #homeRoverArt,.home-screen:has(.home-3d[data-status="fallback"]) #homeRoverArt{display:none}
.result-rover-art{width:min(100%,360px);min-height:110px;height:130px;margin:0 auto 8px;background:none}
.result-rover-art svg{width:100%;max-height:130px;filter:drop-shadow(0 10px 8px #0008)}
@media(min-width:901px){.home-screen #homeRoverArt{transform:translateY(32px)}}
/* v0.8.2 screen environments and readable instrument surfaces. */
#tracksPanel{background:linear-gradient(90deg,#101925f0,#17212dc9),url('./assets/stage7/landscape-plain-b14.webp') center/cover no-repeat}
#garagePanel,#roverPanel,#upgradesPanel{background:linear-gradient(90deg,#101925e8,#132030c4),url('./assets/stage7/hangar.webp') center/cover no-repeat}
#garagePanel .garage-sidebar,#roverPanel .rover-story-layout>div:last-child{padding:clamp(18px,2.5vw,28px);border:1px solid #d7a77a5e;border-radius:18px;background:linear-gradient(155deg,#263545ee,#192431ef);box-shadow:inset 0 1px #ffffff19,0 16px 36px #080c15a3}
#garagePanel .garage-layout>.rover-art,#garagePanel #garagePreview{background:radial-gradient(ellipse at 50% 75%,#b8846240,#17212c00 70%)}
.track-card,.rover-card,.upgrade-card{background:linear-gradient(155deg,#2b3b4ae8,#182433ee);border:1px solid #d3a57b66;box-shadow:inset 0 1px #ffffff1b,0 10px 26px #070e1b78;backdrop-filter:blur(5px)}
.track-card.current,.rover-card.selected{border-color:#f1bb84;box-shadow:inset 0 1px #ffffff30,0 0 0 1px #bf8156aa,0 10px 28px #07101cb0}
#tracksPanel .track-card-head{color:#f6bc84}#garagePanel .garage-nav button{background:#263748e8;border-color:#bc8f6970;min-height:48px}
#garagePanel .garage-nav button:hover,#garagePanel .garage-nav button:focus-visible{border-color:#f2bd86;background:#3a4b58}
#upgradesPanel .upgrade-card p,#tracksPanel .track-card p{color:#eadbd0;line-height:1.48}
@media(max-width:600px){#garagePanel .garage-sidebar,#roverPanel .rover-story-layout>div:last-child{padding:16px}.track-card,.rover-card,.upgrade-card{backdrop-filter:none}.screen-head h1{overflow-wrap:anywhere}}
.track-thumb,.record-thumb{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:10px;border:1px solid #dab38b66;background:#263b47}.track-card .track-thumb{margin:2px 0 5px}.record-thumb{margin-bottom:10px}.track-card{min-height:0}.track-card .track-status{flex:0 0 auto}.track-card button{margin-top:auto}

/* The five mechanical branches form one readable workshop row on wide displays. */
@media(min-width:1150px){#upgradesPanel .upgrade-rows{grid-template-columns:repeat(5,minmax(0,1fr))}}

/* Two distinct destinations in the appearance workshop. */
#skinsPanel{background:linear-gradient(100deg,#111d2bf2,#162334d9),url('./assets/stage7/hangar.webp') center/cover no-repeat}
.shop-mode-nav{display:flex;gap:10px;flex-wrap:wrap;margin:22px 0 18px;padding-bottom:15px;border-bottom:1px solid #d3a87d66}
.shop-mode-nav button{min-height:48px;padding:10px 20px;font-size:16px;font-weight:800;background:#25364aee;border-color:#c8a07a77}
.shop-mode-nav button[aria-pressed="true"]{background:#b77243;color:#1b1515;border-color:#f2c291;box-shadow:0 6px 24px #080d18a0}
.shop-section{max-width:1480px;padding:clamp(18px,2.3vw,32px);border:1px solid #d3a87d55;border-radius:18px;background:linear-gradient(140deg,#223246dc,#162434f1);box-shadow:0 16px 35px #08101c70}
.shop-section[hidden]{display:none}
.shop-store{background:linear-gradient(140deg,#263745ea,#19283aed),url('./assets/stage7/landscape-copper-maze.webp') center/cover no-repeat}
.shop-section .shop-filters{margin-top:0}
@media(max-width:600px){.shop-mode-nav{display:grid;grid-template-columns:1fr 1fr}.shop-mode-nav button{padding:9px 7px;font-size:14px}.shop-section{padding:15px}}

/* The expedition journal, medals, time records and crew profile have their own places. */
#questsPanel{background:linear-gradient(105deg,#111d2bf4,#142735e4),url('./assets/stage7/landscape-delta.webp') center/cover no-repeat}
#achievementsPanel{background:linear-gradient(105deg,#111b28f3,#352b2de7),url('./assets/stage7/landscape-last-horizon.webp') center/cover no-repeat}
#recordsPanel{background:linear-gradient(105deg,#101d2ef5,#15283de8),url('./assets/stage7/landscape-terraces.webp') center/cover no-repeat}
#profilePanel{background:linear-gradient(105deg,#141b2bf5,#26233be8),url('./assets/stage7/landscape-phobos-shadow.webp') center/cover no-repeat}

/* Settings stay compact; the sound desk receives its own full-size screen. */
#settingsPanel{background:linear-gradient(105deg,#121d2cf4,#263247e7),url('./assets/stage7/hangar.webp') center/cover no-repeat}
#audioSettingsPanel{max-width:1100px!important;background:linear-gradient(105deg,#10192bf2,#22263ce5),url('./assets/stage7/landscape-night-b14.webp') center/cover no-repeat}
@media(min-width:721px){#settingsPanel .settings-layout{grid-template-rows:auto;align-items:stretch}#settingsPanel .setting-group:nth-child(n){grid-area:auto}}
#audioSettingsPanel .audio-settings-layout{max-width:950px}
#audioSettingsPanel .setting-group{padding:clamp(18px,2vw,30px)}
#audioSettingsPanel .setting-row.setting-switch{display:grid!important;grid-template-columns:minmax(0,1fr) 48px 73px;gap:10px}
#audioSettingsPanel .setting-row.setting-switch input{width:48px;height:28px}
#audioSettingsPanel .setting-row.setting-switch strong{min-width:0;text-align:right}
@media(max-width:480px){#audioSettingsPanel .setting-row.setting-switch{grid-template-columns:minmax(0,1fr) 48px 55px}}

/* Field manual, expedition briefing, comic and community desk. */
#controlsPanel{background:linear-gradient(105deg,#111d2af5,#1c2a39e9),url('./assets/stage7/landscape-iron.webp') center/cover no-repeat}
#aboutPanel{background:linear-gradient(105deg,#131d2bf4,#292939e9),url('./assets/stage7/landscape-wind-steps.webp') center/cover no-repeat}
#storyPanel{background:linear-gradient(105deg,#121b2bf4,#2a263de7),url('./assets/stage7/landscape-night-b14.webp') center/cover no-repeat}
#supportPanel{background:linear-gradient(105deg,#131d2bf5,#2b293be8),url('./assets/stage7/landscape-last-horizon.webp') center/cover no-repeat}

/* In-race decisions and outcomes use the same Mars scenery as the expedition. */
#preparePanel{background:linear-gradient(105deg,#121e2df4,#1c2a39e8),url('./assets/stage7/landscape-plain-b14.webp') center/cover no-repeat}
#pausePanel{background:linear-gradient(105deg,#101a2af5,#25283cea),url('./assets/stage7/landscape-night-b14.webp') center/cover no-repeat}
#crashPanel{background:linear-gradient(105deg,#211a24f4,#321f28e8),url('./assets/stage7/landscape-fissure.webp') center/cover no-repeat}
#finishPanel{background:linear-gradient(105deg,#14242cf3,#243746e7),url('./assets/stage7/landscape-last-horizon.webp') center/cover no-repeat}
.result-rewards{width:min(100%,780px);margin:16px 0 4px;padding:18px 22px;border:1px solid #e0b88988;border-radius:17px;background:linear-gradient(110deg,#263644f0,#192d3bea),url('./assets/stage7/landscape-mineral-sills.webp') center/cover no-repeat;box-shadow:0 15px 35px #07101b8a}
.result-rewards h2{display:flex;align-items:center;gap:10px;margin:0 0 8px;font-size:clamp(20px,2vw,27px)}
.result-rewards h2 .ui-icon{color:#f2bd81}
.result-rewards p{margin:5px 0;color:#f5e4d2}
.crash-rewards{border-color:#d68d756b;background:linear-gradient(110deg,#302a36f0,#251f2de8),url('./assets/stage7/landscape-fissure.webp') center/cover no-repeat}
#developerPanel{background:linear-gradient(105deg,#101e2af4,#17323be8),url('./assets/stage7/landscape-basalt-b14.webp') center/cover no-repeat}
#audioLabPanel{background:linear-gradient(105deg,#111b2cf5,#292941e7),url('./assets/stage7/landscape-night-b14.webp') center/cover no-repeat}
@media(max-width:600px){.result-rewards{padding:15px}.result-rewards h2{font-size:20px}}

#helpDialog{background:linear-gradient(120deg,#1e2c3cf5,#182739ed),url('./assets/stage7/landscape-channel.webp') center/cover no-repeat}
#confirmDialog .confirm-content{background:linear-gradient(120deg,#283849f4,#1b2635eb),url('./assets/stage7/landscape-fissure.webp') center/cover no-repeat}
.developer-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;max-width:1050px;margin:28px 0}
.developer-metric{display:grid;grid-template-columns:36px minmax(0,1fr);gap:3px 14px;align-items:center;min-height:110px;padding:19px;border:1px solid #96c9c48a;border-radius:14px;background:#213746e8;box-shadow:inset 0 1px #ffffff17}
.developer-metric .ui-icon{grid-row:1/3;color:#9ae1d9;width:32px;height:32px}
.developer-metric span{font-size:14px;color:#b9dad8}.developer-metric strong{font-size:clamp(17px,1.8vw,23px);overflow-wrap:anywhere}
@media(max-width:800px){.developer-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.developer-summary{grid-template-columns:1fr;gap:10px}.developer-metric{min-height:78px;padding:13px}}

/* Small contextual dust warning: keep the driving centre unobstructed. */
.dust-hud{top:112px;left:auto;right:12px;transform:none;max-width:220px;width:auto;padding:6px 10px;border-color:#e6a766;font-size:12px;text-align:right}
.expedition-progress{position:absolute;z-index:3;right:max(12px,env(safe-area-inset-right));top:max(12px,env(safe-area-inset-top));width:min(345px,42vw);padding:9px 11px;border:1px solid #c7946b80;border-radius:11px;background:#101824cb;backdrop-filter:blur(5px);color:#fff1dc;pointer-events:none}.expedition-progress>strong{display:block;margin-bottom:6px;font-size:12px;letter-spacing:.04em}.expedition-progress-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 8px}.progress-item{display:flex;align-items:center;gap:5px;min-width:0;font-size:14px;color:#f4c68d}.progress-item b{font:800 13px ui-monospace,SFMono-Regular,monospace;color:#f7eee5}.progress-item small{font-size:10px;color:#e8d8c9;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:720px){.expedition-progress{right:7px;top:8px;width:auto;max-width:168px;padding:6px 7px}.expedition-progress>strong{font-size:9px;margin-bottom:3px}.expedition-progress-grid{gap:2px 6px}.progress-item{font-size:11px}.progress-item b{font-size:11px}.progress-item small{display:none}}
@media(max-width:420px){.expedition-progress{top:10px;max-width:130px}.progress-item{font-size:10px}.progress-item b{font-size:10px}}
/* Stage 7.1: one local player's identity follows the menu, ride and result. */
.home-identity,.hud-identity,.result-identity,.record-identity{display:flex;align-items:center;gap:9px;min-width:0}
.home-identity{padding:7px 10px;border:1px solid #d6a47b80;border-radius:12px;background:#132237e8;color:#fff4e8}
.home-identity img,.hud-identity img,.result-identity img,.record-identity img{display:block;flex:none;object-fit:cover;border-radius:50%;border:1px solid #e9b784}
.home-identity strong,.hud-identity strong,.result-identity strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.home-identity button{min-height:32px;padding:4px 9px;font-size:11px;white-space:nowrap}
.home-stats .home-identity{max-width:100%}
.hud-identity{width:max-content;max-width:100%;padding:4px 7px;border-radius:9px;background:#101824c9;color:#fff0df;font-size:12px}
.result-identity{margin:4px 0 10px;color:#f4c69e;font-size:18px}
.record-identity{min-height:34px}.record-identity span{overflow-wrap:anywhere}
:root[data-profile-theme="kosmo-dark"] .home-identity{background:linear-gradient(105deg,#0e1b30ec,#263e59d9),url('./assets/stage7/profile/kosmo-dark.webp') center/cover}
:root[data-profile-theme="kosmo-light"] .home-identity{background:linear-gradient(105deg,#254558e9,#597582b9),url('./assets/stage7/profile/kosmo-light.webp') center/cover}
:root[data-profile-theme="martian-spectrum"] .home-identity{background:linear-gradient(105deg,#281d35eb,#70445ab9),url('./assets/stage7/profile/martian-spectrum.webp') center/cover}
@media(max-width:720px){.hud-identity{padding:3px 5px;font-size:10px;gap:5px}.hud-identity img{width:22px;height:22px}.home-identity img{width:36px;height:36px}}
@media(max-width:420px){.hud-identity{max-width:94px}.home-identity{gap:6px}.home-identity button{font-size:10px;padding:4px 6px}.result-identity{font-size:14px}}
@media(max-width:720px){.track-title{top:185px}.risk-warning{top:225px}}
.meteor-hud{position:absolute;z-index:4;top:118px;right:12px;max-width:min(360px,48vw);padding:7px 10px;border:1px solid #f5b877;border-radius:9px;background:#44251fd9;color:#fff1d3;font-size:12px;font-weight:800;text-align:right;pointer-events:none;box-shadow:0 0 14px #fb995b55}
@media(max-width:720px){.meteor-hud{top:122px;right:7px;max-width:160px;font-size:10px;padding:6px 7px}}
@media(max-width:600px){.dust-hud{top:140px;left:auto;right:8px;max-width:170px;width:auto;font-size:11px}}
@media (pointer:coarse) and (orientation:landscape){.viewport .toast{top:42px;max-width:min(35vw,260px);padding:5px 7px;font-size:10px;line-height:1.2}}
@media (pointer:coarse) and (orientation:landscape) and (max-width:720px){.viewport .toast{top:36px;left:57%}}

/* Three illustrated crew themes and nine original expedition portraits. */
:root[data-profile-theme="kosmo-dark"] #profilePanel{background:linear-gradient(100deg,#111b2ce8 0%,#132338db 52%,#111b2c9c 100%),url('./assets/stage7/profile/kosmo-dark.webp') center/cover no-repeat;color:#f7f2eb}
:root[data-profile-theme="kosmo-light"] #profilePanel{background:linear-gradient(100deg,#223849e8 0%,#375363c9 56%,#40607493 100%),url('./assets/stage7/profile/kosmo-light.webp') center/cover no-repeat;color:#fffdf8}
:root[data-profile-theme="martian-spectrum"] #profilePanel{background:linear-gradient(100deg,#211b2cde 0%,#3a2941d3 52%,#503f49a0 100%),url('./assets/stage7/profile/martian-spectrum.webp') center/cover no-repeat;color:#fff7f0}
#profilePanel .profile-top{width:fit-content;max-width:100%;padding:16px 22px;border:1px solid #dfb7927d;border-radius:18px;background:#162538d9;box-shadow:0 12px 28px #0b101c94}
#profilePanel .profile-top p{margin:5px 0 0;color:#eee4db}
#profilePanel .profile-avatar{width:112px;height:112px;overflow:hidden;flex:none;border:3px solid #e7b98b;box-shadow:0 0 0 4px #152334,0 8px 20px #080f1a99}
#profilePanel .profile-avatar img{display:block;width:100%;height:100%;object-fit:cover}
#profilePanel .profile-avatars{grid-template-columns:repeat(3,minmax(105px,1fr));max-width:660px;gap:10px}
#profilePanel .profile-avatars button{height:auto;min-height:132px;padding:8px;gap:7px;border-radius:13px;background:#142438e7}
#profilePanel .profile-avatars button[aria-pressed="true"]{background:#41516a;border-color:#ffcf9d;box-shadow:0 0 0 2px #ecac75a3}
#profilePanel .profile-avatars img{display:block;width:76px;height:76px;object-fit:cover;border-radius:50%;border:1px solid #d9ac83}
#profilePanel .profile-avatars small{max-width:100%;font-size:12px;line-height:1.2;text-align:center;overflow-wrap:anywhere}
#profilePanel .profile-themes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));max-width:660px;gap:12px}
#profilePanel .profile-themes button{display:flex;flex-direction:column;align-items:stretch;gap:7px;min-height:0;padding:7px 7px 10px;border-radius:13px;background:#142438e7;font-weight:700}
#profilePanel .profile-themes button[aria-pressed="true"]{background:#41516a;border-color:#ffcf9d;box-shadow:0 0 0 2px #ecac75a3}
#profilePanel .profile-themes img{display:block;width:100%;aspect-ratio:16/9;height:auto;object-fit:cover;border-radius:8px}
#profilePanel .profile-themes span{text-align:center;line-height:1.2}
#profilePanel .profile-stats span,#profilePanel .profile-history,#profilePanel .account-actions{background:#162538dd;border:1px solid #c49d7b52}
#profilePanel>p,#profileContent>p{max-width:900px;padding:7px 11px;border-radius:7px;background:#162538d0}
@media(max-width:600px){#profilePanel .profile-top{gap:14px;padding:12px}#profilePanel .profile-avatar{width:76px;height:76px}#profilePanel .profile-top strong{font-size:19px}#profilePanel .profile-avatars{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}#profilePanel .profile-avatars button{min-height:112px;padding:5px}#profilePanel .profile-avatars img{width:58px;height:58px}#profilePanel .profile-avatars small{font-size:10px}#profilePanel .profile-themes{gap:6px}#profilePanel .profile-themes button{font-size:11px;padding:5px}#profilePanel .profile-themes span{overflow-wrap:anywhere}}

/* v0.8.6: the selected profile theme lights the entire shared rover stage. */
:root[data-profile-theme="kosmo-dark"] .home-screen{background:#0d1a2a url('./assets/stage7/profile/kosmo-dark.webp') center/cover no-repeat}
:root[data-profile-theme="kosmo-light"] .home-screen{background:#d9bfa8 url('./assets/stage7/profile/kosmo-light.webp') center/cover no-repeat}
:root[data-profile-theme="martian-spectrum"] .home-screen{background:#372735 url('./assets/stage7/profile/martian-spectrum.webp') center/cover no-repeat}
:root[data-profile-theme="kosmo-dark"] .home-screen::before{background:linear-gradient(90deg,#071320e8 0%,#0a1c2cc7 34%,#0a1c2c55 68%,#101b2a18 100%)}
:root[data-profile-theme="kosmo-light"] .home-screen::before{background:linear-gradient(90deg,#1c273ad9 0%,#263244b8 35%,#26324448 65%,#26324418 100%)}
:root[data-profile-theme="martian-spectrum"] .home-screen::before{background:linear-gradient(90deg,#221b35e7 0%,#3c2742bd 35%,#55334b5c 70%,#56304722 100%)}
:root[data-profile-theme="kosmo-light"] .home-screen .menu-grid button{background:linear-gradient(145deg,#213345f2,#2e4355e8);border-color:#f7d0aa9c}
:root[data-profile-theme="martian-spectrum"] .home-screen .menu-grid button{background:linear-gradient(145deg,#382841ef,#25334ee8);border-color:#ec9d73aa}
:root[data-profile-theme="kosmo-light"] .home-screen .hero-play{background:#b76c3e;color:#fff}
:root[data-profile-theme="martian-spectrum"] .home-screen .hero-play{background:#b9694b;color:#fff}
:root[data-profile-theme="kosmo-light"] .home-screen .home-stats>span,:root[data-profile-theme="kosmo-light"] .home-screen .home-rover-name{background:#182b3bdc;border-radius:9px;padding:6px 9px;color:#fff8ed}
:root[data-profile-theme="martian-spectrum"] .home-screen .home-stats>span,:root[data-profile-theme="martian-spectrum"] .home-screen .home-rover-name{background:#241c34d9;border-radius:9px;padding:6px 9px;color:#fff2e9}
@media(max-width:900px){:root[data-profile-theme] .home-screen::before{background:linear-gradient(180deg,#111a29d8 0%,#16223588 40%,#101a2bdc 100%)}}

/* v0.8.6 community desk: short copy, two clear actions, local-only reaction. */
#supportPanel{background:linear-gradient(110deg,#101b29ef,#25233ac9),url('./assets/stage7/landscape-last-horizon.webp') center/cover no-repeat}
#supportPanel .support-intro{max-width:800px;margin:8px 0 22px;padding:18px 22px;border:1px solid #d8a98172;border-radius:16px;background:#17283adf}
#supportPanel .support-intro h2{margin:0 0 8px;font-size:clamp(23px,3vw,32px)}
#supportPanel .support-intro p{margin:0;font-size:15px;line-height:1.5;color:#f3e9df}
#supportPanel .support-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;max-width:1080px}
#supportPanel .support-card{display:grid;grid-template-columns:45px minmax(0,1fr);gap:12px;padding:20px;border:1px solid #d0a07792;border-radius:17px;background:linear-gradient(155deg,#26394aee,#1b2939ee);box-shadow:0 10px 25px #07101b7d}
#supportPanel .support-card>.ui-icon{width:38px;height:38px;color:#f0b886}
#supportPanel .support-card small{display:block;color:#e8aa78;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
#supportPanel .support-card h3{margin:7px 0 10px;font-size:clamp(18px,2vw,23px)}
#supportPanel .support-card p{min-height:92px;margin:0 0 16px;line-height:1.45}
#supportPanel .support-card a{display:inline-flex;align-items:center;min-height:42px;padding:9px 16px;border:1px solid #e6b07e;border-radius:10px;background:#b96c41;color:#fff;text-decoration:none;font-weight:800}
#supportPanel .support-card span{display:block;margin-top:9px;font-size:12px;color:#e3d0c2;overflow-wrap:anywhere}
#supportPanel .reaction-box{display:flex;align-items:center;flex-wrap:wrap;gap:10px 18px;max-width:1080px;margin:18px 0 0;padding:12px 17px;background:#1b2a3bdc}
#supportPanel .reaction-box h3{font-size:17px}.reaction-box p{margin:4px 0 0}
#supportPanel .reaction-buttons{margin-left:auto;gap:8px}
#supportPanel .reaction-buttons button{width:44px;height:44px;padding:7px}
#supportPanel .reaction-buttons svg{width:28px;height:28px}
#supportPanel #reactionStatus{flex-basis:100%;min-height:0}
@media(max-width:720px){#supportPanel .support-cards{grid-template-columns:1fr}#supportPanel .support-card p{min-height:0}#supportPanel .support-intro{padding:15px}#supportPanel .reaction-buttons{margin-left:0}}

/* Illustrated quest emblems and the expedition award collection. */
#questsPanel .quest-card{position:relative;background:linear-gradient(145deg,#283b4be9,#18283ae8);border-color:#d0a17873;box-shadow:inset 0 1px #ffffff16,0 10px 22px #07101b77}
#questsPanel .quest-card h3{color:#ffe4c7}
.quest-badge{display:flex;align-items:center;justify-content:center;min-height:108px;padding:4px;border-radius:12px;background:radial-gradient(circle at 50% 55%,#425766aa,#15243433 72%),url('./assets/stage7/landscape-mineral-sills.webp') center/cover no-repeat}
.quest-badge .reward-art{width:104px;height:104px;filter:drop-shadow(0 5px 9px #06111da6)}
.badge-reward{display:block;padding:8px 10px;border:1px solid #c79d7580;border-radius:8px;background:#a36c463b;color:#fbd6ad!important;font-weight:700}
#achievementsPanel .achievement-hero{background:linear-gradient(110deg,#243747ed,#1a2a3ad9),url('./assets/stage7/landscape-last-horizon.webp') center/cover no-repeat;border:1px solid #d7aa7c79;border-left:5px solid #e8ad75;border-radius:15px}
#achievementsPanel .achievement-cards{max-width:none;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr))}
#achievementsPanel .achievement-card{min-height:135px;background:linear-gradient(135deg,#27394ae8,#172638ec);border:1px solid #b98c696e;box-shadow:0 10px 22px #070e1a70}
#achievementsPanel .achievement-card.earned{border-color:#efba83}
#achievementsPanel .achievement-card .reward-art{flex:none;width:84px;height:84px;filter:drop-shadow(0 7px 8px #080f18a0)}
.quest-medal-title{margin:38px 0 18px;color:#ffe0bc;font-size:clamp(23px,2.7vw,32px)}
.quest-medals{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,190px),1fr));gap:12px}
.quest-medal{display:flex;align-items:center;gap:10px;min-width:0;min-height:96px;padding:10px;border:1px solid #a881696b;border-radius:13px;background:linear-gradient(140deg,#253747e9,#172535ec)}
.quest-medal.earned{border-color:#f2c191;background:linear-gradient(140deg,#475166ed,#273543ec)}
.quest-medal .reward-art{flex:none;width:70px;height:70px}
.quest-medal div{min-width:0}.quest-medal strong,.quest-medal small{display:block;overflow-wrap:anywhere}.quest-medal strong{font-size:13px;line-height:1.25}.quest-medal small{margin-top:5px;color:#efc395;font-size:11px}
.paint-card .paint-description{min-height:52px;line-height:1.42;color:#e9dcd1}
.companion-concept{display:flex;align-items:center;gap:18px;width:min(100%,680px);padding:16px;border:1px solid #b38d6c7d;border-radius:15px;background:#203144dd;color:#ebd9c9;line-height:1.5}
.companion-concept img{display:block;width:96px;height:96px;flex:none;border-radius:50%;object-fit:cover;border:2px solid #e7b887}
.comic-panel.scene-p08-01 .comic-dialogue{inset:8px 10px auto}
.comic-panel.scene-p08-01 .comic-shot{top:auto;bottom:9px}
@media(max-width:600px){#achievementsPanel .achievement-card{min-height:115px;padding:12px}#achievementsPanel .achievement-card .reward-art{width:67px;height:67px}.quest-medals{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.quest-medal{min-height:82px;padding:5px;gap:5px}.quest-medal .reward-art{width:49px;height:49px}.quest-medal strong{font-size:11px}.quest-medal small{font-size:10px}.quest-badge{min-height:94px}.quest-badge .reward-art{width:88px;height:88px}}

/* Editorial science cards use the actual credited article illustration. */
.fact-card{display:grid;grid-template-columns:minmax(145px,34%) minmax(0,1fr);gap:0;overflow:hidden;padding:0;background:#192738;border-color:#c89b70;box-shadow:0 12px 28px #08111d83}
.fact-visual{position:relative;min-height:270px;overflow:hidden;background:#101924}
.fact-visual::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#0d18241a 40%,#192738ba 100%);pointer-events:none}
.fact-visual img{display:block;width:100%;height:100%;min-height:270px;object-fit:cover;filter:brightness(.72) saturate(.9)}
.fact-copy{display:flex;flex-direction:column;min-width:0;padding:17px 21px;gap:8px}
.fact-copy strong{font-size:13px;letter-spacing:.14em;text-transform:uppercase;color:#e8b889}
.fact-copy h3{margin:0;color:#f8e1c6;font-size:clamp(17px,1.65vw,23px);line-height:1.25;overflow-wrap:anywhere}
.fact-copy p{margin:0;color:#fff6eb;font-size:17px!important;line-height:1.45}
.fact-card .fact-credit{display:block;margin-top:auto;color:#d4c6b6;font-size:11px;font-weight:400;line-height:1.35}
.fact-links{display:flex;flex-wrap:wrap;gap:6px 13px;align-items:center}
.fact-card .fact-links a{display:inline-block;margin:0;color:#a9e8df;font-size:12px;line-height:1.25;overflow-wrap:anywhere}
.mini-fact{display:block}
.mini-fact .fact-visual,.mini-fact .fact-visual img{height:125px;min-height:125px}
.mini-fact .fact-visual::after{background:linear-gradient(180deg,#0d18241a,#192738aa)}
.mini-fact .fact-copy{padding:12px 15px}
.mini-fact .fact-copy h3{font-size:16px}
.mini-fact .fact-copy p{font-size:14px!important}
@media(max-width:600px){.fact-card{display:block}.fact-visual,.fact-visual img{height:145px;min-height:145px}.fact-visual::after{background:linear-gradient(180deg,#0d18241a,#192738ba)}.fact-copy{padding:14px 16px}.fact-copy h3{font-size:17px}.fact-copy p{font-size:15px!important}.fact-card .fact-credit{font-size:10px}.fact-card .fact-links a{font-size:11px}}

/* Keep the home artwork in the entire available window; scroll its content on short screens. */
#homePanel.home-screen{width:100%;max-width:none;height:100%;min-height:0;margin:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
.viewport:has(#overlay:not(.hidden)){touch-action:pan-y}
#scene{touch-action:none}
@media(max-width:900px){.home-3d{touch-action:pan-y}}

/* Stage 8A: garage and local profile share one hangar entrance. */
.hangar-tabs{display:flex;gap:8px;max-width:560px;margin:8px 0 22px;padding:5px;border:1px solid #c78c6859;border-radius:15px;background:#102238c9}.hangar-tabs button{flex:1;min-height:44px;border-radius:10px}.hangar-tabs button[aria-current=page]{background:#b86e49;color:#fff;border-color:#eac18d}#profilePanel .hangar-tabs{margin-top:12px}@media(max-width:540px){.hangar-tabs{width:100%}.hangar-tabs button{font-size:14px}}

/* Stage 8A: original Kosmo-fakta identity in the existing About page. */
#aboutPanel{background:linear-gradient(130deg,#071423f4 5%,#17283fe4 57%,#2e1f2cda),url('./assets/stage7/landscape-noctis-depths.webp') center/cover no-repeat;border-color:#ae795d;box-shadow:inset 0 0 0 1px #82a8b83d,0 24px 70px #0009}
#aboutPanel .screen-head{border-bottom:1px solid #b8896a55;padding-bottom:14px}
#aboutPanel .screen-head h1{font-size:clamp(30px,4vw,55px);letter-spacing:.025em;color:#fff1e5;text-shadow:0 3px 24px #0b182acc}
#aboutPanel .about-hero{max-width:none;grid-template-columns:minmax(110px,170px) 1fr;background:linear-gradient(110deg,#122c44e8,#211e35db 58%,#52352bc7);border:1px solid #d4a2718c;box-shadow:inset 0 1px 0 #ffffff20,0 22px 45px #0006}
#aboutPanel .about-orbit{width:clamp(96px,10vw,150px);height:clamp(96px,10vw,150px);display:grid;place-items:center;border-radius:50%;border:1px solid #eba97382;background:#0d1b2cb8;box-shadow:0 0 35px #d381463b}
#aboutPanel .about-orbit img{display:block;width:82%;height:82%;object-fit:contain;border-radius:50%}
#aboutPanel .about-hero h2{color:#fff0de;font-size:clamp(29px,3vw,48px);line-height:1.13}
#aboutPanel .about-grid{max-width:1000px}
#aboutPanel .about-card{background:linear-gradient(135deg,#14273be8,#1b2738d9);border:1px solid #86a8b756;box-shadow:inset 0 1px 0 #ffffff0e}
#aboutPanel .about-card h3{color:#ffd2a5}
#aboutPanel .about-grid{grid-template-columns:1fr;align-items:start;gap:12px}
#aboutPanel .about-card{padding:17px 20px;gap:13px;align-self:start}
#aboutPanel .about-card-wide{grid-column:1/-1}
#aboutPanel .about-card p+p{margin-top:9px!important}
#aboutPanel .about-card button{margin-top:14px;min-height:42px}
#aboutPanel .guide-bindings{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 14px}
@media(max-width:720px){#aboutPanel .about-grid,#aboutPanel .guide-bindings{grid-template-columns:1fr}#aboutPanel .about-card-wide{grid-column:auto}}
@media(max-width:600px){#aboutPanel .about-hero{grid-template-columns:1fr;padding:22px}#aboutPanel .about-orbit{width:96px;height:96px}#aboutPanel .about-card{min-width:0}#aboutPanel .about-card p{overflow-wrap:anywhere}}

/* Stage 8A guided first drive. The card is smaller than the route view. */
.tutorial-card{position:absolute;z-index:8;left:50%;top:14%;transform:translateX(-50%);width:min(490px,calc(100% - 24px));padding:clamp(16px,2vw,24px);border:1px solid #e2a577;border-radius:18px;background:linear-gradient(125deg,#102439f5,#25223ced 74%,#58362add);box-shadow:0 20px 55px #040b18b8;color:#fff2e2;backdrop-filter:blur(10px)}
.tutorial-card small{color:#8fd5df;letter-spacing:.1em;font-weight:800}.tutorial-card h2{font-size:clamp(22px,3vw,30px);margin:8px 0 10px;color:#ffd3a4}.tutorial-card p{font-size:clamp(15px,1.6vw,18px);line-height:1.45;margin:0 0 16px}.tutorial-actions{display:flex;flex-wrap:wrap;gap:8px}.tutorial-actions button{min-height:44px;flex:1 1 120px}.tutorial-actions button:first-child{flex-basis:100%}.tutorial-finish-note{padding:13px 17px;border:1px solid #dba3758a;border-radius:12px;background:#203348df;color:#ffdfbd!important}
.tutorial-card .tutorial-note{padding:9px 11px;margin:-5px 0 15px;border-left:3px solid #8fd5df;background:#0b2338b8;color:#d3eef0;font-size:13px;line-height:1.35}
@media(max-height:540px){.tutorial-card{top:5%;max-height:85%;overflow:auto}.tutorial-card p{font-size:14px}.tutorial-actions button{min-height:38px}}
/* Supplied comic pages are complete 3:2 artworks. Keep every word visible. */
#storyPanel .comic-pages{display:block;width:min(100%,1536px);max-width:1536px;max-height:min(78vh,1024px);overflow:auto;overscroll-behavior:contain;border:3px solid #e6d5bc;background:#162232;touch-action:pan-x pan-y}
#storyPanel .comic-page-image{display:block;width:100%;height:auto;max-width:none;object-fit:contain;user-select:none}
#storyPanel .comic-pages.zoomed{cursor:grab}
#storyPanel .comic-pages.zoomed:active{cursor:grabbing}
#storyPanel .comic-zoom-controls{display:flex;justify-content:flex-end;gap:8px;max-width:1536px;margin:0 0 8px}
#storyPanel .comic-zoom-controls button{min-width:44px;min-height:44px;font-size:24px}
@media(max-width:850px){#storyPanel .comic-pages{max-height:72vh}#storyPanel .comic-page-image{min-width:100%}}
/* One grounded 3D work bay; explicit zoom keeps ordinary page scrolling intact. */
.home-3d .home-zoom-controls{position:absolute;z-index:4;right:10px;top:10px;display:flex;gap:6px}
.home-3d .home-zoom-controls button{min-width:40px;min-height:40px;padding:4px 10px;font-size:21px;background:#203343e8;color:#fff;border:1px solid #c6936e;border-radius:8px;cursor:pointer}
.home-audio-controls{position:absolute;z-index:5;right:10px;top:58px;display:flex;gap:6px}.home-audio-controls button{min-width:40px;min-height:40px;padding:4px 8px;font-size:19px;background:#203343e8;border:1px solid #c6936e;border-radius:8px}
.home-account{grid-column:1;display:flex;align-items:center;gap:8px;flex-wrap:wrap;position:relative;z-index:3;color:#ffe7ca;font:600 13px/1.4 system-ui}.home-account span{padding:5px 9px;border-radius:8px;background:#142332df;border:1px solid #b88966a8}.home-account a{padding:5px 10px;border-radius:7px;background:#2c4154e8;color:#fff;text-decoration:none;border:1px solid #c38a5f}.home-account a:focus-visible{outline:3px solid #f7c28e;outline-offset:2px}
.home-hints{position:absolute;inset:0;pointer-events:none;z-index:3}.home-hint{position:absolute;display:inline-block;max-width:34%;padding:7px 10px;border:1px solid #e3ad77;border-radius:12px;background:#fff4ddf2;color:#172738;font:700 clamp(10px,1.1vw,14px)/1.2 system-ui;box-shadow:0 5px 16px #0006}.home-hint[hidden]{display:none}.astronaut-hint{left:1%;top:24%}.rover-hint{right:104px;top:60px}
.kf-import-dialog{max-width:min(450px,calc(100vw - 28px));border:1px solid #d69d6d;border-radius:16px;background:#172231;color:#fff0dd;padding:24px;box-shadow:0 20px 70px #000b}.kf-import-dialog::backdrop{background:#040a13b8}.kf-import-dialog h2{margin:0 0 12px;font-size:24px}.kf-import-dialog p{line-height:1.5}.kf-import-dialog .confirm-actions{display:flex;gap:10px;flex-wrap:wrap}.kf-import-dialog button{min-height:44px;border:1px solid #d69d6d;border-radius:8px;background:#b76b48;color:#fff;padding:8px 14px;cursor:pointer}
@media(max-width:900px){.home-account{margin:12px 0}.home-hint{font-size:11px}.astronaut-hint{left:1%;top:17%}}
@media(max-width:600px){.home-hint{max-width:43%;font-size:10px;padding:5px 7px}.astronaut-hint{left:0;top:20%}}
.home-3d:not(.ready) .home-zoom-controls,.home-3d[data-graphics="low"] .home-zoom-controls{display:none}
#storyPanel .comic-pages{max-height:none;overflow:visible}
#storyPanel .comic-pages.zoomed{max-height:78vh;overflow:auto}
@media(max-width:850px){#storyPanel .comic-pages{max-height:none}#storyPanel .comic-pages.zoomed{max-height:72vh}}
@media(max-width:600px){.touch{left:max(4px,env(safe-area-inset-left));right:max(4px,env(safe-area-inset-right));gap:3px}.touch-group{gap:3px}.touch-btn{width:clamp(44px,15vw,58px);min-width:0;padding:2px;font-size:24px;border-radius:13px}.touch-btn span{font-size:8px;letter-spacing:0}.touch-special,.touch-pickup{width:clamp(48px,15vw,60px)}}
/* Driving controls: left thumb tilts, right thumb drives and triggers devices. */
#touchControls>.touch-group:first-child{position:absolute;right:calc(var(--touch-extra-width,clamp(60px,10vw,78px)) + 6px);bottom:calc(100% + 8px)}
#touchControls>.touch-pickup{right:0;bottom:calc(200% + 16px)}
@media(max-width:600px){#touchControls{--touch-extra-width:clamp(48px,15vw,60px)}}
@media(max-height:430px){#touchControls>.touch-group:first-child{bottom:calc(100% + 4px)}#touchControls>.touch-pickup{bottom:calc(200% + 8px)}}
.touch-layout-settings{margin:24px 0;padding:16px;border:1px solid #b78562;border-radius:12px;background:#203044}.touch-layout-settings h2{margin:0 0 8px}.touch-layout-settings p{margin:0 0 12px}.touch-layout-settings button{min-height:44px}
.game.touch-layout-edit .overlay{display:none!important}.game.touch-layout-edit .touch{display:flex!important;z-index:7}.game.touch-layout-edit .touch-btn{cursor:grab;touch-action:none}.game.touch-layout-edit .touch-btn.touch-moving{cursor:grabbing;outline:3px solid #ffdf9b;outline-offset:2px}
.touch-layout-toolbar{position:absolute;z-index:8;top:10px;left:50%;transform:translateX(-50%);width:min(650px,calc(100% - 16px));display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;padding:9px;border:1px solid #f1bb84;border-radius:12px;background:#101b2af2;box-shadow:0 8px 22px #0008}.touch-layout-toolbar[hidden]{display:none}.touch-layout-toolbar label{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700}.touch-layout-toolbar input{width:95px;accent-color:#e5a16d}.touch-layout-toolbar button{min-height:36px;padding:6px 9px;font-size:12px}
@media(max-width:600px){.touch-layout-toolbar{top:4px;gap:5px;padding:6px}.touch-layout-toolbar label{font-size:10px}.touch-layout-toolbar input{width:70px}.touch-layout-toolbar button{min-height:30px;font-size:10px;padding:4px 6px}}

/* Compact controls for the actual CSS viewport inside the WordPress iframe. */
@media (max-width:1024px){
  .game.in-drive .touch{display:flex}
  .bar{flex:0 0 auto;min-height:44px;height:44px;padding:3px 8px;gap:6px;flex-wrap:nowrap}
  .brand{flex:1 1 auto;overflow:hidden;gap:6px;white-space:nowrap}
  .brand img{width:28px;height:28px}
  .brand>div{min-width:0;overflow:hidden}
  .brand .eyebrow{display:none}
  .brand strong{font-size:12px;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .brand .muted{display:none}
  .toolbar{flex:0 0 auto;width:auto;display:flex;flex-wrap:nowrap;align-items:center;gap:4px}
  .toolbar button{min-height:34px;padding:4px 7px;font-size:11px;line-height:1.1}
  .toolbar #helpBtn,.toolbar #restartBtn{display:none}
  .toolbar #soundBtn,.toolbar #fullBtn{width:34px;padding:3px 0;font-size:0;overflow:hidden}
  .toolbar #soundBtn::after{content:'♫';font-size:18px}
  .toolbar #fullBtn::after{content:'⛶';font-size:20px}
  .game.in-drive .toolbar #langBtn{display:none}
  .game:not(.in-drive) .toolbar #menuBtn,.game:not(.in-drive) .toolbar #pauseBtn{display:none}
  .engine-badge{display:none}
  .viewport{min-height:0}
  .hud{top:5px;left:5px;gap:5px}
  .speedometer{width:58px;height:58px}
  .dial-readout{top:51%}
  .dial-readout small{font-size:5px}
  .dial-readout strong{font-size:14px}
  .dial-readout span{font-size:7px}
  .hud-data{gap:3px}
  .hud-identity{max-width:95px;padding:2px 4px;font-size:9px}
  .hud-identity img{width:17px;height:17px}
  .hud-card{min-width:0;width:104px;padding:3px 5px}
  .hud-card small{font-size:7px}
  .hud-card strong{font-size:12px}
  .route-length{font-size:7px}
  .expedition-progress{top:5px;right:5px;max-width:118px;padding:4px 5px}
  .expedition-progress>strong{font-size:8px;margin-bottom:2px}
  .expedition-progress-grid{gap:1px 3px}
  .progress-item,.progress-item b{font-size:9px}
  .progress-item small{display:none}
  .track-title{top:122px;max-width:72vw;font-size:10px;padding:4px 6px}
  .risk-warning{top:147px;font-size:9px}
  .touch{left:max(5px,env(safe-area-inset-left));right:max(5px,env(safe-area-inset-right));bottom:max(5px,env(safe-area-inset-bottom));gap:4px}
  .touch-group{gap:4px}
  .touch-btn{width:clamp(48px,14vmin,62px);height:clamp(54px,15vmin,68px);border-radius:12px;font-size:23px}
  .touch-btn span{font-size:8px}
  .touch-special,.touch-pickup{width:clamp(48px,14vmin,62px);height:clamp(50px,14vmin,64px)}
  #touchControls{--touch-extra-width:clamp(48px,14vmin,62px)}
  #touchControls>.touch-group:first-child{bottom:calc(100% + 4px)}
  #touchControls>.touch-pickup{bottom:calc(200% + 8px)}
  .footer{display:none}
}
@media (max-width:1024px) and (max-height:500px){
  .bar{height:38px;min-height:38px;padding:2px 8px}
  .bar .brand img{width:24px;height:24px}
  .toolbar button{min-height:30px;padding:3px 6px}
  .hud{top:4px}
  .speedometer{width:48px;height:48px}
  .hud-data{grid-template-columns:repeat(2,auto);gap:3px}
  .hud-identity{grid-column:1/-1;width:max-content}
  .hud-card{width:auto;min-width:82px}
  .hud-card strong{font-size:11px}
  .route-length{display:none}
  .expedition-progress{width:115px}
  .touch-btn{font-size:20px}
  .track-title{top:75px}
  .risk-warning{top:99px}
}

/* Thumb zones follow the two-pedal mobile driving pattern. Keep secondary
   actions on a separate row so the terrain remains visible between thumbs. */
@media (max-width:1024px) and (min-height:501px) and (orientation:portrait){
  .game.in-drive .touch{left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));gap:8px}
  .game.in-drive .touch-group{gap:clamp(6px,2vw,14px)}
  .game.in-drive .touch-group:nth-child(2) .touch-btn{width:clamp(66px,18vw,84px);height:clamp(76px,12vh,100px);font-size:32px}
  .game.in-drive .touch-group:nth-child(3) .touch-btn{width:clamp(76px,21vw,98px);height:clamp(82px,13vh,108px);font-size:36px}
  .game.in-drive .touch-btn span{font-size:clamp(10px,2.6vw,13px);line-height:1.1}
  .game.in-drive #touchControls>.touch-group:nth-child(2){position:absolute;left:0;bottom:0}
  .game.in-drive #touchControls>.touch-group:nth-child(3){position:absolute;right:0;bottom:0}
  .game.in-drive #touchControls>.touch-group:first-child{left:calc(50% - clamp(104px,28vw,130px));right:auto;bottom:clamp(132px,20vh,166px);gap:14px}
  .game.in-drive #touchControls>.touch-group:first-child .touch-btn{width:clamp(52px,15vw,68px);height:clamp(58px,9vh,72px);font-size:25px}
  .game.in-drive #touchControls>.touch-special{position:absolute;left:calc(50% + clamp(50px,13vw,74px));right:auto;bottom:clamp(132px,20vh,166px);width:clamp(58px,16vw,74px);height:clamp(58px,9vh,74px);font-size:28px}
  .game.in-drive #touchControls>.touch-pickup{left:calc(50% + clamp(50px,13vw,74px));right:auto;bottom:clamp(210px,30vh,248px);width:clamp(58px,16vw,74px);height:clamp(58px,9vh,74px)}
}
@media (min-width:701px) and (max-width:1024px) and (min-height:501px) and (orientation:landscape){
  .game.in-drive .touch-group:nth-child(2) .touch-btn,.game.in-drive .touch-group:nth-child(3) .touch-btn{width:clamp(76px,9vw,100px);height:clamp(78px,12vh,104px);font-size:32px}
  .game.in-drive .touch-btn span{font-size:11px}
  .game.in-drive #touchControls>.touch-group:first-child{left:0;right:auto;bottom:calc(100% + 6px)}
  .game.in-drive #touchControls>.touch-special{position:absolute;right:0;bottom:calc(100% + 6px)}
}
@media (max-height:500px) and (min-width:500px){
  #homePanel.home-screen{display:grid;grid-template-columns:minmax(230px,1fr) minmax(0,1fr);grid-template-rows:repeat(5,auto) 1fr;align-content:start;gap:3px 12px;padding:8px 14px}
  #homePanel.home-screen>.eyebrow{margin:0;font-size:9px}
  #homePanel.home-screen>h1{font-size:28px;margin:0}
  #homePanel.home-screen .home-rover-name{font-size:16px}
  #homePanel.home-screen .home-stats{margin:0;gap:4px;font-size:11px}
  #homePanel.home-screen .home-account{margin:0;font-size:10px}
  #homePanel.home-screen .hero-play{width:190px;min-height:38px;padding:4px 10px;font-size:16px}
  #homePanel.home-screen .home-3d{grid-column:2;grid-row:1/6;height:145px;min-height:0;transform:translateY(70px)}
  #homePanel.home-screen .menu-grid{grid-column:1/-1;grid-template-columns:repeat(4,minmax(0,1fr));margin:3px 0;gap:4px}
  #homePanel.home-screen .menu-grid button{min-height:34px;padding:4px 6px;font-size:11px}
}

/* Compact menu cards keep their action in view on phones and small tablets. */
@media (max-width:700px){
  .panel.game-screen,.panel.menu-panel{scroll-padding-top:8px}
  .screen-head{position:sticky;top:0;z-index:8;margin:-14px -14px 12px;padding:10px 14px;background:#192332f5;backdrop-filter:blur(8px)}
  .screen-head .back-btn{width:auto;min-width:76px;min-height:44px;order:0}
  .screen-head>div{min-width:0;flex:1}
  .screen-head .eyebrow{display:none}
  .screen-head h1{font-size:clamp(21px,6vw,29px)!important;margin:0!important}
  #tracksPanel .track-cards{grid-template-columns:1fr;gap:9px}
  #tracksPanel .track-card{display:grid;grid-template-columns:clamp(82px,26vw,112px) minmax(0,1fr);grid-template-rows:auto auto auto 1fr auto;column-gap:10px;row-gap:3px;min-height:0;padding:9px 10px}
  #tracksPanel .track-thumb{grid-column:1;grid-row:1/6;width:100%;height:100%;max-height:128px;aspect-ratio:auto;object-fit:cover;margin:0}
  #tracksPanel .track-card-head,#tracksPanel .track-card h2,#tracksPanel .track-card p,#tracksPanel .track-status{grid-column:2;min-width:0}
  #tracksPanel .track-card-head{font-size:15px}
  #tracksPanel .track-card h2{font-size:18px;margin:0;line-height:1.18}
  #tracksPanel .track-card p,#tracksPanel .track-status{font-size:13px!important;line-height:1.3;overflow-wrap:anywhere}
  #tracksPanel .track-card button{align-self:end;width:100%;min-width:0;min-height:44px;margin:3px 0 0;padding:7px 9px;font-size:13px}
  #tracksPanel .track-card button.primary{grid-column:2;grid-row:6}
  #tracksPanel .track-card button:not(.primary){grid-column:1;grid-row:6;padding:5px;font-size:11px;line-height:1.15}
  #garagePanel .garage-nav,#skinsPanel .shop-mode-nav,#skinsPanel .shop-filters{display:flex;gap:6px;overflow-x:auto;scroll-snap-type:x proximity;padding-bottom:5px}
  #garagePanel .garage-nav button,#skinsPanel .shop-mode-nav button,#skinsPanel .shop-filters button{flex:0 0 auto;min-height:44px;scroll-snap-align:start;white-space:nowrap}
  .upgrade-rows,.skin-cards,.paint-grid,.pet-cards{grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:10px}
  .upgrade-card,.skin-card{min-height:0;padding:13px}
  .upgrade-card button,.skin-card button,.rover-card button{min-height:44px}
  .rover-card{grid-template-columns:minmax(70px,28%) minmax(0,1fr);gap:8px}
  .rover-card button{grid-column:1/-1;width:100%;font-size:13px}
  .fact-card{grid-template-columns:1fr;margin:10px 0}
  .fact-card .fact-visual,.fact-card .fact-visual img{height:100px;min-height:100px}
  .fact-card .fact-copy{padding:12px 14px;gap:6px}
  .fact-card .fact-copy h3{font-size:18px}
  .fact-card .fact-copy p{font-size:15px!important;line-height:1.42}
  .fact-card .fact-links a{font-size:13px;min-height:32px;display:inline-flex;align-items:center}
  .mini-fact .fact-visual,.mini-fact .fact-visual img{height:76px;min-height:76px}
  .pause-actions{gap:7px}
  .pause-actions button{min-height:44px;padding:8px 10px}
}
@media (max-height:500px) and (min-width:600px){
  .screen-head{margin:-12px -12px 9px;padding:7px 12px}
  .screen-head .back-btn{min-height:38px}
  #tracksPanel .track-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  #tracksPanel .track-card{grid-template-columns:64px minmax(0,1fr);padding:7px;column-gap:8px}
  #tracksPanel .track-thumb{max-height:112px}
  #tracksPanel .track-card-head{font-size:13px}
  #tracksPanel .track-card h2{font-size:15px}
  #tracksPanel .track-card p,#tracksPanel .track-status{font-size:12px!important}
  #tracksPanel .track-card button{min-height:38px;font-size:11px}
  .fact-card{grid-template-columns:24% minmax(0,1fr)}
  .fact-card .fact-visual,.fact-card .fact-visual img{height:100%;min-height:110px}
  .fact-card .fact-copy{padding:10px 12px}
}

/* The same thumb map survives a phone or tablet rotation. */
@media (max-width:1024px) and (orientation:landscape){
  .game.in-drive #touchControls>.touch-group:nth-child(2){position:absolute;left:0;bottom:0;gap:10px}
  .game.in-drive #touchControls>.touch-group:nth-child(3){position:absolute;right:0;bottom:0;gap:10px}
  .game.in-drive #touchControls>.touch-group:first-child{position:absolute;left:calc(50% + 40px);right:auto;bottom:clamp(150px,41vh,210px);gap:18px}
  .game.in-drive #touchControls>.touch-special{position:absolute;left:calc(50% + 200px);right:auto;bottom:clamp(150px,41vh,210px)}
  .game.in-drive #touchControls>.touch-pickup{left:calc(50% + 200px);right:auto;bottom:clamp(210px,55vh,260px)}
  .game.in-drive #touchControls>.touch-group:first-child .touch-btn,.game.in-drive #touchControls>.touch-special,.game.in-drive #touchControls>.touch-pickup{font-size:22px}
}
@media (min-width:900px) and (max-width:1024px) and (orientation:landscape){
  /* Tablet action buttons can grow to 83 px; reserve their full width. */
  .game.in-drive #touchControls>.touch-special,
  .game.in-drive #touchControls>.touch-pickup{left:calc(50% + 240px)}
}
@media (pointer:coarse) and (min-width:1025px) and (max-width:1600px){
  .game.in-drive #touchControls>.touch-group:nth-child(2){position:absolute;left:0;bottom:0;gap:14px}
  .game.in-drive #touchControls>.touch-group:nth-child(3){position:absolute;right:0;bottom:0;gap:14px}
  .game.in-drive #touchControls>.touch-group:first-child{position:absolute;left:calc(50% - 116px);right:auto;bottom:clamp(150px,22vh,210px);gap:18px}
  .game.in-drive #touchControls>.touch-special{position:absolute;left:calc(50% + 78px);right:auto;bottom:clamp(150px,22vh,210px)}
  .game.in-drive #touchControls>.touch-pickup{left:calc(50% + 78px);right:auto;bottom:clamp(204px,24vh,262px)}
}

/* Stage 8K: two workspaces share the existing hangar and mission artwork. */
.unified-garage,.mission-screen{scroll-behavior:smooth;overflow-x:hidden}
.unified-garage .garage-quick[hidden]{display:none!important}
.unified-garage .screen-head,.mission-screen .screen-head{gap:12px}
.unified-garage .screen-head #wallet{display:flex;align-items:center;flex-wrap:wrap;gap:5px;min-width:0}
.workspace-profile{min-height:44px;padding:8px 14px;white-space:nowrap;border-color:#d9a47588;background:#26384be8}
.workspace-profile:before{content:'◉';margin-right:8px;color:#edbc87}
.unified-garage .hangar-tabs,.mission-screen .hangar-tabs{max-width:420px;margin:0 0 22px}
.unified-garage .hangar-tabs,.mission-screen .hangar-tabs{position:relative;z-index:3}
.unified-garage #garagePreview{pointer-events:none}
.garage-work-section,.mission-quests{margin-top:36px;padding:clamp(16px,2.5vw,30px);border:1px solid #d3a57b72;border-radius:18px;background:linear-gradient(145deg,#1c2c3be9,#172331ef);scroll-margin-top:80px}
.garage-work-section>h2,.mission-quests>h2,.garage-section-head h2{margin:0 0 16px;color:#f4d1ad}
.garage-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.garage-section-head #shopWallet{display:flex;align-items:center;gap:6px}
.unified-garage .shop-mode-nav,.unified-garage .shop-filters{display:flex;flex-wrap:wrap;gap:8px}
.unified-garage .shop-section{max-width:none}
.unified-garage .upgrade-rows{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}
.unified-garage .rover-card{min-width:0}
.unified-garage .rover-card strong,.unified-garage .rover-card small{overflow-wrap:anywhere}
.mission-screen #trackCards{padding-bottom:0}
.mission-quests .quest-summary{max-width:620px}
@media(max-width:700px){
  .unified-garage .screen-head,.mission-screen .screen-head{position:static;margin:0 0 14px;padding:0;background:none;backdrop-filter:none}
  .unified-garage .screen-head .back-btn,.mission-screen .screen-head .back-btn{width:auto}
  .unified-garage .screen-head h1,.mission-screen .screen-head h1{white-space:nowrap}
  .unified-garage .screen-head #wallet{order:3;width:100%;font-size:12px}
  .workspace-profile{margin-left:auto;font-size:12px}
  .unified-garage .hangar-tabs,.mission-screen .hangar-tabs{width:100%;max-width:none}
  .garage-work-section,.mission-quests{margin-top:20px;padding:14px;scroll-margin-top:12px}
  .unified-garage .shop-mode-nav button,.unified-garage .shop-filters button{min-height:44px}
  .unified-garage .shop-section{padding:14px}
  .unified-garage .rover-card{grid-template-columns:minmax(64px,26%) minmax(0,1fr);gap:8px}
  .unified-garage .rover-card button{grid-column:1/-1;width:100%}
}
@media(max-width:900px) and (max-height:500px) and (orientation:landscape){
  .unified-garage .screen-head,.mission-screen .screen-head{margin-bottom:8px;gap:6px}
  .unified-garage .hangar-tabs,.mission-screen .hangar-tabs{margin-bottom:9px}
  .unified-garage .garage-layout .rover-art{height:150px;min-height:140px}
}
