/* Menus fill the portrait band's full height. Control sizes follow the 9:16
   artboard; extra height separates the fixed header and bottom navigation. */
#menu-backdrop {
  display: none; position: fixed; inset: 0; margin: auto; z-index: 94;
  width: var(--menu-area-width); height: var(--menu-area-height);
  pointer-events: none;
  background: #4779a3 url('screens/menu-background.webp') center / cover no-repeat;
}
#menu-backdrop.show { display: block; }
#menu-backdrop[data-scene="garage"] { background-image: url('screens/garage-background.webp'); background-position: center 55%; }
#menu-backdrop[data-scene="parking"] { background-image: url('screens/parking-background.webp'); }
#menu-backdrop[data-scene="game"] {
  background: rgba(3, 2, 10, .7);
  backdrop-filter: blur(.4em) saturate(120%);
  -webkit-backdrop-filter: blur(.4em) saturate(120%);
}
#menu-stage {
  display: none; position: fixed; inset: 0; margin: auto; z-index: 95;
  width: var(--menu-ui-width);
  height: var(--menu-area-height);
  --menu-design-height: calc(var(--menu-ui-width) * 16 / 9);
  --menu-bottom-inset: max(calc(var(--menu-design-height) * .0622), env(safe-area-inset-bottom));
  font-size: 16px; overflow: hidden; isolation: isolate;
  background: none;
}
#menu-stage.show { display: block; }
#menu-stage .screen-reader { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#menu-stage button:focus-visible, #menu-stage [role=button]:focus-visible { outline: 3px solid #fff57d; outline-offset: 2px; }
#menu-stage #title-screen, #menu-stage #garage-screen, #menu-stage #levelselect-screen {
  padding: 0; gap: 0; background: none; animation: none;
}
#menu-stage #title-screen::before, #menu-stage #title-screen::after,
#menu-stage #garage-screen::before, #menu-stage #garage-screen::after,
#menu-stage #levelselect-screen::before, #menu-stage #levelselect-screen::after { display: none; }
#menu-stage #title-screen > *, #menu-stage #garage-screen > *, #menu-stage #levelselect-screen > * { position: absolute; }
#menu-stage .title-headings { left: 10.99%; top: max(calc(var(--menu-design-height) * .0374), env(safe-area-inset-top)); width: 78.23%; aspect-ratio: 541 / 166; padding: 0; background: url('screens/logo.webp?v=2') center / contain no-repeat; }
#menu-stage .title-headings h1 { font-size: 0; }
#menu-stage .subtitle, #menu-stage #hero-container { display: none; }
#menu-stage .title-buttons { inset: 0; margin: 0; pointer-events: none; }
#menu-stage .title-buttons > * { pointer-events: auto; }
#menu-stage #play-btn {
  position: absolute; left: 15.91%; top: auto; bottom: calc(var(--menu-bottom-inset) + var(--menu-design-height) * .1229); width: 68.97%; height: calc(var(--menu-design-height) * .0935);
  padding: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none;
  background: url('screens/play.webp?v=2') center / contain no-repeat;
  backdrop-filter: none; color: transparent; text-shadow: none; font-size: .9em;
}
#menu-stage #play-btn::after { display: none; }
#menu-stage #main-sound-btn { display: none; }
/* These utilities are outside the supplied artboards, in the pause dialog. */
#pause-overlay #main-reset-btn { position: static; width: auto; height: auto; opacity: 1; font-size: .7em; }
#pause-overlay #infinite-btn { margin: 0; }
#reset-confirm-overlay.game-overlay { z-index: 350; }
#screen-nav { position: absolute; z-index: 250; left: 4.34%; top: auto; bottom: var(--menu-bottom-inset); width: 91.53%; height: calc(var(--menu-design-height) * .1041); }
/* Exact positions from the source artboard: crops start at x=30/232/434,
   their widths are 228/228/229, and the full navigation spans 633 points. */
