/* The course keeps the same full view as the illustrated launch. */
.is-playing #game-shell:not([data-state='menu']){--hud-room:66px;--control-room:80px;padding:0;gap:0;display:block;overflow:hidden}
.is-playing #game-shell:not([data-state='menu']) .play-area{position:absolute;inset:0;width:100%;height:100%;max-width:none;align-self:stretch;justify-self:stretch}
.is-playing #game-shell:not([data-state='menu']) #game-surface{width:100%;height:100%;aspect-ratio:auto;border:0;border-radius:0;animation:none}
.is-playing #game-shell:not([data-state='menu']) .player-hud{position:absolute;inset:0 0 auto;z-index:12;margin:0;padding:max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 12px max(12px,env(safe-area-inset-left));box-sizing:border-box;background:linear-gradient(#102a3fed 65%,#102a3f00);gap:10px;pointer-events:none}
.is-playing #game-shell:not([data-state='menu']) .player-controls{pointer-events:auto}
.is-playing #game-shell:not([data-state='menu']) .player-controls button{min-width:44px;min-height:44px!important;padding:8px 10px;background:#123440db}
.is-playing #game-shell:not([data-state='menu']) .runner-actions{position:absolute;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));z-index:8;min-height:52px;justify-content:space-between;gap:8px;pointer-events:none}
.is-playing #game-shell:not([data-state='menu']) .runner-actions button{pointer-events:auto;min-height:48px}
.is-playing #game-shell:not([data-state='menu']) #jump{margin-left:auto}
.is-playing #game-shell:not([data-state='menu']) .runner-help{margin-left:12px;padding:5px 8px;border-radius:8px;background:#102b3fc9;color:#fff0cf;font-size:11px}
.is-playing #game-shell:not([data-state='menu']) .player-status{position:absolute;left:12px;right:12px;bottom:calc(max(10px,env(safe-area-inset-bottom)) + 58px);z-index:7;min-height:0;pointer-events:none}
.is-playing #game-shell:not([data-state='menu']) #game-status{padding:4px 10px;border-radius:8px;background:#102b3fdb;color:#fff0cf;font-size:12px;text-shadow:0 1px 2px #081826}
.is-playing #game-shell:not([data-state='menu']) #turn-guide{top:calc(max(0px,env(safe-area-inset-top)) + var(--hud-room) + 6px);z-index:5}
.is-playing #game-shell:not([data-state='menu']) .power-indicator{top:calc(max(0px,env(safe-area-inset-top)) + var(--hud-room) + 78px);max-width:calc(50% - 60px);z-index:5}
.is-playing #game-shell:not([data-state='menu']) .game-menu{inset:calc(max(0px,env(safe-area-inset-top)) + var(--hud-room)) 0 calc(max(0px,env(safe-area-inset-bottom)) + var(--control-room));z-index:10;border-radius:0}
@media(max-width:800px){
 .is-playing #game-shell:not([data-state='menu']){--hud-room:110px}
 .is-playing #game-shell:not([data-state='menu']) .player-hud{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px 6px;padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
 .is-playing #game-shell:not([data-state='menu']) .stat{min-width:0}
 .is-playing #game-shell:not([data-state='menu']) .stat span{font-size:7px;letter-spacing:0;white-space:nowrap}
 .is-playing #game-shell:not([data-state='menu']) .stat strong{font-size:16px!important;white-space:nowrap}
 .is-playing #game-shell:not([data-state='menu']) .player-controls{grid-column:1/-1;display:flex;width:100%;justify-content:space-between;margin:0;gap:4px}
 .is-playing #game-shell:not([data-state='menu']) .player-controls button{font-size:10px;padding:7px 6px}
 .is-playing #game-shell:not([data-state='menu']) .runner-actions{left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));gap:5px}
 .is-playing #game-shell:not([data-state='menu']) .runner-help{display:none}
 .is-playing #game-shell:not([data-state='menu']) #jump,.is-playing #game-shell:not([data-state='menu']) #slide{min-width:72px;padding:10px 8px;font-size:12px}
 .is-playing #game-shell:not([data-state='menu']) .lane-buttons{gap:3px}
 .is-playing #game-shell:not([data-state='menu']) .lane-buttons button{min-width:44px;padding:8px}
}
@media(max-height:450px) and (orientation:landscape){
 .is-playing #game-shell:not([data-state='menu']){--hud-room:62px;--control-room:70px}
 .is-playing #game-shell:not([data-state='menu']) .player-hud{display:flex;flex-wrap:nowrap;gap:5px;padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
 .is-playing #game-shell:not([data-state='menu']) .stat{flex:1;min-width:0}
 .is-playing #game-shell:not([data-state='menu']) .stat span{font-size:7px;letter-spacing:0;white-space:nowrap}
 .is-playing #game-shell:not([data-state='menu']) .stat strong{font-size:14px!important}
 .is-playing #game-shell:not([data-state='menu']) .player-controls{flex:none;width:auto;gap:3px;margin-left:5px}
 .is-playing #game-shell:not([data-state='menu']) .player-controls button{font-size:9px;padding:6px 5px}
 .is-playing #game-shell:not([data-state='menu']) .runner-help{display:none}
 .is-playing #game-shell:not([data-state='menu']) #jump,.is-playing #game-shell:not([data-state='menu']) #slide{min-width:74px;min-height:44px}
 .is-playing #game-shell:not([data-state='menu']) .player-status{right:auto;width:calc(50% - 100px);min-width:140px;justify-content:flex-start;text-align:left}
 .is-playing #game-shell:not([data-state='menu']) #game-status{font-size:10px;line-height:1.25}
 .is-playing #game-shell:not([data-state='menu']) .power-indicator{font-size:10px;padding:5px 7px}
}

