/* Wide scene and the pull-down HUD. JS toggles body.hud-open and the ARIA state. */
.app{max-width:none;width:100%;padding:12px clamp(8px,1.5vw,24px) 36px}
.topbar{position:relative;min-height:43px;gap:14px;padding:0 2px 9px}
.topbar .route-line{margin-top:3px}
.hud-toggle{flex:none;min-height:42px;padding:8px 15px;border-color:#8eaa70;background:#26372b;color:#f3f9e9;font-size:11px;font-weight:700}
.hud-toggle span{margin-left:6px;color:var(--lime)}
.hud-toggle:focus-visible,.hud-panel button:focus-visible,.scene-exit:focus-visible,.apartment-room-nav button:focus-visible,.phone-shortcut:focus-visible{outline:3px solid var(--lime);outline-offset:2px}
.layout{display:block;margin-top:8px}
.main-column{width:min(100%,163.56vh);width:min(100%,163.56svh);max-width:1720px;margin-inline:auto}
.scene-heading{align-items:end;margin-bottom:8px}
.scene-heading h1{font-size:clamp(24px,3vw,38px);margin:4px 0 4px}
.scene-heading p{font-size:12px}
.first-scene-help{margin-bottom:7px;padding:7px 10px}
.game-scene{width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:16/9;border-width:2px;border-radius:13px;box-shadow:0 12px 32px #0008}
.progress-row{min-height:48px;margin:7px 1px 8px;gap:12px}
.progress-track{min-width:55px}
.progress-row .phone-shortcut{flex:none;min-width:111px;min-height:40px;padding:8px 11px;border:1px solid #91b87c;background:#24392a;color:#eaf7da;font-size:10px;font-weight:700;box-shadow:0 3px 10px #0005}
.progress-row .phone-shortcut:hover{border-color:var(--lime);background:#36523a}
.progress-row .phone-shortcut span{background:var(--orange);color:#1d1713}
.journal{margin-top:6px}

.hud-backdrop{position:fixed;inset:0;z-index:29;background:#080e0bc4;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .22s,visibility .22s}
.hud-panel{position:fixed;left:0;right:0;top:0;z-index:30;max-height:min(86vh,900px);max-height:min(86svh,900px);padding:calc(12px + env(safe-area-inset-top)) clamp(12px,3vw,42px) 22px;overflow:auto;overscroll-behavior:contain;border-bottom:2px solid #82966e;border-radius:0 0 20px 20px;background:linear-gradient(155deg,#26352b,#17221c 62%,#131b17);box-shadow:0 22px 60px #000a;transform:translateY(-103%);visibility:hidden;pointer-events:none;transition:transform .24s ease,visibility .24s}
.hud-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:11px}
.hud-panel-head .kicker{font-size:11px}
.hud-panel-head button{min-height:42px;color:#edf7e4;border-color:#779066}
.hud-panel .top-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:8px;margin-bottom:12px}
.hud-panel .top-actions button{min-height:42px;white-space:normal;text-align:left;font-size:10px}
.hud-panel .sidebar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-content:start}
.hud-panel .card{min-width:0;padding:13px}
.hud-panel .card-head{margin-bottom:7px}
.hud-panel .stat{margin:7px 0}
.hud-panel .body-preview{height:110px}
.hud-panel .objective-card{grid-column:auto}
body.hud-open{overflow:hidden}
body.hud-open .hud-backdrop{opacity:1;visibility:visible;pointer-events:auto}
body.hud-open .hud-panel{transform:translateY(0);visibility:visible;pointer-events:auto}
.overlay{z-index:50}
.cinematic{z-index:60}

.game-scene .apartment-room-nav{position:absolute;top:61px;right:12px;left:auto;z-index:9;display:flex;justify-content:flex-end;gap:8px;max-width:65%;margin:0;padding:0;background:none;pointer-events:auto}
.game-scene .apartment-room-nav[hidden]{display:none}
.game-scene .apartment-room-nav button{min-height:44px;padding:7px 10px;border:2px solid #d2e2b2;background:#1e352aee;color:#f4ffe8;font-size:10px;white-space:nowrap;box-shadow:0 4px 12px #0008;touch-action:manipulation}
.game-scene .apartment-room-nav button[aria-current="true"]{border-color:#eeefc4;background:#c0df91;color:#203122}
.scene-exit{position:absolute;top:10px;right:10px;z-index:10;min-width:85px;min-height:44px;padding:7px 11px;border:2px solid #d9edbb;border-radius:9px;background:#1f3829ef;color:#f4ffe9;font:800 11px Manrope,system-ui,sans-serif;box-shadow:0 4px 13px #0009;cursor:pointer;touch-action:manipulation}
.scene-exit[hidden]{display:none}
.scene-exit:hover,.scene-exit:active{background:#456a42}
.scene-exit:disabled{opacity:.58;border-color:#829688;background:#27382e;color:#bac9b7;box-shadow:none;cursor:not-allowed}
.scene-exit:disabled:hover,.scene-exit:disabled:active{background:#27382e}
.orientation-hint{display:none}

@media(max-width:900px){
  .app{padding:9px 7px 26px}
  .main-column{width:100%}
  .scene-heading{margin:4px 3px 8px}
  .game-scene{aspect-ratio:16/9;height:auto;min-height:0;border-radius:10px}
  .game-scene .scene-background{background-size:cover}
  .touch-controls{position:static;display:flex;align-items:end;justify-content:space-between;width:100%;min-height:85px;margin:0;padding:7px 4px 0;pointer-events:auto}
  .touch-controls .dpad{grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px)}
  .touch-controls .dpad button{min-height:44px}
  .touch-controls .act-button{min-height:48px;padding:0 16px}
  .hud-panel .sidebar{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hud-panel .objective-card{grid-column:1/-1}
  .progress-row{flex-wrap:nowrap}
  .progress-row .progress-track{min-width:45px}
  .progress-row .phone-shortcut{min-width:106px}
}
@media(max-width:600px){
  .topbar{padding-bottom:7px}
  .brand{font-size:9px}
  .route-line{gap:9px;font-size:9px}
  .hud-toggle{min-width:106px;padding:7px 9px;font-size:10px}
  .scene-heading h1{font-size:clamp(22px,6vw,30px)}
  .scene-heading p{font-size:11px;line-height:1.35}
  .control-hint{display:none}
  .first-scene-help{font-size:10px}
  .game-scene{aspect-ratio:16/9;height:auto}
  .game-scene .apartment-room-nav{top:58px;right:7px;gap:8px;max-width:85%}
  .game-scene .apartment-room-nav button{min-height:44px;padding:6px 8px;font-size:9px}
  .scene-exit{top:7px;right:7px;min-width:74px;min-height:44px;padding:6px 9px}
  .orientation-hint{display:block;margin:0 4px 5px;color:#aab9a8;font:10px/1.35 'Space Mono',monospace}
  .progress-row{gap:7px}
  .progress-row .phone-shortcut{min-width:98px;min-height:42px;padding:7px;font-size:9px}
  .hud-panel{max-height: 91vh;max-height: 91svh;padding-inline:10px}
  .hud-panel .top-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hud-panel .sidebar{grid-template-columns:1fr}
  .hud-panel .objective-card{grid-column:auto}
}
@media(max-width:360px){.game-scene .apartment-room-nav{top:54px;max-width:95%}.game-scene .apartment-room-nav button{padding:5px 6px;font-size:8px}.progress-row .phone-shortcut{min-width:89px}}
@media(max-width:900px) and (orientation:landscape){.app{padding:5px 8px 18px}.topbar{min-height:35px;padding-bottom:4px}.scene-heading{margin:2px 3px 4px}.scene-heading h1{font-size:19px}.scene-heading p{display:none}.first-scene-help{margin-bottom:4px;padding:5px 8px}.orientation-hint{display:none}.touch-controls{min-height:63px}.touch-controls .dpad{grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px)}.touch-controls .dpad button{min-height:44px}.touch-controls .act-button{min-height:44px}}
@media(prefers-reduced-motion:reduce){.hud-panel,.hud-backdrop{transition:none}}

/* The map header stays short; details remain available inside the HUD. */
.topbar{align-items:center;min-height:54px}
.top-location{display:flex;align-items:center;gap:12px;min-width:0}
.top-location #mapKicker{display:block;min-width:0;max-width:min(56vw,540px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#f1f8e8;font:800 clamp(18px,2.3vw,27px)/1.1 Manrope,system-ui,sans-serif;letter-spacing:-.02em;text-transform:none}
.top-location #dayLabel{flex:none;padding:5px 8px;border:1px solid #657958;border-radius:7px;color:#cce7aa;font:700 13px/1 'Space Mono',monospace;white-space:nowrap}
.top-location #mapCounter{display:none}
.hud-toggle{min-height:46px;font-size:14px}
.hud-panel-head .kicker{font-size:14px}
.hud-panel-head button{font-size:13px}
.hud-scene-summary{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 20px;margin-bottom:12px;padding:12px 14px;border:1px solid #49604a;border-radius:12px;background:#15231bc4}
.hud-scene-summary h1{margin:0 0 6px;font-size:clamp(22px,2.4vw,30px);line-height:1.12;letter-spacing:-.035em}
.hud-scene-summary p{margin:0;color:#d0dfcf;font-size:15px;line-height:1.4}
.hud-scene-summary .control-hint{display:block;text-align:right;color:#cad8c7;font:12px/1.45 'Space Mono',monospace}
.hud-panel .first-scene-help{margin:0 0 12px;padding:11px 13px;font-size:14px;line-height:1.45}
.hud-panel .top-actions button{min-height:46px;font-size:13px}
.hud-panel .card .kicker{font-size:13px;line-height:1.2}
.hud-panel .mood{font-size:12px}
.hud-panel .stat>div:first-child,.hud-panel .garage-line{font-size:14px}
.hud-panel .stat b,.hud-panel .garage-line b{font-size:13px}
.hud-panel .body-metrics,.hud-panel .route-step{font-size:12px}
.hud-panel .subnote{font-size:13px}
.hud-panel .objective-card p{font-size:15px}
.hud-panel .garage-open{min-height:44px;font-size:13px}
.game-scene .hotspot:not(.hat-peek):not(.timed-cap):not(.gym-tolya-spot){min-width:44px;min-height:44px;height:auto;padding:8px 12px;font-size:clamp(12px,1vw,16px);line-height:1.15}
.game-scene .gym-tolya-spot span{font-size:13px}
.game-scene .apartment-room-nav button{min-height:44px;font-size:13px}
.scene-exit{min-height:44px;font-size:14px}
.progress-row{font-size:13px}
.progress-row .phone-shortcut{min-height:44px;font-size:13px}
.orientation-hint{font-size:12px}
.touch-controls .dpad button{font-size:16px}
.touch-controls .act-button{min-height:46px;font-size:14px}
.dialog{width:min(620px,100%)}
.dialog h2{font-size:clamp(25px,3vw,32px)}
.dialog>p{font-size:15px;line-height:1.5}
.mini-actions button,.mini-option,.activity-choice,.mini-button{min-height:44px;font-size:14px}
.mini-status{font-size:13px;line-height:1.4}
.journal p{font-size:13px}
@media(max-width:600px){
  .topbar{min-height:51px}
  .top-location{gap:6px}
  .top-location #mapKicker{max-width:43vw;font-size:19px}
  .top-location #dayLabel{padding:5px 6px;font-size:11px}
  .hud-toggle{min-width:114px;min-height:44px;font-size:12px}
  .hud-scene-summary{grid-template-columns:1fr;padding:10px}
  .hud-scene-summary .control-hint{text-align:left;font-size:12px}
  .hud-panel .card .kicker{font-size:13px}
  .hud-panel .stat>div:first-child,.hud-panel .garage-line{font-size:14px}
  .game-scene .hotspot:not(.hat-peek):not(.timed-cap):not(.gym-tolya-spot){min-width:44px;min-height:44px;padding:6px 8px;font-size:12px}
  .game-scene .apartment-room-nav button{min-height:44px;font-size:11px}
  .progress-row .phone-shortcut{min-width:108px;font-size:11px}
}

/* Mini-games use the viewport, with scrolling for long stages and controls. */
.overlay{padding:10px}
.dialog{width:min(1040px,100%);max-width:100%;max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px);padding:clamp(19px,2vw,30px);overflow-x:auto;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
.dialog #miniContent{min-width:0;max-width:100%}
.dialog .close-button{min-width:44px;min-height:44px;top:7px;right:8px;font-size:30px;line-height:1}
.dialog #dialogTag{font-size:13px;line-height:1.35}
.dialog h2{margin-right:48px;font-size:clamp(27px,3vw,37px);line-height:1.15}
.dialog>p{font-size:16px;line-height:1.5}
.mini-actions{gap:10px;margin-top:17px}
.dialog .mini-actions button,.dialog .mini-option,.dialog .activity-choice,.dialog .mini-button{min-height:52px;padding:12px 16px;font-size:16px;line-height:1.25;white-space:normal;overflow-wrap:anywhere;touch-action:manipulation}
.dialog .activity-choice{min-height:72px}
/* П.31: у невыполненного досуга (велозаезд уже был сегодня) кнопка должна ВЫГЛЯДЕТЬ
   недоступной — логика disabled уже есть, визуала не было (аудит зоны 5, №4). */
.dialog .activity-choice:disabled{opacity:.55;cursor:default;filter:grayscale(.35)}
.dialog .activity-choice:disabled:hover{border-color:inherit;background:inherit}
.dialog .activity-choice strong{font-size:17px}
.dialog .mini-status{font-size:14px;line-height:1.45;overflow-wrap:anywhere}
.dialog button:focus-visible{outline:3px solid var(--lime);outline-offset:2px}
.dialog .home-laundry-pile button span,.dialog .home-tidy-items button span,.dialog .home-search-grid button span,.dialog .home-plant-icon{font-size:clamp(32px,4vw,46px)}
.dialog .home-ingredients button{min-height:70px;font-size:34px}
.dialog .cap-chip{min-height:100px;font-size:12px}
.dialog .cap-chip .cap-drawing{height:56px}

/* Road game: its canvas keeps its ratio; overlays and weapon cards can scroll. */
.dialog .bike-stage.bike-ex-stage{width:100%;max-width:100%;height:auto;aspect-ratio:8/5}
.dialog .bike-screen{overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;justify-content:center;justify-content:safe center}
.dialog .bike-screen>*{flex-shrink:0}
.dialog .bike-screen .bike-tag{font-size:13px}
.dialog .bike-screen p{font-size:15px;line-height:1.4}
.dialog .bike-screen .bike-keys,.dialog .bike-screen .bike-stats{font-size:13px;line-height:1.45}
.dialog .bike-hud-top .bike-pill{font-size:12px}
.dialog .bike-wslot{min-width:110px;min-height:76px;font-size:11px}
.dialog .bike-wslot .bike-wicon{width:37px;height:35px;font-size:25px}
.dialog .bike-wslot .bike-wicon svg{width:29px;height:29px}
.dialog .bike-touch button{min-width:52px;min-height:52px;font-size:23px}

/* Tender: larger cards and readable figures without forcing horizontal overflow. */
.dialog .tender-docs,.dialog .tender-ledger,.dialog .tender-signals,.dialog .tender-payout{max-width:100%;min-width:0}
.dialog .tender-doc{min-height:66px;padding:11px 14px;font-size:15px;line-height:1.25}
.dialog .tender-doc small,.dialog .tender-doc-slots small{font-size:13px}
.dialog .tender-doc-slots>div{min-height:54px;font-size:15px}
.dialog .tender-ledger label,.dialog .tender-margin,.dialog .tender-current,.dialog .tender-payout>div{font-size:15px;overflow-wrap:anywhere}
.dialog .tender-ledger b,.dialog .tender-payout b{min-width:0;overflow-wrap:anywhere}
.dialog .tender-signal{min-width:0;font-size:15px}
.dialog .tender-signal button{min-height:50px;font-size:14px}
.dialog .tender-track{height:27px}
.dialog .tender-cursor{height:33px}

/* The ring uses its own dialog instead of .dialog. */
.bonus-overlay{padding:8px}
.bonus-dialog{width:min(1080px,calc(100vw - 16px));max-width:100%;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);overflow-y:auto;overflow-x:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.bonus-close{min-width:44px;min-height:44px}
.bonus-ring-layout p{font-size:16px;line-height:1.45}
.bonus-ring-status{font-size:17px}
.bonus-ring{width:100%;max-width:920px;height:clamp(300px,40vw,420px)}
.bonus-ring-cue{font-size:15px;line-height:1.25}
.bonus-ring-controls button{min-height:56px;padding:9px 12px;font-size:16px}

@media(max-width:650px){
  .overlay{padding:6px}
  .dialog{width:100%;max-height:calc(100vh - 12px);max-height:calc(100dvh - 12px);padding:18px 14px;border-radius:12px}
  .dialog h2{font-size:26px}
  .dialog>p{font-size:15px}
  .dialog .mini-actions button{flex:1 1 46%;min-width:0;min-height:52px;padding:10px 12px;font-size:15px}
  .dialog .mini-option,.dialog .activity-choice,.dialog .mini-button{font-size:15px}
  .dialog .bike-screen{justify-content:safe center;gap:5px;padding:9px}
  .dialog .bike-screen h2{font-size:clamp(20px,5vw,30px)}
  .dialog .bike-screen p{font-size:14px}
  .dialog .bike-hud-top .bike-pill{font-size:10px}
  .dialog .bike-wslot{min-width:88px;min-height:70px;font-size:10px}
  .dialog .bike-touch button{min-width:46px;min-height:46px;font-size:20px}
  .dialog .tender-doc-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dialog .tender-ledger label{grid-template-columns:minmax(0,1fr) minmax(75px,auto)}
  .dialog .tender-signal{grid-template-columns:minmax(0,1fr) minmax(105px,auto)}
  .bonus-overlay{padding:6px}
  .bonus-dialog{max-height: calc(100vh - 12px);max-height: calc(100dvh - 12px)}
  .bonus-ring-layout{padding:14px 10px}
  .bonus-ring{height:clamp(270px,78vw,340px)}
  .bonus-ring-status{font-size:14px}
  .bonus-ring-controls button{min-height:54px;font-size:15px}
}
@media(max-width:360px){.dialog .tender-doc-cards{grid-template-columns:1fr}.dialog .bike-wslot{min-width:79px}.dialog .home-ingredients button{font-size:30px}}


/* Compact scene controls and a single, short HUD. */
.topbar{display:none}
.layout{margin-top:0}
.main-column{position:relative}
.scene-hud-corner{position:absolute;top:10px;left:22px;z-index:12;display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid #d8edbf;border-radius:10px;background:#17231deF;color:#f3ffe8;font:700 20px/1 system-ui,sans-serif;box-shadow:0 4px 14px #0008;cursor:pointer;touch-action:manipulation}
.scene-hud-corner:hover,.scene-hud-corner:focus-visible{background:#36523a;outline:3px solid var(--lime);outline-offset:2px}
.scene-utility{position:relative;z-index:1;display:flex;align-items:center;justify-content:flex-end;gap:8px;max-width:100%;margin:7px 1px 0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;backdrop-filter:none}
.scene-meta{display:grid;gap:3px;min-width:0;padding:0 5px;color:#f3f8ed;font-size:12px;line-height:1.15}
.scene-meta #mapKicker{color:#f3f8ed;font:800 14px/1.15 Manrope,system-ui,sans-serif;letter-spacing:0;text-transform:none}
.scene-meta #dayLabel{color:#cce7aa;font:11px/1.2 'Space Mono',monospace;text-transform:capitalize}
.scene-meta strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
.scene-meta span{color:#cce7aa;font:11px/1.2 'Space Mono',monospace}
.scene-utility .hud-toggle,.scene-utility .phone-shortcut{flex:none;min-height:44px;padding:8px 11px;border-color:#91b87c;background:#24392a;color:#eaf7da;font-size:11px;font-weight:700;white-space:nowrap}
.scene-utility .phone-shortcut span{background:var(--orange);color:#1d1713}
.scene-utility .hud-toggle span{margin-left:4px;color:var(--lime)}
.progress-row{margin-top:7px}
.hud-scene-summary{display:none!important}
.hud-panel .first-scene-help:not([hidden]){display:grid!important;gap:3px;margin:0 0 8px;padding:8px 10px;font-size:12px}
.hud-panel .first-scene-help[hidden]{display:none!important}
.hud-panel{max-height:min(78vh,720px);max-height:min(78svh,720px);padding:12px clamp(12px,3vw,42px) 16px}
.hud-panel-head{margin-bottom:8px}
.hud-panel .top-actions{grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:6px;margin-bottom:8px}
.hud-panel .top-actions button{min-height:38px;padding:7px 9px;font-size:11px}
.hud-panel .sidebar{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.hud-panel .card{padding:10px}
.hud-panel .card:not(.objective-card)>.card-head{display:none}
.hud-panel .stat{margin:5px 0}
.hud-panel .stat>div:first-child{margin-bottom:3px;font-size:12px}
.hud-panel .objective-card{grid-column:1/-1}
.hud-panel .objective-card p{margin:5px 0;font-size:13px}
.hud-panel #routeMini[hidden]{display:none!important}
.hud-panel .garage-card,.hud-panel .body-card{display:block}
.hud-panel .garage-card>summary,.hud-panel .body-card>summary{cursor:pointer;list-style:none;min-height:25px;font-size:12px}
.hud-panel .garage-card>summary::-webkit-details-marker,.hud-panel .body-card>summary::-webkit-details-marker{display:none}
.hud-panel .garage-card>summary::after,.hud-panel .body-card>summary::after{content:'＋';float:right;color:var(--lime)}
.hud-panel .garage-card[open]>summary::after,.hud-panel .body-card[open]>summary::after{content:'−'}
.hud-panel .garage-card[open]>summary,.hud-panel .body-card[open]>summary{margin-bottom:10px}
.hud-panel .relaxation-card[hidden]{display:none}
.journal{margin-top:6px;padding:10px 13px;min-height:0}
.journal>summary{cursor:pointer;list-style:none;font-size:12px}
.journal>summary::-webkit-details-marker{display:none}
.journal>summary::after{content:'＋';float:right;color:var(--lime)}
.journal[open]>summary::after{content:'−'}
.journal-scroll{max-height:115px;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
.journal-scroll p{margin:7px 0 0;font-size:12px}
@media(max-width:600px){
  .game-scene{aspect-ratio:16/9;min-height:0}
  .scene-utility{gap:5px;margin-top:5px}
  .scene-meta{font-size:10px}
  .scene-meta #mapKicker{font-size:11px;max-width:23vw}
  .scene-meta span{font-size:9px}
  .scene-utility .hud-toggle,.scene-utility .phone-shortcut{min-height:44px;padding:7px 8px;font-size:9px}
  .scene-hud-corner{top:7px;left:22px;width:42px;height:42px}
  .hud-panel{max-height: 82vh;max-height: 82svh;padding-inline:9px}
  .hud-panel .sidebar{grid-template-columns:1fr}
  .hud-panel .objective-card{grid-column:auto}
  .journal-scroll{max-height:90px}
}
@media(max-width:380px){.scene-utility{gap:3px}.scene-meta{display:grid;padding:0 2px}.scene-meta #mapKicker{max-width:27vw;font-size:10px}.scene-utility .hud-toggle,.scene-utility .phone-shortcut{padding:6px;font-size:8px}}

/* One-screen map layout: progress and notes float over the scene; controls stay below. */
.app{padding:4px 4px max(4px,env(safe-area-inset-bottom))}
.main-column{width:100%;max-width:none;margin:0}
.game-scene{position:relative;overflow:hidden;height: min(56.25vw,calc(100vh - 94px));height: min(56.25vw,calc(100svh - 94px));aspect-ratio:auto;border-radius:8px}
.game-scene .scene-background{background-size:100% 100%}
.scene-progress{position:absolute;left:12px;top:50%;z-index:11;display:flex;flex-direction:column;align-items:center;gap:7px;transform:translateY(-50%);padding:9px 7px;border:1px solid #d9edbb77;border-radius:10px;background:#101913d9;color:#f2f8e9;font:700 10px/1 'Space Mono',monospace;box-shadow:0 4px 14px #0008;pointer-events:none}
.scene-progress-track{width:5px;height: clamp(66px,13vh,120px);height: clamp(66px,13svh,120px);border-radius:9px;background:#ffffff35;overflow:hidden;display:flex;align-items:flex-end}
.scene-progress-track i{display:block;width:100%;height:0;background:var(--lime);transition:height .25s}
.scene-journal{position:absolute;top:10px;right:104px;z-index:13;margin:0;color:#f3f8ed;font:600 12px Manrope,system-ui,sans-serif}
.scene-journal-toggle{min-height:44px;display:flex;align-items:center;padding:0 12px;border:1px solid #d8edbf;border-radius:9px;background:#17231def;box-shadow:0 4px 14px #0008;cursor:pointer;list-style:none;white-space:nowrap}
.scene-journal-toggle::-webkit-details-marker{display:none}
.scene-journal[open] .scene-journal-toggle{display:none}
.scene-journal-panel{width:min(330px,calc(100vw - 32px));max-height: min(48vh,320px);max-height: min(48svh,320px);overflow:auto;overscroll-behavior:contain;padding:10px;border:1px solid #a4c17e;border-radius:11px;background:#17231df2;box-shadow:0 8px 24px #000a}
.scene-journal-close{display:block;margin-left:auto;min-height:44px;padding:6px 10px;border:1px solid #91b87c;border-radius:7px;background:#24392a;color:#eaf7da;font-weight:700;cursor:pointer}
.scene-journal .journal-scroll{max-height:220px;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.scene-journal .journal-scroll p{margin:8px 0 0;font-size:12px;line-height:1.4}
.progress-row{display:none}
@media(max-width:900px){.scene-journal{right:94px;top:8px}.scene-progress{left:8px}}
@media(max-width:600px){
 .app{min-height: 100vh;min-height: 100svh;padding:4px 5px max(46px,env(safe-area-inset-bottom))}
 .game-scene{aspect-ratio:16/9}
 .scene-utility{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;margin:4px 0 0}
 .scene-meta{display:flex;align-items:center;gap:5px;padding:0;min-width:0}
 .scene-meta #mapKicker{max-width:34vw;font-size:11px}
 .scene-meta #dayLabel{font-size:9px;white-space:nowrap}
 .scene-utility .hud-toggle,.scene-utility .phone-shortcut{min-width:0;min-height:44px;padding:5px 7px;font-size:9px}
 .touch-controls{min-height:62px;padding:2px 4px 0;align-items:center}
 .touch-controls .dpad{grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px);gap:8px}
 .touch-controls .dpad button{min-height:44px}
 .touch-controls .act-button{min-height:44px;padding:0 12px}
 .scene-progress{left:6px;padding:7px 5px;font-size:9px}
 .scene-progress-track{height: clamp(52px,10vh,82px);height: clamp(52px,10svh,82px)}
 .scene-journal{top:6px;right:88px}
 .scene-journal-toggle{min-height:44px;padding:0 8px;font-size:10px}
 .scene-journal-close{min-height:44px}
}
@media(max-width:390px){.scene-utility{grid-template-columns:minmax(0,1fr) auto auto;gap:8px}.scene-meta #mapKicker{max-width:30vw;font-size:10px}.scene-utility .hud-toggle,.scene-utility .phone-shortcut{padding:5px;font-size:8px}.scene-journal{right:83px}.scene-journal-toggle{padding:0 6px;font-size:9px}}
@media(max-width:900px) and (orientation:landscape){.app{padding:3px 6px max(3px,env(safe-area-inset-bottom))}.game-scene{aspect-ratio:2.25/1;height: min(56.25vw,calc(100vh - 132px));height: min(56.25vw,calc(100svh - 132px))}.scene-utility{margin-top:3px}.touch-controls{min-height:52px;padding-top:0}.touch-controls .dpad{grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px)}.touch-controls .dpad button{min-height:44px}.touch-controls .act-button{min-height:44px}.scene-progress-track{height:50px}}

/* Show the complete 16:9 location art on the left; reserve the dark right rail
   for controls. Every shipped room background is 1672x941 (approximately 16:9). */
.playfield-row{display:grid;grid-template-columns: minmax(0,min(calc(100% - 250px),calc(177.7778vh - 170.6667px))) minmax(250px,1fr);grid-template-columns: minmax(0,min(calc(100% - 250px),calc(177.7778svh - 170.6667px))) minmax(250px,1fr);width:100%;align-items:stretch;background:#0a0d0b}
.playfield-row .game-scene{width:100%;height:auto;aspect-ratio:16/9;min-height:0;max-height:none;border-radius:8px 0 0 8px}
.playfield-row .scene-background{background-size:100% 100%;background-position:center}
.scene-rail{position:relative;display:flex;flex-direction:column;align-items:stretch;gap:9px;min-width:0;padding:12px;border:1px solid #35443a;border-left:0;border-radius:0 8px 8px 0;background:#0b100dcc;color:#edf4e9}
.scene-rail .scene-hud-corner{position:static;flex:none;place-self:start;width:48px;height:48px}
.scene-rail .scene-journal{position:relative;top:auto;right:auto;z-index:13;width:100%;margin:0}
.scene-rail .scene-journal-toggle{min-height:44px;max-width:100%;padding:0 10px;white-space:normal;line-height:1.2}
.scene-rail .scene-journal-panel{position:absolute;top:0;right:calc(100% + 13px);z-index:15;width:min(340px,60vw);max-height: min(50vh,340px);max-height: min(50svh,340px)}
.scene-rail .scene-progress{position:relative;top:auto;left:auto;z-index:1;align-self:center;margin:auto 0 7px;transform:none}
.scene-rail .scene-progress-track{height: clamp(85px,19vh,170px);height: clamp(85px,19svh,170px)}

/* Right-rail controls: keep journal content inside the rail and show three
   horizontal task indicators while retaining the legacy JS progress hook. */
.scene-rail .scene-journal{position:relative;isolation:isolate}
.scene-rail .scene-journal[open]{z-index:20;min-height:0;flex:1;overflow:hidden}
.scene-rail .scene-journal-panel{position:relative;inset:auto;z-index:2;width:100%;max-width:100%;max-height: min(54vh,500px);max-height: min(54svh,500px);box-sizing:border-box;overflow:auto;border-radius:9px;background:#101913f5}
.scene-rail .scene-journal[open] .scene-journal-toggle{display:none}
.scene-rail .scene-progress{width:100%;align-self:stretch;box-sizing:border-box;gap:7px;margin:0 0 4px;padding:10px;border-color:#35443a;background:#080c0ad9}
.scene-progress-label{align-self:flex-start;color:#d6e6c9;font:700 11px/1.1 'Space Mono',monospace;letter-spacing:.08em}
.scene-progress-bars{display:grid;width:100%;gap:7px}
.scene-progress-bar{display:block;height:9px;overflow:hidden;border:1px solid #b9d89c66;border-radius:99px;background:#ffffff20}
.scene-progress-bar b{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#8dbb65,var(--lime));box-shadow:0 0 8px #b9e88988}
.scene-rail .scene-progress-track{display:none}
.scene-rail #progressText{align-self:flex-end;color:#f2f8e9;font:700 12px/1.2 'Space Mono',monospace}
.scene-utility .phone-shortcut{position:relative}
.scene-utility .phone-shortcut:has(#phoneUnread:not([hidden])){border-color:#ffe17c;background:linear-gradient(135deg,#394326,#69451e);color:#fff2c5;box-shadow:0 0 9px #ffc83f99,0 0 22px #ff9d3577;animation:phone-unread-jitter .22s ease-in-out infinite alternate,phone-unread-glow 1.1s ease-in-out infinite}
.scene-utility .phone-shortcut:has(#phoneUnread:not([hidden])) #phoneUnread{box-shadow:0 0 8px #ffd15c;animation:phone-badge-blink .7s steps(2,end) infinite}
@keyframes phone-unread-jitter{from{transform:rotate(-1.2deg) translateX(-1px)}to{transform:rotate(1.2deg) translateX(1px)}}
@keyframes phone-unread-glow{0%,100%{filter:brightness(1);box-shadow:0 0 8px #ffc83f77,0 0 18px #ff9d3555}50%{filter:brightness(1.35);box-shadow:0 0 14px #ffe27c,0 0 30px #ff9d35aa}}
@keyframes phone-badge-blink{50%{opacity:.45}}
.hud-toggle,.scene-utility .phone-shortcut{font-size:clamp(15px,1.15vw,18px)}
.scene-meta #mapKicker{font-size:clamp(18px,1.5vw,21px)}
.scene-meta #dayLabel,.scene-meta span{font-size:14px}
.scene-rail .scene-hud-corner{font-size:28px}
.scene-rail .scene-journal-toggle{min-height:56px;padding:8px;font-size:16px;font-weight:700}
.scene-rail .scene-journal-close{min-height:46px;font-size:15px}
.scene-rail .scene-journal .journal-scroll p{font-size:16px;line-height:1.5}
.hud-panel-head .kicker{font-size:18px}
.hud-panel-head button,.hud-panel .top-actions button{font-size:16px}
.hud-panel .card .kicker,.hud-panel .stat>div:first-child,.hud-panel .garage-line{font-size:18px}
.hud-panel .stat b,.hud-panel .garage-line b{font-size:17px}
.hud-panel .mood,.hud-panel .body-metrics,.hud-panel .route-step,.hud-panel .subnote{font-size:16px}
.hud-panel .objective-card p{font-size:19px}
.hud-panel .garage-card>summary,.hud-panel .body-card>summary{min-height:40px;font-size:18px;line-height:1.35}
.hud-panel .garage-card>summary::after,.hud-panel .body-card>summary::after{content:'＋  РАСКРЫТЬ';font-size:12px;font-weight:800;letter-spacing:.03em}
.hud-panel .garage-card[open]>summary::after,.hud-panel .body-card[open]>summary::after{content:'−  СВЕРНУТЬ'}
.hud-panel .garage-open{min-height:50px;font-size:16px}
@media(prefers-reduced-motion:reduce){.scene-utility .phone-shortcut:has(#phoneUnread:not([hidden])),.scene-utility .phone-shortcut:has(#phoneUnread:not([hidden])) #phoneUnread{animation:none}}
@media(max-width:680px) and (orientation:portrait){
 .playfield-row{display:flex;flex-direction:column}
 .playfield-row .game-scene{width:100%;height:auto;aspect-ratio:16/9;border-radius:8px 8px 0 0}
 .scene-rail{flex-direction:row;align-items:center;gap:8px;min-height:54px;padding:5px 7px;border:1px solid #35443a;border-top:0;border-radius:0 0 8px 8px}
 .scene-rail .scene-hud-corner{width:42px;height:42px}
 .scene-rail .scene-journal{width:auto;flex:1;min-width:0}
 .scene-rail .scene-journal-toggle{min-height:44px;width:max-content;max-width:100%;font-size:11px}
 .scene-rail .scene-journal-panel{top:0;right:auto;bottom:auto;left:0;width:100%;max-width:100%}
 .scene-rail .scene-progress{flex:0 0 112px;flex-direction:column;align-items:stretch;gap:4px;margin:0;padding:5px 7px}
 .scene-progress-label{font-size:9px}
 .scene-progress-bars{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}
 .scene-progress-bar{height:7px}
 .scene-rail #progressText{font-size:10px}
 .scene-rail .scene-journal-panel{inset:auto;width:100%;max-width:100%;max-height: 45vh;max-height: 45svh}
 .scene-rail .scene-journal-toggle{font-size:14px}
}
@media(max-width:680px) and (orientation:landscape){
 .playfield-row{grid-template-columns: minmax(0,min(calc(100% - 75px),calc(177.7778vh - 184.8889px))) minmax(75px,1fr);grid-template-columns: minmax(0,min(calc(100% - 75px),calc(177.7778svh - 184.8889px))) minmax(75px,1fr)}
 .scene-rail{padding:6px;gap:6px}
 .scene-rail .scene-hud-corner{width:40px;height:40px}
 .scene-rail .scene-journal-toggle{min-height:44px;padding:0 5px;font-size:9px}
 .scene-rail .scene-progress{padding:6px 3px;font-size:9px}
 .scene-rail .scene-progress{flex-basis:95px;padding:5px}
}

/* Stable scene rail: menu, journal, then the task counter at the bottom. */
.scene-rail{display:grid;grid-template-rows:auto minmax(0,1fr) auto;align-content:stretch;align-items:stretch;gap:8px;min-height:0;overflow:hidden}
.scene-rail .scene-hud-corner{grid-row:1;justify-self:start;align-self:start}
.scene-rail .scene-journal{grid-row:2;position:relative;top:auto;right:auto;z-index:2;width:100%;min-width:0;min-height:0;margin:0;align-self:start;overflow:visible}
.scene-rail .scene-journal-toggle{display:flex;width:100%;min-height:44px;box-sizing:border-box;white-space:normal;line-height:1.2}
.scene-rail .scene-journal[open]{z-index:3;align-self:stretch;min-height:0;overflow:hidden}
.scene-rail .scene-journal[open] .scene-journal-toggle{display:none}
.scene-rail .scene-journal-panel{position:absolute;inset:0 0 0 0;z-index:4;display:flex;flex-direction:column;width:100%;max-width:100%;height:100%;max-height:100%;box-sizing:border-box;overflow:hidden;border-radius:9px;background:#101913f5}
.scene-rail .scene-journal-close{flex:none}
.scene-rail .scene-journal .journal-scroll{min-height:0;max-height:none;flex:1;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.scene-rail .scene-journal .journal-scroll{overflow-x:hidden}
.scene-rail .journal-scroll p{overflow-wrap:anywhere}
.scene-rail .journal-finance{padding:8px 0;border-top:1px solid #b0ca9b35}
.scene-rail .journal-finance.income{color:#c8f09c}
.scene-rail .journal-finance.expense{color:#e9d5b6}
.scene-rail .journal-finance small{display:block;margin-top:3px;color:#aebca8;font-size:12px;line-height:1.3}
.scene-rail .journal-balance{padding-top:8px;border-top:1px solid #b0ca9b70;color:#c9f18d;font-weight:800}
.scene-rail .scene-progress{grid-row:3;position:relative;top:auto;left:auto;z-index:1;align-self:end;width:100%;min-width:0;box-sizing:border-box;flex:none;gap:6px;margin:0;padding:8px;border-color:#35443a;background:#080c0ad9}
.scene-rail .scene-progress-bars{grid-template-columns:1fr;gap:5px}
.scene-rail .scene-progress-bar{height:6px}
.scene-rail .scene-progress-track{display:none}
.scene-rail #progressText{align-self:flex-end}
@media(max-width:680px) and (orientation:portrait){
 .scene-rail{display:grid;grid-template-rows:auto minmax(0,1fr) auto;grid-template-columns:minmax(0,1fr);flex-direction:initial;align-items:stretch;gap:6px;min-height:138px;padding:6px 8px}
 .scene-rail .scene-hud-corner{width:38px;height:38px}
 .scene-rail .scene-journal{width:100%;min-width:0;flex:initial}
 .scene-rail .scene-journal-toggle{width:100%;min-height:44px;font-size:12px}
 .scene-rail .scene-journal-panel{inset:0;height:100%;max-height:100%}
 .scene-rail .scene-progress{width:100%;flex:none;flex-direction:column;align-items:stretch;gap:4px;margin:0;padding:5px 7px}
 .scene-rail .scene-progress-label{font-size:9px}
 .scene-rail .scene-progress-bars{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
 .scene-rail .scene-progress-bar{height:6px}
 .scene-rail #progressText{font-size:10px}
}
@media(max-width:680px) and (orientation:landscape){
 .playfield-row{grid-template-columns: minmax(0,min(calc(100% - 75px),calc(177.7778vh - 184.8889px))) minmax(75px,1fr);grid-template-columns: minmax(0,min(calc(100% - 75px),calc(177.7778svh - 184.8889px))) minmax(75px,1fr)}
 .scene-rail{grid-template-rows:auto minmax(0,1fr) auto;min-height:0;padding:5px;gap:5px}
 .scene-rail .scene-hud-corner{width:34px;height:34px}
 .scene-rail .scene-journal-toggle{min-height:44px;padding:4px;font-size:9px}
 .scene-rail .scene-progress{padding:5px 4px}
 .scene-rail .scene-progress-bar{height:5px}
}
@media(min-width:681px) and (max-width:1000px) and (orientation:landscape){.playfield-row{grid-template-columns: minmax(0,min(calc(100% - 135px),calc(177.7778vh - 170.6667px))) minmax(135px,1fr);grid-template-columns: minmax(0,min(calc(100% - 135px),calc(177.7778svh - 170.6667px))) minmax(135px,1fr)}.scene-rail .scene-journal .journal-scroll p{font-size:12px;line-height:1.35}}
.money-notice{position:fixed;z-index:55;top:18px;left:18px;max-width:min(380px,calc(100vw - 36px));padding:12px 16px;border:1px solid #a6d77b;border-radius:10px;background:#14251de8;color:#eaffd7;font:700 14px/1.35 Manrope,system-ui,sans-serif;box-shadow:0 12px 32px #0008;pointer-events:none;opacity:0;transform:translateY(-12px);transition:opacity .22s,transform .22s}
.money-notice.show{opacity:1;transform:translateY(0)}
/* Keep the ring and its action buttons visible together on short screens. */
@media(max-height:800px){
 .bonus-ring-layout{padding:10px 16px}
 .bonus-ring-layout h2{font-size:clamp(1.5rem,4vw,2.4rem);margin:.15em 0}
 .bonus-ring-layout>p{margin:5px auto 7px;line-height:1.25}
 .bonus-ring-status{margin-bottom:6px}
 .bonus-ring{height: clamp(235px,42vh,330px);height: clamp(235px,42dvh,330px)}
 .bonus-ring-controls{margin-top:8px}
 .bonus-ring-controls button{min-height:44px}
}
@media(max-height:520px){
 .bonus-ring-layout>p{font-size:12px}
 .bonus-ring{height: clamp(145px,43vh,185px);height: clamp(145px,43dvh,185px)}
 .bonus-ring-fighter{scale:.72;transform-origin:bottom center}
}
/* P.39 (B5): tap active feedback for classes without :active */
.hud-toggle:active,.scene-journal-toggle:active,.touch-controls button:active,.touch-controls .act-button:active{transform:scale(.97);filter:brightness(.92)}
