/* Only the open game animates; no extra map, tiles or continuous JS drawing. */
.bus-game-modal .info-modal-header{background:#e94986!important;color:#111!important}
html body #infoModal.bus-game-modal.open{position:fixed!important;inset:0!important;transform:none!important;display:flex!important;flex-direction:column!important;width:100%!important;max-width:none!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;border-radius:0!important;z-index:15000!important}
html body #infoModal.bus-game-modal .info-modal-header{flex:0 0 auto;padding-top:max(12px,env(safe-area-inset-top))!important}
html body #infoModal.bus-game-modal #infoModalBody{flex:1;min-height:0;max-height:none!important;overflow:auto;padding-bottom:max(12px,env(safe-area-inset-bottom))!important}
.bus-game{display:flex;flex-direction:column;min-height:100%;height:100%;gap:0}
body.bus-game-open #stopView>.stop-control-bar,body.bus-game-open #stopView>.stop-body,body.bus-game-open #stopAlertBanner{display:none!important}
.bus-game-modal #infoModalBody{padding:12px!important}
.bus-game-picker p{margin:0 0 12px}
.bus-game-choices{display:flex;flex-direction:column;gap:7px}
.bus-game-choice{display:flex;align-items:center;gap:10px;width:100%;min-height:64px;padding:10px;border:0;border-radius:17px;background:var(--surface2,#eee);color:inherit;font:inherit;text-align:left;cursor:pointer}
.bus-game-choice>span:nth-child(2){flex:1;min-width:0;display:grid;gap:4px}
.bus-game-choice strong{font-weight:850;overflow-wrap:anywhere}
.bus-game-choice small,.bus-game-note{font-size:12px;color:var(--muted,#777)}
.bus-game-choice>b{font-size:21px}
.bus-game-note{margin-top:12px!important;line-height:1.4}
.bus-game-line{display:inline-grid;place-items:center;flex:0 0 auto;min-width:35px;padding:3px 8px;border-radius:8px;font-weight:900;font-size:18px;line-height:1.3}
.bus-game-pin{position:sticky;top:-12px;z-index:3;margin:-2px -2px 10px;padding:10px 8px;background:var(--surface,#fff);border-bottom:2px solid var(--surface2,#eee)}
.bus-game-pin>div:first-child{display:flex;align-items:center;gap:8px}
.bus-game-pin strong{flex:1;min-width:0;font-size:16px;font-weight:850;overflow-wrap:anywhere}
.bus-game-pin-time{display:flex;align-items:baseline;gap:12px;margin-top:7px}
.bus-game-pin-time>b{font-size:30px;font-weight:900;line-height:1.1}
.bus-game-pin small{display:block;margin-top:4px;color:var(--muted,#777);font-size:12px}
#busGameDepartureStatus{margin:6px 0 0;font-size:13px;font-weight:800;color:var(--text,#111)}
#busGameDepartureStatus:empty{display:none}
.bus-game-scoreboard{display:flex;align-items:center;gap:14px;font-size:14px}
.bus-game-scoreboard>strong{flex:1;font-size:18px}
.bus-game-scoreboard button,.bus-game-change,.bus-game-bottom button{min-height:38px;padding:7px 12px;border:0;border-radius:12px;background:#111;color:#fff;font:800 13px var(--font-app,Outfit,sans-serif);cursor:pointer}
.bus-game-instruction{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:10px 0;font-weight:850}
.bus-game-instruction>span:last-child{font-weight:500;font-size:12px;color:var(--muted,#777)}
.bus-game-map{position:relative;overflow:hidden;isolation:isolate;border-radius:22px;background:#e9e7dd}
.bus-game-map{flex:1;min-height:220px}
.bus-game-map>svg{position:absolute;inset:0;display:block;width:100%;height:100%;font-family:var(--font-app,Outfit,sans-serif)}
.bus-game-vehicle.map-vehicle-marker{top:27px!important;left:17px!important;will-change:auto}
.bus-game-map foreignObject{overflow:visible}
.bus-game-pin,.bus-game-scoreboard,.bus-game-instruction,.bus-game-feedback,.bus-game-bottom{flex-shrink:0}
.bus-game-map-label{position:absolute;left:9px;top:8px;z-index:1;border-radius:8px;background:#fffdf4e8;color:#333;padding:4px 7px;font-size:10px;font-weight:750;pointer-events:none}
[data-game-bus]{cursor:pointer;outline:none}
[data-game-bus]:focus-visible .map-vehicle-disc{outline:3px solid #e94986;outline-offset:3px}
.bus-game-pause-cover{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:#111b;color:#fff;font-size:22px;font-weight:900;pointer-events:none}
.bus-game-pause-cover[hidden]{display:none}
.bus-game-feedback{min-height:20px;margin:8px 0;font-size:14px;font-weight:800}
.bus-game-bottom{display:flex;justify-content:space-between;gap:8px}
.bus-game button:focus-visible{outline:3px solid #e94986;outline-offset:2px}
html[data-theme="dark"] .bus-game-pin{background:var(--surface,#242424);color:#fff}
html[data-theme="dark"] .bus-game-choice{background:var(--surface2,#333);color:#fff}
html[data-theme="dark"] .bus-game-scoreboard button,html[data-theme="dark"] .bus-game-change,html[data-theme="dark"] .bus-game-bottom button{background:#fff;color:#111}
.bus-game-vehicle .map-vehicle-disc svg{width:20px;height:20px}
html body #infoModal.bus-game-modal .info-modal-header{padding:10px 16px!important;padding-top:max(10px,env(safe-area-inset-top))!important}
.bus-game-modal .info-modal-header h2{font-size:20px}
.bus-game-pin{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px;padding:6px 2px;margin-bottom:7px;position:static}
.bus-game-pin strong{font-size:14px}
.bus-game-pin>div:first-child{gap:6px}
.bus-game-pin-time{flex-direction:column;align-items:flex-end;gap:1px;margin:0}
.bus-game-pin-time>b{font-size:25px}
.bus-game-pin-time>span{font-size:11px}
.bus-game-pin>small,.bus-game-pin>p{grid-column:1/-1}
.bus-game-change{font-size:11px;padding:5px 8px;min-height:32px}
.bus-game-scoreboard button,.bus-game-bottom button{min-height:32px}
.bus-game-instruction{margin:7px 0}
.bus-game-feedback{margin:6px 0;font-size:13px}
html[data-theme="dark"] .bus-game-map{--bus-map-ground:var(--surface,#242424);--bus-map-block:var(--surface2,#333);--bus-map-road:#454545;--bus-map-park:#293b30;--bus-map-water:#274c62;--bus-map-stop:#fff}
html[data-theme="dark"] .bus-game-map-label{background:#242424e8;color:#fff}
/* The original app map is temporarily hosted here, never duplicated. */
html body #infoModal.bus-game-modal #infoModalBody{padding:0!important;background:var(--page,#0a090b)}
.bus-game-real-map{gap:8px;padding:0 8px 8px;box-sizing:border-box}
.bus-game-real-map>.bus-game-map{min-height:220px;border-radius:22px;background:var(--surface2,#eee)}
html body .bus-game-map>.home-map{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;transform:none!important;border-radius:0!important;z-index:0!important}
html body .bus-game-map #homeMap{position:absolute!important;inset:0!important;width:100%!important;height:100%!important}
.bus-game-map>#busGameBoard{z-index:2;pointer-events:none;background:transparent}
.bus-game-map #busGameVehicles>[data-game-bus]{pointer-events:all}
.bus-game-map .map-vehicle-marker:not(.bus-game-vehicle),.bus-game-map .community-marker,.bus-game-map .home-map-overlay,.bus-game-map .home-location-btn,.bus-game-map .map-controls-btn,.bus-game-map .community-map-controls,.bus-game-map .map-status-row,.bus-game-map .maplibregl-ctrl-group{display:none!important}
.bus-game-map .map-stop-marker,.bus-game-map .map-rental-marker{pointer-events:none!important}
.bus-game-map-label{z-index:3}
.bus-game-pause-cover{z-index:4;font-size:16px;text-align:center;padding:18px}
.bus-game-dock{flex:0 0 auto;background:var(--surface,#fff);color:var(--text,#111);border-radius:22px;padding:10px 12px;max-height:45%;overflow:auto}
.bus-game-dock .bus-game-scoreboard{gap:9px}
.bus-game-dock .bus-game-scoreboard>span{font-size:12px}
.bus-game-dock .bus-game-pin{margin:0 0 7px}

/* A locked game state in the existing application workspace, without a dialog. */
html body #busGameInterface{position:absolute;inset:0;z-index:30;display:flex;flex-direction:column;gap:8px;padding:10px;box-sizing:border-box;background:var(--bemove-base,#0a090b);color:var(--text,#111);overflow:hidden}
.bus-game-header{display:flex;align-items:center;gap:7px;flex:0 0 48px;min-height:48px}
.bus-game-header .header-favorite-btn{flex:0 0 36px;min-width:36px;width:36px}
.bus-game-header-icon{display:grid;place-items:center;width:46px;height:46px;flex:0 0 46px;border-radius:50%;background:#fff;color:#111;font-size:29px}
.bus-game-header h1{margin:0;background:#e94986;color:#111;font:900 clamp(20px,4vw,27px)/1.1 Outfit,sans-serif;padding:10px 18px 10px 24px;border-radius:14px;clip-path:polygon(16px 0,100% 0,100% 100%,16px 100%,0 50%);width:max-content}
#busGameBody{flex:1;min-height:0;overflow:hidden}
#busGameBody>.bus-game{height:100%;min-height:0;display:grid;grid-template-rows:minmax(0,2fr) minmax(0,1fr);padding:0;gap:8px}
#busGameBody .bus-game-map{min-height:0;height:100%;width:100%}
#busGameBody .bus-game-dock{min-height:0;max-height:none;height:100%;box-sizing:border-box;overflow:auto;border-radius:22px;background:var(--surface,#fff);padding:10px 12px}
#busGameBody>.bus-game-picker{height:100%;overflow:auto;box-sizing:border-box;background:var(--surface,#fff);border-radius:22px;padding:16px}
body.bus-game-open #modularResizeHandle,body.bus-game-open #sheetDragHandle{display:none!important;pointer-events:none!important}
.bus-game-map .maplibregl-marker:not(:has(.bus-game-vehicle)),.bus-game-map .maplibregl-control-container,.bus-game-map .trip-map-actions,.bus-game-map .planner-map-actions,.bus-game-map .map-controls-panel,.bus-game-map .map-controls-backdrop{visibility:hidden!important;pointer-events:none!important}
.bus-game-map .maplibregl-ctrl-attrib{visibility:visible!important;pointer-events:auto!important}
#busGameInterface .bus-game-map-label{display:none}
#busGameInterface .bus-game-pin{padding:0 0 5px;margin:0 0 5px}
#busGameInterface .bus-game-pin small{font-size:11px}
#busGameInterface .bus-game-instruction{margin:5px 0}
#busGameInterface .bus-game-feedback{min-height:0;margin:4px 0}
#busGameInterface .bus-game-bottom button{min-height:32px}

html body #busGameInterface{z-index:1000}
body.bus-game-open #homePanel{visibility:hidden!important;pointer-events:none!important}
body.bus-game-open #homeView>.home-map{visibility:hidden!important;pointer-events:none!important}

body.bus-game-open #homeMapStatus,body.bus-game-open #mapStatusRow,body.bus-game-open .maplibregl-marker{visibility:hidden!important;pointer-events:none!important}

#busGameBody>.bus-game{grid-template-rows:minmax(0,2fr) auto minmax(0,1fr)}
#busGameInterface .bus-game-controls{display:flex;gap:8px;margin:0;align-items:center;justify-content:stretch}
#busGameInterface .bus-game-controls button{flex:1;min-height:38px;font-size:14px}
body.bus-game-open #homeMapStatus,body.bus-game-open #mapStatusRow,body.bus-game-open .home-map-status{display:none!important}
.bus-game-art{transform-box:fill-box;transform-origin:center;pointer-events:auto}
.bus-game-art.arriving{animation:busGameArrive .22s ease-out both}
.bus-game-art.leaving{animation:busGameLeave .25s ease-in both;pointer-events:none}
.bus-game-art.caught{animation:busGameCaught .32s ease-out both;pointer-events:none}
.bus-game-art.missed{animation:busGameMissed .28s ease-out both;pointer-events:none}
.bus-game-points{text-anchor:middle;font:bold 22px Outfit,sans-serif;paint-order:stroke;stroke:var(--surface,#fff);stroke-width:3px;fill:#148448;pointer-events:none;animation:busGamePoints .32s ease-out both}
.bus-game-points.missed{fill:#e52844}
@keyframes busGameArrive{from{opacity:0;transform:scale(.35)}to{opacity:1;transform:scale(1)}}
@keyframes busGameLeave{to{opacity:0;transform:scale(.6)}}
@keyframes busGameCaught{35%{transform:scale(1.3)}to{transform:scale(.25);opacity:0}}
@keyframes busGameMissed{30%{transform:translateX(-5px)}65%{transform:translateX(5px)}to{opacity:0;transform:scale(.6)}}
@keyframes busGamePoints{to{opacity:0;transform:translateY(-27px)}}
@media(prefers-reduced-motion:reduce){.bus-game-art,.bus-game-points{animation:none!important}}

/* Anchor the centre of each disc exactly on its mapped street. */
.bus-game-vehicle.map-vehicle-marker{top:15px!important;left:17px!important;width:46px!important;height:66px!important}
.bus-game-vehicle .map-vehicle-disc{width:34px!important;height:34px!important;margin-bottom:4px!important}
.bus-game-vehicle .map-vehicle-labels{display:flex!important}

#busGameInterface .bus-game-scoreboard>strong{display:flex;align-items:baseline;gap:10px;font-size:18px}
#busGameScore{font-size:40px;font-weight:950;line-height:1}
.bus-game-survival{margin:7px 0 10px}
.bus-game-survival>div:first-child{display:flex;align-items:baseline;gap:9px;margin-bottom:5px}
#busGameTime{font-size:24px;line-height:1;font-weight:900;font-variant-numeric:tabular-nums}
.bus-game-survival span{font-size:12px;color:var(--muted,#777)}
.bus-game-gauge{height:12px;overflow:hidden;border-radius:9px;background:var(--surface2,#ddd)}
#busGameGauge{display:block;width:100%;height:100%;border-radius:inherit;background:#e94986;transform-origin:left;transition:transform .1s linear}
.bus-game-gauge.urgent #busGameGauge{background:#ee384a}
@media(prefers-reduced-motion:reduce){#busGameGauge{transition:none}}

.bus-game-selection-hint{display:flex;flex-wrap:wrap;align-items:center;gap:8px;background:#e94986;color:#111;border-radius:16px;padding:10px 12px;margin:6px 8px;font-size:14px}
.bus-game-selection-hint strong{font-weight:900}.bus-game-selection-hint span{flex:1}
.bus-game-selection-hint button{background:#111;color:#fff;border:0;border-radius:10px;min-height:36px;padding:6px 12px;font:800 13px Outfit,sans-serif}
body.bus-game-selecting #depsContainer .bus-game-unavailable{opacity:.35;filter:grayscale(1);cursor:not-allowed!important}
body.bus-game-selecting #depsContainer .dep-card:focus-visible{outline:3px solid #e94986;outline-offset:-3px}

.bus-game-header h1{min-width:0;font-size:clamp(16px,4.2vw,27px);max-width:calc(100% - 100px);box-sizing:border-box}
.bus-game-vehicle .map-vehicle-disc .material-icons-outlined{font-size:20px;line-height:1}

#busGameDepartureStatus.is-arriving{background:#ffe000;color:#111;border-radius:10px;padding:7px 10px;font-weight:900}