#turn-guide[data-opening='true']{
 font-size:clamp(15px,2.6vw,25px);letter-spacing:.03em;
 box-shadow:0 4px 14px #061e36a6
}
#run-earned:not([hidden]){
 display:block;margin:.55em 0 .25em;padding:.55em .8em;border-radius:8px;
 background:#153d4e;color:#ffe4a9;font-size:clamp(12px,1.8vw,16px);font-weight:750
}
#game-menu:has(#run-earned:not([hidden])) .run-actions{
 display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;max-width:100%
}
#game-menu:has(#run-earned:not([hidden])) #play{min-width:140px;min-height:50px;font-size:17px}
#game-menu #continue-run{
 min-height:44px;padding:8px 14px;border:1px solid #d0ae71;border-radius:9px;
 background:#163a49;color:#ffedc9;font-size:14px
}
#continue-run:focus-visible{outline:3px solid #fff4ce;outline-offset:3px}
@media(max-height:500px) and (min-width:601px){
 #game-menu:has(#run-earned:not([hidden])) .run-actions{grid-column:1;grid-row:4}
}

#run-daily-progress:not([hidden]){display:block;margin:.4em 0;color:#d1efe9;font-size:12px}

#turn-guide[data-junction='true']{
  border:2px solid #ffd47b;
  color:#fff1c9;
  background:#102c39;
}

#doubler-indicator{left:50%;transform:translateX(-50%);margin-top:52px}

.courier-portrait{object-fit:contain;display:block}