#screen-nav > button { position: absolute; top: 0; display: block; min-width: 0; width: 36.018957%; height: 100%; border: none; padding: 0; margin: 0; border-radius: 0; background-position: center; background-size: 100% 100%; background-repeat: no-repeat; background-color: transparent; box-shadow: none; backdrop-filter: none; cursor: pointer; color: transparent; font-size: 1em; }
#screen-nav > button:active { transform: translateY(.15em); }
#screen-nav #levelselect-btn { left: 0; background-image: url('screens/nav-levels.webp?v=2'); }
#screen-nav #collection-btn { left: 31.911532%; background-image: url('screens/nav-garage.webp?v=2'); }
#screen-nav .cta-banner { left: 63.823065%; width: 36.176935%; background-image: url('screens/nav-partner.webp?v=2'); }
#screen-nav > button > span { display: none; }
#screen-nav #collection-count, #screen-nav .has-new::before { display: none; }
#menu-stage .col-header { position: absolute; left: 0; top: max(calc(var(--menu-design-height) * .0585), env(safe-area-inset-top)); width: 100%; height: calc(var(--menu-design-height) * .092); z-index: 5; display: block; }
#menu-stage .col-title-block { position: absolute; left: 30.8%; width: 55.2%; height: 100%; background: url('screens/garage-heading.webp?v=2') center / 100% 100% no-repeat; }
#menu-stage #levelselect-screen .col-title-block { left: 27%; width: 62.5%; background-image: url('screens/levels-heading.webp?v=2'); }
#menu-stage .col-title { color: transparent; font-size: 1em; text-shadow: none; }
#menu-stage .col-progress, #menu-stage .garage-info, #menu-stage .garage-dots,
#menu-stage .garage-badge-new { display: none; }
#menu-stage .col-header .icon-btn { position: absolute; left: 13.59%; top: 0; width: 19.52%; height: 100%; border: 0; border-radius: 0; background: url('screens/back.webp?v=2') center / contain no-repeat; box-shadow: none; backdrop-filter: none; }
#menu-stage #levelselect-screen .icon-btn { left: 9.7%; }
#menu-stage .icon-btn svg, #menu-stage .title-spacer { visibility: hidden; }
/* Five source-sized columns, ten rows. Overlapping transparent side wedges keep
   the slanted cards densely packed; only the grid scrolls under the fixed UI. */
#menu-stage .ls-grid { position: absolute; left: 6%; right: 6%; top: calc(var(--menu-design-height) * .1889); bottom: calc(var(--menu-bottom-inset) + var(--menu-design-height) * .1348); padding: .12em .75em .25em; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(10, max-content); gap: 0; align-content: start; justify-items: center; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: none; }
#menu-stage .ls-grid::-webkit-scrollbar { display: none; }
#menu-stage .ls-scrollbar { position: absolute; left: 95%; right: 1%; top: calc(var(--menu-design-height) * .1889); bottom: calc(var(--menu-bottom-inset) + var(--menu-design-height) * .1348); border: .08em solid #7cc6ee; border-radius: .25em; background: linear-gradient(90deg, #113b70, #256eae 55%, #123a70); box-shadow: 0 .12em 0 #09284b, inset 0 .08em .12em #0006; cursor: pointer; touch-action: none; user-select: none; }
#menu-stage .ls-scrollbar[hidden] { display: none; }
#menu-stage .ls-scrollbar::before { content: ''; position: absolute; inset: -.2em -.3em; }
#menu-stage .ls-scrollbar:focus-visible { outline: 2px solid #fff2aa; outline-offset: 2px; }
#menu-stage .ls-scroll-thumb { position: absolute; top: 0; left: .06em; right: .06em; border: .07em solid #ffe09a; border-radius: .2em; background: linear-gradient(180deg, #ffc544, #ff9510 45%, #e94a15); box-shadow: 0 .1em 0 #8f321a, inset 0 .08em 0 #fff7; cursor: grab; pointer-events: auto; }
#menu-stage .ls-scroll-thumb::after { content: ''; position: absolute; left: 18%; right: 18%; top: 50%; height: .6em; transform: translateY(-50%); background: repeating-linear-gradient(to bottom, #9e3f1d 0 .06em, #ffe39d .06em .12em, transparent .12em .24em); }
#menu-stage .ls-scrollbar.dragging .ls-scroll-thumb { cursor: grabbing; filter: brightness(1.12); }
#menu-stage .ls-tile { position: relative; height: auto; width: 120%; min-height: 0; min-width: 0; aspect-ratio: 135 / 108; font-size: 1em; gap: 0; border: 0; border-radius: 0; background: url('screens/tile-open.webp?v=2') center / 100% 100% no-repeat; text-shadow: 0 1px #af3117; }
#menu-stage .ls-tile.locked { opacity: 1; background-image: url('screens/tile-locked.webp?v=2'); }
/* The source already contains the complete rim and highlight. A rectangular
   outline or rounded inset border cuts across that slanted source geometry. */
