:root {
  color-scheme: dark;
  --bg: #071321;
  --bg-soft: #0b1d31;
  --panel: #102844;
  --panel-2: #153452;
  --line: #2d5d85;
  --text: #f5fbff;
  --muted: #a7c8e6;
  --accent: #5cc8ff;
  --accent-2: #7a6cff;
  --good: #4dd596;
  --bad: #ff6d7e;
  --gold: #ffd34d;
  --gold-dark: #9b6600;
  --platinum: #d8f4ff;
  --platinum-dark: #5d8ca5;
  --shadow: 0 18px 50px rgba(0,0,0,.28);
  --radius: 20px;
  --animation-multiplier: 1;
  font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at 50% -20%, #173a62 0, var(--bg) 38rem); color: var(--text); }
body { min-height: 100vh; overflow-x: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #8ad8ff; outline-offset: 3px; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; padding-bottom: 74px; }
.topbar { position: sticky; top: 0; z-index: 50; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; background: rgba(5,18,33,.92); border-bottom: 1px solid rgba(90,171,232,.28); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: .01em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(145deg, #65d4ff, #6f5cff); box-shadow: inset 0 1px rgba(255,255,255,.55), 0 8px 18px rgba(58,137,255,.25); }
.icon-button, .pause-button { width: 40px; height: 40px; border: 1px solid #2b567c; border-radius: 13px; background: #102743; cursor: pointer; }
.wallet { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.wallet > span { display: inline-flex; align-items: center; gap: 5px; min-height: 38px; padding: 0 12px; border: 1px solid #2b567c; border-radius: 999px; background: #102743; }
.wallet-star i { font-style: normal; }
.wallet-star-gold i { color: var(--gold); text-shadow: 0 0 8px rgba(255,211,77,.45); }
.wallet-star-platinum i { color: var(--platinum); text-shadow: 0 0 8px rgba(216,244,255,.45); }

.screen { width: min(1440px, 100%); margin: 0 auto; padding: 18px clamp(12px, 2vw, 28px) 36px; }
.bottom-nav { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; min-height: 70px; padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(5,17,31,.96); border-top: 1px solid rgba(90,171,232,.25); backdrop-filter: blur(18px); }
.bottom-nav button { border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 2px; cursor: pointer; font-size: 18px; }
.bottom-nav button span { font-size: 11px; }
.bottom-nav button.active { color: #fff; background: linear-gradient(to top, rgba(67,159,222,.15), transparent); }

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.65rem, 3vw, 2.8rem); line-height: 1.02; margin-bottom: .45rem; }
h2 { margin-bottom: .5rem; }
p { color: var(--muted); line-height: 1.55; }
.eyebrow { display: block; font-size: .69rem; font-weight: 950; letter-spacing: .14em; color: #79d7ff; margin-bottom: 7px; }
.section-title { display: flex; align-items: end; justify-content: space-between; margin: 12px 0 16px; }
.section-title p { margin: 0; }
.breadcrumb { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; color: var(--muted); }

.primary, .secondary, .ghost, .danger, .file-button { min-height: 44px; border-radius: 13px; padding: 0 17px; border: 1px solid transparent; cursor: pointer; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.primary { background: linear-gradient(145deg, #52c9ff, #675cff); color: white; box-shadow: 0 10px 24px rgba(63,132,255,.28); }
.secondary, .file-button { background: #153452; border-color: #3673a3; }
.ghost { background: transparent; border-color: #2d5d85; }
.danger { background: #4a1724; border-color: #9c354e; color: #ffd8df; }
button:disabled { opacity: .45; cursor: not-allowed; }

.install-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #3b2a0b; border: 1px solid #936a16; margin-bottom: 14px; }
.install-banner span { color: #f5dfad; }
.install-banner a { margin-left: auto; color: #fff; font-weight: 800; }

.hero { min-height: 310px; overflow: hidden; position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px; align-items: center; padding: clamp(24px, 4vw, 54px); border: 1px solid #3476a6; border-radius: 28px; background: linear-gradient(135deg, rgba(23,68,108,.96), rgba(12,32,58,.98)); box-shadow: var(--shadow); }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, rgba(103,115,255,.28), transparent 34%), linear-gradient(120deg, transparent 40%, rgba(73,198,255,.08)); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; }
.hero-copy p { max-width: 640px; font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-terminal { position: relative; height: 220px; border-radius: 24px; background: #234e42; border: 8px solid #5b9f78; box-shadow: inset 0 0 0 2px #1c453a, 0 20px 30px rgba(0,0,0,.25); transform: perspective(800px) rotateY(-6deg) rotateX(4deg); overflow: hidden; }
.mini-road { position: absolute; left: 10%; right: 10%; top: 48%; height: 12px; background: #d7c95a; box-shadow: 0 -50px 0 rgba(223,236,255,.08), 0 50px 0 rgba(223,236,255,.08); }
.mini-vehicle { position: absolute; border-radius: 18px 26px 26px 18px; box-shadow: inset 0 6px rgba(255,255,255,.24), 0 8px 18px rgba(0,0,0,.35); }
.mini-vehicle.car { width: 95px; height: 46px; background: #31c7d5; left: 16%; top: 25%; }
.mini-vehicle.bus { width: 155px; height: 52px; background: #f04464; right: 8%; bottom: 20%; }
.mini-crowd { position: absolute; left: 14px; right: 14px; bottom: 8px; display: flex; gap: 3px; align-items: end; }
.mini-crowd i { width: 8px; height: 19px; border-radius: 50% 50% 4px 4px; background: hsl(calc(var(--i) * 47deg), 76%, 62%); box-shadow: 0 -6px 0 -1px currentColor; }

.mode-grid, .stats-grid, .world-grid, .level-grid, .garage-grid, .profile-grid { display: grid; gap: 14px; }
.mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mode-card, .world-card, .level-card, .garage-card { text-align: left; position: relative; border: 1px solid #2c5d85; border-radius: 18px; background: linear-gradient(145deg, #112b48, #0c2139); padding: 18px; box-shadow: 0 10px 24px rgba(0,0,0,.15); cursor: pointer; }
.mode-card:hover, .world-card:hover, .level-card:hover, .garage-card:hover { border-color: #69caff; transform: translateY(-2px); }
.mode-card .tag { position: absolute; right: 12px; top: 12px; padding: 4px 8px; border-radius: 999px; font-size: .7rem; background: #1d466a; color: #bce8ff; }
.mode-icon { font-size: 2rem; display: block; margin-bottom: 12px; }
.mode-card p, .world-card p, .garage-card p { margin-bottom: 0; }
.stats-grid { grid-template-columns: repeat(4, 1fr); }
.stat-card { min-height: 105px; display: grid; align-content: center; padding: 18px; background: #102844; border: 1px solid #2d5d85; border-radius: 18px; }
.stat-card b { font-size: 1.6rem; }
.stat-card span { color: var(--muted); }
.stat-card.gold b { color: var(--gold); }
.stat-card.platinum b { color: var(--platinum); }

.world-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.world-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.world-icon { font-size: 2.2rem; }
.world-copy h3 { margin-bottom: 4px; }
.world-copy p { margin-bottom: 4px; }
.world-stars { display: grid; gap: 5px; text-align: right; }
.world-stars .gold { color: var(--gold); }
.world-stars .platinum { color: var(--platinum); }
.world-card.locked, .level-card.locked { filter: grayscale(1); opacity: .5; }
.level-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.level-card { min-height: 118px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.level-number { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #1b466c; font-weight: 900; }
.level-card small { grid-column: 1 / -1; color: var(--muted); }
.compact-star-stack { display: inline-grid; gap: 1px; }
.compact-stars { white-space: nowrap; line-height: 1; }
.compact-stars i { font-style: normal; color: #35506a; font-size: .82rem; }
.compact-stars.gold i.earned { color: var(--gold); }
.compact-stars.platinum i.earned { color: var(--platinum); }

/* Game */
.game-header { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 0 0 13px; }
.game-header h1 { font-size: clamp(1.25rem, 2.2vw, 1.8rem); margin-bottom: 2px; }
.game-header p { margin: 0; font-size: .82rem; }
.game-metrics { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.game-metrics > span { min-height: 38px; padding: 0 11px; display: inline-flex; align-items: center; gap: 5px; border-radius: 11px; background: #0c2139; border: 1px solid #2b567c; font-size: .8rem; }
.game-metrics i { width: 9px; height: 9px; border-radius: 50%; background: var(--swatch); }
.game-layout { display: grid; grid-template-columns: minmax(480px, 1.45fr) minmax(380px, .75fr); gap: 14px; align-items: start; }
.board-column { min-width: 0; }
.traffic-board { width: 100%; max-height: calc(100vh - 175px); min-height: 540px; position: relative; overflow: hidden; border: 12px solid #5b9c74; border-radius: 26px; background: radial-gradient(circle at 45% 20%, #397b60 0, #265c48 75%); box-shadow: inset 0 0 0 3px #173e31, inset 0 0 45px rgba(0,0,0,.23), var(--shadow); }
.board-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px); background-size: calc(100% / var(--board-columns)) calc(100% / var(--board-rows)); }
.exit-marker { position: absolute; z-index: 3; padding: 4px 9px; border-radius: 999px; background: #074a31; border: 1px solid #5fba8f; color: #e8fff3; font-size: .68rem; box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.exit-N { top: 4px; left: 50%; transform: translateX(-50%); }
.exit-S { bottom: 4px; left: 50%; transform: translateX(-50%); }
.exit-W { left: 4px; top: 50%; transform: translateY(-50%); }
.exit-E { right: 4px; top: 50%; transform: translateY(-50%); }
.board-vehicle { position: absolute; z-index: 5; border: 0; padding: 0; background: transparent; cursor: pointer; transition: filter .2s, transform .2s; }
.board-vehicle:hover { z-index: 8; filter: brightness(1.14) drop-shadow(0 10px 10px rgba(0,0,0,.28)); }
.board-vehicle.hinted { z-index: 12; animation: hintPulse 1s ease-in-out infinite; }
.board-vehicle.frozen::after, .board-vehicle.locked::after { position: absolute; inset: 12%; display: grid; place-items: center; border-radius: 14px; font-size: clamp(15px, 2.5vw, 28px); background: rgba(5,25,45,.72); border: 2px solid rgba(190,235,255,.8); }
.board-vehicle.frozen::after { content: "❄"; }
.board-vehicle.locked::after { content: "🔒"; }
.vehicle-graphic { position: absolute; left: 50%; top: 50%; transform-origin: center; filter: drop-shadow(0 8px 6px rgba(0,0,0,.38)); }
.vehicle-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.vehicle-body-fill { stroke: rgba(255,255,255,.72); stroke-width: 1.5; }
.vehicle-art { filter: drop-shadow(0 2px 0 rgba(255,255,255,.18)); }
.vehicle-wheel { fill: #07111c; }
.vehicle-glass { fill: #9fd4e9; stroke: rgba(231,252,255,.9); stroke-width: 1; }
.vehicle-glass.coach { fill: #4d738e; }
.vehicle-detail { fill: none; stroke: rgba(7,28,45,.58); stroke-width: 2; }
.vehicle-bed { fill: rgba(38,49,61,.65); stroke: rgba(255,255,255,.25); stroke-width: 1.2; }
.vehicle-cargo { fill: var(--vehicle-color); stroke: rgba(255,255,255,.55); stroke-width: 1.5; }
.vehicle-window-row { fill: #5b829c; stroke: rgba(224,248,255,.7); stroke-width: 1; }
.vehicle-door { fill: rgba(32,53,70,.58); stroke: rgba(255,255,255,.6); stroke-width: 1; }
.vehicle-destination { fill: #172838; }
.vehicle-upper { fill: rgba(255,255,255,.12); stroke: rgba(255,255,255,.4); }
.vehicle-luggage { fill: rgba(39,54,69,.5); stroke: rgba(255,255,255,.3); }
.vehicle-arrow circle { fill: #071827; stroke: #cceeff; stroke-width: 1.3; filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
.vehicle-arrow path { fill: none; stroke: white; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.capacity-badge { position: absolute; z-index: 8; right: 2px; bottom: 1px; min-width: 24px; height: 17px; padding: 0 4px; border-radius: 8px; display: grid; place-items: center; background: #06111e; border: 1px solid #b8d9ef; font-size: .58rem; font-weight: 900; box-shadow: 0 2px 4px rgba(0,0,0,.45); }
.vehicle-name { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 2px; white-space: nowrap; font-size: .52rem; background: rgba(3,13,23,.8); padding: 2px 4px; border-radius: 5px; }
.board-instruction { margin: 10px 0 6px; text-align: center; color: #d5ebff; font-weight: 800; }
.deadlock-banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #4b1a24; border: 1px solid #b7465e; border-radius: 14px; margin-top: 8px; }
.deadlock-banner span { color: #ffd5dc; }
.operations-column { display: grid; gap: 12px; }
.panel { background: linear-gradient(145deg, rgba(17,43,72,.98), rgba(10,30,52,.98)); border: 1px solid #2f628c; border-radius: 19px; padding: 14px; box-shadow: 0 12px 25px rgba(0,0,0,.14); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-heading h2 { font-size: 1.1rem; margin: 0; }
.panel-heading .eyebrow { margin-bottom: 3px; }
.panel-heading > strong { color: #dff5ff; }
.panel-note { margin: 9px 0 0; font-size: .75rem; }
.panel-note.warning { color: #ffd7a2; }
.bay-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.waiting-bay { min-height: 80px; border-radius: 14px; border: 2px dashed #4779a1; background: rgba(4,19,34,.42); }
.waiting-bay.empty { display: grid; place-items: center; align-content: center; color: #c8eaff; }
.waiting-bay.empty small { color: #799bb8; }
.waiting-bay.occupied { display: grid; grid-template-columns: minmax(65px,.8fr) 1fr; align-items: center; gap: 7px; border-style: solid; border-color: color-mix(in srgb, var(--bay-color), white 22%); padding: 6px; cursor: pointer; text-align: left; }
.waiting-bay.priority { box-shadow: 0 0 0 3px #fff, 0 0 18px var(--bay-color); }
.bay-vehicle { min-width: 0; }
.bay-vehicle .vehicle-svg { width: 100%; height: 52px; }
.bay-copy { display: grid; gap: 1px; min-width: 0; }
.bay-copy b { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bay-copy small { color: var(--muted); font-size: .64rem; }
.bay-copy strong { font-size: .75rem; }
.bay-progress { height: 6px; border-radius: 6px; background: #071827; overflow: hidden; }
.bay-progress i { display: block; height: 100%; background: var(--bay-color); border-radius: inherit; }
.tool-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.tool-button { min-height: 69px; border-radius: 12px; border: 1px solid #386d98; background: #173858; display: grid; place-items: center; align-content: center; gap: 2px; cursor: pointer; padding: 5px 2px; }
.tool-button.active { border-color: #fff; box-shadow: 0 0 0 2px #57cfff; }
.tool-button > span { font-size: 1.1rem; }
.tool-button b { font-size: .65rem; }
.tool-button small { font-size: .53rem; color: #b8d4ea; }

.active-platform { min-height: 128px; position: relative; padding: 13px 10px 22px; border-radius: 16px; overflow: hidden; background: linear-gradient(#497a83 0 7px, #d1dbe0 7px 14px, #7d8990 14px 18px, #273c4d 18px 100%); box-shadow: inset 0 0 25px rgba(0,0,0,.4); }
.active-platform::before { content: ""; position: absolute; inset: 22px 0 0; background-image: linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px); background-size: 32px 32px; }
.curb-line { position: absolute; left: 0; right: 0; bottom: 6px; height: 7px; background: repeating-linear-gradient(90deg, #e5cf4d 0 24px, #273542 24px 48px); }
.active-crowd { position: relative; z-index: 2; min-height: 82px; display: flex; flex-wrap: wrap; gap: 7px 5px; align-content: end; justify-content: flex-start; }
.passenger { position: relative; display: inline-block; width: 25px; height: 47px; flex: 0 0 25px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); animation: passengerIdle calc(1.8s * var(--animation-multiplier)) ease-in-out infinite alternate; }
.passenger:nth-child(3n) { animation-delay: -.6s; }
.passenger-head { position: absolute; left: 6px; top: 0; width: 13px; height: 13px; border-radius: 50%; background: #ffe0bd; border: 1px solid #8d613a; }
.passenger-body { position: absolute; left: 3px; top: 11px; width: 19px; height: 27px; border-radius: 9px 9px 5px 5px; background: linear-gradient(var(--passenger-color), var(--passenger-dark)); border: 1px solid rgba(255,255,255,.55); }
.passenger-body::before, .passenger-body::after { content: ""; position: absolute; top: 5px; width: 5px; height: 20px; border-radius: 5px; background: var(--passenger-color); }
.passenger-body::before { left: -5px; transform: rotate(7deg); }
.passenger-body::after { right: -5px; transform: rotate(-7deg); }
.passenger-symbol { position: absolute; left: 0; right: 0; top: 17px; text-align: center; font-size: 9px; color: white; text-shadow: 0 1px 2px #000; }
.passenger::before, .passenger::after { content: ""; position: absolute; top: 36px; width: 6px; height: 11px; background: #142232; border-radius: 0 0 5px 5px; }
.passenger::before { left: 5px; }.passenger::after { right: 5px; }
.passenger.vip::after { box-shadow: 0 -35px 0 -1px #ffd24a; }
.passenger.tiny { transform: scale(.62); transform-origin: bottom; margin-right: -8px; margin-top: -17px; }
.queue-empty { color: #9bb1c3; align-self: center; }
.reserve-heading { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 6px; }
.reserve-heading span { display: grid; }
.reserve-heading small { color: var(--muted); font-size: .67rem; }
.reserve-queue { min-height: 88px; display: grid; grid-template-columns: 44px 1fr; align-items: stretch; border-radius: 14px; overflow: hidden; background: #091c30; border: 1px solid #2c577a; }
.reserve-gate { writing-mode: vertical-rl; transform: rotate(180deg); display: grid; place-items: center; letter-spacing: .18em; font-size: .58rem; font-weight: 900; color: #f6d36b; background: repeating-linear-gradient(45deg, #273546 0 8px, #d49b21 8px 16px); text-shadow: 0 1px 2px #000; }
.reserve-crowd { display: flex; flex-wrap: wrap; align-content: end; gap: 0; padding: 9px 8px 3px; background: linear-gradient(to top, rgba(56,86,107,.4), transparent); overflow: hidden; }
.reserve-more { align-self: center; margin-left: 8px; padding: 4px 7px; border-radius: 999px; background: #234765; font-size: .68rem; }

.star-panel { padding-bottom: 16px; }
.star-group + .star-group { margin-top: 13px; padding-top: 12px; border-top: 1px solid #285371; }
.star-group-title { display: flex; justify-content: space-between; align-items: center; font-size: .7rem; letter-spacing: .08em; margin-bottom: 7px; }
.star-group.gold .star-group-title { color: var(--gold); }
.star-group.platinum .star-group-title { color: var(--platinum); }
.star-criterion { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px; padding: 6px 7px; border-radius: 10px; }
.star-criterion + .star-criterion { margin-top: 4px; }
.star-criterion.kept { background: rgba(255,255,255,.035); }
.star-criterion.lost { background: rgba(94,33,46,.38); opacity: .7; }
.star-criterion span:nth-child(2) { display: grid; }
.star-criterion b { font-size: .73rem; }
.star-criterion small { color: var(--muted); font-size: .63rem; }
.star-criterion em { font-style: normal; font-size: .66rem; color: #d9f2ff; }
.live-star { display: grid; place-items: center; width: 34px; height: 28px; border-radius: 9px; font-size: 1.35rem; font-style: normal; text-shadow: 0 2px 3px rgba(0,0,0,.6); }
.live-star.gold.kept { color: #ffe66d; background: linear-gradient(145deg, #7d5200, #c58b0a); border: 1px solid #ffd857; box-shadow: inset 0 1px rgba(255,255,255,.35), 0 0 12px rgba(255,210,52,.2); }
.live-star.platinum.kept { color: #f0fcff; background: linear-gradient(145deg, #466f85, #83b8cc); border: 1px solid #d8f6ff; box-shadow: inset 0 1px rgba(255,255,255,.55), 0 0 12px rgba(183,236,255,.2); }
.live-star.lost { color: #46596a; background: #10202f; border: 1px solid #344f64; text-decoration: line-through; filter: grayscale(1); }
.level-actions { display: flex; gap: 8px; margin-top: 13px; }
.level-actions button { flex: 1; min-height: 38px; font-size: .72rem; }

/* Modal, boarding and utility */
.modal-root { position: fixed; z-index: 100; inset: 0; }
.modal-backdrop { min-height: 100%; display: grid; place-items: center; padding: 20px; background: rgba(1,7,14,.76); backdrop-filter: blur(8px); }
.modal-card { width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 26px; border-radius: 24px; background: linear-gradient(145deg, #163a60, #0a1f35); border: 1px solid #4f94c5; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.win-stars { display: grid; gap: 8px; margin: 18px 0; }
.win-stars > div { display: grid; grid-template-columns: 85px 1fr auto; align-items: center; gap: 8px; padding: 9px; border-radius: 13px; background: rgba(255,255,255,.04); }
.win-stars span { display: flex; gap: 6px; }
.result-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.result-grid > div { padding: 9px; border-radius: 11px; background: #0b223b; }
.result-grid dt { color: var(--muted); font-size: .65rem; }
.result-grid dd { margin: 3px 0 0; font-weight: 900; }
.perfect-run { color: #ffe783; font-weight: 900; text-align: center; }
.toast-root { position: fixed; z-index: 120; right: 14px; top: 78px; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 360px; padding: 11px 14px; border-radius: 12px; background: #173a5e; border: 1px solid #5599ca; box-shadow: var(--shadow); }
.toast.bad { background: #4a1925; border-color: #c64e67; }
.toast.good { background: #123f30; border-color: #48b384; }
.toast.star-loss { background: #3e2e10; border-color: #d49d2f; color: #ffecb1; }
.boarding-sprite { position: fixed; z-index: 110; width: 28px; height: 48px; pointer-events: none; }
.boarding-sprite > .passenger { transform: none; }

.garage-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.garage-card.selected { border-color: #70d6ff; box-shadow: 0 0 0 2px #70d6ff; }
.garage-preview { height: 120px; display: grid; place-items: center; border-radius: 15px; background: #234a3e; margin-bottom: 12px; }
.garage-preview .vehicle-svg { width: 85%; height: 90px; }
.garage-preview.midnight { filter: saturate(.7) brightness(.72) hue-rotate(18deg); }
.garage-preview.candy { filter: saturate(1.6) brightness(1.12); }
.garage-preview.heritage { filter: sepia(.35) saturate(.8); }
.profile-grid { grid-template-columns: 1fr 1fr; }
.profile-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.profile-stats > div { padding: 12px; background: #0b223a; border-radius: 12px; }
.profile-stats dt { color: var(--muted); font-size: .72rem; }
.profile-stats dd { margin: 4px 0 0; font-size: 1.3rem; font-weight: 900; }
.profile-stats dd.gold { color: var(--gold); }.profile-stats dd.platinum { color: var(--platinum); }
.panel label { display: grid; gap: 6px; color: var(--muted); }
.panel input, .panel select { width: 100%; min-height: 42px; border-radius: 10px; border: 1px solid #3f7299; background: #081d31; color: #fff; padding: 0 11px; }
.button-stack { display: grid; gap: 8px; margin-top: 12px; }
.file-button input { display: none; }
.settings-panel { max-width: 760px; }
.setting-row { grid-template-columns: 1fr auto !important; align-items: center; padding: 12px; border-bottom: 1px solid #285474; }
.setting-row input[type="checkbox"] { width: 22px; min-height: 22px; }
.setting-row select { width: 150px; }
.score-table { display: grid; gap: 4px; }
.score-row { display: grid; grid-template-columns: 42px minmax(120px,1fr) minmax(110px,1fr) 95px 100px; gap: 8px; align-items: center; min-height: 45px; padding: 5px 9px; border-radius: 9px; background: #0b223a; }
.score-row.header { background: transparent; color: var(--muted); font-size: .72rem; }
.offline-note, .empty-state, .loading { padding: 18px; text-align: center; color: var(--muted); }

@keyframes passengerIdle { from { transform: translateY(0) rotate(-1deg); } to { transform: translateY(-3px) rotate(1deg); } }
@keyframes hintPulse { 0%,100% { filter: drop-shadow(0 0 0 #fff); } 50% { filter: drop-shadow(0 0 14px #fff) brightness(1.35); } }

.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
.high-contrast { --bg: #000; --panel: #071b2a; --line: #7fd8ff; --muted: #d6efff; }
.large-ui { font-size: 118%; }

@media (max-width: 1080px) {
  .game-layout { grid-template-columns: 1fr; }
  .operations-column { grid-template-columns: 1fr 1fr; }
  .traffic-board { max-height: none; min-height: 620px; }
  .mode-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .level-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .screen { padding: 10px 8px 30px; }
  .topbar { padding-left: 8px; padding-right: 8px; }
  .brand span:last-child { display: none; }
  .wallet > span { padding: 0 8px; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding: 24px 18px; }
  .hero-terminal { height: 170px; }
  .mode-grid, .stats-grid, .world-grid, .garage-grid, .profile-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .level-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .game-header { grid-template-columns: auto 1fr; }
  .game-metrics { grid-column: 1 / -1; justify-content: flex-start; }
  .game-metrics > span { flex: 1; justify-content: center; }
  .game-layout { gap: 8px; }
  .operations-column { grid-template-columns: 1fr; }
  .traffic-board { min-height: 560px; border-width: 8px; border-radius: 20px; }
  .tool-grid { grid-template-columns: repeat(5,1fr); }
  .tool-button b { font-size: .58rem; }
  .tool-button small { display: none; }
  .bay-grid { grid-template-columns: repeat(2,1fr); }
  .passenger { width: 22px; height: 43px; flex-basis: 22px; transform-origin: bottom; }
  .passenger-head { left: 5px; width: 12px; height: 12px; }
  .passenger-body { left: 3px; width: 16px; height: 25px; }
  .result-grid { grid-template-columns: repeat(2,1fr); }
  .score-row { grid-template-columns: 30px 1fr 75px 78px; }
  .score-row > :nth-child(3) { display: none; }
}

@media (max-width: 430px) {
  .wallet-star { display: none !important; }
  .level-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .traffic-board { min-height: 500px; }
  .game-header p { font-size: .68rem; }
  .game-metrics > span { font-size: .68rem; padding: 0 6px; }
  .pause-button { width: 36px; }
  .panel { padding: 11px; }
  .star-criterion { grid-template-columns: 33px 1fr; }
  .star-criterion em { grid-column: 2; }
  .active-crowd { gap: 5px 2px; }
  .modal-card { padding: 20px 16px; }
}

.shop-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.shop-card { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:14px; padding:15px; border-radius:17px; background:linear-gradient(145deg,#112b48,#0c2139); border:1px solid #2d5d85; }
.shop-card h3 { margin:0 0 3px; }
.shop-card p { margin:0 0 5px; font-size:.82rem; }
.shop-card small { color:var(--muted); }
.shop-icon { display:grid; place-items:center; width:50px; height:50px; border-radius:15px; background:#1c466b; font-size:1.5rem; }
.reward-panel,.premium-panel { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.reward-panel p,.premium-panel p { margin:0; }
@media(max-width:760px){.shop-grid{grid-template-columns:1fr}.shop-card{grid-template-columns:auto 1fr}.shop-card button{grid-column:1/-1}}