.wardrobe-categories{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
  margin:12px 0;
}
.wardrobe-categories button{min-height:44px;padding:6px 3px;font-size:clamp(.72rem,2.7vw,.95rem)}
.wardrobe-categories button[aria-pressed='true']{background:#ffd47b;color:#132b37}
#wardrobe-accessories:not([hidden]),#wardrobe-outfits:not([hidden]){display:grid;gap:10px}

/* Put the next attempt within thumb reach. Extra receipts stay available below it. */
#game-shell #game-menu[data-run-result]{
 display:flex;flex-flow:column nowrap;align-items:center;justify-content:flex-start;
 overflow:auto;overscroll-behavior:contain;padding:16px;box-sizing:border-box;
 background:linear-gradient(180deg,#112936a6,#102736dd)
}
#game-menu[data-run-result] #home-run-card{
 display:flex;flex-direction:column;align-items:stretch;gap:10px;margin:auto;
 width:min(100%,27rem);box-sizing:border-box;padding:clamp(14px,3vw,26px);
 background:#132f3ef5;color:#fff2d2;border:1px solid #a68a5a;border-radius:18px;
 text-align:center;box-shadow:0 12px 38px #08162166
}
#game-menu[data-run-result] #menu-title{margin:0;font-size:clamp(23px,4vw,34px);line-height:1.12}
#game-menu[data-run-result] #menu-description{margin:0;max-width:none;font-size:14px;line-height:1.45}
#game-menu[data-run-result] .title-actions{display:none}
#result-stats:not([hidden]){display:flex;order:1;margin:0;border-block:1px solid #ffffff25;padding:10px 0}
#result-stats div{flex:1}
#result-stats[data-record] #result-distance-label{color:#ffe3a5;font-weight:700}
#result-stats[data-record] #result-distance{font-size:clamp(27px,5vw,36px);line-height:1.1}
#game-menu[data-run-result] .game-update:not([hidden]){display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px 12px;max-width:27rem;background:transparent;border:0}
#game-menu[data-run-result] .game-update strong{display:none}
#game-menu[data-run-result] .game-update p{margin:0;max-width:24ch;line-height:1.35}
@media(prefers-reduced-motion:no-preference){
 #result-stats[data-record] #result-distance{animation:record-arrives .32s ease-out}
 @keyframes record-arrives{from{transform:translateY(4px);opacity:.5}to{transform:translateY(0);opacity:1}}
}
#result-stats div+div{border-inline-start:1px solid #ffffff25}
#result-stats #result-bonus{font-size:12px;font-weight:600}
#result-stats dt{color:#c6dbe1;font-size:12px}
#result-stats dd{margin:2px 0 0;color:#ffe3a5;font-size:23px;font-weight:750}
#game-menu[data-run-result] .run-actions{order:2;display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:0}
#result-footer:not([hidden]){order:3;display:flex;flex-wrap:wrap;align-items:start;justify-content:center;gap:4px 14px}
#result-footer :is(#result-harbor,summary){box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:4px 10px;border:0;background:transparent;color:#e4edf0;font:inherit;font-size:14px;text-decoration:underline;cursor:pointer}
#result-details[open]{flex-basis:100%}
#result-breakdown{display:grid;gap:5px;padding:8px 0;text-align:center;font-size:13px}
#game-menu[data-run-result] #run-earned{margin:0;background:transparent;padding:0;font-size:14px}
#game-menu[data-run-result] #next-run-target:not([hidden]){color:#ffdb91}
#game-menu[data-run-result] #local-save-status[data-level='ok']{color:#bfd2d8;font-size:12px}
@media(max-height:500px){
 .is-playing #game-shell[data-state='over']:has([data-run-result]) .game-menu{inset:0;z-index:13}
}

.is-playing #game-shell[data-state='over']:has([data-run-result]) :is(.player-hud,.runner-actions){display:none}
.is-playing #game-shell[data-state='over'] #game-menu[data-run-result]{inset:0;padding:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))}
#home-run-card .run-actions[hidden]{display:none}

/* Live Endless shows the three numbers used to make decisions on the quay. */
@media (max-width:800px), (orientation:landscape) and (max-height:450px){
 .is-playing #game-shell[data-state='running'][data-endless-hud] .player-hud{
  background:linear-gradient(180deg,#102b3ff7 0%,#102b3fee 82%,transparent);
  font-variant-numeric:tabular-nums
 }
 #game-shell[data-state='running'][data-endless-hud] .stat:has(:is(#best,#round-time)){display:none}
 .is-playing #game-shell[data-state='running'][data-endless-hud] .stat span{font-size:10px;letter-spacing:.04em;opacity:1;color:#c9dce0}
 .is-playing #game-shell[data-state='running'][data-endless-hud] .stat strong{font-size:16px!important}
 .is-playing #game-shell[data-state='running'][data-endless-hud] .stat #score{font-size:clamp(19px,4.8vw,24px)!important;color:#ffe1a0}
}
@media (max-width:800px){
 .is-playing #game-shell[data-state='running'][data-endless-hud] .player-hud{grid-template-columns:2fr 1fr 1fr}
}