#menu-stage .ls-tile:focus-visible { outline: none; filter: drop-shadow(0 0 .1em #fff2aa); }
#menu-stage .ls-num { font-size: 1em; transform: translate(-.05em, .05em); line-height: 1; display: flex; align-items: center; justify-content: center; }
.design-number { display: inline-flex; align-items: center; justify-content: center; gap: .06em; }
.design-number img { display: block; height: .78em; width: auto; }
#menu-stage .ls-num .design-number img { height: .65em; }
#menu-stage .ls-lock { width: .6em; height: .85em; object-fit: contain; }
#menu-stage .garage-body { position: absolute; inset: calc(var(--menu-design-height) * .17) 0 calc(var(--menu-design-height) * .18); width: 100%; display: block; pointer-events: none; }
#menu-stage .garage-stage { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: auto; }
/* The canvas matches the backdrop, including on tall phones. */
#menu-stage .garage-card { position: absolute; left: 50%; top: calc(var(--menu-design-height) * -.17); width: var(--menu-area-width); height: var(--menu-area-height); transform: translateX(-50%); aspect-ratio: auto; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
#menu-stage .garage-render { inset: 0; touch-action: none; user-select: none; cursor: grab; }
#menu-stage .garage-render.dragging { cursor: grabbing; }
#menu-stage .garage-nameplate { position: absolute; left: 20%; top: calc(var(--garage-podium-y, 60.4%) + var(--menu-design-height) * .118); width: 60%; height: calc(var(--menu-design-height) * .099); background: url('screens/garage-nameplate.webp') center / contain no-repeat; pointer-events: none; z-index: 5; }
#menu-stage .garage-nameplate .garage-name { position: absolute; inset: 18% 11% 25% 8%; display: flex; align-items: center; justify-content: center; font-family: 'Arial Black', var(--font-ui); font-size: 1.55em; font-weight: 900; font-style: italic; letter-spacing: .055em; line-height: 1; color: white; transform: skewX(-8deg); -webkit-text-stroke: .045em #123b70; paint-order: stroke fill; text-shadow: 0 .075em 0 #123b70; }
#menu-stage .garage-arrow { top: calc(var(--garage-podium-y, 60.4%) - var(--menu-design-height) * .29); width: 12.44%; height: calc(var(--menu-design-height) * .06032); padding: 0; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; color: transparent; font-size: 1em; background-position: center; background-size: contain; background-repeat: no-repeat; background-color: transparent; z-index: 4; pointer-events: auto; }
#menu-stage .garage-arrow.prev { left: 5.2%; background-image: url('screens/garage-prev.webp?v=2'); }
#menu-stage .garage-arrow.next { right: 5.2%; background-image: url('screens/garage-next.webp?v=2'); }
#menu-stage .garage-locked-label { font-size: 1em; }
#menu-stage .garage-locked-hint { color: #e4f4ff; font-size: .6em; }
#menu-stage .garage-locked-info { gap: .5em; }
/* Blur the actual board and scenic surround beneath independent controls. */
#menu-stage > .game-overlay { z-index: 220; background: none; animation: none; }
#menu-stage > .game-overlay > .overlay-scrim { background: none; backdrop-filter: none; }
#menu-stage .result-card { left: 10.86%; right: 10.86%; top: calc(50% - var(--menu-design-height) * .2454); height: calc(var(--menu-design-height) * .4856); transform: none; border: 0; border-radius: 0; padding: 0; gap: 0; background: url('screens/result-panel.webp') center / 100% 100% no-repeat; box-shadow: none; backdrop-filter: none; }
#menu-stage .result-card::before { display: none; }
#menu-stage .result-level { position: absolute; left: 4.6125%; top: -5.5276%; width: 73.8007%; height: 13.4003%; margin: 0; padding: 0; border: 0; border-radius: 0; background: url('screens/result-level.webp') center / 100% 100% no-repeat; transform: none; box-shadow: none; font-size: .78em; text-shadow: none; }
#menu-stage .result-level-word { position: absolute; left: 10%; top: 35%; width: 52%; height: 24%; color: transparent; font-size: 0; }
#menu-stage .result-level > span:last-child { position: absolute; left: 65.75%; top: 35%; width: 24.25%; height: 24.1%; display: flex; align-items: center; justify-content: center; }
#menu-stage .result-close { position: absolute; left: 75.8303%; top: -5.3601%; width: 19.0037%; height: 13.4003%; border: 0; padding: 0; background: url('screens/close.webp?v=2') center / contain no-repeat; color: transparent; cursor: pointer; z-index: 3; }
#menu-stage .result-art-title { position: absolute; left: 12.9151%; top: 19.598%; width: 74.1697%; height: 20.1005%; margin: 0; background: url('screens/loss-title.webp?v=2') center / contain no-repeat; font-size: 0; text-shadow: none; }
#menu-stage #lives-overlay .lives-icon { display: none; }
#menu-stage #lives-overlay .lives-copy { position: absolute; left: 9.7786%; top: 42.7136%; width: 80.6273%; height: 31.6583%; margin: 0; background: url('screens/loss-copy.webp?v=2') center / contain no-repeat; color: transparent; font-size: 0; }
#menu-stage .result-card .overlay-btn.primary { position: absolute; left: 5.7196%; top: 89.1122%; width: 88.0074%; height: 19.0955%; padding: 0; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; color: transparent; text-shadow: none; background: url('screens/retry.webp?v=2') center / 100% 100% no-repeat, linear-gradient(180deg, #65b918, #25820a); font-size: .8em; }
#menu-stage .result-card .overlay-btn.primary::after { display: none; }
#menu-stage #win-overlay .result-art-title { left: 11.8081%; top: 13.7353%; width: 76.3838%; height: 13.7353%; background-image: url('screens/win-title.webp?v=2'); }
#menu-stage .result-reward { position: absolute; left: 9.714%; top: 22.447%; width: 78.9243%; height: 71.6532%; object-fit: contain; }
#menu-stage #win-overlay .result-card::after { content: ''; position: absolute; left: -5.5351%; top: 17.9229%; width: 109.7786%; height: 71.1893%; background: url('screens/confetti.webp') center / contain no-repeat; pointer-events: none; }
#menu-stage .result-reward-count { position: absolute; left: 28.2288%; top: 73.1993%; width: 44.2804%; height: 14.5729%; background: url('screens/reward-count.webp') center / 100% 100% no-repeat; color: white; font-size: 1.01em; }
#menu-stage .result-reward-count .coin { position: absolute; left: 15%; top: 25%; width: 16%; height: 45%; background: none; }
#menu-stage #win-reward { position: absolute; left: 35%; top: 30%; width: 50%; height: 35%; display: flex; justify-content: center; align-items: center; gap: .1em; }
#menu-stage #win-overlay .overlay-btn.primary { background-image: url('screens/continue.webp?v=2'), linear-gradient(180deg, #65b918, #25820a); }
/* Shared dialogs and HUD are styled in dialogs.css. */
.overlay-title, .col-title { text-shadow: 0 .06em .04em #123b69; }
#menu-stage .result-card .overlay-btn.primary { background-size: 100% 100%, 65% 65%; background-position: center; background-repeat: no-repeat; }
@media (prefers-reduced-motion: reduce) { #menu-stage *, #menu-stage *::before, #menu-stage *::after { animation: none !important; transition: none !important; } }
