/* style.css - Glassmorphism Neon Theme for Rush Eng 2d */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Press+Start+2P&display=swap');

.runtime-error-box {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 99999;
  padding: 16px;
  color: #fff;
  background: rgba(220, 38, 38, 0.97);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  font: 12px/1.5 monospace;
  white-space: pre-wrap;
}

/* ==========================================================================
   GARAGE RACE LAUNCHER · one deliberate route into every race mode
   ========================================================================== */

#menu-home-view #home-to-workshop-btn[data-race-launcher-superseded='true'],
#menu-home-view #garage-lightspeed-entry[data-race-launcher-superseded='true'] {
  display: none !important;
}

#menu-home-view .garage-bottom-bar,
#menu-home-view .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
  grid-template-areas: 'home special audio stage' !important;
  grid-template-columns:
    minmax(92px, .44fr)
    minmax(155px, .72fr)
    minmax(420px, 2.1fr)
    minmax(190px, .92fr) !important;
}

.garage-race-launcher-trigger {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px !important;
  padding: 7px 14px !important;
  overflow: hidden;
  border: 1px solid rgba(103, 232, 249, .82) !important;
  border-radius: 13px !important;
  background:
    radial-gradient(circle at 80% -30%, rgba(250, 204, 21, .35), transparent 45%),
    linear-gradient(135deg, rgba(6, 78, 103, .98), rgba(49, 46, 129, .98)) !important;
  color: #f8fafc !important;
  box-shadow:
    0 0 24px rgba(34, 211, 238, .24),
    inset 0 1px 0 rgba(255, 255, 255, .18) !important;
}

.garage-race-launcher-trigger::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 15%, rgba(255, 255, 255, .16) 45%, transparent 72%);
  transform: translateX(-125%);
  transition: transform .45s ease;
}

.garage-race-launcher-trigger:hover::after,
.garage-race-launcher-trigger:focus-visible::after { transform: translateX(125%); }

.garage-race-launcher-trigger-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #fde047;
  filter: drop-shadow(0 0 8px rgba(250, 204, 21, .72));
}

.garage-race-launcher-trigger-icon svg,
.garage-race-launcher-mark svg,
.race-mode-option-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.garage-race-launcher-trigger-copy {
  min-width: 0;
  display: grid;
  justify-items: start;
  line-height: 1;
}

.garage-race-launcher-trigger-copy strong {
  font-size: 15px;
  font-weight: 950;
  letter-spacing: .02em;
}

.garage-race-launcher-trigger-copy small {
  margin-top: 4px;
  color: #a5f3fc;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
}

.garage-race-launcher[hidden] { display: none !important; }

.garage-race-launcher {
  position: fixed;
  inset: 0;
  z-index: 14000;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 46%, rgba(14, 116, 144, .2), transparent 42%),
    rgba(1, 8, 22, .82);
  backdrop-filter: blur(10px) saturate(.9);
}

.garage-race-launcher-panel {
  position: relative;
  width: min(1040px, calc(100vw - 56px));
  max-height: calc(100dvh - 56px);
  padding: 28px;
  overflow: auto;
  border: 1px solid rgba(103, 232, 249, .58);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(6, 25, 48, .985), rgba(8, 15, 39, .985)),
    #061426;
  color: #f8fafc;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .72), 0 0 46px rgba(34, 211, 238, .15);
  font-family: var(--font-ui);
}

.garage-race-launcher-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .48);
  border-radius: 13px;
  background: rgba(15, 23, 42, .86);
  color: #e2e8f0;
  font: 700 27px/1 var(--font-ui);
  cursor: pointer;
}

.garage-race-launcher-close:hover,
.garage-race-launcher-close:focus-visible {
  border-color: #67e8f9;
  color: #fff;
  box-shadow: 0 0 16px rgba(34, 211, 238, .22);
}

.garage-race-launcher-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-right: 56px;
}

.garage-race-launcher-mark {
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid rgba(250, 204, 21, .62);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(120, 53, 15, .82), rgba(49, 46, 129, .82));
  color: #fde047;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 0 26px rgba(250, 204, 21, .12);
}

.garage-race-launcher-kicker {
  color: #67e8f9;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
}

.garage-race-launcher-header h2 {
  margin: 5px 0 3px;
  font: 950 clamp(24px, 3vw, 36px)/1.05 var(--font-ui);
}

.garage-race-launcher-header p {
  margin: 0;
  color: #a8bdd1;
  font-size: 13px;
}

.race-mode-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.race-mode-option {
  position: relative;
  min-width: 0;
  min-height: 260px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 16px;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, .36);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 18%, rgba(34, 211, 238, .16), transparent 38%),
    linear-gradient(180deg, rgba(15, 38, 66, .98), rgba(7, 18, 38, .98));
  color: #f8fafc;
  text-align: center;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.race-mode-option::before {
  content: '';
  position: absolute;
  inset: auto 8% 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #67e8f9, transparent);
  opacity: .65;
}

.race-mode-option--expedition { --race-mode-accent: #38bdf8; }
.race-mode-option--lightspeed { --race-mode-accent: #fde047; }
.race-mode-option--boss { --race-mode-accent: #fb7185; }

.race-mode-option:hover,
.race-mode-option:focus-visible {
  transform: translateY(-5px);
  border-color: var(--race-mode-accent);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .32), 0 0 24px color-mix(in srgb, var(--race-mode-accent) 25%, transparent);
  outline: none;
}

.race-mode-option:disabled {
  opacity: .48;
  filter: grayscale(.35);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.race-mode-shortcut {
  position: absolute;
  top: 12px;
  left: 12px;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .36);
  border-radius: 9px;
  background: rgba(2, 6, 23, .72);
  color: #cbd5e1;
  font: 900 12px/1 var(--font-ui);
}

.race-mode-option-icon {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--race-mode-accent) 48%, transparent);
  border-radius: 32px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--race-mode-accent) 25%, transparent), transparent 68%),
    rgba(2, 8, 23, .55);
  color: var(--race-mode-accent);
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--race-mode-accent) 42%, transparent));
  transition: transform .2s ease, filter .2s ease;
}

.race-mode-option:hover .race-mode-option-icon,
.race-mode-option:focus-visible .race-mode-option-icon {
  transform: scale(1.07);
  filter: drop-shadow(0 0 24px color-mix(in srgb, var(--race-mode-accent) 62%, transparent));
}

.race-mode-option-copy {
  display: grid;
  justify-items: center;
}

.race-mode-option-copy strong {
  font: 950 19px/1.05 var(--font-ui);
}

.race-mode-option-copy > span {
  margin-top: 5px;
  color: var(--race-mode-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
}

.race-mode-option-copy small {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  color: #b8c7d9;
  font-size: 11px;
  line-height: 1.45;
  opacity: 0;
  transition: max-height .2s ease, margin-top .2s ease, opacity .2s ease;
}

.race-mode-option:hover .race-mode-option-copy small,
.race-mode-option:focus-visible .race-mode-option-copy small {
  max-height: 52px;
  margin-top: 9px;
  opacity: 1;
}

.race-mode-option-status {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--race-mode-accent) 34%, transparent);
  border-radius: 999px;
  background: rgba(2, 6, 23, .55);
  color: #dbeafe;
  font-size: 10px;
  font-weight: 850;
}

.garage-race-launcher-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  color: #94a3b8;
  font-size: 10px;
}

.garage-race-save-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px solid rgba(250, 204, 21, .34);
  border-radius: 12px;
  background: rgba(113, 63, 18, .2);
  color: #dbeafe;
  font-size: 11px;
  line-height: 1.45;
}

.garage-race-save-note strong { color: #fef08a; }

.garage-race-launcher-footer kbd {
  min-width: 22px;
  display: inline-grid;
  place-items: center;
  margin-right: 3px;
  padding: 3px 5px;
  border: 1px solid rgba(148, 163, 184, .4);
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  font: 800 10px/1 var(--font-ui);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .28);
}

@media (max-width: 1180px) {
  #menu-home-view .garage-bottom-bar,
  #menu-home-view .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
    grid-template-columns: minmax(76px, .45fr) minmax(125px, .72fr) minmax(340px, 2.1fr) minmax(170px, .92fr) !important;
  }
}

/* Central per-device Settings. This modal owns presentation preferences only;
   gameplay, answer, economy, and ranking contracts remain outside its scope. */
#menu-home-view .garage-command-bar {
  grid-template-areas: 'brand profile rank settings balance';
  grid-template-columns: minmax(190px, 1fr) minmax(390px, auto) minmax(44px, .42fr) 46px auto;
}

#menu-home-view .garage-settings-action {
  grid-area: settings;
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  justify-self: stretch;
  padding: 0;
  border-color: rgba(103, 232, 249, .4);
  background: linear-gradient(145deg, rgba(8, 47, 73, .92), rgba(49, 46, 129, .82));
  font-size: 20px;
}

#menu-home-view .garage-settings-action .menu-action-label { display: none; }

#menu-home-view .garage-command-bar:has(#garage-context-help) {
  grid-template-areas: 'brand profile rank settings balance help';
  grid-template-columns: minmax(180px, 1fr) minmax(390px, auto) minmax(44px, .42fr) 46px auto 44px;
}

/* Thai-first command icon and tooltip authority. The tooltip is a single
   viewport-aware DOM node; legacy pseudo/native tooltips are disabled for
   migrated controls so Chrome never shows two descriptions. */
.rush-command-icon {
  width: 24px;
  height: 24px;
  display: block;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.rush-icon-only {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 8px;
}

.rush-icon-only .menu-action-label,
.rush-icon-only > small {
  display: none !important;
}

.icon-tooltip[data-ui-tooltip]::after,
[data-ui-tooltip].icon-tooltip::after {
  display: none !important;
  content: none !important;
}

.rush-ui-tooltip {
  position: fixed;
  width: max-content;
  max-width: min(280px, calc(100vw - 16px));
  padding: 8px 10px;
  border: 1px solid rgba(112, 230, 255, 0.62);
  border-radius: 9px;
  color: #effcff;
  background: rgba(1, 12, 29, 0.98);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48);
  font: 750 13px/1.4 var(--font-ui, system-ui, sans-serif);
  text-align: center;
  white-space: normal;
  pointer-events: none;
  z-index: 2147483000;
}

.rush-ui-tooltip[hidden] {
  display: none !important;
}

html[data-ui-language='en'] .game-settings-language small {
  line-height: 1.35;
}

@media (max-height: 640px) and (orientation: landscape) {
  .rush-icon-only {
    min-width: 45px;
    min-height: 45px;
  }
}

@media (forced-colors: active) {
  .rush-ui-tooltip {
    border: 1px solid ButtonText;
    color: CanvasText;
    background: Canvas;
  }
}

/* These command controls are restyled by several legacy ID selectors later
   in this stylesheet. Keep the final interactive box at the accessibility
   floor even when those older rules win the cascade. */
.rush-icon-only.rush-icon-only {
  min-width: 45px !important;
  min-height: 45px !important;
}

@media (max-height: 640px) and (orientation: landscape) {
  .rush-icon-only.rush-icon-only {
    min-width: 45px !important;
    min-height: 45px !important;
  }
}

body.game-settings-open { overflow: hidden !important; }
.game-settings[hidden] { display: none !important; }
.game-settings {
  position: fixed;
  inset: 0;
  z-index: 22000;
  display: grid;
  place-items: center;
  padding: 22px;
  color: #e8f7ff;
  font-family: var(--font-ui, system-ui, sans-serif);
}
.game-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 7, 20, .86);
  backdrop-filter: blur(11px);
}
.game-settings-panel {
  position: relative;
  width: min(1120px, calc(100vw - 44px));
  max-height: min(850px, calc(100dvh - 44px));
  overflow: auto;
  border: 1px solid rgba(103, 232, 249, .45);
  border-radius: 24px;
  background:
    radial-gradient(circle at 78% 9%, rgba(79, 70, 229, .2), transparent 31%),
    linear-gradient(145deg, rgba(4, 19, 39, .99), rgba(15, 23, 54, .99));
  box-shadow: 0 34px 110px rgba(0, 0, 0, .66), 0 0 50px rgba(34, 211, 238, .12);
}
.game-settings-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
  background: rgba(4, 19, 39, .97);
}
.game-settings-header span { color: #67e8f9; font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.game-settings h2,.game-settings h3,.game-settings p { margin: 0; }
.game-settings h2 { margin-top: 3px; color: #f8fafc; font-size: clamp(22px, 2.5vw, 31px); }
.game-settings-header p { margin-top: 3px; color: #94a3b8; font-size: 12px; }
.game-settings-header > button {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 12px;
  color: #fff;
  background: rgba(15, 23, 42, .8);
  font-size: 25px;
  cursor: pointer;
}
.game-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 15px; }
.game-settings-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 15px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 16px;
  background: rgba(7, 18, 38, .72);
}
.game-settings-card h3 { color: #f8fafc; font-size: 15px; }
.game-settings-card > p { color: #94a3b8; font-size: 11px; line-height: 1.5; }
.game-settings-volume,.game-settings-toggle,.game-settings-select {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 35, 61, .62);
}
.game-settings-volume > span { min-width: 42px; color: #e2e8f0; font-size: 11px; font-weight: 900; }
.game-settings-volume input { min-width: 80px; flex: 1; accent-color: #22d3ee; }
.game-settings-volume output { min-width: 40px; color: #a5f3fc; font-size: 10px; font-weight: 900; text-align: right; }
.game-settings-toggle > span,.game-settings-select > span { min-width: 0; display: grid; gap: 3px; }
.game-settings-toggle strong,.game-settings-select strong { color: #e2e8f0; font-size: 11px; }
.game-settings-toggle small,.game-settings-select small { color: #94a3b8; font-size: 9px; line-height: 1.35; }
.game-settings-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.game-settings-toggle i {
  position: relative;
  width: 43px;
  height: 25px;
  flex: 0 0 43px;
  border: 1px solid rgba(148, 163, 184, .4);
  border-radius: 999px;
  background: #172033;
  transition: background .16s ease;
}
.game-settings-toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #cbd5e1; transition: transform .16s ease; }
.game-settings-toggle input:checked + i { border-color: #22d3ee; background: #0e7490; }
.game-settings-toggle input:checked + i::after { transform: translateX(18px); background: #fff; }
.game-settings-select select {
  max-width: 128px;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid rgba(103, 232, 249, .35);
  border-radius: 9px;
  color: #e0f2fe;
  background: #0b1830;
  font: 800 10px/1 var(--font-ui);
}
.game-settings-inline { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.game-settings-card button,.game-settings-footer button {
  min-height: 45px;
  padding: 8px 11px;
  border: 1px solid rgba(103, 232, 249, .34);
  border-radius: 11px;
  color: #e0f2fe;
  background: rgba(8, 47, 73, .65);
  font: 800 10px/1.25 var(--font-ui);
  cursor: pointer;
}
.game-settings-shortcuts,.game-settings-boundary { padding: 10px; border-radius: 11px; color: #cbd5e1 !important; background: rgba(30, 41, 59, .58); font-size: 10px !important; line-height: 1.5 !important; }
.game-settings-shortcuts { display: grid; gap: 4px; }
.game-settings-shortcuts strong { color: #fde68a; }
.game-settings-footer { position: sticky; bottom: 0; z-index: 3; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 15px; border-top: 1px solid rgba(148, 163, 184, .18); background: rgba(4, 19, 39, .97); }
.game-settings-footer span { min-height: 16px; color: #a5f3fc; font-size: 10px; text-align: center; }
.game-settings-footer span[data-state='error'] { color: #fda4af; }
.game-settings :focus-visible { outline: 3px solid #fde047; outline-offset: 3px; }
.game-settings-toggle:has(input:focus-visible) { outline: 3px solid #fde047; outline-offset: 3px; }

html[data-game-motion='reduce'] .game-settings-backdrop { backdrop-filter: none; }
html[data-game-motion='reduce'] :is(.garage-ambient,.garage-spotlight,.garage-speed-lines,.garage-platform-ring) { animation: none !important; }
html[data-game-motion='reduce'] .garage-canvas-wrap:hover #vehicle-preview-canvas { transform: none !important; }
html[data-game-screen-shake='false'] .lightspeed-scene.lightspeed-vfx-collision canvas { animation: none !important; }
html[data-game-reduce-flashes='true'] .lightspeed-effect-vignette,
html[data-game-reduce-flashes='true'] .lightspeed-scene::after { opacity: 0 !important; animation: none !important; }
html[data-game-high-contrast='true'] :is(.lightspeed-question-card,.game-settings-card,.profile-center-card) { border-color: rgba(255,255,255,.68) !important; background-color: rgba(0,8,22,.94) !important; }
html[data-game-strong-focus='false'] :focus-visible { outline-width: 2px !important; outline-color: #67e8f9 !important; }
html[data-game-text-size='large'] :is(#lightspeed-question,#play-active-word) { font-size: 1.18em !important; }
html[data-game-text-size='xlarge'] :is(#lightspeed-question,#play-active-word) { font-size: 1.34em !important; }
html[data-game-text-size='large'] :is(.lightspeed-answer-button strong,#play-active-ipa) { font-size: 1.1em !important; }
html[data-game-text-size='xlarge'] :is(.lightspeed-answer-button strong,#play-active-ipa) { font-size: 1.2em !important; }

@media (max-width: 1180px) {
  #menu-home-view .garage-command-bar,
  #menu-home-view .garage-command-bar:has(#garage-context-help) {
    grid-template-columns: minmax(145px, 1fr) minmax(350px, auto) 44px 44px auto 44px;
    gap: 7px;
  }
  .game-settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 820px) and (orientation: portrait) {
  #menu-home-view .garage-command-bar,
  #menu-home-view .garage-command-bar:has(#garage-context-help) {
    grid-template-areas: 'brand rank settings balance help' 'profile profile profile profile profile';
    grid-template-columns: minmax(0,1fr) 42px 42px auto 44px;
  }
  .game-settings { padding: 8px; }
  .game-settings-panel { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .game-settings-grid { grid-template-columns: 1fr; padding: 9px; }
}

@media (max-width: 900px) {
  .garage-race-launcher-panel { padding: 22px; }
  .race-mode-option { min-height: 230px; }
  .race-mode-option-icon { width: 94px; height: 94px; padding: 20px; }
}

@media (max-height: 720px) and (orientation: landscape) {
  .garage-race-launcher { padding: 16px; }
  .garage-race-launcher-panel { max-height: calc(100dvh - 32px); padding: 18px 22px; }
  .garage-race-launcher-mark { width: 48px; height: 48px; flex-basis: 48px; padding: 9px; }
  .garage-race-launcher-header h2 { font-size: 23px; }
  .race-mode-options { margin-top: 14px; }
  .race-mode-option { min-height: 190px; padding-block: 14px 11px; }
  .race-mode-option-icon { width: 78px; height: 78px; padding: 17px; border-radius: 24px; }
  .race-mode-option-copy strong { font-size: 16px; }
  .garage-race-launcher-footer { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .garage-race-launcher-trigger::after,
  .race-mode-option,
  .race-mode-option-icon,
  .race-mode-option-copy small { transition: none !important; }
  .race-mode-option:hover,
  .race-mode-option:focus-visible,
  .race-mode-option:hover .race-mode-option-icon,
  .race-mode-option:focus-visible .race-mode-option-icon { transform: none; }
}

.runtime-error-title { font-size: 14px; font-weight: 800; }
.runtime-error-message { margin: 8px 0; }
.runtime-error-debug { max-height: 30vh; overflow: auto; opacity: 0.9; }
.runtime-error-dismiss {
  margin-top: 10px;
  padding: 5px 10px;
  border: 0;
  border-radius: 4px;
  color: #dc2626;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.direct-file-preview-warning {
  background: #8a4b08;
  border-bottom: 2px solid #fbbf24;
  color: #fff7d6;
}

.direct-file-preview-warning .runtime-error-dismiss {
  color: #713f12;
}

.provider-mark {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
  line-height: 1;
}
.provider-mark-google { color: #4285f4; background: #fff; }
.provider-mark-facebook { color: #fff; background: #1877f2; font-family: Arial, sans-serif; }
.provider-mark-apple { color: #fff; font-size: 16px; }

:root {
  /* Match Codex's platform UI typography without redistributing its private font asset. */
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  --neon-blue: #00f2fe;
  --neon-pink: #ff007f;
  --neon-green: #00ff66;
  --neon-purple: #8a2be2;
  --neon-yellow: #ffd700;
  
  --bg-dark: #070913;
  --panel-glass: rgba(15, 23, 42, 0.55);
  --border-glass: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
}

html {
  overflow: hidden;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-dark);
  color: #f1f5f9;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  overflow: hidden;
  position: relative;
  /* Cyberpunk grid backdrop background */
  background-image: 
    linear-gradient(rgba(18, 24, 48, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 24, 48, 0.3) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center;
}

button,
input,
select,
textarea {
  font-family: var(--font-ui);
}

/* Background animated neon rings */
body::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, transparent 70%);
  top: -10%;
  left: -10%;
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.12) 0%, transparent 70%);
  bottom: -15%;
  right: -10%;
  z-index: -1;
  pointer-events: none;
}

/* Main shell — single full-window game surface */
.arcade-container {
  display: flex;
  flex: 0 0 100vw;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  padding: 0;
  box-sizing: border-box;
  align-items: stretch;
  justify-content: stretch;
  position: relative;
  z-index: 10;
}

/* Side panel removed from home — help content lives under mode list */
.side-panel {
  display: none !important;
}

.panel-header h1 {
  font-family: 'Press Start 2P', cursive;
  font-size: 20px;
  line-height: 1.5;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
  margin-bottom: 8px;
}

.panel-header .subtitle {
  font-size: 14px;
  color: #94a3b8;
  letter-spacing: 1px;
}

.info-box {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: 15px;
}

.info-box h3 {
  font-size: 15px;
  color: var(--neon-blue);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-box ul {
  list-style: none;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.8;
}

.info-box li {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-badge {
  background: #334155;
  color: #f8fafc;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: bold;
  border-bottom: 3px solid #1e293b;
  font-size: 11px;
}

/* Full-window game surface (menu + play) */
.game-viewport {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  position: relative;
  background: #000;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-viewport::before {
  display: none;
}

#game-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  background-color: #070913;
}

/* Menu / play both use full viewport; float UI only on play */
body.layout-play .arcade-container,
body.layout-menu .arcade-container {
  gap: 0;
  padding: 0;
}

/* Overlay screens */
.overlay-screen {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(8, 10, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  text-align: center;
}

/* Stage Complete uses two compact pages so celebration art never competes
   with rewards and run statistics for the same viewport height. */
#stagecomplete-screen {
  justify-content: center;
  overflow: hidden;
}

.stage-complete-step {
  display: none;
  width: min(100%, 440px);
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  flex-direction: column;
  align-items: center;
  flex: 0 1 auto;
  padding: 4px 8px 12px;
}

.stage-complete-step.is-active {
  display: flex;
  animation: stage-complete-step-in 220ms ease-out;
}

.stage-complete-step-kicker {
  margin-bottom: 8px;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.stage-complete-results-title {
  margin-bottom: 18px;
  color: #00ff66;
  font-family: 'Press Start 2P', cursive;
  font-size: 18px;
  line-height: 1.4;
  text-shadow: 0 0 15px rgba(0, 255, 102, 0.5);
}

.complete-boss-portrait {
  width: clamp(170px, 32vh, 240px);
  flex: 0 0 auto;
}

#complete-next-btn {
  width: 100%;
  max-width: 300px;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.4);
}

.stage-complete-actions {
  display: flex;
  width: 100%;
  max-width: 440px;
  justify-content: center;
  gap: 10px;
}

.stage-complete-actions .btn {
  flex: 1 1 0;
  justify-content: center;
  padding-inline: 16px;
  font-size: 13px;
}

@keyframes stage-complete-step-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px), (max-height: 620px) {
  #stagecomplete-screen {
    padding: 12px !important;
  }

  .stage-complete-step {
    padding-inline: 4px;
  }

  .stage-complete-actions {
    flex-direction: column-reverse;
  }

  .stage-complete-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage-complete-step.is-active {
    animation: none;
  }
}

/* Context help + minimal-copy pass (0.47.54). Audio player rules intentionally untouched. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.garage-brand-sub {
  display: none !important;
}

.garage-input-legend,
.garage-car-heading .garage-eyebrow,
.garage-progress-copy .garage-eyebrow,
.garage-panel-paint .garage-eyebrow,
.garage-collection-heading .garage-eyebrow,
.garage-panel-copy,
.garage-equipped-line,
.special-vehicles-premium-tag,
.special-market-heading .garage-eyebrow,
.special-vehicle-paint-heading .garage-eyebrow,
.garage-view-hint,
.special-vehicles-bottom-bar p,
.stage-route-kicker,
.stage-route-summary p,
.stage-route-legend,
.stage-route-score-card > span,
.stage-complete-step-kicker,
#complete-stars-subtitle,
#perks-screen > p,
#mastery-screen .mastery-container > p {
  display: none !important;
}

.garage-nav-btn small {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.garage-nav-btn::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: 210px;
  padding: 6px 8px;
  border: 1px solid rgba(112, 230, 255, 0.55);
  border-radius: 8px;
  color: #effcff;
  background: rgba(1, 12, 29, 0.98);
  font: 700 11px/1.3 var(--font-ui);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  visibility: hidden;
  z-index: 20;
}

.garage-nav-btn:is(:hover, :focus-visible)::after {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.garage-workshop-slot-art.is-placeholder,
.garage-workshop-slot.is-empty .garage-workshop-slot-art {
  opacity: 0.2;
  filter: grayscale(0.35) saturate(0.7) brightness(0.8);
}

.garage-workshop-slot.is-empty .garage-workshop-slot-copy {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.context-help-trigger {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(82, 220, 255, 0.58);
  border-radius: 50%;
  color: #e8fbff;
  background: rgba(6, 25, 48, 0.92);
  font: 900 18px/1 var(--font-ui);
  cursor: pointer;
  position: relative;
  z-index: 8;
}

.context-help-trigger:hover {
  border-color: #70e6ff;
  background: rgba(12, 48, 78, 0.96);
}

.context-help-trigger:focus-visible,
.context-help-close:focus-visible,
.context-help-footer :is(button, a):focus-visible {
  outline: 3px solid #ffd84d;
  outline-offset: 3px;
}

.icon-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: min(240px, 72vw);
  padding: 7px 9px;
  border: 1px solid rgba(112, 230, 255, 0.55);
  border-radius: 8px;
  color: #effcff;
  background: rgba(1, 12, 29, 0.98);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36);
  font: 700 12px/1.35 var(--font-ui);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: normal;
  visibility: hidden;
  z-index: 60;
}

.icon-tooltip:is(:hover, :focus-visible)::after {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

#welcome-how-to-play-btn.context-help-trigger {
  width: 100%;
  border-radius: 10px;
}

.garage-command-bar,
.special-vehicles-command-bar,
.stage-route-summary,
.mastery-container,
.leaderboard-header-actions {
  position: relative;
}

#pause-screen > .context-help-trigger,
#stagecomplete-screen > .context-help-trigger,
#gameover-screen > .context-help-trigger,
#perks-screen > .context-help-trigger {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
}

.supporter-pass-details {
  border: 1px solid rgba(92, 212, 255, 0.28);
  border-radius: 12px;
  background: rgba(10, 38, 62, 0.36);
}

.supporter-pass-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  color: #dff8ff;
  font-weight: 800;
  cursor: pointer;
}

.supporter-pass-details-copy {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  color: #c7d8e9;
  font-size: 12px;
  line-height: 1.5;
}

.supporter-pass-details-copy p {
  margin: 0;
}

@media (hover: none) {
  .icon-tooltip::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .icon-tooltip::after {
    transition: none;
  }
}

@media (forced-colors: active) {
  .context-help-trigger {
    border: 1px solid ButtonText;
  }
}

/* Menu Screen Specifically */
#menu-screen h2 {
  font-family: 'Press Start 2P', cursive;
  font-size: 26px;
  margin-bottom: 30px;
  background: linear-gradient(180deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.theme-selector {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}

/* General Button Styles */
.btn {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 16px;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-blue) 0%, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}

.btn.gamepad-selected {
  outline: 3px solid #00f0ff;
  outline-offset: 2px;
  transform: scale(1.03);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 12px 30px rgba(79, 70, 229, 0.6),
    0 0 15px var(--neon-blue);
}

.btn-secondary {
  background: var(--panel-glass);
  color: #fff;
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.btn-accent-1 {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%); /* Green for forest */
  color: #fff;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.btn-accent-1:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 12px 30px rgba(16, 185, 129, 0.6),
    0 0 15px var(--neon-green);
}

/* HUD Overlay during gameplay */
.hud-overlay {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  pointer-events: none;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hud-group {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  padding: 8px 14px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.score-hud {
  font-family: 'Press Start 2P', cursive;
  font-size: 14px;
  color: var(--neon-yellow);
}

/* Phase 7 gameplay focus/performance: preserve essential HUD, remove costly
   live blur and non-essential motion while a vocabulary decision is active. */
body.layout-play .play-float-panel,
body.layout-play .top-question-banner,
body.layout-play .bottom-decoder-panel {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.question-focus .combo-badge {
  animation: none !important;
}

body.question-focus #bottom-decoder-panel {
  display: none !important;
}

body.question-focus #play-controls {
  padding: 6px !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body.question-focus #play-controls .play-controls-body {
  display: none !important;
}

body.question-focus #play-controls .play-controls-toggle {
  position: static !important;
}

.leaderboard-local-warning {
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid rgba(251, 191, 36, 0.52);
  border-radius: 9px;
  background: rgba(120, 53, 15, 0.3);
  color: #fde68a;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.combo-badge {
  background: var(--neon-pink);
  color: #fff;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 13px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 8px var(--neon-pink); }
  100% { transform: scale(1); }
}

/* Bottom Controls area */
.bottom-hud {
  position: absolute;
  bottom: 20px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
}

/* ─── In-play floating panels (decoder L / controls R) ─── */
.play-float-ui {
  position: absolute;
  inset: 0;
  z-index: 55;
  pointer-events: none;
}

.play-float-panel {
  pointer-events: auto;
  position: absolute;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  color: #e2e8f0;
  max-width: min(280px, 38vw);
}

.play-float-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--neon-blue);
  margin-bottom: 6px;
}

/* Top-left: latest answer decoder (unified panel - scaled up 30% larger fonts) */
.play-decoder {
  top: 58px;
  left: 4px;
  padding: 8px 10px;
  border-color: rgba(255, 0, 127, 0.28);
  max-width: min(220px, 30vw);
  max-height: min(65vh, 420px);
  overflow-y: auto;
  width: 100%;
  font-size: 14.5px;
}

.play-decoder .play-float-title {
  font-size: 17px;
  margin-bottom: 8px;
}

.play-tts-wrap {
  margin-bottom: 8px;
}

.play-tts-btn {
  width: 100%;
  border: 1px solid rgba(0, 242, 254, 0.35);
  background: rgba(0, 242, 254, 0.12);
  color: #e0f2fe;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-ui);
}

.play-tts-btn:hover:not(:disabled) {
  background: rgba(0, 242, 254, 0.22);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);
}

.play-tts-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.play-decoder-placeholder {
  font-size: 13.5px;
  color: #64748b;
  font-style: italic;
  line-height: 1.45;
}

.play-decoder-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.play-decoder-word {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
}

.play-decoder-ipa {
  font-size: 13.5px;
  color: var(--neon-blue);
  font-style: italic;
  margin-bottom: 8px;
}

.play-decoder-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14.5px;
}

.play-decoder-list li {
  padding: 4px 8px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  line-height: 1.35;
}

.play-decoder-list li.correct-choice {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}

/* Top-right: controls guide (collapsible) */
.play-controls {
  top: 58px;
  right: 12px;
  padding: 10px 12px 10px 12px;
  min-width: 44px;
  transition: max-width 0.2s ease, padding 0.2s ease;
}

.play-controls-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0, 242, 254, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: var(--neon-blue);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}

.play-controls-toggle:hover {
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.35);
}

.play-controls-body {
  padding-right: 28px;
}

.play-controls-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.7;
}

.play-controls-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.play-controls-hint {
  margin: 6px 0 0;
  font-size: 10px;
  color: #94a3b8;
}

/* Collapsed: only the ? button */
.play-controls.is-collapsed {
  padding: 6px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.play-controls.is-collapsed .play-controls-body {
  display: none;
}

.play-controls.is-collapsed .play-controls-toggle {
  position: static;
}

/* Hide float UI when not in play shell (safety) */
body.layout-menu .play-float-ui {
  display: none !important;
}

@media (max-width: 700px) {
  .play-float-panel {
    max-width: min(46vw, 200px);
  }
  .play-decoder {
    top: 52px;
    left: 8px;
    padding: 8px 10px;
    max-width: min(55vw, 240px);
    max-height: 52vh;
  }
  .play-controls {
    top: 52px;
    right: 8px;
  }
  .play-decoder-word {
    font-size: 15px;
  }
  .play-decoder-list {
    font-size: 12px;
  }
  .play-controls-list {
    font-size: 10px;
  }
}

@media (max-width: 420px) {
  /* On very small screens keep decoder; default-collapse controls via JS */
  .play-decoder {
    max-width: min(58vw, 216px);
  }
}

.gps-btn {
  background: linear-gradient(135deg, var(--neon-purple) 0%, #4f46e5 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  pointer-events: auto;
  font-weight: bold;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.gps-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 12px var(--neon-purple);
}

.gps-btn:disabled {
  background: #334155;
  opacity: 0.5;
  cursor: not-allowed;
}

.gamepad-indicator {
  background: rgba(16, 185, 129, 0.15);
  color: var(--neon-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: bold;
  display: none;
  align-items: center;
  gap: 6px;
}

.gamepad-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  background-color: var(--neon-green);
  border-radius: 50%;
  display: inline-block;
  animation: blink 1s infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Perk Selection Cards Screen */
#perks-screen h2 {
  font-family: 'Press Start 2P', cursive;
  font-size: 16px;
  color: var(--neon-blue);
  margin-bottom: 25px;
}

.perk-cards-row {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 360px;
}

.perk-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  text-align: left;
}

.perk-card:hover {
  background: rgba(79, 70, 229, 0.15);
  border-color: var(--neon-blue);
  transform: scale(1.04);
  box-shadow: 0 8px 20px rgba(0, 242, 254, 0.1);
}

.perk-card.gamepad-selected {
  background: rgba(79, 70, 229, 0.25) !important;
  border-color: #00f0ff !important;
  transform: scale(1.04) !important;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.6) !important;
  outline: 3px solid #00f0ff;
  outline-offset: 2px;
}

.perk-icon {
  font-size: 28px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 10px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.perk-title {
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 2px;
}

.perk-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}

/* Game Over Screen */
.stats-summary {
  display: flex;
  gap: 20px;
  margin: 20px 0;
  width: 100%;
  max-width: 320px;
}

.stat-item {
  flex: 1;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 12px;
}

.stat-item span {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
}

.stat-item h4 {
  font-size: 18px;
  color: #fff;
  margin-top: 4px;
}

.highscore-badge {
  background: var(--neon-yellow);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  margin-top: 10px;
  display: none;
  animation: pulse 1s infinite;
}

/* Mastery Review Screen */
.mastery-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px 10px;
}

.mastery-container h2 {
  font-family: 'Press Start 2P', cursive;
  font-size: 14px;
  color: var(--neon-blue);
  margin-bottom: 15px;
}

.scroll-table-container {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 20px;
  border-radius: 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-glass);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 240, 255, 0.3) transparent;
}

.scroll-table-container::-webkit-scrollbar {
  width: 6px;
}
.scroll-table-container::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

th {
  background: rgba(15, 23, 42, 0.9);
  padding: 10px;
  color: #94a3b8;
  position: sticky;
  top: 0;
  z-index: 10;
}

td {
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.ipa-span {
  font-size: 10px;
  color: #64748b;
  margin-left: 4px;
}

.progress-bar-container {
  width: 90px;
  height: 12px;
  background: #1e293b;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 6px;
}

.progress-percent {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.mastery-high {
  background: var(--neon-green);
  box-shadow: 0 0 8px rgba(0, 255, 102, 0.4);
}

.mastery-mid {
  background: var(--neon-yellow);
}

.mastery-low {
  background: var(--neon-pink);
}

/* Mute Control HUD Element */
.mute-indicator-hud {
  cursor: pointer;
  pointer-events: auto;
}

@media (max-width: 900px) {
  .theme-selector {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .btn-stage .stage-name {
    font-size: 11px;
  }
  .menu-brand-title {
    font-size: 16px !important;
  }
  .theme-selector {
    max-width: 100%;
  }
}

/* ─── Unified home menu (modes first, help at bottom) ─── */
.menu-screen-unified {
  justify-content: flex-start !important;
  align-items: center !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 20px 16px 28px !important;
  text-align: center;
  /* Scenic neon highway art + dark scrim so UI stays readable */
  background-color: #070913 !important;
  background-image:
    linear-gradient(
      180deg,
      rgba(7, 9, 19, 0.72) 0%,
      rgba(7, 9, 19, 0.55) 35%,
      rgba(7, 9, 19, 0.78) 70%,
      rgba(7, 9, 19, 0.92) 100%
    ),
    radial-gradient(ellipse 90% 60% at 50% 20%, rgba(79, 70, 229, 0.18), transparent 55%),
    url('assets/ui/menu-bg.jpg') !important;
  background-size: cover, cover, cover !important;
  background-position: center, center, center !important;
  background-repeat: no-repeat !important;
  background-attachment: local;
  backdrop-filter: none !important;
}

.menu-screen-unified .btn-stage {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.menu-top-brand {
  width: 100%;
  max-width: 920px;
  margin-bottom: 10px;
}

.menu-brand-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 22px;
  line-height: 1.45;
  margin: 0 0 6px;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu-brand-sub {
  font-size: 13px;
  letter-spacing: 2px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.menu-intro {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0 auto 12px;
  max-width: 520px;
}

.menu-modes-wrap {
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.menu-section-label {
  width: 100%;
  max-width: 920px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #94a3b8;
  margin: 10px 0 8px;
  text-align: left;
  padding-left: 2px;
}

.theme-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 920px;
  margin-bottom: 8px;
}

.theme-selector-relation {
  grid-template-columns: 1fr 1fr;
}

.theme-selector-exam {
  grid-template-columns: repeat(3, 1fr);
}

.menu-actions-row {
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 8px;
}

.menu-actions-row #stats-btn {
  flex: 1 1 240px;
  max-width: 360px;
  padding: 10px 14px;
  font-size: 13px;
  justify-content: center;
}

.menu-highscore-line {
  font-size: 13px;
  color: #64748b;
}

.menu-highscore-line #high-score-display {
  color: var(--neon-yellow);
  font-weight: bold;
}

#menu-screen h2 {
  margin-bottom: 8px;
}

/* ───────── STAGE SELECTION GLOW BUTTONS ───────── */
.btn-stage {
  font-family: var(--font-ui);
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}
.btn-stage:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}
.btn-stage .stage-num {
  font-size: 9px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.btn-stage .stage-name {
  font-size: 12px;
  font-weight: 600;
}
/* Recommendations Card Style */
.rec-card {
  pointer-events: auto !important;
  cursor: pointer;
  background: rgba(30, 41, 59, 0.7);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}
.rec-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 240, 255, 0.2);
}
.btn-stage .stage-highscore {
  font-size: 9px;
  font-weight: 600;
  color: var(--neon-yellow);
  margin-top: 3px;
  opacity: 0.8;
  letter-spacing: 0.5px;
}
/* Individual stage color glows */
.btn-city:hover { border-color: #00f2fe; box-shadow: 0 0 12px rgba(0, 242, 254, 0.4); }
.btn-suburban:hover { border-color: #f59e0b; box-shadow: 0 0 12px rgba(245, 158, 11, 0.4); }
.btn-forest:hover { border-color: #10b981; box-shadow: 0 0 12px rgba(16, 185, 129, 0.4); }
.btn-beach:hover { border-color: #ec4899; box-shadow: 0 0 12px rgba(236, 72, 153, 0.4); }
.btn-expressway:hover { border-color: #8b5cf6; box-shadow: 0 0 12px rgba(139, 92, 246, 0.4); }
.btn-space:hover { border-color: #14b8a6; box-shadow: 0 0 12px rgba(20, 184, 166, 0.4); }
.btn-food:hover { border-color: #f97316; box-shadow: 0 0 12px rgba(249, 115, 22, 0.4); }
.btn-travel:hover { border-color: #38bdf8; box-shadow: 0 0 12px rgba(56, 189, 248, 0.4); }
.btn-health:hover { border-color: #4ade80; box-shadow: 0 0 12px rgba(74, 222, 128, 0.4); }
.btn-tech:hover { border-color: #818cf8; box-shadow: 0 0 12px rgba(129, 140, 248, 0.4); }
.btn-sports:hover { border-color: #fbbf24; box-shadow: 0 0 12px rgba(251, 191, 36, 0.4); }
.btn-emotion:hover { border-color: #e879f9; box-shadow: 0 0 12px rgba(232, 121, 249, 0.4); }
.btn-toeic:hover { border-color: #60a5fa; box-shadow: 0 0 12px rgba(96, 165, 250, 0.4); }
.btn-ielts:hover { border-color: #a78bfa; box-shadow: 0 0 12px rgba(167, 139, 250, 0.4); }
.btn-cutep:hover { border-color: #2dd4bf; box-shadow: 0 0 12px rgba(45, 212, 191, 0.4); }
.btn-synonym:hover { border-color: #93c5fd; box-shadow: 0 0 12px rgba(147, 197, 253, 0.4); }
.btn-antonym:hover { border-color: #fb7185; box-shadow: 0 0 12px rgba(251, 113, 133, 0.4); }

/* Gamepad Selected highlights */
.btn-stage.gamepad-selected {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.15);
  border-width: 2px !important;
  border-style: solid !important;
}
.btn-stage.gamepad-selected.btn-city { border-color: #00f2fe; box-shadow: 0 0 12px rgba(0, 242, 254, 0.4); }
.btn-stage.gamepad-selected.btn-suburban { border-color: #f59e0b; box-shadow: 0 0 12px rgba(245, 158, 11, 0.4); }
.btn-stage.gamepad-selected.btn-forest { border-color: #10b981; box-shadow: 0 0 12px rgba(16, 185, 129, 0.4); }
.btn-stage.gamepad-selected.btn-beach { border-color: #ec4899; box-shadow: 0 0 12px rgba(236, 72, 153, 0.4); }
.btn-stage.gamepad-selected.btn-expressway { border-color: #8b5cf6; box-shadow: 0 0 12px rgba(139, 92, 246, 0.4); }
.btn-stage.gamepad-selected.btn-space { border-color: #14b8a6; box-shadow: 0 0 12px rgba(20, 184, 166, 0.4); }
.btn-stage.gamepad-selected.btn-food { border-color: #f97316; box-shadow: 0 0 12px rgba(249, 115, 22, 0.4); }
.btn-stage.gamepad-selected.btn-travel { border-color: #38bdf8; box-shadow: 0 0 12px rgba(56, 189, 248, 0.4); }
.btn-stage.gamepad-selected.btn-health { border-color: #4ade80; box-shadow: 0 0 12px rgba(74, 222, 128, 0.4); }
.btn-stage.gamepad-selected.btn-tech { border-color: #818cf8; box-shadow: 0 0 12px rgba(129, 140, 248, 0.4); }
.btn-stage.gamepad-selected.btn-sports { border-color: #fbbf24; box-shadow: 0 0 12px rgba(251, 191, 36, 0.4); }
.btn-stage.gamepad-selected.btn-emotion { border-color: #e879f9; box-shadow: 0 0 12px rgba(232, 121, 249, 0.4); }
.btn-stage.gamepad-selected.btn-toeic { border-color: #60a5fa; box-shadow: 0 0 12px rgba(96, 165, 250, 0.4); }
.btn-stage.gamepad-selected.btn-ielts { border-color: #a78bfa; box-shadow: 0 0 12px rgba(167, 139, 250, 0.4); }
.btn-stage.gamepad-selected.btn-cutep { border-color: #2dd4bf; box-shadow: 0 0 12px rgba(45, 212, 191, 0.4); }
.btn-stage.gamepad-selected.btn-synonym { border-color: #93c5fd; box-shadow: 0 0 12px rgba(147, 197, 253, 0.4); }
.btn-stage.gamepad-selected.btn-antonym { border-color: #fb7185; box-shadow: 0 0 12px rgba(251, 113, 133, 0.4); }

/* ───────── ARCHIVE DECODER STYLES ───────── */
.decoder-box {
  border: 1px dashed rgba(255, 0, 127, 0.3) !important;
  box-shadow: inset 0 0 8px rgba(255, 0, 127, 0.05);
}
.badge-status {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-status.correct {
  background: rgba(16, 185, 129, 0.2);
  color: var(--neon-green);
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.badge-status.incorrect {
  background: rgba(239, 68, 68, 0.2);
  color: var(--neon-pink);
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.decoder-item {
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.03);
}
.decoder-item.correct-choice {
  border-color: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}
.decoder-item.incorrect-choice {
  color: #f87171;
}

/* ─── Menu hero: Garage (left) + Profile (right) ─── */
.menu-hero-row {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 14px;
  width: 100%;
  max-width: 920px;
  margin: 0 15px 20px 15px;
  text-align: left;
  box-sizing: border-box;
}

.menu-panel {
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-width: 0;
}

.menu-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.menu-panel-icon {
  font-size: 22px;
  line-height: 1;
}

.menu-panel-kicker {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.menu-panel-title {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
}

.garage-hint {
  font-size: 11px;
  color: #94a3b8;
  margin: 0 0 10px;
  line-height: 1.4;
}

/* One-at-a-time vehicle carousel */
.vehicle-carousel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.vehicle-nav-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: #67e8f9;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  line-height: 1;
  padding: 0;
}

.vehicle-nav-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.25);
  background: rgba(0, 240, 255, 0.12);
}

.vehicle-nav-btn:active {
  transform: scale(0.96);
}

.vehicle-stage {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(0, 240, 255, 0.08), transparent 70%),
    rgba(15, 23, 42, 0.88);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.25);
  min-height: 200px;
}

.vehicle-stage.is-locked {
  border-color: rgba(100, 116, 139, 0.35);
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(15, 23, 42, 0.5), transparent 70%),
    rgba(8, 10, 18, 0.92);
}

.vehicle-stage.is-selected-active {
  border-color: rgba(0, 240, 255, 0.55);
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.2),
    0 0 16px rgba(0, 240, 255, 0.15);
}

#vehicle-preview-canvas {
  width: 140px;
  height: 140px;
  display: block;
  image-rendering: auto;
}

.vehicle-lock-overlay {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 18px;
  opacity: 0.95;
  pointer-events: none;
}

.vehicle-stage-info {
  text-align: center;
  width: 100%;
}

.vehicle-preview-name {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.25;
}

.vehicle-stage.is-locked .vehicle-preview-name {
  color: #94a3b8;
  letter-spacing: 2px;
}

.vehicle-preview-index {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
}

.garage-selected-bar {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #cbd5e1;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 10px;
}

.garage-selected-bar strong {
  color: #00f0ff;
}

.garage-wallet {
  margin-left: auto;
  color: var(--neon-yellow, #ffd700);
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 700;
  font-size: 11px;
}

.profile-panel .profile-active-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.profile-name {
  display: block;
  font-size: 18px;
  color: var(--neon-blue, #00f2fe);
  margin-bottom: 4px;
}

.profile-score-chip {
  display: inline-block;
  font-size: 12px;
  color: var(--neon-yellow, #ffd700);
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 999px;
  padding: 2px 10px;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.profile-select {
  background: #0f172a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  outline: none;
  max-width: 160px;
}

.profile-mini-btn {
  padding: 6px 10px !important;
  font-size: 11px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  min-height: 0;
}

.add-profile-form {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
  padding: 20px;
}

.add-profile-form-content {
  background: #0f172a;
  border: 2px solid var(--neon-blue, #00f2fe);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.8), 0 0 20px rgba(0, 242, 254, 0.3);
  max-width: 400px;
  width: 100%;
}

.add-profile-form-content h3 {
  margin: 0;
  color: #fff;
  font-family: var(--font-ui);
  text-align: center;
  font-size: 20px;
}

.add-profile-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.add-profile-form input {
  flex: 1 1 100%;
  width: 100%;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--neon-blue, #00f2fe);
  border-radius: 6px;
  padding: 12px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 16px;
  outline: none;
}
.add-profile-form input:focus {
  border-color: #4facfe;
  box-shadow: 0 0 10px rgba(79, 172, 254, 0.5);
}

.profile-stats-block {
  background: rgba(8, 12, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.profile-stats-title {
  font-size: 12px;
  font-weight: 800;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.profile-top-stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-top-stages li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.65);
  border-radius: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.profile-top-stages .rank {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 240, 255, 0.12);
  color: #67e8f9;
  flex-shrink: 0;
}

.profile-top-stages .rank.gold { background: rgba(255, 215, 0, 0.18); color: #fde047; }
.profile-top-stages .rank.silver { background: rgba(226, 232, 240, 0.14); color: #e2e8f0; }
.profile-top-stages .rank.bronze { background: rgba(251, 146, 60, 0.16); color: #fdba74; }

.profile-top-stages .stage-label {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-top-stages .stage-score {
  color: var(--neon-yellow, #ffd700);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.profile-top-empty {
  justify-content: center !important;
  color: #64748b !important;
  font-size: 11px !important;
  background: transparent !important;
  border: none !important;
  padding: 4px 0 !important;
}

.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-meta-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
}

.profile-meta-label {
  font-size: 10px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.profile-meta-value {
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
}

@media (max-width: 780px) {
  .menu-hero-row {
    grid-template-columns: 1fr;
    margin-left: 10px;
    margin-right: 10px;
  }
}

@media (max-width: 420px) {
  .profile-meta-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  #vehicle-preview-canvas {
    width: 120px;
    height: 120px;
  }
  .vehicle-stage {
    min-height: 180px;
  }
  .vehicle-nav-btn {
    width: 36px;
    height: 36px;
  }
}

@keyframes bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

/* (height media rules moved into fullscreen shell section) */

/* ───────── ORIENTATION MODE SELECTOR ───────── */
.orientation-selector-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 4px;
}

.orientation-title {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.orientation-btn-group {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.orientation-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.orientation-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--neon-cyan, #00f0ff);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.orientation-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(0, 255, 102, 0.25));
  border-color: #00f0ff;
  color: #ffffff;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.5);
}

.orientation-icon {
  font-size: 16px;
}

/* ───────── PLANTS VS ZOMBIES LAYOUT STYLING ───────── */
.top-question-banner {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  border: 2px solid var(--neon-blue, #00f0ff);
  border-radius: 16px;
  padding: 8px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 95;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
  pointer-events: auto;
  min-width: 280px;
}

.top-prompt-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--neon-blue, #00f0ff);
  letter-spacing: 0.5px;
}

.top-active-word {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.top-active-ipa {
  font-size: 13px;
  font-style: italic;
  color: #a78bfa;
}

.top-tts-btn {
  margin-top: 4px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.top-tts-btn:hover {
  background: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.bottom-decoder-panel {
  position: absolute;
  bottom: 65px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 650px;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 10px 18px;
  z-index: 95;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
}

.bottom-decoder-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.bottom-decoder-word {
  font-size: 20px;
  font-weight: 900;
  color: var(--neon-blue, #00f0ff);
}

.bottom-decoder-ipa {
  font-size: 13px;
  font-style: italic;
  color: #94a3b8;
}

.bottom-decoder-list {
  list-style: none;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  margin-bottom: 4px;
}

.bottom-decoder-sentence {
  font-size: 12px;
  color: #cbd5e1;
  font-style: italic;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 4px;
  margin-top: 4px;
}

/* Full Width Canvas rules for horizontal mode */
body.layout-play.orientation-horizontal .game-viewport {
  width: 100vw;
  max-width: 100vw;
}

body.layout-play.orientation-horizontal #game-canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: fill;
}



/* ───────── HORIZONTAL MODE SPECIFIC UI OVERRIDES ───────── */
body.layout-play.orientation-horizontal .game-viewport {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #070913 !important;
}

body.layout-play.orientation-horizontal #game-canvas {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  object-fit: fill !important;
}

/* Move How-To-Play Guide (.play-controls) to Bottom-Left Corner */
body.layout-play.orientation-horizontal #play-controls {
  position: absolute !important;
  top: auto !important;
  right: auto !important;
  bottom: 18px !important;
  left: 16px !important;
  z-index: 96 !important;
  background: rgba(15, 23, 42, 0.9) !important;
  border: 1.5px solid rgba(0, 240, 255, 0.35) !important;
  border-radius: 12px !important;
  padding: 8px 12px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
  max-width: 270px !important;
}

body.layout-play.orientation-horizontal #play-controls .play-controls-list {
  font-size: 11px;
  line-height: 1.6;
}

/* Position HUD Overlay & Top-Right Pause Button */
body.layout-play.orientation-horizontal #hud-overlay {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  width: calc(100vw - 24px);
  max-width: none;
  z-index: 95;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

body.layout-play.orientation-horizontal #pause-toggle-hud {
  pointer-events: auto;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid var(--neon-blue, #00f0ff);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.layout-play.orientation-horizontal #pause-toggle-hud:hover {
  transform: scale(1.08);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.7);
}

/* Additional robust selectors for orientation-horizontal */
body.orientation-horizontal .game-viewport,
body.orientation-horizontal .arcade-container {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.orientation-horizontal #game-canvas {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  object-fit: fill !important;
}

body.orientation-horizontal #play-controls {
  position: absolute !important;
  top: auto !important;
  right: auto !important;
  bottom: 18px !important;
  left: 16px !important;
  z-index: 96 !important;
}

body.orientation-horizontal #hud-overlay {
  position: absolute !important;
  top: 10px !important;
  left: 12px !important;
  right: 12px !important;
  width: calc(100vw - 24px) !important;
}

/* Horizontal HUD order: speed/perks, progress, then GPS on the last row. */
body.layout-play.orientation-horizontal #bottom-hud-status-stack {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center !important;
  justify-items: end;
  gap: 6px 8px !important;
}

body.layout-play.orientation-horizontal #bottom-hud-speed-row {
  display: contents !important;
}

body.layout-play.orientation-horizontal #active-perks-container {
  grid-column: 1;
  grid-row: 1;
}

body.layout-play.orientation-horizontal #bottom-hud-speed-row > .hud-group {
  grid-column: 2;
  grid-row: 1;
}

body.layout-play.orientation-horizontal #stage-progress-bar-container {
  grid-column: 1 / -1;
  grid-row: 2;
}

body.layout-play.orientation-horizontal #gps-trigger-btn {
  grid-column: 1 / -1;
  grid-row: 3;
  width: min(100%, 260px);
  justify-self: end;
}

/* Vertical Mode Layout Enhancements */
body.orientation-vertical #hud-overlay > div:first-child {
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
}

body.orientation-vertical .play-decoder {
  top: var(--vertical-decoder-top, 136px) !important;
  max-height: min(
    65vh,
    420px,
    calc(100vh - var(--vertical-decoder-top, 136px) - 18px)
  );
}

body.orientation-vertical .bottom-decoder-panel {
  bottom: 45px !important;
}

/* Vertical HUD order: status, progress, then the GPS action below it. */
body.layout-play.orientation-vertical #bottom-hud-status-stack {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center !important;
  justify-items: end;
  gap: 6px 8px !important;
}

body.layout-play.orientation-vertical #bottom-hud-speed-row {
  display: contents !important;
}

body.layout-play.orientation-vertical #active-perks-container {
  grid-column: 1;
  grid-row: 1;
}

body.layout-play.orientation-vertical #bottom-hud-speed-row > .hud-group {
  grid-column: 2;
  grid-row: 1;
}

body.layout-play.orientation-vertical #stage-progress-bar-container {
  grid-column: 1 / -1;
  grid-row: 2;
}

body.layout-play.orientation-vertical #gps-trigger-btn {
  grid-column: 1 / -1;
  grid-row: 3;
  width: min(100%, 260px);
  justify-self: end;
}

/* Top Right Control Buttons (Sound Toggles + Pause ESC) */
#top-right-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: auto;
}

#top-right-controls .mute-indicator-hud {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#top-right-controls .mute-indicator-hud:hover {
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.6);
  border-color: rgba(0, 240, 255, 0.8);
}

/* Vertical Mode: Place ? Help button under Boss Avatar on far right */
body.orientation-vertical #play-controls {
  position: absolute !important;
  top: var(--vertical-help-top, 205px) !important;
  right: 16px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 98 !important;
}

#boss-overlay-canvas {
  display: none;
  position: absolute;
  top: 52px;
  right: 12px;
  z-index: 95;
  pointer-events: none;
}
body.orientation-vertical #boss-overlay-canvas {
  display: block;
  top: var(--vertical-boss-top, 82px);
}

/* ==========================================================================
   CASUAL GAME ART DIRECTION - PREMIUM UI REDESIGN
   ========================================================================== */

/* Menu Views Switcher */
.menu-view {
  display: none !important;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeInView 0.3s ease-out forwards;
}

.menu-view.active {
  display: flex !important;
}

@keyframes fadeInView {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Brand & Header Utilities */
.menu-top-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.brand-logo-container {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.menu-brand-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 22px;
  line-height: 1.2;
  background: linear-gradient(180deg, #ffffff 0%, #00f2fe 50%, #4f46e5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 12px rgba(0, 242, 254, 0.4);
}

.menu-brand-badge {
  font-size: 11px;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: 2px;
  margin-top: 2px;
}

.header-utility-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.utility-icon-btn {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  border: 2px solid #ffffff;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 16px;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.utility-icon-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 15px rgba(2, 132, 199, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.8);
}

/* Home Profile Row */
.home-profile-row {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.profile-card-compact {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 2px solid rgba(0, 240, 255, 0.3);
  border-radius: 24px;
  padding: 10px 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.profile-avatar {
  font-size: 24px;
  background: rgba(0, 240, 255, 0.15);
  border-radius: 50%;
  padding: 6px;
}

.profile-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.profile-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.profile-score-chip {
  font-size: 12px;
  font-weight: 700;
  color: #ffd700;
}

/* CENTER SHOWCASE: LARGE VEHICLE SHOWROOM */
.vehicle-showroom-wrapper {
  width: 100%;
  max-width: 760px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.85) 100%);
  border: 3px solid rgba(0, 240, 255, 0.35);
  border-radius: 28px;
  padding: 18px 24px;
  box-shadow: 0 12px 32px rgba(0, 240, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
}

.showroom-title-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 14px;
  color: #00f2fe;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  padding-bottom: 8px;
}

.vehicle-showroom-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  margin: 8px 0;
}

.showroom-canvas-container {
  position: relative;
  width: 560px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 3D Pedestal Background */
  background: radial-gradient(ellipse at bottom, rgba(0, 240, 255, 0.18) 0%, rgba(15, 23, 42, 0) 70%);
}

#vehicle-preview-canvas {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.6));
  transform: none;
}

@keyframes floatIdle {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(-1.5deg); }
}

.showroom-nav-btn {
  background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
  border: 3px solid #ffffff;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-size: 22px;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(126, 34, 206, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.showroom-nav-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 8px 22px rgba(126, 34, 206, 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.9);
}

.showroom-nav-btn:active {
  transform: scale(0.95);
}

.showroom-canvas-container {
  position: relative;
  cursor: pointer;
}

.garage-view-badge {
  position: absolute;
  top: 8px;
  right: 12px;
  background: rgba(8, 14, 24, 0.85);
  border: 1px solid rgba(55, 216, 255, 0.4);
  color: #37d8ff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 5;
  transition: all 0.2s ease;
}

.showroom-details-card {
  width: 100%;
  max-width: 420px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.showroom-veh-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.vehicle-name-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}

.vehicle-index-badge {
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 240, 255, 0.2);
  color: #00f2fe;
  padding: 3px 8px;
  border-radius: 10px;
}

.vehicle-status-meta {
  font-size: 13px;
  color: #cbd5e1;
}

/* Color Customization */
.showroom-colors-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}
.color-swatches-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.color-swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  background: var(--swatch-color, #888);
}
.color-swatch-btn:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.6);
}
.color-swatch-btn.is-active {
  border-color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
  transform: scale(1.15);
}
.color-swatch-btn.is-locked::after {
  content: '🔒';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  opacity: 0.8;
}
.btn-unlock-color {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-unlock-color:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.showroom-equipped-line {
  font-size: 12px;
  color: #94a3b8;
}

.equipped-tag {
  color: #10b981;
  font-weight: 800;
}

/* Integrated Top Brand Header & Profile Row */
.menu-top-brand {
  width: 100%;
  max-width: 980px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(8, 14, 24, 0.82);
  border: 1px solid rgba(196, 228, 255, 0.22);
  border-radius: 14px;
  backdrop-filter: blur(18px);
  margin-bottom: 14px;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.home-profile-row {
  margin: 0;
  width: auto;
  flex-shrink: 0;
}

.profile-card-compact {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

/* BOTTOM NAVIGATION BAR (RED WELCOME BTN + GREEN STAGE BTN) */
.home-main-action-wrap {
  width: 100%;
  max-width: 680px;
  margin: 16px auto 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
}

@media (max-width: 640px) {
  .home-main-action-wrap {
    grid-template-columns: 1fr;
  }
}

.btn-nav-action {
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border-radius: 12px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-nav-action:active {
  transform: translateY(1px) scale(0.98);
}

/* Red Welcome Button (Left Arrow) */
.btn-welcome-red {
  background: linear-gradient(180deg, #ff4d4d 0%, #dc2626 50%, #991b1b 100%);
  border: 2px solid rgba(254, 202, 202, 0.7);
  box-shadow: 
    0 8px 24px rgba(220, 38, 38, 0.45),
    inset 0 3px 0 rgba(255, 255, 255, 0.5),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3);
}

.btn-welcome-red:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 12px 30px rgba(220, 38, 38, 0.65),
    inset 0 3px 0 rgba(255, 255, 255, 0.7),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3);
  filter: brightness(1.08);
}

/* Green Stage Select Button (Right Arrow) */
.btn-stage-green {
  background: linear-gradient(180deg, #34d399 0%, #059669 50%, #064e3b 100%);
  border: 2px solid rgba(167, 243, 208, 0.7);
  box-shadow: 
    0 8px 24px rgba(16, 185, 129, 0.45),
    inset 0 3px 0 rgba(255, 255, 255, 0.5),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3);
}

.btn-stage-green:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 12px 30px rgba(16, 185, 129, 0.65),
    inset 0 3px 0 rgba(255, 255, 255, 0.7),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3);
  filter: brightness(1.08);
}

.btn-primary-play {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(180deg, #ffd54f 0%, #ff9800 50%, #e65100 100%);
  border: 3px solid #ffffff;
  border-radius: 14px;
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  box-shadow: 
    0 10px 30px rgba(255, 152, 0, 0.5),
    inset 0 4px 0 rgba(255, 255, 255, 0.8),
    inset 0 -4px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
  animation: playPulse 2.8s ease-in-out infinite;
}

@keyframes playPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.btn-primary-play:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 
    0 14px 40px rgba(255, 152, 0, 0.7),
    inset 0 4px 0 rgba(255, 255, 255, 0.9),
    inset 0 -4px 0 rgba(0, 0, 0, 0.2);
}

.btn-primary-play:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 6px 15px rgba(255, 152, 0, 0.4);
}

/* Bottom Player Stats Block */
.home-bottom-stats-block {
  width: 100%;
  max-width: 760px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Page 2 Single Column Showroom Container */
.home-showroom-single-col {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.home-showroom-single-col .vehicle-showroom-wrapper {
  width: 100%;
}

@media (max-width: 780px) {
  .vehicle-showroom-wrapper {
    padding-left: 12px;
    padding-right: 12px;
  }

  .vehicle-showroom-stage {
    gap: 8px;
  }

  .showroom-canvas-container {
    width: min(55vw, 420px);
    height: 250px;
  }
}

@media (max-width: 520px) {
  .vehicle-showroom-stage .welcome-button {
    min-width: 48px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  .showroom-canvas-container {
    width: 58vw;
    height: 210px;
  }
}

/* Glowing CTA button for Next Stage on Page 2 */
.btn-stage-next-glow {
  background: linear-gradient(135deg, #0ea5e9, #2563eb) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
  border: 1px solid rgba(56, 189, 248, 0.6) !important;
  padding: 10px 22px !important;
  transition: all 0.22s ease !important;
}

.btn-stage-next-glow:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 24px rgba(14, 165, 233, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.6) !important;
}

/* ==========================================================================
   PHASE 5 — GARAGE HERO EXPERIENCE
   Full-screen Bright Velocity showroom. The older showroom rules above remain
   as fallbacks for legacy markup; these scoped rules own #menu-home-view.
   ========================================================================== */

.garage-hero-view {
  --garage-ink: #10182b;
  --garage-road: #18243b;
  --garage-panel: rgba(13, 23, 42, 0.92);
  --garage-panel-soft: rgba(24, 36, 59, 0.76);
  --garage-cyan: #32c7e8;
  --garage-blue: #3978f6;
  --garage-mint: #38d9a9;
  --garage-yellow: #fece02;
  --garage-coral: #ff5d73;
  --garage-text: #f7faff;
  --garage-muted: #a8b7cf;
  width: min(100%, 1540px) !important;
  max-width: 1540px !important;
  height: calc(100dvh - 40px);
  min-height: 650px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: stretch !important;
  gap: 12px !important;
  color: var(--garage-text);
}

.menu-view.garage-hero-view.active {
  display: grid !important;
}

.garage-hero-view::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 18%, rgba(50, 199, 232, 0.12), transparent 26%),
    radial-gradient(circle at 88% 72%, rgba(57, 120, 246, 0.13), transparent 30%);
  z-index: -1;
}

.garage-command-bar {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(10, 19, 36, 0.95), rgba(25, 39, 66, 0.9));
  border: 1px solid rgba(168, 183, 207, 0.2);
  border-radius: 18px;
  box-shadow: 0 16px 44px rgba(3, 9, 22, 0.38);
  backdrop-filter: blur(20px);
}

.garage-brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.garage-brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 15px 8px 15px 8px;
  background: linear-gradient(145deg, var(--garage-cyan), var(--garage-blue));
  color: #fff;
  font: 900 25px/1 var(--font-ui);
  font-style: italic;
  box-shadow:
    0 9px 24px rgba(50, 199, 232, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.garage-brand-title {
  margin: 0;
  color: var(--garage-text);
  font: 900 clamp(17px, 1.7vw, 25px)/1 var(--font-ui);
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.garage-profile-row {
  width: auto;
  margin: 0;
}

.garage-profile-card {
  min-width: 360px;
  padding: 6px 10px;
  gap: 10px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: none;
}

.garage-profile-card .profile-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  font-size: 20px;
  border: 2px solid rgba(50, 199, 232, 0.65);
  background: rgba(50, 199, 232, 0.12);
}

.garage-profile-card .profile-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.garage-profile-card .profile-score-chip {
  font-size: 10px;
}

.garage-profile-card .profile-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.garage-profile-card .profile-select {
  max-width: 150px;
  height: 32px;
  font-size: 10px;
  border-radius: 9px;
}

.garage-add-profile-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(50, 199, 232, 0.32);
  border-radius: 9px;
  color: var(--garage-cyan);
  background: rgba(50, 199, 232, 0.08);
  font: 800 18px/1 var(--font-ui);
  cursor: pointer;
}

.garage-logout-btn {
  width: fit-content;
  margin-top: 2px;
  padding: 0;
  border: 0;
  color: rgba(255, 93, 115, 0.86);
  background: transparent;
  font: 700 9px/1.2 var(--font-ui);
  cursor: pointer;
}

.garage-add-profile-btn:hover,
.garage-logout-btn:hover {
  filter: brightness(1.25);
}

.garage-balance-group {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.garage-balance-chip,
.garage-collection-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.garage-balance-chip {
  color: var(--garage-yellow);
  border: 1px solid rgba(254, 206, 2, 0.26);
  background: rgba(254, 206, 2, 0.08);
}

.garage-collection-chip {
  color: var(--garage-mint);
  border: 1px solid rgba(56, 217, 169, 0.25);
  background: rgba(56, 217, 169, 0.08);
}

.garage-showroom-shell {
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(345px, 0.72fr);
  gap: 12px;
  align-items: stretch;
}

.garage-showcase,
.garage-console {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(168, 183, 207, 0.16);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(15, 28, 52, 0.96), rgba(10, 18, 34, 0.94));
  box-shadow: 0 24px 60px rgba(1, 7, 19, 0.44);
}

.garage-showcase {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 17px 18px 13px;
  isolation: isolate;
}

.garage-showcase::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(50, 199, 232, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(50, 199, 232, 0.03) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 80%);
}

.garage-showcase::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 8%;
  height: 36%;
  z-index: -2;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(50, 199, 232, 0.14), transparent 66%);
  filter: blur(12px);
}

.garage-ambient {
  position: absolute;
  width: 210px;
  height: 210px;
  z-index: -2;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.24;
  animation: garageAmbientDrift 9s ease-in-out infinite alternate;
}

.garage-ambient-one {
  top: -100px;
  right: 9%;
  background: var(--garage-blue);
}

.garage-ambient-two {
  bottom: -130px;
  left: 12%;
  background: var(--garage-cyan);
  animation-delay: -4s;
}

@keyframes garageAmbientDrift {
  from { transform: translate3d(-18px, 0, 0) scale(0.92); }
  to { transform: translate3d(28px, 16px, 0) scale(1.1); }
}

.garage-stage-topline {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.garage-vehicle-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.garage-tag,
.garage-index-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.garage-tag-rarity {
  color: #07211c;
  background: var(--garage-mint);
  border: 1px solid rgba(255, 255, 255, 0.32);
}

.garage-tag-rarity[data-rarity="rare"] {
  color: #081b31;
  background: #68b6ff;
}

.garage-tag-rarity[data-rarity="epic"] {
  color: #fff;
  background: #8b5cf6;
}

.garage-tag-rarity[data-rarity="elite"] {
  color: #2b2100;
  background: var(--garage-yellow);
}

.garage-tag-rarity[data-rarity="legendary"] {
  color: #fff;
  background: linear-gradient(90deg, #ff5d73, #8b5cf6);
}

.garage-tag-theme {
  color: var(--garage-cyan);
  background: rgba(50, 199, 232, 0.08);
  border: 1px solid rgba(50, 199, 232, 0.22);
}

.garage-index-badge {
  color: var(--garage-muted);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.garage-vehicle-stage {
  position: relative;
  min-height: 0;
  width: 100%;
  height: 100%;
  gap: 4px;
  margin: 0;
}

.garage-canvas-wrap {
  position: relative;
  width: auto;
  height: 100%;
  max-width: min(100%, 780px);
  max-height: 620px;
  min-height: 330px;
  aspect-ratio: 12 / 7;
  overflow: visible;
  cursor: pointer;
  background: none;
}

.garage-canvas-wrap #vehicle-preview-canvas,
.special-vehicle-canvas-wrap #special-vehicle-preview-canvas {
  position: relative;
  z-index: 4;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 22px 18px rgba(0, 0, 0, 0.45));
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.garage-canvas-wrap:hover #vehicle-preview-canvas,
.special-vehicle-canvas-wrap:hover #special-vehicle-preview-canvas {
  transform: translateY(-3px);
}

.garage-spotlight {
  position: absolute;
  z-index: 0;
  top: -18%;
  left: 18%;
  width: 64%;
  height: 102%;
  clip-path: polygon(36% 0, 64% 0, 94% 100%, 6% 100%);
  background: linear-gradient(180deg, rgba(217, 246, 255, 0.15), rgba(50, 199, 232, 0.015));
  filter: blur(9px);
  animation: garageSpotlight 5.5s ease-in-out infinite alternate;
}

@keyframes garageSpotlight {
  from { opacity: 0.56; transform: translateX(-3%); }
  to { opacity: 0.9; transform: translateX(3%); }
}

.garage-speed-lines {
  position: absolute;
  z-index: 0;
  inset: 10% 5% 24%;
  opacity: 0.2;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(50, 199, 232, 0.58) 8% 10%, transparent 10% 32%, rgba(57, 120, 246, 0.5) 32% 33%, transparent 33% 100%);
  mask-image: linear-gradient(90deg, transparent, black 25%, black 75%, transparent);
  animation: garageLines 4s ease-in-out infinite alternate;
}

@keyframes garageLines {
  from { transform: translateX(-12px) skewX(-8deg); opacity: 0.12; }
  to { transform: translateX(12px) skewX(-8deg); opacity: 0.28; }
}

.garage-platform {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 3%;
  width: 66%;
  height: 24%;
  transform: translateX(-50%);
  pointer-events: none;
}

.garage-platform-ring,
.garage-platform-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.garage-platform-ring {
  border: 2px solid rgba(50, 199, 232, 0.55);
  box-shadow:
    0 0 24px rgba(50, 199, 232, 0.24),
    inset 0 0 32px rgba(57, 120, 246, 0.14);
  animation: garagePlatformPulse 3.2s ease-in-out infinite;
}

.garage-platform-ring::before,
.garage-platform-ring::after {
  content: '';
  position: absolute;
  border-radius: inherit;
  border: 1px solid rgba(57, 120, 246, 0.26);
}

.garage-platform-ring::before { inset: 14%; }
.garage-platform-ring::after { inset: 30%; }

.garage-platform-core {
  inset: 28% 17%;
  background: radial-gradient(ellipse, rgba(50, 199, 232, 0.18), rgba(24, 36, 59, 0.04) 65%);
  filter: blur(4px);
}

@keyframes garagePlatformPulse {
  0%, 100% { opacity: 0.6; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.015); }
}

.garage-nav-btn {
  position: relative;
  z-index: 9;
  width: 52px;
  height: 76px;
  flex: 0 0 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(168, 183, 207, 0.2);
  border-radius: 16px;
  color: var(--garage-text);
  background: rgba(11, 21, 40, 0.82);
  box-shadow: 0 10px 24px rgba(1, 7, 18, 0.32);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.garage-nav-btn > span {
  font: 500 38px/0.8 Arial, sans-serif;
}

.garage-nav-btn small {
  color: var(--garage-muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.garage-nav-btn:hover,
.garage-nav-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(50, 199, 232, 0.7);
  background: rgba(50, 199, 232, 0.12);
  outline: none;
}

.garage-lock-overlay {
  z-index: 6;
  top: auto;
  left: 50%;
  right: auto;
  bottom: 20%;
  width: auto;
  min-width: 220px;
  padding: 9px 18px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 93, 115, 0.3);
  border-radius: 999px;
  background: rgba(10, 17, 31, 0.88);
  color: var(--garage-coral);
  box-shadow: 0 12px 30px rgba(2, 6, 18, 0.46);
  backdrop-filter: blur(12px);
}

.garage-lock-overlay .lock-icon {
  display: inline;
  margin-right: 6px;
  font-size: 13px;
}

.garage-lock-overlay .lock-text {
  display: inline;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.garage-view-control {
  position: relative;
  z-index: 8;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.garage-view-label {
  color: var(--garage-cyan);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.garage-view-selector {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(168, 183, 207, 0.14);
  border-radius: 12px;
  background: rgba(4, 11, 23, 0.5);
}

.garage-view-btn {
  min-height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  color: var(--garage-muted);
  background: transparent;
  font: 800 10px/1 var(--font-ui);
  cursor: pointer;
}

.garage-view-btn:hover {
  color: var(--garage-text);
}

.garage-view-btn.is-active {
  color: #071b29;
  background: var(--garage-cyan);
  box-shadow: 0 6px 16px rgba(50, 199, 232, 0.22);
}

.garage-console {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 12px;
}

.garage-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(2, 9, 21, 0.48);
}

.garage-tab {
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  color: var(--garage-muted);
  background: transparent;
  font: 900 10px/1 var(--font-ui);
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.garage-tab:hover {
  color: var(--garage-text);
}

.garage-tab.is-active {
  color: var(--garage-text);
  background: linear-gradient(135deg, rgba(50, 199, 232, 0.22), rgba(57, 120, 246, 0.22));
  box-shadow: inset 0 0 0 1px rgba(50, 199, 232, 0.28);
}

.garage-tab-panels {
  min-height: 0;
}

.garage-tab-panel {
  height: 100%;
  min-height: 0;
  padding: 20px 8px 6px;
  text-align: left;
}

.garage-tab-panel.is-active {
  display: flex;
  flex-direction: column;
  animation: garagePanelIn 0.22s ease both;
}

.garage-tab-panel[hidden] {
  display: none !important;
}

@keyframes garagePanelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.garage-eyebrow {
  margin-bottom: 6px;
  color: var(--garage-cyan);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.garage-car-heading,
.garage-paint-heading,
.garage-collection-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.garage-car-name,
.garage-paint-heading h2,
.garage-collection-heading h2 {
  margin: 0;
  color: var(--garage-text);
  font: 900 clamp(21px, 2.05vw, 31px)/1.08 var(--font-ui);
  letter-spacing: -0.02em;
}

.garage-paint-heading h2,
.garage-collection-heading h2 {
  font-size: clamp(18px, 1.55vw, 24px);
}

.garage-car-subtitle {
  margin-top: 7px;
  color: var(--garage-muted);
  font-size: 11px;
  line-height: 1.4;
}

.garage-equipped-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  margin-top: 6px;
  border-radius: 50%;
  background: #526078;
  box-shadow: 0 0 0 5px rgba(82, 96, 120, 0.12);
}

.garage-equipped-dot.is-equipped {
  background: var(--garage-mint);
  box-shadow: 0 0 0 5px rgba(56, 217, 169, 0.12), 0 0 14px rgba(56, 217, 169, 0.48);
}

.garage-progress-card {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(168, 183, 207, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.038);
}

.garage-progress-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  text-align: center;
}

.garage-progress-copy .garage-eyebrow {
  margin: 0;
  color: var(--garage-muted);
}

.garage-progress-copy strong {
  color: var(--garage-text);
  font-size: 11px;
  text-align: center;
}

.garage-progress-stars {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 7px 0 6px;
}

.garage-progress-stars span {
  color: #46536a;
  font-size: 43.5px;
  line-height: 1;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.32));
}

.garage-progress-stars span.is-earned {
  color: var(--garage-yellow);
  filter: drop-shadow(0 0 7px rgba(254, 206, 2, 0.38));
}

.garage-progress-track,
.garage-collection-meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(168, 183, 207, 0.13);
}

.garage-progress-track span,
.garage-collection-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--garage-cyan), var(--garage-mint));
  box-shadow: 0 0 12px rgba(50, 199, 232, 0.36);
  transition: width 0.35s ease;
}

.garage-progress-note {
  margin-top: 9px;
  color: var(--garage-muted);
  font-size: 10px;
  text-align: center;
}

.garage-workshop-loadout {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(50, 199, 232, 0.2);
  border-radius: 15px;
  background:
    linear-gradient(145deg, rgba(50, 199, 232, 0.07), rgba(56, 217, 169, 0.035)),
    rgba(3, 12, 27, 0.58);
}

.garage-workshop-loadout[hidden] {
  display: none !important;
}

.garage-workshop-loadout.is-assignment-locked {
  border-color: rgba(251, 191, 36, 0.34);
}

.garage-workshop-loadout-head {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(50, 199, 232, 0.22);
  border-radius: 10px;
  color: inherit;
  background: rgba(50, 199, 232, 0.055);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.garage-workshop-loadout-copy {
  min-width: 0;
}

.garage-workshop-loadout-head .garage-eyebrow {
  display: block;
  margin: 0 0 2px;
  font-size: 7px;
}

.garage-workshop-loadout-head strong {
  display: block;
  color: var(--garage-text);
  font: 900 10px/1.1 var(--font-ui);
  letter-spacing: 0.03em;
}

.garage-workshop-loadout-head-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.garage-workshop-loadout-open-icon {
  color: var(--garage-cyan);
  font: 900 20px/1 var(--font-ui);
  transform: translateX(0);
  transition: transform 0.16s ease;
}

.garage-workshop-loadout-head:not(:disabled):hover {
  border-color: rgba(50, 199, 232, 0.48);
  background: rgba(50, 199, 232, 0.1);
  transform: translateY(-1px);
}

.garage-workshop-loadout-head:not(:disabled):hover .garage-workshop-loadout-open-icon {
  transform: translateX(2px);
}

.garage-workshop-loadout-head:not(:disabled):active {
  transform: translateY(1px);
}

.garage-workshop-loadout-head:disabled {
  cursor: default;
  opacity: 0.72;
}

.garage-workshop-loadout-status {
  flex: 0 0 auto;
  padding: 4px 6px;
  border: 1px solid rgba(56, 217, 169, 0.22);
  border-radius: 999px;
  color: var(--garage-mint);
  background: rgba(56, 217, 169, 0.08);
  font: 900 7px/1 var(--font-ui);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.garage-workshop-loadout-status.is-locked {
  border-color: rgba(251, 191, 36, 0.32);
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}

.garage-workshop-slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}

.garage-workshop-slot {
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--garage-workshop-rarity, var(--garage-cyan)) 48%, transparent);
  border-radius: 10px;
  color: var(--garage-text);
  background: color-mix(in srgb, var(--garage-workshop-rarity, #32c7e8) 9%, rgba(2, 10, 24, 0.9));
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, filter 0.16s ease;
}

.garage-workshop-slot.is-empty {
  border-style: dashed;
  border-color: rgba(168, 183, 207, 0.2);
  background: rgba(3, 12, 27, 0.58);
}

.garage-workshop-slot:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.garage-workshop-slot:disabled {
  cursor: default;
  opacity: 0.68;
}

.garage-workshop-slot-art,
.garage-workshop-empty-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.garage-workshop-slot-art {
  display: block;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.22);
}

.garage-workshop-empty-icon {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(168, 183, 207, 0.28);
  color: var(--garage-cyan);
  background: rgba(50, 199, 232, 0.06);
  font: 800 18px/1 var(--font-ui);
}

.garage-workshop-slot-copy {
  min-width: 0;
}

.garage-workshop-slot-copy small,
.garage-workshop-slot-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.garage-workshop-slot-copy small {
  color: var(--garage-muted);
  font: 700 6.5px/1.2 var(--font-ui);
  text-transform: uppercase;
}

.garage-workshop-slot-copy strong {
  margin-top: 3px;
  color: var(--garage-text);
  font: 800 8px/1.2 var(--font-ui);
}

.garage-workshop-loadout-live {
  min-height: 11px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--garage-muted);
  font-size: 7px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.garage-primary-action,
.garage-race-action,
.garage-secondary-action {
  min-height: 48px;
  border-radius: 14px;
  font-family: var(--font-ui);
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.garage-primary-action {
  width: 100%;
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #061b24;
  background: linear-gradient(135deg, var(--garage-cyan), var(--garage-mint));
  box-shadow: 0 12px 28px rgba(50, 199, 232, 0.22);
  font-size: 13px;
}

.garage-primary-action:not(:disabled):hover,
.garage-race-action:hover,
.garage-secondary-action:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.garage-primary-action:disabled {
  color: rgba(247, 250, 255, 0.55);
  border-color: rgba(168, 183, 207, 0.13);
  background: rgba(168, 183, 207, 0.08);
  box-shadow: none;
  cursor: default;
}

.garage-primary-action.is-locked {
  color: #fff;
  border-color: rgba(255, 93, 115, 0.25);
  background: rgba(255, 93, 115, 0.1);
}

.garage-paint-tier,
.garage-collection-percent {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--garage-yellow);
  background: rgba(254, 206, 2, 0.08);
  border: 1px solid rgba(254, 206, 2, 0.2);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.garage-colors-wrap {
  display: block;
  margin: 4px 0 0;
}

.garage-color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.garage-color-grid .color-swatch-btn {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  min-height: 44px;
  display: grid;
  place-items: center;
  margin: 0;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.garage-color-grid .color-swatch-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.5);
}

.garage-color-grid .color-swatch-btn.is-active,
.garage-color-grid .color-swatch-btn.is-preview {
  transform: translateY(-2px);
  border-color: var(--garage-cyan);
  box-shadow: 0 0 0 2px rgba(50, 199, 232, 0.13), 0 8px 18px rgba(0, 0, 0, 0.25);
}

.garage-color-grid .color-swatch-btn.is-locked::after {
  content: '⌁';
  position: absolute;
  top: 4px;
  right: 5px;
  left: auto;
  transform: none;
  color: #fff;
  font-size: 10px;
  opacity: 0.82;
  text-shadow: 0 1px 3px #000;
}

.garage-color-chip {
  width: 25px;
  height: 25px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.22), 0 4px 8px rgba(0, 0, 0, 0.28);
}

.garage-paint-summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding: 0 11px;
  border-radius: 12px;
  color: var(--garage-muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
}

.garage-paint-summary strong {
  color: var(--garage-yellow);
  font-size: 11px;
}

.garage-paint-actions {
  display: grid;
  grid-template-rows: auto minmax(18px, auto) auto;
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
}

.garage-paint-actions .garage-primary-action {
  margin-top: 0;
}

.garage-paint-equip-action:not(:disabled) {
  color: #effff6;
  border-color: rgba(104, 255, 177, 0.42);
  background: linear-gradient(135deg, rgba(13, 208, 125, 0.88), rgba(8, 108, 112, 0.92));
  box-shadow: 0 12px 28px rgba(13, 208, 125, 0.18);
}

.garage-notice {
  min-height: 18px;
  margin-top: 7px;
  color: var(--garage-muted);
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}

.garage-paint-actions .garage-notice {
  margin: 0;
  padding: 0 4px;
}

.garage-notice.is-error {
  color: var(--garage-coral);
}

.garage-collection-meter {
  margin: 12px 0 0;
}

.garage-shop-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  overflow-y: auto;
}

.garage-shop-card {
  min-height: 86px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(168, 183, 207, 0.14);
  border-radius: 14px;
  color: var(--garage-text);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.052), rgba(50, 199, 232, 0.035));
  text-align: left;
  cursor: pointer;
}

.garage-shop-card:hover,
.garage-shop-card.is-current {
  border-color: rgba(50, 199, 232, 0.62);
  background: rgba(50, 199, 232, 0.1);
}

.garage-shop-card.is-owned {
  border-color: rgba(56, 217, 169, 0.44);
}

.garage-shop-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(254, 206, 2, 0.14);
  font-size: 21px;
}

.garage-shop-card-copy,
.garage-shop-card-copy strong,
.garage-shop-card-copy small,
.garage-shop-card-copy b {
  min-width: 0;
  display: block;
}

.garage-shop-card-copy strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.garage-shop-card-copy small {
  margin-top: 3px;
  color: var(--garage-muted);
  font-size: 8px;
}

.garage-shop-card-copy b {
  margin-top: 7px;
  color: var(--garage-yellow);
  font-size: 8px;
}

.garage-shop-card.is-owned .garage-shop-card-copy b {
  color: var(--garage-mint);
}

.garage-shop-hint {
  margin: auto 0 0;
  padding-top: 10px;
  color: var(--garage-muted);
  font-size: 10px;
  text-align: center;
}

.garage-collection-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 1px 3px 6px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(50, 199, 232, 0.45) rgba(255, 255, 255, 0.04);
}

.garage-collection-card {
  min-height: 62px;
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(168, 183, 207, 0.1);
  border-radius: 12px;
  color: var(--garage-text);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
  cursor: pointer;
}

.garage-collection-card:hover,
.garage-collection-card.is-current {
  border-color: rgba(50, 199, 232, 0.5);
  background: rgba(50, 199, 232, 0.08);
}

.garage-collection-card.is-locked {
  color: rgba(247, 250, 255, 0.62);
}

.garage-collection-icon {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #071925;
  background: var(--garage-mint);
  font-size: 16px;
}

.garage-collection-card.is-locked .garage-collection-icon {
  color: var(--garage-muted);
  background: rgba(168, 183, 207, 0.09);
}

.garage-collection-card-copy {
  min-width: 0;
}

.garage-collection-card-copy strong,
.garage-collection-card-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.garage-collection-card-copy strong {
  font-size: 10px;
}

.garage-collection-card-copy small {
  margin-top: 4px;
  color: var(--garage-muted);
  font-size: 8px;
}

.garage-bottom-bar {
  width: 100%;
  max-width: none;
  min-height: 56px;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(120px, 0.5fr) auto minmax(230px, 0.8fr);
  align-items: center;
  gap: 12px;
  padding: 7px;
  border: 1px solid rgba(168, 183, 207, 0.16);
  border-radius: 17px;
  background: rgba(10, 19, 36, 0.92);
  box-shadow: 0 14px 36px rgba(1, 7, 19, 0.32);
}

.garage-secondary-action,
.garage-race-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  font-size: 12px;
}

.garage-secondary-action {
  justify-self: start;
  color: var(--garage-muted);
  border: 1px solid rgba(168, 183, 207, 0.18);
  background: rgba(255, 255, 255, 0.035);
}

.garage-race-action {
  justify-self: end;
  min-width: 230px;
  position: relative;
  overflow: hidden;
  color: #effff6;
  border: 1px solid rgba(104, 255, 177, 0.58);
  background:
    radial-gradient(circle at 28% 18%, rgba(192, 255, 177, 0.34), transparent 38%),
    linear-gradient(135deg, rgba(13, 208, 125, 0.72), rgba(6, 151, 113, 0.64) 52%, rgba(8, 108, 112, 0.68)),
    rgba(4, 35, 30, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 255, 153, 0.16),
    0 0 18px rgba(24, 235, 139, 0.16),
    0 9px 26px rgba(4, 165, 105, 0.24);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  text-shadow: 0 1px 10px rgba(186, 255, 216, 0.5);
}

.garage-tab:focus-visible,
.garage-view-btn:focus-visible,
.garage-primary-action:focus-visible,
.garage-workshop-loadout-head:focus-visible,
.garage-workshop-slot:focus-visible,
.garage-secondary-action:focus-visible,
.garage-race-action:focus-visible,
.garage-collection-card:focus-visible,
.garage-color-grid .color-swatch-btn:focus-visible {
  outline: 2px solid var(--garage-yellow);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .garage-command-bar {
    grid-template-columns: minmax(210px, 0.8fr) auto minmax(165px, 0.55fr);
  }

  .garage-profile-card {
    min-width: 310px;
  }

  .garage-profile-card .profile-select {
    max-width: 110px;
  }

  .garage-balance-group {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .garage-balance-chip,
  .garage-collection-chip {
    min-height: 28px;
    font-size: 9px;
  }

  .garage-showroom-shell {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  }

  .garage-canvas-wrap {
    min-height: 300px;
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  .garage-hero-view {
    height: auto;
    min-height: calc(100dvh - 24px);
  }

  .garage-command-bar {
    grid-template-columns: 1fr auto;
  }

  .garage-profile-row {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .garage-profile-card {
    width: 100%;
    min-width: 0;
  }

  .garage-showroom-shell {
    display: flex;
    flex-direction: column;
  }

  .garage-showcase {
    min-height: 500px;
  }

  .garage-console {
    min-height: 430px;
  }

  .garage-bottom-bar {
    grid-template-columns: 0.55fr 1fr;
  }

  .garage-input-legend {
    display: none;
  }
}

@media (max-height: 800px) and (orientation: landscape) {
  .menu-screen-unified {
    padding: 8px 10px 10px !important;
  }

  .garage-hero-view {
    height: calc(100dvh - 18px);
    min-height: 0;
    gap: 7px !important;
  }

  .garage-command-bar {
    min-height: 52px;
    padding: 5px 9px;
  }

  .garage-brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 20px;
    border-radius: 11px 6px 11px 6px;
  }

  .garage-brand-sub,
  .garage-profile-card .profile-actions,
  .garage-logout-btn,
  .garage-input-legend {
    display: none;
  }

  .garage-profile-card {
    min-width: 190px;
  }

  .garage-balance-group {
    flex-direction: row;
  }

  .garage-showroom-shell {
    grid-template-columns: minmax(0, 1.55fr) minmax(285px, 0.75fr);
    gap: 7px;
  }

  .garage-showcase {
    padding: 9px 12px 7px;
    border-radius: 17px;
  }

  .garage-canvas-wrap {
    min-height: 190px;
    max-height: none;
  }

  .garage-nav-btn {
    width: 42px;
    height: 58px;
    flex-basis: 42px;
    border-radius: 12px;
  }

  .garage-nav-btn > span {
    font-size: 30px;
  }

  .garage-view-control {
    min-height: 34px;
  }

  .garage-view-hint {
    display: none;
  }

  .garage-console {
    padding: 7px;
    border-radius: 17px;
  }

  .garage-tab {
    min-height: 31px;
    font-size: 8px;
  }

  .garage-tab-panel {
    padding: 10px 5px 3px;
  }

  .garage-tab-panels {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .garage-car-name {
    font-size: 20px;
  }

  .garage-car-subtitle {
    display: none;
  }

  .garage-progress-card {
    margin-top: 7px;
    padding: 8px;
  }

  .garage-progress-copy .garage-eyebrow,
  .garage-progress-note {
    display: block;
  }

  .garage-progress-copy strong {
    font-size: 8px;
  }

  .garage-progress-stars {
    margin: 4px 0;
  }

  .garage-progress-stars span {
    font-size: 27px;
  }

  .garage-progress-track {
    height: 4px;
  }

  .garage-workshop-loadout {
    margin-top: 5px;
    padding: 5px;
    border-radius: 10px;
  }

  .garage-workshop-loadout-head .garage-eyebrow,
  .garage-workshop-loadout-live {
    display: none;
  }

  .garage-workshop-loadout-head strong {
    font-size: 8px;
  }

  .garage-workshop-loadout-status {
    padding: 3px 5px;
    font-size: 6px;
  }

  .garage-workshop-slot-grid {
    gap: 4px;
    margin-top: 4px;
  }

  .garage-workshop-slot {
    min-height: 32px;
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 4px;
    padding: 2px 4px;
    border-radius: 7px;
  }

  .garage-workshop-slot-art,
  .garage-workshop-empty-icon {
    width: 25px;
    height: 25px;
    border-radius: 6px;
  }

  .garage-workshop-slot-copy small {
    font-size: 5.5px;
  }

  .garage-workshop-slot-copy strong {
    margin-top: 1px;
    font-size: 6.5px;
  }

  .garage-primary-action {
    min-height: 36px;
    margin-top: 6px;
  }

  #garage-equip-btn {
    min-height: 44px;
  }

  .garage-equipped-line {
    display: none;
  }

  .garage-panel-copy {
    margin: 6px 0;
    line-height: 1.25;
  }

  #garage-panel-paint .garage-panel-copy {
    display: none;
  }

  #garage-panel-paint {
    position: relative;
    padding-bottom: 3px;
    overflow-y: auto;
  }

  .garage-paint-heading h2 {
    font-size: 16px;
    line-height: 0.95;
  }

  .garage-paint-tier {
    min-height: 22px;
    padding: 0 7px;
    font-size: 8px;
  }

  .garage-color-grid {
    gap: 4px;
  }

  .garage-color-grid .color-swatch-btn {
    min-height: 34px;
    border-radius: 9px;
  }

  .garage-color-chip {
    width: 20px;
    height: 20px;
  }

  #garage-panel-paint .garage-paint-summary {
    display: none;
  }

  #garage-panel-paint .garage-paint-actions {
    position: static;
    margin: 4px 0 0;
    gap: 4px;
  }

  #garage-panel-paint .garage-paint-actions .garage-primary-action {
    position: static;
    width: 100%;
    min-height: 32px;
    margin: 0;
  }

  #garage-panel-paint .garage-notice {
    display: block;
    min-height: 18px;
    margin: 0;
    padding: 0 3px;
    font-size: 8px;
    line-height: 1.25;
  }

  .garage-bottom-bar {
    min-height: 44px;
    grid-template-columns: 120px 1fr;
    padding: 4px;
  }

  .garage-secondary-action,
  .garage-race-action {
    min-height: 34px;
  }
}

/* ==========================================================================
   SUPPORTER PASS · dormant account/restore preview
   ========================================================================== */

.supporter-entry-action {
  border-color: rgba(255, 211, 86, 0.62) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.25), transparent 36%),
    linear-gradient(135deg, #8f5d08 0%, #a9412d 52%, #5d2f8e 100%) !important;
  box-shadow: 0 10px 25px rgba(221, 154, 34, 0.2) !important;
}

.supporter-pass-dialog {
  width: min(720px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 211, 86, 0.54);
  border-radius: 22px;
  color: #f8fbff;
  background: #07111f;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
}

.supporter-pass-dialog::backdrop {
  background: rgba(1, 5, 14, 0.82);
  backdrop-filter: blur(9px);
}

.supporter-pass-shell {
  max-height: calc(100dvh - 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 92% -8%, rgba(255, 190, 65, 0.22), transparent 34%),
    linear-gradient(145deg, rgba(22, 42, 71, 0.98), rgba(5, 13, 25, 0.99));
}

.supporter-pass-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 211, 86, 0.18);
}

.supporter-pass-header h2 {
  margin: 3px 0 0;
  font: 900 clamp(22px, 4vw, 32px)/1 var(--font-ui);
}

.supporter-pass-kicker {
  color: #ffd45f;
  font: 800 10px/1.2 var(--font-ui);
  letter-spacing: 0.13em;
}

.supporter-pass-close,
.supporter-pass-button {
  min-height: 44px;
  border: 1px solid rgba(205, 222, 242, 0.24);
  border-radius: 12px;
  color: #f6fbff;
  background: rgba(255, 255, 255, 0.07);
  font: 800 13px/1 var(--font-ui);
  cursor: pointer;
}

.supporter-pass-close {
  min-width: 54px;
  padding: 0 14px;
}

.supporter-pass-body {
  min-height: 0;
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
  overflow-y: auto;
}

.supporter-pass-hero,
.supporter-pass-status,
.supporter-pass-acknowledgement {
  padding: 14px 16px;
  border: 1px solid rgba(164, 195, 226, 0.15);
  border-radius: 15px;
  background: rgba(2, 9, 20, 0.48);
}

.supporter-pass-hero strong {
  display: block;
  color: #ffe17f;
  font: 900 22px/1.15 var(--font-ui);
}

.supporter-pass-hero p,
.supporter-pass-status p,
.supporter-pass-exclusions {
  margin: 7px 0 0;
  color: #bdcde0;
  font: 500 13px/1.55 var(--font-ui);
}

.supporter-pass-preview {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #ffd36a;
  background: rgba(255, 193, 53, 0.12);
  font: 800 10px/1 var(--font-ui);
  letter-spacing: 0.08em;
}

.supporter-pass-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.supporter-pass-benefit {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(90, 206, 255, 0.24);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(25, 92, 132, 0.18), rgba(83, 49, 129, 0.16));
}

.supporter-pass-benefit > span {
  color: #61dcff;
  font: 800 10px/1 var(--font-ui);
  letter-spacing: 0.12em;
}

.supporter-pass-benefit strong { font: 900 18px/1.2 var(--font-ui); }
.supporter-pass-benefit small { color: #aebfd4; font: 500 12px/1.4 var(--font-ui); }
.supporter-pass-exclusions { margin: 0; text-align: center; }

.supporter-pass-policies {
  display: flex;
  justify-content: center;
  gap: 6px 14px;
  flex-wrap: wrap;
}

.supporter-pass-policy-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: #72ddff;
  font: 700 12px/1.2 var(--font-ui);
  text-underline-offset: 3px;
}

.supporter-pass-policy-link:focus-visible {
  outline: 3px solid #ffd45e;
  outline-offset: 2px;
  border-radius: 4px;
}

.supporter-pass-status {
  min-height: 74px;
  border-color: rgba(91, 207, 255, 0.25);
}

.supporter-pass-status strong { font: 800 15px/1.2 var(--font-ui); }
.supporter-pass-status[data-tone='success'] { border-color: rgba(90, 237, 159, 0.42); }
.supporter-pass-status[data-tone='warning'] { border-color: rgba(255, 197, 82, 0.42); }

.supporter-pass-acknowledgement {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: #c6d5e6;
  font: 500 12px/1.5 var(--font-ui);
}

.supporter-pass-acknowledgement input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: #ffc43d;
}

.supporter-pass-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.supporter-pass-button { padding: 0 15px; }
.supporter-pass-primary {
  border-color: rgba(255, 209, 82, 0.62);
  color: #1a1100;
  background: linear-gradient(135deg, #ffe37c, #ffb42c);
}

.supporter-pass-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.4);
}

@media (max-width: 480px) and (orientation: portrait) {
  .supporter-pass-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: 15px; }
  .supporter-pass-shell { max-height: calc(100dvh - 12px); }
  .supporter-pass-header { min-height: 60px; padding: 11px 13px; }
  .supporter-pass-body { padding: 12px; }
  .supporter-pass-benefits,
  .supporter-pass-actions { grid-template-columns: 1fr; }
}

@media (max-height: 640px) and (orientation: landscape) {
  .supporter-pass-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: 13px; }
  .supporter-pass-shell { max-height: calc(100dvh - 12px); }
  .supporter-pass-header { min-height: 54px; padding: 8px 14px; }
  .supporter-pass-header h2 { font-size: 20px; }
  .supporter-pass-body { gap: 9px; padding: 10px 14px 12px; }
  .supporter-pass-hero,
  .supporter-pass-status,
  .supporter-pass-acknowledgement { padding: 9px 12px; }
  .supporter-pass-benefit { min-height: 82px; padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .supporter-pass-dialog *,
  .supporter-entry-action { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media (max-width: 680px) {
  .garage-brand-sub,
  .garage-profile-card .profile-actions,
  .garage-input-legend {
    display: none;
  }

  .garage-command-bar {
    gap: 8px;
  }

  .garage-balance-group {
    flex-direction: column;
  }

  .garage-collection-chip {
    display: none;
  }

  .garage-showcase {
    padding-left: 8px;
    padding-right: 8px;
  }

  .garage-canvas-wrap {
    width: min(100%, 570px);
  }

  .garage-nav-btn {
    width: 42px;
    flex-basis: 42px;
  }

  .garage-view-hint {
    display: none;
  }

  .garage-view-btn {
    padding: 0 9px;
  }

  .garage-bottom-bar {
    grid-template-columns: 105px 1fr;
  }

  .garage-race-action {
    width: 100%;
    min-width: 0;
  }
}

.garage-profile-card .profile-avatar-button {
  appearance: none;
  flex: 0 0 40px;
  margin: 0;
  color: #ecfeff;
  cursor: pointer;
}

.garage-profile-card .profile-avatar-button:hover {
  border-color: #67e8f9;
  box-shadow: 0 0 18px rgba(34, 211, 238, .34);
}

.garage-profile-card .profile-avatar-button:focus-visible {
  outline: 3px solid #fde047;
  outline-offset: 3px;
}

.garage-profile-sync-badge {
  width: max-content;
  margin-top: 2px;
  padding: 2px 6px;
  border: 1px solid rgba(103, 232, 249, .34);
  border-radius: 999px;
  color: #a5f3fc;
  background: rgba(8, 47, 73, .5);
  font: 900 11px/1.2 var(--font-ui);
  letter-spacing: .07em;
}

.garage-profile-sync-badge[data-state='offline'],
.garage-profile-sync-badge[data-state='conflict'] {
  border-color: rgba(251, 191, 36, .55);
  color: #fde68a;
  background: rgba(120, 53, 15, .38);
}

body.profile-center-open { overflow: hidden !important; }
.profile-center[hidden] { display: none !important; }
.profile-center {
  position: fixed;
  inset: 0;
  z-index: 21000;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #e8f7ff;
  font-family: var(--font-ui, system-ui, sans-serif);
}
.profile-center-backdrop { position: absolute; inset: 0; background: rgba(1, 7, 20, .82); backdrop-filter: blur(10px); }
.profile-center-panel {
  position: relative;
  width: min(980px, calc(100vw - 48px));
  max-height: min(820px, calc(100dvh - 48px));
  overflow: auto;
  border: 1px solid rgba(103, 232, 249, .42);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(4, 19, 39, .99), rgba(15, 23, 54, .99));
  box-shadow: 0 34px 100px rgba(0, 0, 0, .62), 0 0 42px rgba(34, 211, 238, .12);
}
.profile-center-header,
.profile-center-footer,
.profile-center-section-title,
.profile-center-identity,
.profile-center-inline-actions { display: flex; align-items: center; }
.profile-center-header { position: sticky; top: 0; z-index: 2; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid rgba(148, 163, 184, .18); background: rgba(4, 19, 39, .96); }
.profile-center-identity { gap: 14px; min-width: 0; }
.profile-center-avatar { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; overflow: hidden; border: 2px solid #22d3ee; border-radius: 50%; background: rgba(34, 211, 238, .12); font-size: 26px; }
.profile-center-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-center-kicker { color: #67e8f9; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.profile-center h2,.profile-center h3,.profile-center p { margin: 0; }
.profile-center h2 { margin-top: 3px; font-size: clamp(20px, 2.4vw, 30px); }
.profile-center-identity p { margin-top: 3px; color: #94a3b8; font-size: 12px; }
.profile-center-close { width: 46px; height: 46px; flex: 0 0 46px; border: 1px solid rgba(148, 163, 184, .35); border-radius: 12px; color: #fff; background: rgba(15, 23, 42, .78); font-size: 25px; cursor: pointer; }
.profile-center-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.profile-center-card { min-width: 0; padding: 15px; border: 1px solid rgba(148, 163, 184, .18); border-radius: 16px; background: rgba(7, 18, 38, .72); }
.profile-center-lightspeed,.profile-center-history { grid-column: 1 / -1; }
.profile-center-section-title { justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.profile-center-section-title h3 { color: #f8fafc; font-size: 14px; }
.profile-center-section-title > span { padding: 4px 7px; border-radius: 999px; color: #a5f3fc; background: rgba(8, 47, 73, .62); font-size: 9px; font-weight: 900; letter-spacing: .05em; }
.profile-center-facts,.profile-center-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 0; }
.profile-center-stats { grid-template-columns: repeat(5,minmax(0,1fr)); }
.profile-center-facts > div,.profile-center-stats > div { min-width: 0; padding: 9px; border-radius: 11px; background: rgba(15, 35, 61, .64); }
.profile-center dt { color: #94a3b8; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.profile-center dd { overflow-wrap: anywhere; margin: 4px 0 0; color: #f8fafc; font-size: 12px; font-weight: 800; }
.profile-center-sync p,.profile-center-rewards p { color: #cbd5e1; font-size: 12px; line-height: 1.55; }
.profile-center-sync small { display: block; margin-top: 7px; color: #94a3b8; font-size: 10px; }
.profile-center-inline-actions { flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.profile-center-inline-actions button,.profile-center-footer button,.profile-center-footer a { min-height: 45px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border: 1px solid rgba(103, 232, 249, .32); border-radius: 11px; color: #e0f2fe; background: rgba(8, 47, 73, .62); font: 800 11px/1.2 var(--font-ui); text-decoration: none; cursor: pointer; }
.profile-center-history ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.profile-center-history li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 10px; background: rgba(15, 35, 61, .52); color: #cbd5e1; font-size: 11px; }
.profile-center-history time { color: #64748b; }
.profile-center-footer { justify-content: flex-end; gap: 8px; padding: 0 16px 16px; }
.profile-center-live { min-height: 20px; padding: 0 18px 16px; color: #a5f3fc; font-size: 11px; }
.profile-center-live[data-state='error'] { color: #fda4af; }
.profile-center-live[data-state='success'] { color: #86efac; }
.profile-center :focus-visible { outline: 3px solid #fde047; outline-offset: 2px; }
@media (max-width: 760px) {
  .profile-center { padding: 10px; }
  .profile-center-panel { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .profile-center-body { grid-template-columns: 1fr; padding: 10px; }
  .profile-center-lightspeed,.profile-center-history { grid-column: auto; }
  .profile-center-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) { .profile-center-backdrop { backdrop-filter: none; } }

@media (prefers-reduced-motion: reduce) {
  .garage-ambient,
  .garage-spotlight,
  .garage-speed-lines,
  .garage-platform-ring {
    animation: none !important;
  }

  .garage-canvas-wrap:hover #vehicle-preview-canvas {
    transform: none;
  }
}

/* Page 3 Stats Banner */
.stage-stats-banner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto 16px auto;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(0, 240, 255, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

.stage-utility-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-category-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.category-title-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
  text-align: left;
}

.horizontal-snap-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px 16px 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.horizontal-snap-row::-webkit-scrollbar {
  height: 8px;
}
.horizontal-snap-row::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.3);
  border-radius: 4px;
}

.stage-row-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.row-nav-btn {
  background: rgba(8, 14, 24, 0.88);
  border: 1px solid rgba(196, 228, 255, 0.3);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  font-size: 16px;
  color: #37d8ff;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.row-nav-btn:hover {
  transform: scale(1.1);
  border-color: #37d8ff;
  box-shadow: 0 0 20px rgba(55, 216, 255, 0.45);
  color: #ffffff;
}

.row-nav-btn:active {
  transform: scale(0.95);
}

.horizontal-snap-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 4px 14px 4px;
  scroll-behavior: smooth;
  flex: 1;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.horizontal-snap-row::-webkit-scrollbar {
  display: none !important;
}

/* BOSS CARDS (HEIGHTENED PORTRAITS & CENTERED BADGES) */
.boss-card {
  flex: 0 0 210px;
  min-height: 360px;
  background: rgba(8, 14, 24, 0.85);
  border: 1px solid rgba(196, 228, 255, 0.22);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.boss-card:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: #37d8ff;
  box-shadow: 0 14px 32px rgba(55, 216, 255, 0.35);
}

.boss-card-image-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 1) 0%, rgba(15, 23, 42, 1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.boss-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s ease;
}

.boss-card:hover .boss-img {
  transform: scale(1.06);
}

.boss-level-tag {
  width: 100%;
  padding: 8px 10px;
  background: rgba(8, 14, 24, 0.95);
  border-bottom: 1px solid rgba(55, 216, 255, 0.3);
  color: #37d8ff;
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  z-index: 5;
  white-space: nowrap;
}

.boss-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.boss-theme-name {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.boss-diff-stars {
  font-size: 12px;
  color: #ffd700;
}

.boss-highscore {
  font-size: 11px;
  color: #94a3b8;
}

.btn-boss-start {
  width: 100%;
  margin-top: 6px;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(55, 216, 255, 0.95), rgba(25, 110, 190, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  color: #ffffff;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 20px rgba(55, 216, 255, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
}

.btn-boss-start:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45), 0 0 32px rgba(55, 216, 255, 0.4);
}

/* Embedded Stage Selection orientation controls */
.stage-orientation-subhead {
  width: 100%;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid rgba(126, 232, 255, 0.16);
  border-radius: 12px;
  background: rgba(5, 14, 29, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.footer-orientation-label {
  font-size: 14px;
  font-weight: 800;
  color: #37d8ff;
}

/* ==========================================================================
   FRONT DOOR WELCOME TITLE SCREEN (VNEXT CODEX STYLE)
   ========================================================================== */

.welcome-title-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  overflow-y: auto;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: linear-gradient(90deg, rgba(4, 8, 18, 0.95), rgba(4, 8, 18, 0.85)),
              linear-gradient(180deg, rgba(4, 8, 18, 0.85), rgba(4, 8, 18, 0.98)),
              #050a12;
  backdrop-filter: blur(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.welcome-title-overlay.is-hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-panel {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(300px, 0.9fr);
  width: min(960px, 95vw);
  max-height: 90vh;
  border: 1px solid rgba(196, 228, 255, 0.22);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(8, 14, 24, 0.94);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(18px);
}

@media (max-width: 820px) {
  .welcome-panel {
    grid-template-columns: 1fr;
    max-height: 92vh;
    overflow-y: auto;
  }

  .welcome-art {
    min-height: 180px;
    height: 200px;
  }
}

.welcome-art {
  position: relative;
  min-height: 440px;
  margin: 0;
  overflow: hidden;
  background: #07111c;
}

.welcome-art::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(4, 8, 18, 0), rgba(4, 8, 18, 0.52)),
              linear-gradient(180deg, rgba(4, 8, 18, 0), rgba(4, 8, 18, 0.3));
}

.welcome-art-img,
.welcome-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.welcome-content {
  display: grid;
  align-content: center;
  padding: 28px;
  text-align: left;
}

.welcome-kicker {
  color: #37d8ff;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.welcome-metadata-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.welcome-early-access-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid rgba(254, 206, 2, 0.58);
  border-radius: 999px;
  background: rgba(254, 206, 2, 0.1);
  color: #ffe169;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  box-shadow: 0 0 18px rgba(254, 206, 2, 0.08);
}

.welcome-early-access-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #fece02;
  box-shadow: 0 0 9px rgba(254, 206, 2, 0.9);
}

.welcome-status-message {
  min-height: 44px;
  margin: 12px 0 10px;
  color: #9db1c8;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.welcome-status-message:empty {
  display: none;
  min-height: 0;
  margin: 0;
}

.welcome-login-primary {
  min-height: 58px;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  text-align: center;
}

.welcome-login-main,
.welcome-login-sub {
  display: block;
  width: 100%;
  line-height: 1.15;
}

.welcome-login-main {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.welcome-login-sub {
  font-size: 12px;
  font-weight: 800;
}

.welcome-guest-notice {
  margin-top: -4px;
  padding: 7px 10px;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  background: rgba(255, 165, 0, 0.1);
  color: #ffcc00;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
}

.welcome-menu,
.new-game-actions {
  display: grid;
  gap: 10px;
}

.welcome-utility-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.welcome-utility-row .welcome-button {
  width: 100%;
  min-width: 0;
  padding-inline: 10px;
  font-size: 15px;
}

.welcome-utility-row .welcome-music-button {
  grid-column: 1 / -1;
  min-height: 44px;
}

.welcome-button {
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
  transition: transform 0.15s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-button.primary {
  background: linear-gradient(180deg, rgba(55, 216, 255, 0.95), rgba(25, 110, 190, 0.95));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32), 0 0 28px rgba(55, 216, 255, 0.22);
}

.welcome-button.quiet {
  color: #9db1c8;
  background: rgba(255, 255, 255, 0.035);
}

.welcome-button:active {
  transform: translateY(1px);
}

.new-game-panel {
  display: grid;
  gap: 10px;
}

.login-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  color: #37d8ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.welcome-input {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  padding: 0 14px;
  outline: none;
}

.welcome-input:focus {
  border-color: #37d8ff;
  box-shadow: 0 0 12px rgba(55, 216, 255, 0.4);
}


/* ===== Secret Daily Review stage (bottom row) ===== */
.stage-secret-section {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px dashed rgba(167, 139, 250, 0.35);
}
.stage-secret-section .category-title-bar {
  background: linear-gradient(90deg, rgba(88, 28, 135, 0.35), rgba(15, 23, 42, 0.2));
}
.boss-card-daily {
  border-color: rgba(167, 139, 250, 0.55) !important;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.25);
}
.boss-card-daily.is-locked {
  filter: saturate(0.45) brightness(0.88);
  cursor: not-allowed;
}
.boss-card-daily.is-locked:hover {
  transform: none;
}
.secret-card-art {
  position: relative;
}
.secret-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(2, 6, 23, 0.62);
  z-index: 4;
  pointer-events: none;
}
.secret-lock-icon {
  font-size: 36px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}
.secret-lock-text {
  font-size: 12px;
  font-weight: 800;
  color: #e9d5ff;
  background: rgba(76, 29, 149, 0.75);
  border: 1px solid rgba(216, 180, 254, 0.45);
  padding: 4px 10px;
  border-radius: 999px;
}
.boss-card-daily:not(.is-locked) .btn-boss-start {
  background: linear-gradient(180deg, rgba(192, 132, 252, 0.95), rgba(109, 40, 217, 0.95));
}
.rec-boss-card-secret {
  border-color: rgba(250, 204, 21, 0.65) !important;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.28);
}
.rec-boss-card-secret .boss-level-tag {
  background: linear-gradient(180deg, #fbbf24, #d97706);
  color: #1e1b4b;
}

/* ── World Leaderboard (bottom of stage select) ── */
.stage-leaderboard-panel {
  width: 100%;
  margin: 8px 0 24px;
  padding: 16px 18px 18px;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(8, 18, 40, 0.92), rgba(15, 23, 42, 0.88));
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stage-leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.stage-leaderboard-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #7dd3fc;
  letter-spacing: 0.2px;
}

.stage-leaderboard-sub {
  margin: 0 0 12px;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.65);
}

.btn-refresh-leaderboard {
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, 0.45);
  background: rgba(14, 116, 144, 0.45);
  color: #e0f2fe;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-refresh-leaderboard:hover {
  transform: scale(1.04);
  background: rgba(8, 145, 178, 0.55);
  border-color: #38bdf8;
}

.leaderboard-table-container {
  width: 100%;
  max-height: 320px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.55);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: #e2e8f0;
}

.leaderboard-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.96);
  color: #94a3b8;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
}

.leaderboard-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  vertical-align: middle;
}

.leaderboard-table tbody tr:hover td {
  background: rgba(14, 165, 233, 0.08);
}

.leaderboard-status-cell {
  text-align: center !important;
  padding: 18px 12px !important;
  color: rgba(226, 232, 240, 0.8);
  white-space: normal;
}

.leaderboard-status-cell.is-error {
  color: #fb7185 !important;
}

.leaderboard-score-cell {
  color: #38bdf8;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.leaderboard-rank-1 {
  color: #fbbf24;
  font-weight: 900;
}

.leaderboard-rank-2 {
  color: #cbd5e1;
  font-weight: 800;
}

.leaderboard-rank-3 {
  color: #fb923c;
  font-weight: 800;
}

@media (max-width: 640px) {
  .stage-leaderboard-title {
    font-size: 15px;
  }
  .leaderboard-table {
    font-size: 13px;
  }
  .leaderboard-table-container {
    max-height: 260px;
  }
}

/* ── Minnie starter gift overlay ── */
.minnie-gift-screen {
  z-index: 120;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.minnie-gift-card {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 22px;
  align-items: center;
  padding: 22px 24px;
  border-radius: 20px;
  background: linear-gradient(155deg, rgba(46, 16, 101, 0.92), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(216, 180, 254, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 40px rgba(168, 85, 247, 0.2);
}

.minnie-gift-portrait-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(250, 204, 21, 0.65);
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.28);
  background: #0f172a;
}

.minnie-gift-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.minnie-gift-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.minnie-gift-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #e9d5ff;
  text-transform: uppercase;
}

.minnie-gift-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: #fef3c7;
}

.minnie-gift-speech {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 700;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.55);
  border-left: 4px solid #fbbf24;
  padding: 12px 14px;
  border-radius: 0 12px 12px 0;
}

.minnie-gift-hint {
  margin: 0;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.75);
}

.minnie-gift-ok {
  margin-top: 6px;
  align-self: flex-start;
  min-width: 220px;
}

@media (max-width: 720px) {
  .minnie-gift-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .minnie-gift-portrait-wrap {
    max-width: 220px;
    margin: 0 auto;
  }
  .minnie-gift-copy {
    text-align: center;
    align-items: center;
  }
  .minnie-gift-speech {
    text-align: left;
  }
  .minnie-gift-ok {
    align-self: center;
  }
}

/* ── First-time How to Play ── */
body.how-to-play-open {
  overflow: hidden;
}

.how-to-play-screen {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: none;
  align-items: center;
  justify-content: center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 18% 18%, rgba(34, 211, 238, 0.18), transparent 34%),
    radial-gradient(circle at 86% 82%, rgba(139, 92, 246, 0.2), transparent 38%),
    rgba(2, 6, 23, 0.93);
  backdrop-filter: blur(14px);
}

.how-to-play-dialog {
  width: min(820px, 100%);
  max-height: min(720px, calc(100dvh - 32px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(103, 232, 249, 0.48);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(10, 25, 48, 0.98), rgba(17, 18, 48, 0.98));
  color: #f8fafc;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.62),
    0 0 44px rgba(34, 211, 238, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.how-to-play-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 14px;
}

.how-to-play-kicker,
.how-to-play-step-label {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.how-to-play-header h2 {
  margin: 3px 0 2px;
  font: 900 clamp(28px, 5vw, 42px)/1 var(--font-ui);
}

.how-to-play-header p {
  margin: 6px 0 0;
  color: #a9bdd3;
  font-size: 14px;
}

.how-to-play-skip,
.how-to-play-button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 12px;
  color: #f8fafc;
  background: rgba(148, 163, 184, 0.1);
  font: 800 15px/1 var(--font-ui);
  cursor: pointer;
}

.how-to-play-skip {
  flex: 0 0 auto;
  padding: 0 16px;
}

.how-to-play-progress-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 26px 12px;
}

.how-to-play-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
}

.how-to-play-progress > span {
  width: 20%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #818cf8, #c084fc);
  transition: width 180ms ease;
}

.how-to-play-progress-text {
  min-width: 42px;
  color: #c4d8ec;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.how-to-play-steps {
  min-height: 0;
  overflow: auto;
  padding: 8px 26px 20px;
  overscroll-behavior: contain;
}

.how-to-play-step {
  min-height: 280px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(124, 58, 237, 0.09)),
    rgba(15, 23, 42, 0.72);
  animation: how-to-play-enter 180ms ease-out;
}

.how-to-play-step[hidden] {
  display: none !important;
}

.how-to-play-step-icon {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(103, 232, 249, 0.38);
  border-radius: 24px;
  background: rgba(8, 47, 73, 0.68);
  font-size: 42px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.how-to-play-step h3 {
  margin: 7px 0 10px;
  color: #fff;
  font: 900 clamp(22px, 4vw, 32px)/1.15 var(--font-ui);
  outline: none;
}

.how-to-play-step p {
  margin: 0;
  color: #d3dfec;
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.58;
}

.how-to-play-step .how-to-play-note {
  margin-top: 10px;
  color: #9fb5ca;
  font-size: 13px;
}

.how-to-play-boundary {
  width: fit-content;
  margin-top: 14px !important;
  padding: 9px 12px;
  border-left: 3px solid #fbbf24;
  border-radius: 0 10px 10px 0;
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a !important;
  font-size: 14px !important;
  font-weight: 800;
}

.how-to-play-lane-demo {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.how-to-play-lane-demo[data-tutorial-orientation="portrait"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.how-to-play-lane-demo[data-tutorial-orientation="landscape"] {
  grid-template-columns: 1fr;
}

.how-to-play-lane-demo span {
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(103, 232, 249, 0.3);
  border-radius: 8px;
  background: rgba(8, 145, 178, 0.14);
  color: #a5f3fc;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.how-to-play-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 26px 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.36);
}

.how-to-play-button {
  min-width: 132px;
  padding: 0 20px;
}

.how-to-play-button.primary {
  border-color: rgba(103, 232, 249, 0.7);
  background: linear-gradient(135deg, #0891b2, #4f46e5);
  box-shadow: 0 10px 24px rgba(34, 211, 238, 0.16);
}

.how-to-play-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.how-to-play-skip:focus-visible,
.how-to-play-button:focus-visible,
#welcome-how-to-play-btn:focus-visible {
  outline: 3px solid #facc15;
  outline-offset: 3px;
}

@keyframes how-to-play-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 620px) {
  .welcome-utility-row {
    gap: 8px;
  }

  .welcome-utility-row .welcome-button {
    font-size: 14px;
  }

  .how-to-play-screen {
    align-items: stretch;
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .how-to-play-dialog {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 18px;
  }

  .how-to-play-header {
    padding: 18px 18px 10px;
  }

  .how-to-play-header h2 {
    font-size: 30px;
  }

  .how-to-play-header p {
    font-size: 12px;
  }

  .how-to-play-progress-wrap {
    padding: 0 18px 10px;
  }

  .how-to-play-steps {
    padding: 6px 18px 14px;
  }

  .how-to-play-step {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
  }

  .how-to-play-step-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    font-size: 30px;
  }

  .how-to-play-actions {
    padding: 12px 18px 18px;
  }

  .how-to-play-button {
    min-width: 0;
    flex: 1 1 0;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  .how-to-play-screen {
    align-items: stretch;
    padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .how-to-play-dialog {
    width: min(900px, 100%);
    max-height: calc(100dvh - 12px);
    border-radius: 16px;
  }

  .how-to-play-header {
    align-items: center;
    padding: 10px 16px 6px;
  }

  .how-to-play-header h2 {
    display: inline;
    margin-right: 8px;
    font-size: 25px;
  }

  .how-to-play-header p {
    display: inline;
    font-size: 12px;
  }

  .how-to-play-kicker {
    display: none;
  }

  .how-to-play-progress-wrap {
    padding: 0 16px 7px;
  }

  .how-to-play-steps {
    padding: 4px 16px 8px;
  }

  .how-to-play-step {
    min-height: 0;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
    padding: 12px 16px;
  }

  .how-to-play-step-icon {
    width: 54px;
    height: 54px;
    border-radius: 15px;
    font-size: 27px;
  }

  .how-to-play-step h3 {
    margin: 2px 0 4px;
    font-size: 20px;
  }

  .how-to-play-step p {
    font-size: 14px;
    line-height: 1.38;
  }

  .how-to-play-lane-demo[data-tutorial-orientation="portrait"] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    margin-top: 7px;
  }

  .how-to-play-lane-demo[data-tutorial-orientation="landscape"] {
    grid-template-columns: 1fr !important;
    margin-top: 7px;
  }

  .how-to-play-lane-demo span {
    min-height: 24px;
  }

  .how-to-play-actions {
    padding: 7px 16px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .how-to-play-step {
    animation: none !important;
  }

  .how-to-play-progress > span,
  .how-to-play-button,
  .how-to-play-skip {
    transition: none !important;
  }
}

/* ==========================================================================
   PHASE 6 — COMPACT STAGE ROUTE + WORLD RANK
   ========================================================================== */

body.stage-select-active,
body.world-rank-open {
  overflow: hidden;
}

body.stage-select-active .menu-screen-unified {
  overflow: hidden !important;
  padding: 12px 16px !important;
}

#menu-stage-view.active {
  width: min(100%, 1240px);
  max-width: 1240px;
  height: calc(100dvh - 24px);
  min-height: 560px;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
  overflow: hidden;
}

#menu-stage-view.active > .stage-stats-banner,
#menu-stage-view.active > .recommendations-box,
#menu-stage-view.active > .stage-category-section,
#menu-stage-view.active > .menu-actions-row {
  display: none !important;
}

.stage-world-rank-btn,
.garage-world-rank-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(50, 199, 232, 0.5);
  border-radius: 11px;
  color: #e7faff;
  background: linear-gradient(135deg, rgba(25, 95, 149, 0.75), rgba(26, 42, 80, 0.92));
  box-shadow: 0 8px 22px rgba(25, 131, 181, 0.16);
  font: 800 11px/1 var(--font-ui);
  letter-spacing: 0.06em;
}

.stage-world-rank-btn {
  justify-self: end;
}

.stage-world-rank-btn:hover,
.garage-world-rank-action:hover {
  border-color: #32c7e8;
  box-shadow: 0 0 22px rgba(50, 199, 232, 0.28);
  transform: translateY(-1px);
}

.garage-bottom-bar {
  grid-template-columns: minmax(105px, 0.42fr) auto minmax(135px, 0.5fr) minmax(220px, 0.8fr);
}

.garage-world-rank-action {
  justify-self: stretch;
  padding: 0 13px;
}

.stage-route-shell {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 9px;
  padding: 13px;
  overflow: hidden;
  border: 1px solid rgba(50, 199, 232, 0.24);
  border-radius: 20px;
  background:
    radial-gradient(circle at 12% 0%, rgba(50, 199, 232, 0.17), transparent 32%),
    radial-gradient(circle at 88% 100%, rgba(57, 120, 246, 0.16), transparent 36%),
    linear-gradient(145deg, rgba(12, 24, 47, 0.97), rgba(9, 17, 34, 0.98));
  box-shadow: 0 18px 48px rgba(1, 7, 19, 0.4);
}

.stage-route-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  text-align: left;
}

.stage-route-kicker,
.leaderboard-kicker {
  display: block;
  color: #7ee8ff;
  font: 800 9px/1.1 var(--font-ui);
  letter-spacing: 0.18em;
}

.stage-route-summary h2 {
  margin: 3px 0 2px;
  color: #f7faff;
  font: 900 20px/1.1 var(--font-ui);
}

.stage-route-summary p {
  margin: 0;
  color: #a8b7cf;
  font-size: 11px;
}

.stage-route-score-card {
  min-width: 160px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 2px 10px;
  padding: 9px 12px;
  border: 1px solid rgba(254, 206, 2, 0.28);
  border-radius: 13px;
  color: #a8b7cf;
  background: rgba(6, 15, 31, 0.7);
  text-align: left;
}

.stage-route-score-card span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.stage-route-score-card strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: #fece02;
  font-size: 23px;
}

.stage-route-score-card small {
  font-size: 9px;
}

.stage-chapter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.stage-chapter-tabs::-webkit-scrollbar,
.stage-route-track::-webkit-scrollbar {
  display: none;
}

.stage-chapter-tab {
  flex: 0 0 auto;
  min-height: 31px;
  padding: 0 12px;
  border: 1px solid rgba(168, 183, 207, 0.2);
  border-radius: 999px;
  color: #a8b7cf;
  background: rgba(255, 255, 255, 0.035);
  font: 800 9px/1 var(--font-ui);
  letter-spacing: 0.06em;
}

.stage-chapter-tab.active {
  color: #071927;
  border-color: #7ee8ff;
  background: linear-gradient(135deg, #7ee8ff, #32c7e8);
  box-shadow: 0 5px 16px rgba(50, 199, 232, 0.18);
}

.stage-route-row {
  min-height: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: stretch;
  gap: 8px;
}

.stage-route-nav {
  align-self: center;
  width: 38px;
  height: 66px;
  border: 1px solid rgba(50, 199, 232, 0.28);
  border-radius: 12px;
  color: #7ee8ff;
  background: rgba(9, 19, 37, 0.9);
  font: 300 32px/1 var(--font-ui);
}

.stage-route-nav:hover {
  border-color: #32c7e8;
  background: rgba(20, 61, 95, 0.9);
}

.stage-route-track {
  min-width: 0;
  min-height: 0;
  display: flex;
  gap: 11px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.stage-route-card {
  position: relative;
  flex: 0 0 clamp(170px, 17vw, 210px);
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(105px, 1fr) auto;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid rgba(168, 183, 207, 0.2);
  border-radius: 16px;
  color: #f7faff;
  background: rgba(10, 19, 36, 0.96);
  box-shadow: 0 9px 24px rgba(1, 7, 19, 0.32);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.stage-route-card:hover,
.stage-route-card:focus-visible {
  transform: translateY(-3px);
  border-color: #32c7e8;
  box-shadow: 0 13px 28px rgba(1, 7, 19, 0.45), 0 0 20px rgba(50, 199, 232, 0.16);
}

.stage-route-card.has-ranked-score {
  border-color: rgba(56, 217, 169, 0.55);
}

.stage-route-card.has-assisted-score {
  border-color: rgba(254, 206, 2, 0.48);
}

.stage-route-card.is-locked {
  /* The gate message is sufficient; keep locked stage artwork fully visible. */
  filter: none;
}

.stage-route-art {
  position: relative;
  min-height: 0;
  display: block;
  overflow: hidden;
  background: #10182b;
}

.stage-route-art::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 55%;
  background: linear-gradient(transparent, rgba(7, 15, 29, 0.92));
}

.stage-route-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 220ms ease;
}

.stage-route-card:hover .stage-route-art img {
  transform: scale(1.045);
}

.stage-route-number,
.stage-route-state {
  position: absolute;
  top: 8px;
  z-index: 2;
  border-radius: 999px;
  font: 900 8px/1 var(--font-ui);
  letter-spacing: 0.08em;
}

.stage-route-number {
  left: 8px;
  min-width: 28px;
  padding: 6px 7px;
  color: #071927;
  background: #7ee8ff;
  text-align: center;
}

.stage-route-state {
  right: 8px;
  padding: 6px 8px;
  color: #d7e2f3;
  background: rgba(8, 14, 24, 0.82);
  border: 1px solid rgba(168, 183, 207, 0.22);
}

.has-ranked-score .stage-route-state {
  color: #06291f;
  background: #38d9a9;
}

.has-assisted-score .stage-route-state {
  color: #2e2100;
  background: #fece02;
}

.stage-route-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  padding: 8px 10px 7px;
}

.stage-route-copy small {
  grid-column: 1 / -1;
  color: #7ee8ff;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.stage-route-copy strong {
  overflow: hidden;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.stage-route-copy > span {
  grid-column: 1;
  overflow: hidden;
  color: #a8b7cf;
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.stage-route-copy b {
  grid-column: 1;
  width: 100%;
  margin-top: 3px;
  padding-top: 4px;
  overflow: hidden;
  border-top: 1px solid rgba(168, 183, 207, 0.12);
  color: #fece02;
  font-size: 8px;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.stage-route-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #a8b7cf;
  font-size: 8px;
  text-align: left;
}

.stage-route-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.route-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
}

.route-dot-ranked { background: #38d9a9; }
.route-dot-assisted { background: #fece02; }
.route-dot-new { background: #64748b; }

.world-rank-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(2, 7, 19, 0.86);
  backdrop-filter: blur(14px);
}

.world-rank-overlay.is-open {
  display: grid;
}

.world-rank-overlay .stage-leaderboard-panel {
  width: min(1080px, 100%);
  height: min(760px, calc(100dvh - 36px));
  max-height: calc(100dvh - 36px);
  margin: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid rgba(50, 199, 232, 0.38);
  border-radius: 22px;
  background:
    radial-gradient(circle at 10% 0%, rgba(50, 199, 232, 0.16), transparent 32%),
    linear-gradient(155deg, rgba(12, 24, 47, 0.99), rgba(7, 14, 29, 0.99));
}

.stage-leaderboard-header {
  margin: 0;
}

.leaderboard-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-world-rank {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 93, 115, 0.4);
  border-radius: 10px;
  color: #ff9baa;
  background: rgba(80, 21, 39, 0.5);
}

.leaderboard-verification-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(254, 206, 2, 0.22);
  border-radius: 12px;
  background: rgba(78, 54, 2, 0.18);
  text-align: left;
}

.leaderboard-verification-notice.is-verified-mode {
  border-color: rgba(77, 226, 176, 0.28);
  background: rgba(20, 91, 71, 0.2);
}

.leaderboard-verification-notice p {
  margin: 0;
  color: #d6deea;
  font-size: 10px;
}

.verification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font: 900 7px/1 var(--font-ui);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.verification-badge.is-unverified {
  color: #2d2100;
  border: 1px solid rgba(254, 206, 2, 0.7);
  background: #fece02;
}

.verification-badge.is-verified {
  color: #06281d;
  border: 1px solid rgba(77, 226, 176, 0.8);
  background: #4de2b0;
}

.verification-badge.is-community {
  color: #062834;
  border: 1px solid rgba(34, 211, 238, 0.82);
  background: #67e8f9;
}

.leaderboard-player-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.leaderboard-player-card > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(168, 183, 207, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
}

.leaderboard-player-card span {
  color: #8fa3bf;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.leaderboard-player-card strong {
  overflow: hidden;
  color: #f7faff;
  font-size: 17px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.leaderboard-player-card > div:first-child strong {
  color: #fece02;
  font-size: 22px;
}

.leaderboard-table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f7faff;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.leaderboard-table-title span {
  color: #8fa3bf;
  letter-spacing: 0;
}

.world-rank-overlay .leaderboard-table-container {
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.world-rank-overlay .leaderboard-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.leaderboard-table tbody tr.is-current-player {
  background: rgba(50, 199, 232, 0.13);
  box-shadow: inset 3px 0 0 #32c7e8;
}

.leaderboard-table tbody tr.is-current-player td {
  color: #f7faff;
}

@media (max-width: 980px) {
  .garage-bottom-bar {
    grid-template-columns: minmax(95px, 0.45fr) minmax(125px, 0.55fr) minmax(200px, 1fr);
  }

  .garage-input-legend {
    display: none;
  }

  .stage-route-card {
    flex-basis: 185px;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  body.stage-select-active .menu-screen-unified {
    padding: 6px 8px !important;
  }

  #menu-stage-view.active {
    height: calc(100dvh - 14px);
    min-height: 0;
    gap: 5px;
  }

  #menu-stage-view .stage-orientation-subhead {
    min-height: 36px;
    padding: 3px 8px;
  }

  #menu-stage-view .footer-orientation-label {
    font-size: 9px;
  }

  #menu-stage-view .orientation-btn {
    min-height: 28px;
    padding: 0 8px;
    font-size: 8px;
  }

  .stage-route-shell {
    gap: 4px;
    padding: 6px;
    border-radius: 12px;
  }

  .stage-route-summary h2 {
    margin: 1px 0;
    font-size: 13px;
  }

  .stage-route-summary p,
  .stage-route-kicker {
    display: none;
  }

  .stage-route-score-card {
    min-width: 135px;
    padding: 4px 8px;
  }

  .stage-route-score-card strong {
    font-size: 17px;
  }

  .stage-chapter-tab {
    min-height: 25px;
    padding: 0 9px;
    font-size: 7px;
  }

  .stage-route-row {
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    gap: 4px;
  }

  .stage-route-nav {
    width: 30px;
    height: 48px;
    font-size: 24px;
  }

  .stage-route-track {
    gap: 7px;
  }

  .stage-route-card {
    flex-basis: 175px;
    grid-template-rows: minmax(64px, 1fr) auto;
    border-radius: 10px;
  }

  .stage-route-copy {
    padding: 4px 7px 5px;
  }

  .stage-route-copy strong {
    font-size: 10px;
  }

  .stage-route-copy > span,
  .stage-route-copy b {
    font-size: 7px;
  }

  .stage-route-legend {
    min-height: 20px;
    font-size: 7px;
  }

  .stage-route-legend span {
    display: none;
  }

  .garage-bottom-bar {
    grid-template-columns: 90px minmax(115px, 0.65fr) minmax(170px, 1fr) !important;
  }

  .garage-world-rank-action {
    display: inline-flex;
    min-height: 34px;
    font-size: 8px;
  }

  .world-rank-overlay {
    padding: 5px;
  }

  .world-rank-overlay .stage-leaderboard-panel {
    width: 100%;
    height: calc(100dvh - 10px);
    max-height: calc(100dvh - 10px);
    gap: 4px;
    padding: 7px;
    border-radius: 12px;
  }

  .leaderboard-verification-notice {
    padding: 4px 7px;
  }

  .leaderboard-player-card > div {
    padding: 5px 7px;
  }

  .leaderboard-player-card strong {
    font-size: 12px;
  }
}

@media (max-width: 640px) and (orientation: portrait) {
  #menu-stage-view.active {
    height: calc(100dvh - 24px);
    min-height: 0;
  }

  .stage-route-summary p {
    display: none;
  }

  .stage-route-summary h2 {
    font-size: 14px;
  }

  .stage-route-score-card {
    min-width: 120px;
  }

  .stage-route-row {
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    gap: 4px;
  }

  .stage-route-nav {
    width: 28px;
    height: 52px;
    font-size: 23px;
  }

  .stage-route-card {
    flex-basis: 168px;
  }

  .stage-route-legend span {
    display: none;
  }

  .leaderboard-player-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .leaderboard-table th:nth-child(3),
  .leaderboard-table td:nth-child(3) {
    display: none;
  }
}

/* ==========================================================================
   PHASE 7.1 — SMALL-PHONE RELEASE STABILIZATION
   Keep the front door actionable in portrait and move feedback off the CTA.
   ========================================================================== */

@media (max-width: 820px) and (orientation: portrait) {
  .welcome-title-overlay {
    place-items: start center;
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .welcome-panel {
    width: 100%;
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
    grid-template-rows: minmax(140px, 32dvh) auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .welcome-panel .welcome-art {
    min-height: 0;
    height: 32dvh;
    max-height: 240px;
  }

  .welcome-content {
    align-content: start;
    padding: 18px;
  }

  .garage-hero-view {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    height: auto !important;
    min-height: 0 !important;
    grid-template-rows: auto auto auto;
    overflow: visible;
    flex: 0 0 auto;
  }

  .garage-command-bar,
  .garage-showroom-shell,
  .garage-showcase,
  .garage-console,
  .garage-bottom-bar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .garage-command-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .garage-brand-title {
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
  }

  .garage-showroom-shell {
    height: auto;
    min-height: 742px;
    display: flex;
    flex-direction: column;
  }

  .garage-showcase {
    min-height: 340px;
  }

  .garage-vehicle-stage {
    height: 235px;
    min-width: 0;
  }

  .garage-canvas-wrap {
    width: min(calc(100% - 96px), 570px);
    height: auto;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 12 / 7;
  }

  .garage-console {
    min-height: 390px;
    grid-template-columns: minmax(0, 1fr);
  }

  .garage-tab-panels,
  .garage-tab-panel {
    width: 100%;
    min-width: 0;
  }

  .garage-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .garage-tab {
    min-width: 0;
    padding: 0 4px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
  }

  .garage-car-heading,
  .garage-car-heading > div,
  .garage-progress-card,
  .garage-progress-copy > * {
    min-width: 0;
  }

  .garage-car-name {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    font-size: clamp(18px, 6vw, 24px);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .garage-progress-card {
    overflow: hidden;
  }

  .garage-bottom-bar {
    grid-template-columns: 62px 92px minmax(0, 1fr) !important;
    gap: 6px;
    padding: 6px;
  }

  .garage-secondary-action,
  .garage-world-rank-action,
  .garage-race-action {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0 7px;
    font-size: 9px;
  }

  .garage-secondary-action span:last-child {
    display: none;
  }
}

/* ==========================================================================
   ECONOMY V3 — SPECIAL VEHICLE MARKET
   Purchasable vehicles live on their own page; the main Garage stays focused
   on starter and 3-star boss rewards.
   ========================================================================== */

.garage-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.garage-bottom-bar {
  grid-template-columns:
    minmax(105px, 0.42fr)
    minmax(180px, 0.62fr)
    auto
    minmax(135px, 0.5fr)
    minmax(220px, 0.8fr);
}

.garage-special-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.34), transparent 36%),
    linear-gradient(135deg, #ff4f93 0%, #9747ff 48%, #2f8dff 100%);
  box-shadow:
    0 10px 25px rgba(151, 71, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  font-family: var(--font-ui);
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.garage-special-action:hover {
  filter: saturate(1.14) brightness(1.08);
  transform: translateY(-2px);
  box-shadow:
    0 13px 30px rgba(151, 71, 255, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.garage-special-action-icon {
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 25px;
  border-radius: 8px;
  color: #fff6b8;
  background: rgba(6, 12, 31, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.garage-special-action > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.garage-special-action strong {
  font-size: 12px;
  font-weight: 900;
}

.garage-special-action small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.garage-special-action:focus-visible,
.special-vehicle-card:focus-visible,
.special-vehicle-equip-action:focus-visible {
  outline: 2px solid var(--garage-yellow);
  outline-offset: 2px;
}

.special-vehicles-view {
  --garage-ink: #10182b;
  --garage-road: #18243b;
  --garage-panel: rgba(13, 23, 42, 0.92);
  --garage-panel-soft: rgba(24, 36, 59, 0.76);
  --garage-cyan: #32c7e8;
  --garage-blue: #3978f6;
  --garage-mint: #38d9a9;
  --garage-yellow: #fece02;
  --garage-coral: #ff5d73;
  --garage-text: #f7faff;
  --garage-muted: #a8b7cf;
  width: 100%;
  max-width: 1920px;
  height: calc(100dvh - 34px);
  min-height: 620px;
  margin: 0 auto;
  flex-direction: column;
  gap: 12px;
  color: var(--garage-text);
}

.menu-view.special-vehicles-view.active {
  width: min(100%, 1540px) !important;
  max-width: 1540px !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: stretch !important;
}

body.special-vehicles-active {
  overflow: hidden;
}

body.special-vehicles-active .menu-screen-unified {
  overflow: hidden !important;
  padding: 12px 16px !important;
}

.special-vehicles-command-bar {
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1fr) minmax(210px, 0.65fr);
}

.special-vehicles-brand-mark {
  background: linear-gradient(145deg, #ff4f93, #9747ff 50%, #2f8dff);
  box-shadow: 0 10px 28px rgba(151, 71, 255, 0.32);
}

.special-vehicles-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.special-vehicles-heading span {
  color: #ffdc69;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.special-vehicles-heading strong {
  color: var(--garage-muted);
  font-size: 9px;
  font-weight: 700;
}

.special-vehicles-shell {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.62fr);
  gap: 12px;
}

.special-vehicles-showcase,
.special-vehicles-console {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(168, 183, 207, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 48% 18%, rgba(151, 71, 255, 0.15), transparent 38%),
    linear-gradient(145deg, rgba(13, 27, 52, 0.98), rgba(7, 18, 36, 0.98));
  box-shadow: 0 18px 48px rgba(1, 7, 19, 0.42);
  overflow: hidden;
}

.special-vehicles-showcase {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 16px 18px 10px;
}

.special-vehicles-premium-tag {
  color: #241800;
  background: linear-gradient(135deg, #ffe36a, #ffb52e);
}

.special-vehicle-canvas-wrap {
  background:
    radial-gradient(ellipse at 50% 72%, rgba(151, 71, 255, 0.17), transparent 43%),
    radial-gradient(circle at 50% 30%, rgba(50, 199, 232, 0.09), transparent 38%);
}

.special-vehicle-state-badge {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: 16%;
  min-width: 160px;
  padding: 8px 16px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 220, 105, 0.35);
  border-radius: 999px;
  color: #ffe36a;
  background: rgba(6, 12, 31, 0.86);
  box-shadow: 0 12px 28px rgba(2, 6, 18, 0.4);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-align: center;
  backdrop-filter: blur(10px);
}

.special-vehicle-state-badge.is-owned {
  border-color: rgba(60, 215, 177, 0.42);
  color: var(--garage-mint);
}

.special-vehicles-console {
  display: flex;
  flex-direction: column;
  padding: 18px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(60, 215, 177, 0.42) rgba(168, 183, 207, 0.08);
  overscroll-behavior: contain;
}

.special-vehicles-console::-webkit-scrollbar {
  width: 6px;
}

.special-vehicles-console::-webkit-scrollbar-track {
  background: rgba(168, 183, 207, 0.08);
}

.special-vehicles-console::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(60, 215, 177, 0.42);
}

.special-market-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.special-market-heading h2 {
  margin: 0;
  color: #fff;
  font: 900 clamp(22px, 2vw, 31px)/1 var(--font-ui);
}

.special-market-heading p {
  margin: 7px 0 0;
  color: var(--garage-muted);
  font-size: 10px;
}

.special-owned-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 220, 105, 0.32);
  border-radius: 999px;
  color: #ffe36a;
  background: rgba(255, 220, 105, 0.08);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.special-owned-badge.is-owned {
  border-color: rgba(60, 215, 177, 0.35);
  color: var(--garage-mint);
  background: rgba(60, 215, 177, 0.08);
}

.special-vehicle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
}

.special-vehicle-card {
  min-width: 0;
  min-height: 86px;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid rgba(168, 183, 207, 0.15);
  border-radius: 14px;
  color: var(--garage-text);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.special-vehicle-card:hover,
.special-vehicle-card.is-current {
  border-color: rgba(151, 71, 255, 0.65);
  background: linear-gradient(135deg, rgba(255, 79, 147, 0.08), rgba(47, 141, 255, 0.1));
  transform: translateY(-1px);
}

.special-vehicle-card.is-owned {
  box-shadow: inset 0 0 0 1px rgba(60, 215, 177, 0.18);
}

.special-vehicle-card-art {
  width: 70px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.3));
}

.special-vehicle-card-copy {
  min-width: 0;
}

.special-vehicle-card-copy strong,
.special-vehicle-card-copy small,
.special-vehicle-card-copy b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.special-vehicle-card-copy strong {
  font-size: 10px;
}

.special-vehicle-card-copy small {
  margin-top: 4px;
  color: var(--garage-muted);
  font-size: 8px;
}

.special-vehicle-card-copy b {
  margin-top: 6px;
  color: #ffdc69;
  font-size: 9px;
}

.special-vehicle-card.is-owned .special-vehicle-card-copy b {
  color: var(--garage-mint);
}

.special-market-price-card {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(168, 183, 207, 0.15);
  border-radius: 14px;
  background: rgba(3, 10, 24, 0.42);
}

.special-income-bonus-card {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(104, 255, 177, 0.3);
  border-radius: 13px;
  background:
    radial-gradient(circle at 85% 20%, rgba(104, 255, 177, 0.13), transparent 38%),
    rgba(3, 24, 24, 0.5);
}

.special-income-bonus-card span,
.special-income-bonus-card strong,
.special-income-bonus-card small {
  display: block;
}

.special-income-bonus-card span {
  color: #72f5bd;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.special-income-bonus-card strong {
  margin-top: 3px;
  color: #6effb1;
  font: 900 22px/1 var(--font-ui);
}

.special-income-bonus-card small {
  margin-top: 4px;
  color: var(--garage-muted);
  font-size: 8px;
  line-height: 1.4;
}

.special-income-bonus-card-command {
  width: min(100%, 560px);
  min-height: 48px;
  margin-top: 0;
  padding: 6px 14px;
  display: grid;
  grid-template-columns: max-content max-content;
  grid-template-areas:
    "label value"
    "detail detail";
  align-content: center;
  justify-content: center;
  column-gap: 10px;
  text-align: center;
}

.special-income-bonus-card-command span {
  grid-area: label;
  align-self: center;
}

.special-income-bonus-card-command strong {
  grid-area: value;
  align-self: center;
  margin-top: 0;
  font-size: 20px;
}

.special-income-bonus-card-command small {
  grid-area: detail;
  margin-top: 2px;
  white-space: nowrap;
}

.special-market-price-card span,
.special-market-price-card strong,
.special-market-price-card small {
  display: block;
}

.special-market-price-card span {
  color: var(--garage-muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.special-market-price-card strong {
  margin-top: 4px;
  color: #ffdc69;
  font: 900 clamp(22px, 2vw, 30px)/1 var(--font-ui);
}

.special-market-price-card small {
  margin-top: 6px;
  color: rgba(168, 183, 207, 0.72);
  font-size: 8px;
}

.special-market-progress {
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(168, 183, 207, 0.12);
}

.special-market-progress span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff4f93, #9747ff 52%, #3cd7b1);
  transition: width 0.24s ease;
}

.special-vehicle-paint-panel {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(49, 198, 236, 0.2);
  border-radius: 13px;
  background: rgba(5, 15, 32, 0.52);
}

.special-vehicle-paint-heading,
.special-vehicle-paint-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.special-vehicle-paint-heading strong {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}

.special-vehicle-color-grid {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.special-vehicle-color-grid .color-swatch-btn {
  min-height: 27px;
}

.special-vehicle-paint-summary {
  margin-top: 7px;
  color: var(--garage-muted);
  font-size: 8px;
}

.special-vehicle-paint-summary strong {
  color: #ffdc69;
}

.special-vehicle-paint-action {
  width: 100%;
  min-height: 31px;
  margin-top: 7px;
  border: 1px solid rgba(49, 198, 236, 0.42);
  border-radius: 9px;
  color: #061326;
  background: linear-gradient(135deg, var(--garage-cyan), var(--garage-mint));
  font: 900 9px/1 var(--font-ui);
  cursor: pointer;
}

.special-vehicle-paint-action:disabled {
  color: var(--garage-muted);
  background: rgba(168, 183, 207, 0.08);
  cursor: not-allowed;
}

.special-vehicle-notice {
  min-height: 30px;
  margin-top: 8px;
}

.special-vehicle-notice:empty {
  display: none;
}

.special-market-actions {
  flex: 0 0 auto;
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.special-vehicle-primary-action {
  margin-top: 0;
  color: #081326;
  background: linear-gradient(135deg, #ffdc69, #ff9f43);
}

.special-vehicle-primary-action.is-owned {
  background: linear-gradient(135deg, var(--garage-cyan), var(--garage-mint));
}

.special-vehicle-equip-action {
  min-height: 39px;
  border: 1px solid rgba(104, 255, 177, 0.42);
  border-radius: 11px;
  color: #effff6;
  background: linear-gradient(135deg, rgba(13, 208, 125, 0.42), rgba(8, 108, 112, 0.42));
  font: 800 10px/1 var(--font-ui);
  cursor: pointer;
}

.special-vehicle-equip-action:hover {
  color: #fff;
  background: linear-gradient(135deg, rgba(13, 208, 125, 0.62), rgba(8, 108, 112, 0.58));
}

.special-vehicle-equip-action:disabled {
  opacity: 0.58;
  cursor: default;
}

.special-vehicles-bottom-bar {
  position: relative;
  z-index: 30;
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(130px, 0.4fr) minmax(280px, 1fr) minmax(210px, 0.62fr);
  align-items: center;
  gap: 12px;
  padding: 7px;
  border: 1px solid rgba(168, 183, 207, 0.16);
  border-radius: 17px;
  background: rgba(10, 19, 36, 0.92);
  box-shadow: 0 14px 36px rgba(1, 7, 19, 0.32);
}

.special-vehicles-stage-action {
  justify-self: stretch;
  position: relative;
  overflow: hidden;
  min-height: 42px;
  margin-top: 0;
  color: #effff6;
  border: 1px solid rgba(104, 255, 177, 0.58);
  background:
    radial-gradient(circle at 28% 18%, rgba(192, 255, 177, 0.34), transparent 38%),
    linear-gradient(135deg, rgba(13, 208, 125, 0.72), rgba(6, 151, 113, 0.64) 52%, rgba(8, 108, 112, 0.68)),
    rgba(4, 35, 30, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 255, 153, 0.16),
    0 0 18px rgba(24, 235, 139, 0.16),
    0 9px 26px rgba(4, 165, 105, 0.24);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  text-shadow: 0 1px 10px rgba(186, 255, 216, 0.5);
}

.special-vehicles-bottom-bar p {
  margin: 0;
  color: var(--garage-muted);
  font-size: 9px;
  text-align: center;
}

.special-vehicles-disclaimer {
  margin-left: 3px;
  color: rgba(255, 220, 105, 0.82);
  font-size: 8px;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .garage-bottom-bar {
    grid-template-columns:
      minmax(90px, 0.4fr)
      minmax(145px, 0.58fr)
      minmax(125px, 0.5fr)
      minmax(190px, 0.78fr);
  }

  .garage-input-legend {
    display: none;
  }

  .special-vehicles-command-bar {
    grid-template-columns: minmax(230px, 0.9fr) minmax(250px, 1fr) minmax(180px, 0.65fr);
  }

  .special-vehicles-shell {
    grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.72fr);
  }

  .special-vehicle-grid {
    grid-template-columns: 1fr;
    max-height: 205px;
    overflow-y: auto;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  .garage-bottom-bar {
    grid-template-columns: 82px 130px minmax(115px, 0.6fr) minmax(165px, 0.9fr) !important;
  }

  .garage-special-action {
    min-height: 34px;
    padding: 0 8px;
  }

  .garage-special-action-icon,
  .garage-special-action small {
    display: none;
  }

  .garage-special-action strong {
    font-size: 9px;
  }

  .special-vehicles-view {
    height: calc(100dvh - 18px);
    min-height: 0;
    gap: 7px;
  }

  .special-vehicles-command-bar {
    min-height: 52px;
    padding: 5px 9px;
  }

  .special-income-bonus-card-command {
    min-height: 40px;
    padding: 4px 10px;
  }

  .special-vehicles-shell {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
    gap: 7px;
  }

  .special-vehicles-showcase {
    padding: 9px 12px 7px;
    border-radius: 17px;
  }

  .special-vehicle-stage {
    min-height: 185px;
  }

  .special-vehicle-canvas-wrap {
    min-height: 185px;
  }

  .special-vehicles-console {
    padding: 10px;
    border-radius: 17px;
  }

  .special-market-heading h2 {
    font-size: 18px;
  }

  .special-market-heading p,
  .special-market-price-card small,
  .special-vehicle-notice {
    display: none;
  }

  .special-vehicle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    max-height: none;
    margin-top: 8px;
  }

  .special-vehicle-card {
    min-height: 56px;
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 4px;
  }

  .special-vehicle-card-art {
    width: 46px;
    height: 42px;
  }

  .special-vehicle-card-copy small {
    display: none;
  }

  .special-market-price-card {
    margin-top: 7px;
    padding: 7px 9px;
  }

  .special-market-price-card strong {
    font-size: 18px;
  }

  .special-market-progress {
    margin-top: 6px;
  }

  .special-market-actions {
    grid-template-columns: minmax(0, 1fr) minmax(110px, 0.55fr);
    gap: 6px;
  }

  .special-market-actions .garage-primary-action,
  .special-vehicle-equip-action {
    min-height: 34px;
    font-size: 8px;
  }

  .special-vehicles-bottom-bar {
    min-height: 44px;
    grid-template-columns: 120px 1fr;
    padding: 4px;
  }

  .special-vehicles-disclaimer {
    display: none;
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  body.special-vehicles-active {
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.special-vehicles-active .menu-screen-unified {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .garage-bottom-bar {
    grid-template-columns: 60px 96px minmax(82px, 0.44fr) minmax(0, 1fr) !important;
  }

  .garage-special-action {
    width: 100%;
    min-width: 0;
    padding: 0 7px;
  }

  .garage-special-action-icon,
  .garage-special-action small {
    display: none;
  }

  .garage-special-action strong {
    font-size: 9px;
  }

  .special-vehicles-view {
    width: 100%;
    height: auto !important;
    min-height: 0;
    overflow: visible;
  }

  .menu-view.special-vehicles-view.active {
    grid-template-rows: auto auto auto;
    overflow: visible;
  }

  .special-vehicles-command-bar {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .special-vehicles-heading {
    width: 100%;
    display: flex;
    grid-column: 1 / -1;
  }

  .special-income-bonus-card-command {
    width: 100%;
    max-width: none;
  }

  .special-vehicles-shell {
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .special-vehicles-showcase {
    min-height: 350px;
  }

  .special-vehicle-stage {
    height: 238px;
  }

  .special-vehicle-canvas-wrap {
    width: min(calc(100% - 96px), 570px);
    min-height: 0;
    aspect-ratio: 12 / 7;
  }

  .special-vehicles-console {
    min-height: 620px;
    overflow: visible;
  }

  .special-vehicle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .special-vehicle-card {
    min-height: 76px;
    grid-template-columns: 52px minmax(0, 1fr);
    padding: 6px;
  }

  .special-vehicle-card-art {
    width: 52px;
    height: 48px;
  }

  .special-vehicle-card-copy small {
    display: none;
  }

  .special-vehicles-bottom-bar {
    grid-template-columns: 110px minmax(0, 1fr);
    flex: 0 0 auto;
  }

  .special-vehicles-disclaimer {
    display: none;
  }
}

@media (max-width: 540px) {
  .special-vehicles-brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .special-vehicle-card-copy strong {
    font-size: 9px;
  }

  .special-vehicle-card-copy b {
    font-size: 8px;
  }

  .special-market-heading h2 {
    max-width: 210px;
    overflow: hidden;
    font-size: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .special-vehicles-bottom-bar p {
    font-size: 8px;
  }
}
/* Local test save: make it unmistakable when progression and prices are bypassed. */
body.gm-mode-active .garage-profile-card {
  border-color: rgba(255, 78, 205, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 78, 205, 0.18), 0 0 26px rgba(255, 78, 205, 0.13);
}

body.gm-mode-active #active-player-name,
body.gm-mode-active #active-player-score,
body.gm-mode-active #garage-wallet {
  color: #ff78d9;
}

body.gm-mode-active #profile-select-dropdown {
  border-color: rgba(255, 78, 205, 0.65);
}

/* Named Guest + World Board V2 (feature-flagged, hidden when disabled). */
.named-guest-form {
  z-index: 10020;
}

.named-guest-form-content {
  max-height: min(680px, calc(100dvh - 24px));
  overflow: auto;
}

.named-guest-kicker {
  color: #67e8f9;
  font: 900 10px/1 var(--font-ui);
  letter-spacing: 0.16em;
  text-align: center;
}

.named-guest-form-content p,
.named-guest-form-content label {
  margin: 0;
  color: #cbd5e1;
  font: 600 12px/1.55 var(--font-ui);
}

.named-guest-form-content label {
  color: #f8fafc;
}

.named-guest-error {
  min-height: 18px;
  color: #fda4af;
  font: 700 11px/1.4 var(--font-ui);
}

.named-guest-privacy {
  padding: 9px 10px;
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-radius: 9px;
  background: rgba(8, 47, 73, 0.25);
}

.complete-stage-king-status {
  width: 100%;
  max-width: 360px;
  margin: -5px 0 12px;
  padding: 9px 12px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 10px;
  color: #fde68a;
  background: rgba(120, 53, 15, 0.28);
  font: 800 12px/1.4 var(--font-ui);
  text-align: center;
}

.complete-ranked-online-status {
  width: 100%;
  max-width: 360px;
  margin: -5px 0 12px;
  padding: 9px 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.62);
  font: 800 11px/1.4 var(--font-ui);
  text-align: center;
}

.complete-ranked-online-status.is-pending {
  border-color: rgba(56, 189, 248, 0.5);
  color: #bae6fd;
  background: rgba(3, 105, 161, 0.2);
}

.complete-ranked-online-status.is-confirmed {
  border-color: rgba(74, 222, 128, 0.56);
  color: #bbf7d0;
  background: rgba(20, 83, 45, 0.28);
}

.complete-stage-king-status.is-king {
  border-color: rgba(250, 204, 21, 0.8);
  color: #fef08a;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.16);
}

.complete-stage-king-status.is-pending {
  border-color: rgba(56, 189, 248, 0.5);
  color: #bae6fd;
  background: rgba(3, 105, 161, 0.2);
}

.stage-route-king {
  min-height: 14px;
  overflow: hidden;
  color: #fde68a !important;
  font-size: 8px !important;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-v2-sections {
  display: grid;
  gap: 10px;
}

.community-connection-state {
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.7);
  font: 800 9px/1.3 var(--font-ui);
  letter-spacing: 0.05em;
}

.community-connection-state.is-online {
  border-color: rgba(74, 222, 128, 0.38);
  color: #86efac;
}

.community-connection-state.is-pending {
  border-color: rgba(56, 189, 248, 0.42);
  color: #bae6fd;
}

.community-board-section,
.community-account-tools {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.community-board-section[hidden],
.community-account-tools[hidden] {
  display: none;
}

.recent-racers-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-racers-list li {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(103, 232, 249, 0.14);
  border-radius: 9px;
  background: rgba(8, 47, 73, 0.22);
}

.recent-racers-list li.is-current-player {
  border-color: #67e8f9;
}

.recent-racers-list strong,
.recent-racers-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-racers-list strong {
  color: #f8fafc;
  font-size: 10px;
}

.recent-racers-list span {
  color: #94a3b8;
  font-size: 8px;
}

.stage-kings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.stage-king-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 8px;
  border: 1px solid rgba(250, 204, 21, 0.22);
  border-radius: 9px;
  background: rgba(113, 63, 18, 0.18);
}

.stage-king-card strong,
.stage-king-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-king-card strong {
  color: #f8fafc;
  font-size: 9px;
}

.stage-king-card span {
  grid-column: 1;
  color: #fde68a;
  font-size: 8px;
}

.stage-king-card b {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: #facc15;
  font-size: 11px;
}

.stage-king-card.is-empty {
  opacity: 0.72;
}

.community-account-tools > strong {
  color: #e2e8f0;
  font-size: 10px;
}

.community-account-tools > span {
  color: #94a3b8;
  font-size: 9px;
}

.community-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.community-link-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(103, 232, 249, 0.32);
  border-radius: 8px;
  color: #cffafe;
  background: rgba(8, 47, 73, 0.45);
  font: 800 9px/1 var(--font-ui);
}

.world-rank-overlay .stage-leaderboard-panel {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.world-rank-overlay .leaderboard-table-container {
  flex: 0 0 min(300px, 42dvh);
}

@media (max-width: 720px) {
  .recent-racers-list,
  .stage-kings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .named-guest-form {
    justify-content: flex-start;
    overflow: auto;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .named-guest-form-content {
    margin: auto 0;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  .named-guest-form-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "kicker label"
      "title input"
      "description error"
      "privacy actions";
    column-gap: 14px;
    row-gap: 6px;
    width: min(720px, calc(100vw - 40px));
    max-width: 720px;
    padding: 10px 14px;
    overflow: visible;
  }

  .named-guest-kicker {
    grid-area: kicker;
  }

  .named-guest-form-content h3 {
    grid-area: title;
    font-size: 17px;
    line-height: 1.2;
    text-align: left;
  }

  .named-guest-form-content > p:first-of-type {
    grid-area: description;
  }

  .named-guest-form-content label {
    grid-area: label;
  }

  .named-guest-form-content input {
    grid-area: input;
    min-width: 0;
    padding: 9px 10px;
  }

  .named-guest-error {
    grid-area: error;
    min-height: 14px;
  }

  .named-guest-privacy {
    grid-area: privacy;
    padding: 6px 8px;
  }

  .named-guest-form-content .add-profile-form-actions {
    grid-area: actions;
    align-self: center;
    gap: 6px;
  }

  .named-guest-form-content .add-profile-form-actions .btn {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .recent-racers-list,
  .stage-kings-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .world-rank-overlay .leaderboard-table-container {
    flex-basis: 190px;
  }
}

/* ==========================================================================
   PREMIUM WIDE FRONT DOOR · desktop-only composition
   ========================================================================== */

@media (min-width: 1024px) {
  .welcome-panel {
    width: min(1120px, 95vw);
    grid-template-columns: minmax(0, 1fr) minmax(400px, 432px);
    border-color: rgba(159, 216, 255, 0.34);
    background:
      linear-gradient(115deg, rgba(26, 230, 255, 0.045), transparent 38%, rgba(145, 82, 255, 0.055)),
      rgba(8, 14, 24, 0.96);
    box-shadow:
      inset 1px 0 0 rgba(51, 224, 255, 0.2),
      inset -1px 0 0 rgba(161, 99, 255, 0.22),
      0 0 34px rgba(27, 211, 255, 0.08),
      0 0 62px rgba(137, 75, 255, 0.075),
      0 30px 90px rgba(0, 0, 0, 0.64);
  }

  .welcome-content {
    width: 100%;
    min-width: 400px;
    max-width: 432px;
  }

  .welcome-art::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    box-shadow:
      inset 18px 0 34px rgba(23, 217, 255, 0.045),
      inset -18px 0 34px rgba(148, 83, 255, 0.055);
  }
}

/* ==========================================================================
   PREMIUM DIGITAL SHOWROOM · main Garage only
   ========================================================================== */

#menu-home-view .garage-showcase {
  border-color: rgba(111, 211, 255, 0.24);
  background:
    radial-gradient(ellipse at 50% 13%, rgba(124, 220, 255, 0.18), transparent 34%),
    radial-gradient(ellipse at 50% 88%, rgba(34, 202, 255, 0.13), transparent 42%),
    linear-gradient(160deg, rgba(18, 39, 72, 0.98), rgba(7, 17, 34, 0.98) 60%, rgba(10, 25, 48, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(48, 211, 255, 0.08),
    0 24px 64px rgba(1, 7, 19, 0.52);
}

#menu-home-view .garage-showcase::before {
  background:
    linear-gradient(90deg, rgba(72, 210, 246, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(72, 210, 246, 0.045) 1px, transparent 1px),
    linear-gradient(110deg, transparent 0 42%, rgba(255, 255, 255, 0.022) 42% 43%, transparent 43% 100%);
  background-size: 54px 54px, 54px 54px, 100% 100%;
}

#menu-home-view .garage-canvas-wrap::before {
  content: '';
  position: absolute;
  z-index: 2;
  left: 22%;
  right: 22%;
  bottom: 13%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.58), rgba(20, 173, 220, 0.13) 48%, transparent 72%);
  filter: blur(8px);
  pointer-events: none;
}

#menu-home-view .garage-platform {
  width: 72%;
  height: 25%;
}

#menu-home-view .garage-platform-ring {
  border-color: rgba(72, 220, 255, 0.72);
  box-shadow:
    0 0 28px rgba(50, 199, 232, 0.3),
    0 10px 36px rgba(0, 0, 0, 0.26),
    inset 0 0 38px rgba(57, 120, 246, 0.17);
}

#menu-home-view .garage-console {
  border-color: rgba(122, 202, 255, 0.2);
  background:
    linear-gradient(180deg, rgba(18, 33, 59, 0.98), rgba(8, 18, 35, 0.98)),
    rgba(7, 16, 31, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 24px 60px rgba(1, 7, 19, 0.5);
}

#menu-home-view .garage-tabs {
  gap: 14px;
  padding: 0 6px;
  border-bottom: 1px solid rgba(168, 183, 207, 0.13);
  border-radius: 0;
  background: transparent;
}

#menu-home-view .garage-tab {
  position: relative;
  min-height: 46px;
  border-radius: 0;
}

#menu-home-view .garage-tab::after {
  content: '';
  position: absolute;
  right: 14%;
  bottom: -1px;
  left: 14%;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--garage-cyan), #7a8cff);
  box-shadow: 0 0 12px rgba(50, 199, 232, 0.55);
  opacity: 0;
  transform: scaleX(0.55);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#menu-home-view .garage-tab.is-active {
  color: #f9fdff;
  background: transparent;
  box-shadow: none;
}

#menu-home-view .garage-tab.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

#menu-home-view .garage-progress-card {
  border-color: rgba(117, 202, 255, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(61, 137, 206, 0.035)),
    rgba(5, 14, 29, 0.42);
}

#menu-home-view .garage-bottom-bar {
  border-color: rgba(110, 206, 255, 0.2);
  background: linear-gradient(180deg, rgba(15, 29, 52, 0.97), rgba(7, 17, 33, 0.97));
}

#menu-home-view .garage-race-action {
  min-height: 46px;
  border-color: rgba(117, 255, 190, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 24px rgba(24, 235, 139, 0.24),
    0 12px 30px rgba(4, 165, 105, 0.3);
}

#menu-home-view .garage-special-action {
  border-color: rgba(218, 170, 255, 0.48);
  filter: saturate(0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 9px 22px rgba(151, 71, 255, 0.22);
}

#menu-home-view .garage-world-rank-action {
  border-color: rgba(93, 177, 235, 0.28);
  background: rgba(30, 86, 137, 0.2);
  box-shadow: none;
}

/* ==========================================================================
   SPECIAL VEHICLE CATALOG · scalable Phase A
   ========================================================================== */

.special-vehicle-catalog-trigger {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 11px;
  margin-top: 15px;
  padding: 10px 13px;
  border: 1px solid rgba(177, 117, 255, 0.38);
  border-radius: 15px;
  color: var(--garage-text);
  background:
    radial-gradient(circle at 0 0, rgba(255, 79, 147, 0.14), transparent 42%),
    linear-gradient(135deg, rgba(151, 71, 255, 0.12), rgba(47, 141, 255, 0.1));
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.special-vehicle-catalog-trigger:hover,
.special-vehicle-catalog-trigger:focus-visible {
  border-color: rgba(98, 214, 255, 0.72);
  background:
    radial-gradient(circle at 0 0, rgba(255, 79, 147, 0.2), transparent 42%),
    linear-gradient(135deg, rgba(151, 71, 255, 0.18), rgba(47, 141, 255, 0.16));
  transform: translateY(-1px);
  outline: none;
}

.special-vehicle-catalog-trigger-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #fff2a8;
  background: linear-gradient(145deg, rgba(255, 79, 147, 0.46), rgba(86, 80, 255, 0.46));
  font-size: 22px;
}

.special-vehicle-catalog-trigger-copy,
.special-vehicle-catalog-trigger-copy strong,
.special-vehicle-catalog-trigger-copy small {
  min-width: 0;
  display: block;
}

.special-vehicle-catalog-trigger-copy strong {
  font-size: 11px;
}

.special-vehicle-catalog-trigger-copy small {
  margin-top: 5px;
  color: var(--garage-muted);
  font-size: 8px;
}

.special-vehicle-catalog-trigger-arrow {
  color: #7ee9ff;
  font-size: 20px;
  text-align: right;
}

.special-vehicle-catalog-dialog {
  width: min(1180px, calc(100vw - 32px));
  height: min(760px, calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(132, 210, 255, 0.36);
  border-radius: 24px;
  color: #f7faff;
  background:
    radial-gradient(circle at 12% 0, rgba(255, 79, 147, 0.15), transparent 31%),
    radial-gradient(circle at 92% 8%, rgba(47, 141, 255, 0.17), transparent 34%),
    linear-gradient(155deg, #111d37, #071225 68%, #0d1830);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 30px 100px rgba(0, 0, 0, 0.72);
}

.special-vehicle-catalog-dialog::backdrop {
  background: rgba(2, 6, 18, 0.76);
  backdrop-filter: blur(10px);
}

.special-vehicle-catalog-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.special-vehicle-catalog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid rgba(168, 183, 207, 0.12);
}

.special-vehicle-catalog-header h2 {
  margin: 0;
  font: 900 clamp(24px, 3vw, 38px)/1 var(--font-ui);
}

.special-vehicle-catalog-header p {
  margin: 8px 0 0;
  color: #a8b7cf;
  font-size: 11px;
}

.special-vehicle-catalog-close {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid rgba(168, 183, 207, 0.24);
  border-radius: 14px;
  color: #f7faff;
  background: rgba(255, 255, 255, 0.055);
  font: 300 31px/1 sans-serif;
  cursor: pointer;
}

.special-vehicle-catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 24px;
}

.special-vehicle-catalog-filter {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(168, 183, 207, 0.2);
  border-radius: 999px;
  color: #a8b7cf;
  background: rgba(255, 255, 255, 0.04);
  font: 800 11px/1 var(--font-ui);
  cursor: pointer;
}

.special-vehicle-catalog-filter.is-active {
  border-color: rgba(83, 218, 255, 0.62);
  color: #071827;
  background: linear-gradient(135deg, #55dfff, #63e3b5);
  box-shadow: 0 7px 18px rgba(50, 199, 232, 0.2);
}

.special-vehicle-catalog-close:focus-visible,
.special-vehicle-catalog-filter:focus-visible,
.special-vehicle-catalog-dialog .special-vehicle-card:focus-visible {
  outline: 3px solid #fece02;
  outline-offset: 2px;
}

.special-vehicle-catalog-scroll {
  min-height: 0;
  padding: 4px 24px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(71, 210, 242, 0.58) rgba(168, 183, 207, 0.08);
}

.special-vehicle-catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.special-vehicle-catalog-grid .special-vehicle-card {
  min-height: 158px;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(86px, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  border-radius: 17px;
  background:
    radial-gradient(circle at 50% 6%, rgba(50, 199, 232, 0.09), transparent 48%),
    rgba(255, 255, 255, 0.035);
}

.special-vehicle-catalog-grid .special-vehicle-card:hover,
.special-vehicle-catalog-grid .special-vehicle-card.is-current {
  border-color: rgba(112, 217, 255, 0.7);
  background:
    radial-gradient(circle at 50% 6%, rgba(50, 199, 232, 0.16), transparent 48%),
    linear-gradient(145deg, rgba(255, 79, 147, 0.08), rgba(47, 141, 255, 0.1));
}

.special-vehicle-catalog-grid .special-vehicle-card.is-equipped {
  box-shadow: inset 0 0 0 1px rgba(56, 217, 169, 0.42), 0 0 22px rgba(56, 217, 169, 0.08);
}

.special-vehicle-catalog-grid .special-vehicle-card-art {
  width: 100%;
  height: 96px;
  object-fit: contain;
}

.special-vehicle-catalog-grid .special-vehicle-card-copy strong {
  font-size: 12px;
}

.special-vehicle-catalog-grid .special-vehicle-card-copy small {
  font-size: 9px;
}

.special-vehicle-catalog-grid .special-vehicle-card-copy b {
  font-size: 10px;
}

.special-vehicle-catalog-empty {
  margin: 40px 0;
  color: #a8b7cf;
  font-size: 13px;
  text-align: center;
}

@media (min-width: 600px) {
  .special-vehicle-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .special-vehicle-catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1440px) {
  .special-vehicle-catalog-dialog {
    width: min(1380px, calc(100vw - 48px));
  }

  .special-vehicle-catalog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 599px) {
  .special-vehicle-catalog-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    border-radius: 18px;
  }

  .special-vehicle-catalog-header {
    padding: 17px 16px 12px;
  }

  .special-vehicle-catalog-toolbar {
    padding: 10px 16px;
  }

  .special-vehicle-catalog-filter {
    flex: 1 1 auto;
    padding: 0 11px;
    font-size: 10px;
  }

  .special-vehicle-catalog-scroll {
    padding: 2px 16px 16px;
  }

  .special-vehicle-catalog-grid .special-vehicle-card {
    min-height: 132px;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: 1fr;
    align-items: center;
  }

  .special-vehicle-catalog-grid .special-vehicle-card-art {
    height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #menu-home-view .garage-ambient,
  #menu-home-view .garage-spotlight,
  #menu-home-view .garage-speed-lines,
  #menu-home-view .garage-platform-ring,
  #menu-home-view .garage-tab-panel.is-active {
    animation: none !important;
  }

  #menu-home-view .garage-canvas-wrap #vehicle-preview-canvas,
  .special-vehicle-catalog-trigger,
  .special-vehicle-catalog-dialog .special-vehicle-card {
    transition: none !important;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  #menu-home-view .garage-tabs {
    gap: 4px;
    padding-inline: 4px;
  }

  #menu-home-view .garage-tab {
    min-height: 31px;
  }

  #menu-home-view .garage-race-action {
    min-height: 34px;
  }

  #menu-home-view .garage-tab-panel.is-active {
    animation: none;
  }

  #menu-home-view #garage-panel-paint {
    padding-top: 5px;
  }

  #menu-home-view #garage-panel-paint .garage-eyebrow {
    display: none;
  }

  #menu-home-view #garage-panel-paint .garage-paint-heading h2 {
    margin: 0;
    font: 900 16px/0.95 var(--font-ui);
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  .special-vehicles-shell {
    height: max-content;
    min-height: 982px;
  }
}

/* ==========================================================================
   RUSH WORKSHOP + AUTO EXPEDITION · local GM pilot
   ========================================================================== */

.garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
  grid-template-columns:
    minmax(92px, 0.36fr)
    minmax(148px, 0.52fr)
    minmax(148px, 0.52fr)
    auto
    minmax(126px, 0.44fr)
    minmax(205px, 0.72fr);
}

.workshop-entry-action {
  min-height: 44px;
  border-color: rgba(81, 231, 255, 0.62);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.28), transparent 36%),
    linear-gradient(135deg, #087a91 0%, #1459a8 50%, #4c34b7 100%);
  box-shadow:
    0 10px 25px rgba(24, 181, 221, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.workshop-entry-action[hidden] {
  display: none !important;
}

.workshop-entry-action small {
  max-width: 19ch;
  line-height: 1.2;
  white-space: normal;
}

.workshop-entry-action:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  filter: saturate(0.68);
}

@media (prefers-reduced-motion: reduce) {
  .workshop-entry-action {
    transition: none !important;
  }

  .workshop-entry-action:hover {
    transform: none;
  }
}

.workshop-dialog {
  width: min(1180px, calc(100vw - 28px));
  height: min(820px, calc(100dvh - 28px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(89, 216, 255, 0.56);
  border-radius: 22px;
  color: #f5fbff;
  background: #07101f;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72), 0 0 42px rgba(42, 173, 232, 0.16);
  font-family: var(--font-ui);
}

.workshop-dialog::backdrop {
  background: rgba(1, 6, 16, 0.84);
  backdrop-filter: blur(8px);
}

.workshop-shell {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background:
    radial-gradient(circle at 12% 0%, rgba(36, 210, 255, 0.13), transparent 32%),
    radial-gradient(circle at 88% 100%, rgba(133, 72, 255, 0.12), transparent 34%),
    linear-gradient(155deg, #091527, #070b16 68%);
}

.workshop-header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(130, 205, 255, 0.16);
}

.workshop-header > :first-child {
  min-width: 0;
}

.workshop-header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.workshop-header-actions .workshop-close {
  min-height: 44px;
}

.workshop-header h2,
.workshop-card h3,
.workshop-mission-card h3 {
  margin: 0;
}

.workshop-header h2 {
  margin-top: 3px;
  font-size: clamp(20px, 3vw, 32px);
  line-height: 1;
  letter-spacing: -0.025em;
}

.workshop-kicker {
  color: #63ddff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.workshop-close,
.workshop-button,
.workshop-mini-button,
.workshop-tab,
.workshop-answer {
  min-height: 40px;
  border: 1px solid rgba(147, 204, 255, 0.34);
  border-radius: 11px;
  color: #eef9ff;
  background: rgba(29, 51, 83, 0.78);
  font: 800 13px/1.15 var(--font-ui);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.workshop-close {
  min-width: 70px;
  padding: 0 15px;
}

.workshop-close:hover,
.workshop-button:hover:not(:disabled),
.workshop-mini-button:hover:not(:disabled),
.workshop-tab:hover,
.workshop-answer:hover {
  border-color: #62e1ff;
  background: rgba(33, 89, 128, 0.92);
  transform: translateY(-1px);
}

.workshop-close:focus-visible,
.workshop-button:focus-visible,
.workshop-mini-button:focus-visible,
.workshop-tab:focus-visible,
.workshop-answer:focus-visible,
.workshop-entry-action:focus-visible,
.workshop-dialog select:focus-visible,
.workshop-part-card input:focus-visible {
  outline: 3px solid #ffe26a;
  outline-offset: 2px;
}

.workshop-favorite-button:focus-visible {
  outline: 3px solid #ffe26a;
  outline-offset: 2px;
}

.workshop-button:disabled,
.workshop-mini-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.workshop-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(130, 205, 255, 0.12);
  background: rgba(2, 8, 18, 0.5);
}

.workshop-tab {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 82px;
  display: grid;
  place-items: end stretch;
  overflow: hidden;
  padding: 0;
  text-align: center;
  color: #f4fbff;
  background: rgba(5, 14, 28, 0.92);
}

.workshop-tab::after {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(2, 8, 19, 0.04) 20%, rgba(2, 8, 19, 0.88) 100%),
    linear-gradient(to right, rgba(2, 8, 19, 0.16), transparent 50%, rgba(2, 8, 19, 0.16));
  pointer-events: none;
}

.workshop-tab-art {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
  opacity: 0.86;
  filter: saturate(0.86) brightness(0.72);
  transform: scale(1.015);
  transition: opacity 0.15s ease, filter 0.15s ease, transform 0.15s ease;
}

.workshop-tab-label {
  position: relative;
  z-index: 2;
  display: block;
  min-width: 0;
  width: 100%;
  padding: 28px 10px 10px;
  overflow-wrap: anywhere;
  color: inherit;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.72);
}

.workshop-tab:hover .workshop-tab-art,
.workshop-tab.is-active .workshop-tab-art {
  opacity: 1;
  filter: saturate(1.08) brightness(0.94);
  transform: scale(1.055);
}

.workshop-tab.is-active {
  border-color: rgba(100, 226, 255, 0.82);
  color: #fff;
  background: rgba(5, 14, 28, 0.92);
  box-shadow:
    0 7px 20px rgba(36, 183, 224, 0.18),
    inset 0 0 0 2px rgba(91, 225, 255, 0.38);
}

.workshop-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 22px 24px;
  scrollbar-color: rgba(94, 219, 255, 0.7) rgba(7, 17, 32, 0.4);
}

.workshop-content > * + * {
  margin-top: 14px;
}

.workshop-card,
.workshop-mission-card,
.workshop-part-card,
.workshop-stat-card {
  min-width: 0;
  border: 1px solid rgba(132, 197, 255, 0.2);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(20, 39, 65, 0.9), rgba(10, 19, 36, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.workshop-card,
.workshop-mission-card {
  padding: 16px;
}

.workshop-card p,
.workshop-mission-card p {
  margin: 7px 0 0;
  color: #a8b9cb;
  font-size: 12px;
}

.workshop-overview-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(300px, 0.98fr);
  gap: 12px;
  align-items: stretch;
  width: 100%;
  min-height: 0;
}

.workshop-overview-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.workshop-overview-side {
  display: grid;
  grid-template-rows: auto minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.workshop-vehicle-hero {
  position: relative;
  isolation: isolate;
  min-height: 0;
  aspect-ratio: 720 / 420;
  margin: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--workshop-vehicle-accent) 34%, rgba(132, 197, 255, 0.2));
  border-radius: 18px;
  background:
    linear-gradient(rgba(52, 137, 190, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 137, 190, 0.045) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 78%, color-mix(in srgb, var(--workshop-vehicle-accent) 18%, transparent), transparent 48%),
    linear-gradient(145deg, rgba(16, 39, 67, 0.96), rgba(5, 14, 29, 0.98));
  background-size: 42px 42px, 42px 42px, auto, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    inset 0 -50px 90px rgba(0, 0, 0, 0.2),
    0 14px 32px rgba(0, 0, 0, 0.18);
}

.workshop-vehicle-hero-spotlight {
  position: absolute;
  z-index: 0;
  top: -25%;
  left: 50%;
  width: min(76%, 760px);
  height: 112%;
  transform: translateX(-50%);
  clip-path: polygon(42% 0, 58% 0, 88% 100%, 12% 100%);
  background: linear-gradient(to bottom, rgba(185, 232, 255, 0.16), rgba(73, 187, 228, 0.015));
  filter: blur(2px);
  pointer-events: none;
}

.workshop-vehicle-hero-platform {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 7%;
  width: min(58%, 620px);
  aspect-ratio: 3.8 / 1;
  transform: translateX(-50%);
  border: 2px solid color-mix(in srgb, var(--workshop-vehicle-accent) 66%, transparent);
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--workshop-vehicle-accent) 15%, transparent), transparent 66%);
  box-shadow:
    0 0 26px color-mix(in srgb, var(--workshop-vehicle-accent) 20%, transparent),
    inset 0 0 20px color-mix(in srgb, var(--workshop-vehicle-accent) 12%, transparent);
  pointer-events: none;
}

.workshop-vehicle-hero-fallback,
.workshop-vehicle-hero-canvas {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.18s ease;
}

.workshop-vehicle-hero-fallback {
  box-sizing: border-box;
  padding: 8px 8% 16px;
  object-fit: contain;
  filter: drop-shadow(0 20px 18px rgba(0, 0, 0, 0.46));
}

.workshop-vehicle-hero-canvas {
  opacity: 0;
  image-rendering: auto;
  filter: drop-shadow(0 20px 18px rgba(0, 0, 0, 0.46));
}

.workshop-vehicle-hero.is-canvas-ready .workshop-vehicle-hero-fallback {
  opacity: 0;
}

.workshop-vehicle-hero.is-canvas-ready .workshop-vehicle-hero-canvas {
  opacity: 1;
}

.workshop-vehicle-hero-badge {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 14px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--workshop-vehicle-accent) 52%, rgba(255, 255, 255, 0.12));
  border-radius: 999px;
  color: #dff8ff;
  background: rgba(5, 17, 34, 0.78);
  box-shadow: 0 0 18px color-mix(in srgb, var(--workshop-vehicle-accent) 14%, transparent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.workshop-overview-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.workshop-overview-showcase .workshop-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 4px;
  height: auto;
}

.workshop-overview-showcase .workshop-stat-card {
  display: grid;
  align-content: center;
  min-height: 0;
  padding: 5px 8px;
  border-radius: 9px;
}

.workshop-overview-showcase .workshop-stat-card strong {
  margin-block: 1px;
  font-size: 18px;
  line-height: 1;
}

.workshop-overview-showcase .workshop-stat-card span,
.workshop-overview-showcase .workshop-stat-card small {
  font-size: 7px;
  line-height: 1.15;
}

.workshop-overview-loadout {
  --garage-cyan: #32c7e8;
  --garage-mint: #38d9a9;
  --garage-text: #f7faff;
  --garage-muted: #a8b7cf;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: start;
  min-height: 0;
  margin: 0;
  padding: 7px;
  border-color: rgba(50, 199, 232, 0.2);
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(50, 199, 232, 0.07), rgba(56, 217, 169, 0.035)),
    rgba(3, 12, 27, 0.72);
}

.workshop-overview-loadout.is-assignment-locked {
  border-color: rgba(251, 191, 36, 0.34);
}

.workshop-overview-loadout .garage-workshop-slot-grid {
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 5px;
}

.workshop-overview-loadout .garage-workshop-slot {
  min-height: 42px;
  padding: 4px 5px;
}

.workshop-overview-loadout .garage-workshop-loadout-live {
  min-height: 9px;
  margin-top: 4px;
  font-size: 6.5px;
}

.workshop-overview-ratings {
  margin: 0;
}

.workshop-overview-ratings .workshop-rating-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 761px) and (min-height: 700px) {
  .workshop-content[data-workshop-active-tab='overview'] {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    padding-block: 14px 16px;
    overflow: hidden;
  }

  .workshop-content[data-workshop-active-tab='overview'] > * {
    margin-top: 0;
  }

  .workshop-content[data-workshop-active-tab='overview'] > .workshop-overview-showcase {
    height: 100%;
  }

  .workshop-content[data-workshop-active-tab='overview'] .workshop-vehicle-hero {
    height: 100%;
    aspect-ratio: auto;
  }

  .workshop-content[data-workshop-active-tab='overview'] .workshop-intro {
    padding: 13px 14px;
  }

  .workshop-content[data-workshop-active-tab='overview'] .workshop-intro p {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
  }

  .workshop-content[data-workshop-active-tab='overview'] .workshop-overview-ratings {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    margin: 0;
    padding: 11px 12px;
  }

  .workshop-content[data-workshop-active-tab='overview'] .workshop-overview-ratings h3 {
    font-size: 16px;
  }

  .workshop-content[data-workshop-active-tab='overview'] .workshop-overview-ratings .workshop-rating-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 5px;
    min-height: 0;
    margin-top: 6px;
  }

  .workshop-content[data-workshop-active-tab='overview'] .workshop-overview-ratings .workshop-rating {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 9px;
  }

  .workshop-content[data-workshop-active-tab='overview'] .workshop-overview-ratings .workshop-rating strong {
    flex: 0 0 auto;
  }
}

.workshop-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 3px 12px;
}

.workshop-intro p {
  grid-column: 2;
}

.workshop-powertrain,
.workshop-rarity {
  align-self: start;
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid rgba(92, 222, 255, 0.45);
  border-radius: 999px;
  color: #82eaff;
  background: rgba(18, 126, 153, 0.18);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.workshop-stat-grid,
.workshop-rating-grid,
.workshop-slot-grid,
.workshop-expedition-grid,
.workshop-result-grid,
.workshop-inventory-grid {
  display: grid;
  gap: 10px;
}

.workshop-stat-grid,
.workshop-rating-grid,
.workshop-slot-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workshop-stat-card {
  padding: 13px;
}

.workshop-stat-card span,
.workshop-stat-card small,
.workshop-rating span,
.workshop-slot span {
  display: block;
  color: #91a8bd;
  font-size: 9px;
  font-weight: 800;
}

.workshop-stat-card strong {
  display: block;
  margin: 3px 0;
  color: #fff;
  font-size: 26px;
}

.workshop-slot,
.workshop-rating {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px;
  border-radius: 11px;
  background: rgba(4, 13, 27, 0.55);
}

.workshop-slot.has-part-art {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--workshop-rarity-color) 48%, transparent);
  background:
    radial-gradient(circle at 18% 35%, color-mix(in srgb, var(--workshop-rarity-color) 20%, transparent), transparent 54%),
    rgba(4, 13, 27, 0.68);
}

.workshop-slot-copy {
  min-width: 0;
}

.workshop-slot-copy strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.workshop-slot.has-part-art .workshop-mini-button {
  grid-column: 1 / -1;
}

.workshop-slot .workshop-mini-button {
  margin-top: auto;
}

.workshop-inline-actions,
.workshop-time-lab {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.workshop-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.workshop-filter {
  min-width: 0;
  display: grid;
  gap: 4px;
  color: #91a8bd;
  font-size: 9px;
  font-weight: 800;
}

.workshop-filter select {
  width: 100%;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid rgba(139, 204, 255, 0.28);
  border-radius: 9px;
  color: #edf8ff;
  background: #10223a;
  font: 700 11px/1.1 var(--font-ui);
}

.workshop-preview {
  color: #7fe4ff !important;
}

.workshop-preview.is-warning {
  color: #ffd071 !important;
}

.workshop-inline-actions {
  margin-top: 12px;
}

.workshop-quiz-card[data-claim-mode="correction"] {
  border-color: rgba(255, 202, 93, 0.62);
}

.workshop-card .workshop-claim-ipa {
  color: #d2e9fa;
  font-family: 'Noto Sans Thai', sans-serif;
  font-size: 14px;
}

.workshop-claim-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(91, 221, 255, 0.42);
  border-radius: 10px;
  color: #eafaff;
  background: linear-gradient(90deg, rgba(33, 164, 210, 0.16), rgba(13, 33, 58, 0.78));
}

.workshop-claim-prompt strong {
  flex: 0 0 auto;
  color: #6be1ff;
  font-size: 13px;
  font-weight: 900;
}

.workshop-claim-prompt span {
  font-size: 13px;
  font-weight: 800;
}

.workshop-claim-prompt.is-antonym {
  border-color: rgba(255, 202, 93, 0.5);
  background: linear-gradient(90deg, rgba(255, 172, 48, 0.15), rgba(42, 28, 27, 0.78));
}

.workshop-claim-prompt.is-antonym strong {
  color: #ffd071;
}

.workshop-claim-prompt.is-synonym {
  border-color: rgba(56, 217, 169, 0.48);
  background: linear-gradient(90deg, rgba(56, 217, 169, 0.14), rgba(13, 36, 45, 0.78));
}

.workshop-claim-prompt.is-synonym strong {
  color: #65efc2;
}

.workshop-card .workshop-claim-help {
  color: #ffe08b;
  font-size: 13px;
  font-weight: 800;
}

.workshop-card .workshop-claim-boundary {
  color: #8fa7ba;
}

.workshop-claim-actions {
  padding-top: 12px;
  border-top: 1px solid rgba(132, 197, 255, 0.16);
}

.workshop-button {
  padding: 9px 14px;
}

.workshop-mini-button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 10px;
}

.workshop-primary {
  border-color: rgba(89, 231, 255, 0.78);
  background: linear-gradient(135deg, #078aac, #2755c4);
}

.workshop-danger {
  border-color: rgba(255, 117, 133, 0.52);
  background: rgba(125, 32, 53, 0.72);
}

.workshop-odds,
.workshop-pity {
  font-variant-numeric: tabular-nums;
}

.workshop-result-grid,
.workshop-inventory-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workshop-part-card {
  --workshop-rarity-color: #94a3b8;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 7px 9px;
  padding: 13px;
  border-color: color-mix(in srgb, var(--workshop-rarity-color) 52%, rgba(132, 197, 255, 0.2));
  border-left-width: 4px;
  border-left-color: var(--workshop-rarity-color);
  background:
    radial-gradient(circle at 50% 4%, color-mix(in srgb, var(--workshop-rarity-color) 28%, transparent), transparent 44%),
    linear-gradient(145deg, rgba(20, 39, 65, 0.95), rgba(10, 19, 36, 0.97));
}

.workshop-part-card > strong,
.workshop-part-card > small,
.workshop-part-card > em,
.workshop-part-card > button {
  grid-column: 1 / -1;
}

.workshop-part-card > .workshop-favorite-button {
  grid-column: 2;
  justify-self: end;
}

.workshop-part-art {
  grid-column: 1 / -1;
  width: 100%;
  height: 142px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--workshop-rarity-color) 48%, transparent);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 58%, color-mix(in srgb, var(--workshop-rarity-color) 36%, transparent), transparent 56%),
    linear-gradient(145deg, rgba(4, 13, 27, 0.36), rgba(4, 13, 27, 0.78));
  box-shadow: inset 0 1px 14px color-mix(in srgb, var(--workshop-rarity-color) 13%, transparent);
}

.workshop-part-image {
  width: min(100%, 156px);
  height: min(100%, 156px);
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.workshop-slot-art,
.workshop-delivery-art {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--workshop-rarity-color) 50%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--workshop-rarity-color) 20%, rgba(4, 13, 27, 0.8));
}

.workshop-slot-art {
  width: 52px;
  height: 52px;
}

.workshop-delivery-art {
  width: 48px;
  height: 48px;
}

.workshop-favorite-button {
  min-height: 32px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 218, 97, 0.38);
  border-radius: 999px;
  color: #ffe889;
  background: rgba(91, 69, 17, 0.34);
  font: 800 9px/1 var(--font-ui);
  cursor: pointer;
}

.workshop-part-card > small,
.workshop-part-card > em {
  color: #a8b9cb;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.workshop-part-card > em {
  color: #70e5ff;
}

.workshop-part-card .workshop-rarity {
  border-color: color-mix(in srgb, var(--workshop-rarity-color) 78%, transparent);
  color: color-mix(in srgb, var(--workshop-rarity-color) 78%, white);
  background: color-mix(in srgb, var(--workshop-rarity-color) 19%, transparent);
}

.workshop-delivery-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.workshop-delivery-list li {
  --workshop-rarity-color: #94a3b8;
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--workshop-rarity-color) 42%, transparent);
  border-radius: 11px;
  color: #e9f7ff;
  background: color-mix(in srgb, var(--workshop-rarity-color) 11%, rgba(4, 13, 27, 0.75));
  font-size: 11px;
  font-weight: 800;
}

.workshop-expedition-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workshop-expedition-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(87, 218, 255, 0.34);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(11, 42, 67, 0.78), rgba(7, 17, 36, 0.9));
}

.workshop-expedition-status-item {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 9px;
  border-radius: 10px;
  background: rgba(2, 10, 23, 0.44);
}

.workshop-expedition-status-item span,
.workshop-expedition-assignment-detail span,
.workshop-expedition-dispatch-note {
  color: #b7c9da;
  font-size: 11px;
  line-height: 1.35;
}

.workshop-expedition-status-item strong,
.workshop-expedition-countdown {
  color: #edfbff;
  font-size: 14px;
  line-height: 1.25;
}

.workshop-expedition-status-item[data-state='cap'],
.workshop-expedition-assignment-detail[data-expedition-assignment-state='cap'] {
  border: 1px solid rgba(255, 190, 74, 0.64);
  background: rgba(119, 70, 5, 0.22);
}

.workshop-expedition-assignment-detail[data-expedition-assignment-state='near-cap'] {
  border-color: rgba(255, 203, 103, 0.48);
}

.workshop-expedition-state-label {
  color: #dffbff;
  font-size: 12px;
}

.workshop-expedition-warning {
  grid-column: 1 / -1;
  margin: 0;
  color: #fff0aa;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.workshop-expedition-return-report {
  border-color: rgba(72, 232, 177, 0.56);
  background: linear-gradient(135deg, rgba(8, 70, 61, 0.42), rgba(4, 18, 31, 0.92));
}

.workshop-expedition-return-missions {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-inline-start: 22px;
  color: #dffbff;
  font-size: 12px;
  line-height: 1.4;
}

.workshop-league-board {
  border-color: rgba(250, 204, 21, 0.42);
  background:
    radial-gradient(circle at 92% 0%, rgba(250, 204, 21, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(18, 35, 62, 0.96), rgba(5, 14, 29, 0.97));
}

.workshop-league-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.workshop-league-header h3 {
  margin-top: 2px;
}

.workshop-league-preview-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(250, 204, 21, 0.5);
  border-radius: 999px;
  color: #fff1a8;
  background: rgba(114, 76, 2, 0.28);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.workshop-league-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.workshop-league-summary-item {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid rgba(112, 229, 255, 0.18);
  border-radius: 10px;
  background: rgba(2, 10, 23, 0.48);
}

.workshop-league-summary-item span,
.workshop-league-route span,
.workshop-league-rule-note {
  color: #b7c9da;
  font-size: 11px;
  line-height: 1.35;
}

.workshop-league-summary-item strong {
  color: #fff5b8;
  font-size: 15px;
}

.workshop-league-routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.workshop-league-route {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
  border-radius: 10px;
  background: rgba(12, 35, 55, 0.62);
}

.workshop-league-route > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.workshop-league-route > div strong,
.workshop-league-route > div span {
  overflow-wrap: anywhere;
}

.workshop-league-route-rating {
  flex: 0 0 auto;
  color: #70e5ff;
  font-size: 12px;
  white-space: nowrap;
}

.workshop-league-top100-preview {
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.38);
  border-radius: 10px;
  background: rgba(2, 8, 20, 0.45);
}

.workshop-league-top100-preview > strong {
  color: #dbeafe;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.workshop-league-rule-note {
  margin-top: 8px !important;
}

.workshop-expedition-assignment-detail {
  display: grid;
  gap: 6px;
  margin-top: 2px;
  padding: 9px;
  border: 1px solid rgba(121, 183, 222, 0.24);
  border-radius: 10px;
  background: rgba(3, 14, 28, 0.48);
}

.workshop-expedition-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(210, 238, 255, 0.18);
}

.workshop-expedition-progress::before {
  content: '';
  display: block;
  width: calc(var(--workshop-cycle-progress, 0) * 100%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2ce6ff, #72f6bf);
}

.workshop-expedition-dispatch-note {
  margin: 0;
}

.workshop-recommend-vehicle {
  min-height: 44px;
}

.workshop-mission-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.workshop-mission-card.has-mission-art {
  border-color: rgba(126, 220, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(4, 14, 30, 0.7), rgba(4, 13, 27, 0.9)),
    linear-gradient(90deg, rgba(4, 16, 34, 0.78), rgba(4, 16, 34, 0.32)),
    var(--workshop-mission-art) center / cover no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -70px 90px rgba(2, 8, 18, 0.38),
    0 10px 24px rgba(0, 0, 0, 0.16);
}

.workshop-mission-card.has-mission-art::before {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 0;
  background: radial-gradient(circle at 88% 10%, rgba(103, 225, 255, 0.12), transparent 45%);
  pointer-events: none;
}

.workshop-mission-card.has-mission-art > * {
  position: relative;
  z-index: 1;
}

.workshop-mission-card.has-mission-art h3,
.workshop-mission-card.has-mission-art p,
.workshop-mission-card.has-mission-art .workshop-kicker {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.92);
}

.workshop-mission-card select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(139, 204, 255, 0.34);
  border-radius: 10px;
  color: #edf8ff;
  background: #10223a;
}

.workshop-mission-card .workshop-button,
.workshop-mission-card .workshop-mini-button {
  margin-top: auto;
}

.workshop-sim-order {
  margin: 12px 0 0;
  padding-left: 28px;
}

.workshop-sim-order li {
  padding: 5px 8px;
  color: #a9bacb;
}

.workshop-sim-order .is-player {
  color: #fff4a3;
  font-weight: 900;
  background: rgba(255, 207, 75, 0.08);
}

.workshop-segment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.workshop-segment {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 9px;
  border-radius: 10px;
  color: #99afc3;
  background: rgba(4, 13, 27, 0.55);
  font-size: 9px;
}

.workshop-segment strong {
  color: #f8fcff;
  font-size: 13px;
}

.workshop-segment small {
  color: #6edfff;
}

.workshop-answer-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.workshop-answer {
  min-height: 54px;
  padding: 10px;
}

.workshop-live-notice {
  min-height: 38px;
  padding: 10px 22px;
  border-top: 1px solid rgba(130, 205, 255, 0.14);
  color: #b8cbda;
  background: rgba(3, 9, 19, 0.9);
  font-size: 11px;
}

.workshop-live-notice[data-tone='success'] { color: #79efae; }
.workshop-live-notice[data-tone='warning'] { color: #ffd071; }
.workshop-empty { grid-column: 1 / -1; text-align: center; }

.workshop-fusion-result {
  --workshop-rarity-color: #38bdf8;
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--workshop-rarity-color) 22%, transparent), transparent 38%),
    rgba(1, 7, 18, 0.88);
  backdrop-filter: blur(9px);
}

.workshop-fusion-result[hidden] {
  display: none !important;
}

.workshop-fusion-result:focus-visible {
  outline: none;
}

.workshop-fusion-result-panel {
  --workshop-rarity-color: #38bdf8;
  position: relative;
  width: min(520px, 100%);
  min-height: min(600px, calc(100dvh - 72px));
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  border: 1px solid color-mix(in srgb, var(--workshop-rarity-color) 76%, white 8%);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--workshop-rarity-color) 26%, transparent), transparent 42%),
    linear-gradient(155deg, rgba(17, 35, 61, 0.98), rgba(4, 10, 22, 0.99));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.62),
    0 0 38px color-mix(in srgb, var(--workshop-rarity-color) 28%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.workshop-fusion-result-close {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 14px;
  width: 45px;
  height: 45px;
  border: 1px solid rgba(181, 220, 255, 0.34);
  border-radius: 50%;
  color: #fff;
  background: rgba(6, 17, 35, 0.78);
  font: 700 25px/1 var(--font-ui);
  cursor: pointer;
}

.workshop-fusion-result-close:focus-visible,
.workshop-fusion-result-actions .workshop-button:focus-visible {
  outline: 3px solid #ffe26a;
  outline-offset: 3px;
}

.workshop-fusion-mixer {
  position: absolute;
  z-index: 1;
  width: 210px;
  height: 210px;
  display: grid;
  place-items: center;
}

.workshop-fusion-core,
.workshop-fusion-orbit {
  position: absolute;
  display: block;
  border-radius: 50%;
}

.workshop-fusion-core {
  width: 74px;
  height: 74px;
  border: 2px solid color-mix(in srgb, var(--workshop-rarity-color) 78%, white 18%);
  background: radial-gradient(circle, white 0 8%, var(--workshop-rarity-color) 32%, transparent 72%);
  box-shadow: 0 0 46px var(--workshop-rarity-color);
  animation: workshop-fusion-core 0.72s ease-in-out infinite alternate;
}

.workshop-fusion-orbit {
  --fusion-angle: 0deg;
  width: 34px;
  height: 34px;
  border: 2px solid color-mix(in srgb, var(--workshop-rarity-color) 82%, white 14%);
  background: color-mix(in srgb, var(--workshop-rarity-color) 38%, #07101f);
  box-shadow: 0 0 22px color-mix(in srgb, var(--workshop-rarity-color) 80%, transparent);
  animation: workshop-fusion-orbit 0.86s linear infinite;
}

.workshop-fusion-reveal {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.workshop-fusion-result[data-phase='mixing'] .workshop-fusion-reveal {
  opacity: 0;
  transform: scale(0.78);
  pointer-events: none;
}

.workshop-fusion-result[data-phase='revealed'] .workshop-fusion-mixer {
  opacity: 0;
  transform: scale(1.7);
  transition: opacity 0.24s ease, transform 0.34s ease;
  pointer-events: none;
}

.workshop-fusion-result[data-phase='revealed'] .workshop-fusion-reveal {
  animation: workshop-fusion-reveal 0.46s cubic-bezier(0.2, 0.9, 0.2, 1.2) both;
}

.workshop-fusion-reveal h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 5vw, 34px);
}

.workshop-fusion-reveal > p {
  margin: 0;
  color: #aec4d7;
  font-size: 12px;
}

.workshop-fusion-result-art {
  width: 210px;
  height: 210px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 7px 0 2px;
  border: 1px solid color-mix(in srgb, var(--workshop-rarity-color) 72%, transparent);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--workshop-rarity-color) 44%, transparent), transparent 58%),
    rgba(4, 13, 27, 0.76);
  box-shadow: inset 0 0 34px color-mix(in srgb, var(--workshop-rarity-color) 18%, transparent);
}

.workshop-fusion-result-art .workshop-part-image {
  width: 196px;
  height: 196px;
}

.workshop-fusion-result-name {
  max-width: 100%;
  color: #fff;
  font-size: 21px;
  overflow-wrap: anywhere;
}

.workshop-fusion-result-type {
  color: #a9bfd2;
  font-size: 11px;
}

.workshop-fusion-result-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 7px;
}

.workshop-fusion-result-stat {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 9px 5px;
  border: 1px solid color-mix(in srgb, var(--workshop-rarity-color) 28%, transparent);
  border-radius: 10px;
  background: rgba(4, 13, 27, 0.58);
}

.workshop-fusion-result-stat span {
  color: #91a8bd;
  font-size: 8px;
  font-weight: 800;
}

.workshop-fusion-result-stat strong {
  color: color-mix(in srgb, var(--workshop-rarity-color) 76%, white);
  font-size: 18px;
}

.workshop-fusion-reveal .workshop-fusion-result-route {
  color: #ffe589;
  font-weight: 800;
}

.workshop-fusion-result-actions {
  width: 100%;
  margin-top: 5px;
}

.workshop-fusion-result-actions .workshop-button {
  width: 100%;
  min-height: 46px;
}

.workshop-draw-currency-row {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(135, 199, 255, 0.24);
  border-radius: 14px;
  background: rgba(7, 20, 39, 0.72);
}

.workshop-draw-currency-row h4,
.workshop-draw-currency-row p {
  margin: 0;
}

.workshop-draw-sr-row {
  border-color: rgba(65, 214, 177, 0.42);
  background: linear-gradient(145deg, rgba(8, 42, 45, 0.78), rgba(7, 20, 39, 0.82));
}

.workshop-sr-balance,
.workshop-help-sr,
.workshop-help-recalibration {
  color: #82efd2;
}

.workshop-draw-currency-row .workshop-button,
.workshop-recalibrate-button,
.workshop-help-trigger,
.workshop-nested-actions .workshop-button {
  min-height: 44px;
}

.workshop-sr-button:not(:disabled) {
  border-color: rgba(80, 232, 192, 0.58);
  background: rgba(16, 95, 84, 0.7);
}

.workshop-help-trigger {
  min-width: 112px;
  padding-inline: 16px;
}

.workshop-mission-card[data-workshop-first-mission='true']:focus-visible {
  outline: 3px solid #ffe26a;
  outline-offset: 3px;
}

.workshop-nested-overlay {
  position: absolute;
  z-index: 24;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
  background: rgba(1, 7, 18, 0.9);
  backdrop-filter: blur(9px);
}

.workshop-nested-overlay[hidden] {
  display: none !important;
}

.workshop-nested-overlay:focus-visible {
  outline: none;
}

.workshop-help-panel,
.workshop-recalibration-panel {
  position: relative;
  width: min(860px, 100%);
  max-height: min(720px, calc(100dvh - 64px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 26px;
  border: 1px solid rgba(94, 219, 255, 0.58);
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 0%, rgba(62, 219, 184, 0.14), transparent 34%),
    linear-gradient(155deg, rgba(15, 35, 61, 0.99), rgba(4, 11, 24, 0.99));
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.68);
  scrollbar-gutter: stable;
}

.workshop-help-panel > h3,
.workshop-recalibration-panel > h3 {
  margin: 0 50px 8px 0;
  font-size: clamp(22px, 3vw, 30px);
}

.workshop-help-intro {
  margin: 0 50px 18px 0;
  color: #bad0e4;
}

.workshop-nested-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(181, 220, 255, 0.34);
  border-radius: 50%;
  color: #fff;
  background: rgba(6, 17, 35, 0.84);
  font: 700 25px/1 var(--font-ui);
  cursor: pointer;
}

.workshop-nested-close:focus-visible,
.workshop-nested-actions .workshop-button:focus-visible {
  outline: 3px solid #ffe26a;
  outline-offset: 3px;
}

.workshop-help-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workshop-help-steps li,
.workshop-help-economy,
.workshop-recalibration-stats {
  padding: 13px;
  border: 1px solid rgba(138, 204, 255, 0.2);
  border-radius: 13px;
  background: rgba(5, 17, 34, 0.68);
}

.workshop-help-steps strong {
  color: #f3fbff;
}

.workshop-help-steps p,
.workshop-help-economy p {
  margin: 6px 0 0;
  color: #b8cadb;
  line-height: 1.42;
}

.workshop-help-economy {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.workshop-help-economy h4 {
  margin: 0 0 2px;
  color: #65e1ff;
}

.workshop-help-coins {
  color: #ffe071 !important;
}

.workshop-help-limit {
  color: #ffd071 !important;
}

.workshop-nested-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.workshop-recalibration-panel {
  width: min(620px, 100%);
}

.workshop-recalibration-panel > p {
  margin-block: 8px;
}

.workshop-recalibration-stats {
  margin-top: 10px;
}

.workshop-recalibration-stats h4,
.workshop-recalibration-stats > strong {
  display: block;
  margin: 0 0 6px;
}

.workshop-recalibration-stats h4 {
  color: #65e1ff;
  font-size: 12px;
}

.workshop-recalibration-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.workshop-recalibration-stat-grid > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px;
  border-radius: 9px;
  color: #9fb4c8;
  background: rgba(16, 39, 65, 0.74);
}

.workshop-recalibration-stat-grid strong {
  color: #82efd2;
}

@keyframes workshop-fusion-core {
  from { transform: scale(0.78); filter: brightness(0.92); }
  to { transform: scale(1.14); filter: brightness(1.32); }
}

@keyframes workshop-fusion-orbit {
  from { transform: rotate(var(--fusion-angle)) translateX(88px); }
  to { transform: rotate(calc(var(--fusion-angle) + 360deg)) translateX(30px); }
}

@keyframes workshop-fusion-reveal {
  from { opacity: 0; transform: scale(0.76) translateY(18px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 1180px) {
  .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) .garage-input-legend {
    display: none;
  }
}

@media (max-width: 760px) {
  .workshop-dialog {
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
    border-radius: 15px;
  }

  .workshop-header,
  .workshop-content {
    padding-inline: 14px;
  }

  .workshop-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: 14px;
  }

  .workshop-tab {
    min-height: 76px;
  }

  .workshop-tab-art {
    width: 100%;
    height: 100%;
  }

  .workshop-overview-showcase {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .workshop-overview-main {
    grid-template-rows: auto auto;
  }

  .workshop-overview-side {
    grid-template-rows: auto auto auto;
    gap: 8px;
  }

  .workshop-overview-showcase .workshop-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 8px;
    height: auto;
  }

  .workshop-overview-showcase .workshop-stat-card {
    min-height: 70px;
    padding: 10px 12px;
  }

  .workshop-stat-grid,
  .workshop-rating-grid,
  .workshop-slot-grid,
  .workshop-expedition-grid,
  .workshop-result-grid,
  .workshop-inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workshop-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workshop-delivery-list {
    grid-template-columns: 1fr;
  }

  .workshop-segment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workshop-nested-overlay {
    padding: 7px;
  }

  .workshop-help-panel,
  .workshop-recalibration-panel {
    max-height: calc(100dvh - 26px);
    padding: 20px 14px 14px;
    border-radius: 16px;
  }

  .workshop-help-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) and (orientation: portrait) {
  .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .workshop-entry-action small {
    display: none;
  }

  .workshop-header h2 {
    font-size: 18px;
  }

  .workshop-stat-grid,
  .workshop-rating-grid,
  .workshop-slot-grid,
  .workshop-expedition-grid,
  .workshop-result-grid,
  .workshop-inventory-grid,
  .workshop-answer-list {
    grid-template-columns: 1fr;
  }

  .workshop-filter-grid,
  .workshop-segment-grid {
    grid-template-columns: 1fr;
  }

  .workshop-intro {
    grid-template-columns: 1fr;
  }

  .workshop-intro p {
    grid-column: 1;
  }

  .workshop-vehicle-hero {
    min-height: 0;
  }

  .workshop-vehicle-hero-fallback {
    padding-inline: 3%;
  }

  .workshop-vehicle-hero-platform {
    width: 78%;
  }

  .workshop-overview-showcase .workshop-stat-grid {
    grid-template-columns: 1fr;
  }

  .workshop-overview-loadout .garage-workshop-slot-grid {
    grid-template-columns: 1fr;
  }

  .workshop-fusion-result {
    padding: 8px;
  }

  .workshop-fusion-result-panel {
    min-height: min(590px, calc(100dvh - 28px));
    padding: 22px 14px 16px;
    border-radius: 17px;
  }

  .workshop-fusion-result-art {
    width: 170px;
    height: 170px;
  }

  .workshop-fusion-result-art .workshop-part-image {
    width: 158px;
    height: 158px;
  }

  .workshop-fusion-result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workshop-nested-actions,
  .workshop-recalibration-stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    padding-block: 0;
  }

  .workshop-dialog {
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
    border-radius: 13px;
  }

  .workshop-header {
    padding: 9px 14px;
    gap: 8px;
  }

  .workshop-header-actions {
    gap: 6px;
  }

  .workshop-header-actions .workshop-help-trigger {
    min-width: 100px;
    padding-inline: 10px;
  }

  .workshop-header-actions .workshop-close {
    min-width: 60px;
    padding-inline: 10px;
  }

  .workshop-header h2 {
    font-size: 18px;
  }

  .workshop-tabs {
    padding: 6px 14px;
  }

  .workshop-tab {
    min-height: 52px;
    padding: 0;
  }

  .workshop-tab-art {
    width: 100%;
    height: 100%;
    border-radius: inherit;
  }

  .workshop-tab-label {
    padding: 18px 6px 6px;
    font-size: 11px;
  }

  .workshop-content {
    padding: 10px 14px 14px;
  }

  .workshop-live-notice {
    min-height: 30px;
    padding: 7px 14px;
  }

  .workshop-fusion-result {
    place-items: start center;
    padding: 7px;
  }

  .workshop-fusion-result-panel {
    width: min(760px, 100%);
    min-height: 0;
    padding: 14px 54px 14px 16px;
  }

  .workshop-fusion-reveal {
    grid-template-columns: 150px minmax(0, 1fr);
    grid-template-rows: repeat(7, auto);
    justify-items: start;
    gap: 4px 14px;
    text-align: left;
  }

  .workshop-fusion-reveal > .workshop-kicker,
  .workshop-fusion-reveal > h3,
  .workshop-fusion-reveal > p,
  .workshop-fusion-reveal > .workshop-rarity,
  .workshop-fusion-result-name,
  .workshop-fusion-result-type,
  .workshop-fusion-result-stats,
  .workshop-fusion-result-route,
  .workshop-fusion-result-actions {
    grid-column: 2;
  }

  .workshop-fusion-result-art {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 150px;
    height: 150px;
    align-self: center;
    margin: 0;
  }

  .workshop-fusion-result-art .workshop-part-image {
    width: 140px;
    height: 140px;
  }

  .workshop-fusion-result-stats {
    margin-top: 3px;
  }

  .workshop-fusion-result-actions .workshop-button {
    min-height: 36px;
  }

  .workshop-nested-overlay {
    place-items: start center;
    padding: 6px;
  }

  .workshop-help-panel,
  .workshop-recalibration-panel {
    width: min(920px, 100%);
    max-height: calc(100dvh - 18px);
    padding: 14px 54px 12px 16px;
    border-radius: 14px;
  }

  .workshop-help-panel > h3,
  .workshop-recalibration-panel > h3 {
    font-size: 20px;
  }

  .workshop-help-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .workshop-help-steps li,
  .workshop-help-economy,
  .workshop-recalibration-stats {
    padding: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workshop-dialog *,
  .workshop-entry-action {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 920px) {
  .workshop-expedition-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workshop-league-routes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) and (orientation: portrait) {
  .workshop-expedition-status-strip {
    grid-template-columns: 1fr;
  }

  .workshop-league-header {
    display: grid;
  }

  .workshop-league-preview-badge {
    justify-self: start;
  }

  .workshop-league-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  .workshop-expedition-status-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
  }

  .workshop-expedition-status-item {
    padding: 6px;
  }

  .workshop-league-board {
    padding: 10px;
  }

  .workshop-league-summary,
  .workshop-league-routes {
    gap: 5px;
  }

  .workshop-league-summary-item,
  .workshop-league-route,
  .workshop-league-top100-preview {
    padding: 7px;
  }

  .workshop-expedition-status-item span,
  .workshop-expedition-assignment-detail span,
  .workshop-expedition-dispatch-note {
    font-size: 10px;
  }
}

/* ===========================================================================
   INTERNAL MENU MINIMAL UI CONTRACT · Main Garage + Stage Select
   ========================================================================== */

:root {
  --menu-panel-bg: rgba(9, 19, 37, 0.95);
  --menu-panel-border: rgba(126, 232, 255, 0.2);
  --menu-panel-radius: 18px;
  --menu-control-radius: 12px;
  --menu-rail-gap: 10px;
  --menu-rail-height: 56px;
  --menu-focus-color: #fece02;
}

.menu-action-bar {
  width: 100%;
  min-width: 0;
  min-height: var(--menu-rail-height);
  align-items: center;
  gap: var(--menu-rail-gap);
  padding: 7px;
  border: 1px solid var(--menu-panel-border);
  border-radius: var(--menu-panel-radius);
  background: linear-gradient(180deg, rgba(15, 29, 52, 0.97), rgba(7, 17, 33, 0.97));
  box-shadow: 0 14px 34px rgba(1, 7, 19, 0.3);
}

.menu-control-rail {
  border-radius: var(--menu-control-radius);
}

.menu-action {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 13px;
  overflow: hidden;
  border: 1px solid rgba(168, 183, 207, 0.22);
  border-radius: var(--menu-control-radius);
  color: #f7faff;
  background: rgba(255, 255, 255, 0.04);
  font: 800 11px/1 var(--font-ui);
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.menu-action-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  line-height: 1;
}

.menu-action-copy strong,
.menu-action-copy small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-action-copy strong {
  font-size: 11px;
}

.menu-action-copy small {
  color: rgba(224, 235, 250, 0.68);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.menu-action-home {
  color: #fff5f6;
  border-color: rgba(255, 101, 117, 0.58);
  background: linear-gradient(135deg, rgba(116, 25, 38, 0.96), rgba(71, 20, 32, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 20px rgba(96, 18, 34, 0.2);
}

.menu-action-garage {
  color: #eaf9ff;
  border-color: rgba(50, 199, 232, 0.38);
  background: linear-gradient(135deg, rgba(13, 58, 91, 0.9), rgba(16, 31, 58, 0.96));
}

.menu-action-special {
  color: #fff;
  border-color: rgba(212, 122, 255, 0.5);
  background: linear-gradient(135deg, rgba(194, 57, 133, 0.9), rgba(112, 57, 190, 0.92) 52%, rgba(37, 102, 192, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 20px rgba(151, 71, 255, 0.18);
}

.menu-action-workshop {
  color: #f3fbff;
  border-color: rgba(81, 196, 255, 0.48);
  background: linear-gradient(135deg, rgba(23, 108, 145, 0.9), rgba(38, 67, 156, 0.92) 52%, rgba(76, 52, 183, 0.9));
}

.menu-action-rank {
  color: #e7faff;
  border-color: rgba(50, 199, 232, 0.46);
  background: linear-gradient(135deg, rgba(25, 95, 149, 0.86), rgba(26, 42, 80, 0.95));
  box-shadow: 0 8px 20px rgba(25, 131, 181, 0.14);
}

.menu-action-primary {
  color: #effff6;
  border-color: rgba(104, 255, 177, 0.58);
  background: linear-gradient(135deg, rgba(13, 192, 119, 0.86), rgba(6, 137, 105, 0.86) 55%, rgba(8, 95, 102, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 9px 22px rgba(4, 165, 105, 0.2);
}

.menu-action:hover {
  filter: saturate(1.08) brightness(1.08);
  transform: translateY(-1px);
}

.menu-action:active {
  transform: translateY(1px);
}

.menu-action:focus-visible {
  outline: 3px solid var(--menu-focus-color);
  outline-offset: 2px;
}

/* Main Garage: context-only header, local controls below the vehicle, navigation below content. */
#menu-home-view .garage-command-bar {
  grid-template-areas: 'brand profile rank balance';
  grid-template-columns: minmax(250px, 1fr) auto minmax(150px, 0.48fr) auto;
  gap: 14px;
}

#menu-home-view .garage-brand-lockup { grid-area: brand; }
#menu-home-view .garage-profile-row { grid-area: profile; }
#menu-home-view #home-to-world-rank-btn { grid-area: rank; }
#menu-home-view .garage-balance-group { grid-area: balance; }

#menu-home-view .garage-world-rank-action {
  width: 100%;
  min-width: 150px;
  min-height: 42px;
  justify-self: stretch;
  padding: 0 14px;
}

#menu-home-view .garage-view-control {
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 6px;
}

#menu-home-view .garage-bottom-bar {
  grid-template-columns: minmax(92px, 0.36fr) minmax(155px, 0.58fr) minmax(215px, 0.86fr) !important;
}

#menu-home-view .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
  grid-template-columns:
    minmax(92px, 0.34fr)
    minmax(150px, 0.54fr)
    minmax(150px, 0.54fr)
    minmax(205px, 0.82fr) !important;
}

#menu-home-view .garage-home-action,
#menu-home-view .garage-special-action,
#menu-home-view .workshop-entry-action,
#menu-home-view .garage-race-action {
  justify-self: stretch;
  min-width: 0;
  min-height: 44px;
}

/* Stage Select: one primary shell, embedded orientation rail, one bottom navigation rail. */
#menu-stage-view .stage-route-shell {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

#menu-stage-view .stage-route-summary h2 {
  margin: 3px 0 2px;
  color: #f7faff;
  font: 900 20px/1.1 var(--font-ui);
}

#menu-stage-view .stage-orientation-subhead {
  min-height: 48px;
}

#menu-stage-view .orientation-btn {
  min-height: 40px;
  box-shadow: none;
}

#menu-stage-view .stage-route-legend {
  justify-content: flex-start;
}

#menu-stage-view .stage-bottom-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#menu-stage-view .stage-nav-action,
#menu-stage-view .stage-world-rank-btn {
  min-height: 44px;
  justify-self: stretch;
  padding: 0 14px;
  letter-spacing: 0;
}

@media (max-width: 1180px) {
  #menu-home-view .garage-command-bar {
    grid-template-columns: minmax(190px, 1fr) minmax(285px, auto) 44px auto;
    gap: 10px;
  }

  #menu-home-view .garage-world-rank-action {
    min-width: 44px;
    width: 44px;
    padding: 0;
  }

  #menu-home-view .garage-world-rank-action .menu-action-label {
    display: none;
  }

  #menu-home-view .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px), (pointer: coarse) {
  #menu-home-view .garage-input-legend {
    display: none;
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  #menu-home-view .garage-command-bar {
    grid-template-areas:
      'brand rank balance'
      'profile profile profile';
    grid-template-columns: minmax(0, 1fr) 42px auto;
    gap: 8px;
  }

  #menu-home-view .garage-profile-row {
    width: 100%;
  }

  #menu-home-view .garage-world-rank-action {
    width: 42px;
    min-width: 42px;
  }

  #menu-home-view .garage-bottom-bar,
  #menu-home-view .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px;
  }

  #menu-home-view .garage-bottom-bar:not(:has(.workshop-entry-action:not([hidden]))) #home-to-stage-btn {
    grid-column: 1 / -1;
  }

  #menu-stage-view .stage-route-summary {
    gap: 8px;
  }

  #menu-stage-view .stage-orientation-subhead {
    align-items: stretch;
    gap: 8px;
  }

  #menu-stage-view .footer-orientation-label {
    align-self: center;
    font-size: 11px;
  }

  #menu-stage-view .orientation-btn-group {
    flex: 1;
    gap: 6px;
  }

  #menu-stage-view .orientation-btn {
    flex: 1;
    min-width: 0;
    padding-inline: 8px;
  }

  #menu-stage-view .stage-bottom-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
}

@media (max-width: 640px) and (orientation: portrait) {
  #menu-stage-view .stage-route-summary h2 {
    font-size: 14px;
  }

  #menu-stage-view .stage-orientation-subhead {
    flex-direction: column;
    padding: 6px;
  }

  #menu-stage-view .footer-orientation-label {
    font-size: 9px;
  }

  #menu-stage-view .menu-action-copy small {
    display: none;
  }

  #menu-stage-view .stage-nav-action,
  #menu-stage-view .stage-world-rank-btn {
    min-height: 44px;
    gap: 5px;
    padding: 0 6px;
    font-size: 9px;
  }

  #menu-stage-view .menu-action-copy strong {
    font-size: 9px;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  #menu-home-view .garage-profile-card .profile-actions,
  #menu-home-view .garage-logout-btn {
    display: none !important;
  }

  #menu-home-view .garage-command-bar {
    grid-template-areas: 'brand profile rank balance';
    grid-template-columns: minmax(150px, 0.8fr) minmax(190px, 0.75fr) 40px auto;
    gap: 7px;
  }

  #menu-home-view .garage-world-rank-action {
    width: 40px;
    min-width: 40px;
    min-height: 38px;
  }

  #menu-home-view .garage-bottom-bar {
    min-height: 44px;
    grid-template-columns: 82px minmax(130px, 0.65fr) minmax(165px, 0.9fr) !important;
    padding: 4px;
  }

  #menu-home-view .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
    grid-template-columns: 82px repeat(2, minmax(130px, 0.62fr)) minmax(165px, 0.9fr) !important;
    padding: 1px;
  }

  #menu-home-view .garage-bottom-bar .menu-action {
    min-height: 34px;
  }

  #menu-home-view .garage-bottom-bar .workshop-entry-action {
    min-height: 44px;
  }

  #menu-stage-view .stage-route-summary h2 {
    margin: 1px 0;
    font-size: 13px;
  }

  #menu-stage-view .stage-orientation-subhead {
    min-height: 44px;
    padding: 3px 8px;
  }

  #menu-stage-view .orientation-btn {
    min-height: 36px;
    padding: 0 8px;
    font-size: 8px;
  }

  #menu-stage-view .stage-route-legend {
    display: none;
  }

  #menu-stage-view .stage-bottom-bar {
    min-height: 44px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
  }

  #menu-stage-view .stage-nav-action,
  #menu-stage-view .stage-world-rank-btn {
    min-height: 45px;
    padding: 0 8px;
    font-size: 8px;
  }

  #menu-stage-view .menu-action-copy small {
    display: none;
  }
}

@media (forced-colors: active) {
  .menu-action,
  .menu-action-bar,
  .menu-control-rail {
    border: 1px solid ButtonText;
  }

  .menu-action:focus-visible {
    outline-color: Highlight;
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu-action,
  .garage-workshop-loadout-head,
  .garage-workshop-loadout-open-icon {
    transition: none !important;
  }
}

/* ==========================================================================
   MAIN GARAGE READABILITY + CARS PANEL FLOW
   CURRENT SHOWCASE (11px) is the visible-text floor for the Garage. Short
   viewports scroll the panel instead of shrinking copy or clipping actions.
   ========================================================================== */

#menu-home-view {
  --garage-readable-floor: 11px;
}

#menu-home-view .garage-tab-panels {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

#menu-home-view #garage-panel-cars {
  height: auto;
  min-height: 100%;
  justify-content: flex-start;
}

#menu-home-view #garage-panel-cars .garage-car-subtitle,
#menu-home-view #garage-panel-cars .garage-equipped-line {
  display: none;
}

#menu-home-view #garage-panel-cars .garage-car-name {
  width: 100%;
  max-width: 100%;
  overflow: visible;
  overflow-wrap: normal;
  font-size: clamp(24px, 1.8vw, 28.8px);
  line-height: 1.08;
  text-overflow: clip;
  white-space: normal;
}

#menu-home-view #garage-panel-cars .garage-progress-card {
  margin-top: 12px;
  padding: 12px;
}

#menu-home-view #garage-panel-cars .garage-workshop-loadout {
  margin-top: 10px;
  padding: 8px;
}

#menu-home-view #garage-panel-cars #garage-equip-btn {
  flex: 0 0 auto;
  min-height: 48px;
  margin-top: 10px;
}

/* Readable microcopy. These selectors intentionally stay Garage-scoped so
   icon glyphs and typography in other scenes keep their existing scale. */
#menu-home-view .garage-nav-btn small,
#menu-home-view :is(.garage-brand-sub,.garage-logout-btn,.garage-balance-chip,.garage-collection-chip,.garage-eyebrow,.garage-view-label,.garage-view-hint,.garage-bottom-bar .menu-action strong),
#menu-home-view .garage-tab,
#menu-home-view .garage-workshop-loadout-head .garage-eyebrow,
#menu-home-view .garage-workshop-loadout-status,
#menu-home-view .garage-workshop-slot-copy small,
#menu-home-view .garage-workshop-loadout-live,
#menu-home-view .garage-paint-tier,
#menu-home-view .garage-notice,
#menu-home-view .garage-shop-card-copy small,
#menu-home-view .garage-shop-card-copy b,
#menu-home-view .garage-collection-card-copy small,
#menu-home-view .garage-special-action small,
#menu-home-view .menu-action-copy small,
#menu-home-view .garage-world-rank-action {
  font-size: var(--garage-readable-floor);
}

#menu-home-view .garage-progress-copy strong,
#menu-home-view .garage-workshop-loadout-head strong {
  font-size: 11px;
  line-height: 1.25;
}

#menu-home-view .garage-workshop-slot-copy small {
  line-height: 1.25;
}

#menu-home-view .garage-workshop-slot-copy strong {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.3;
}

#menu-home-view .garage-workshop-loadout-live,
#menu-home-view .garage-progress-note,
#menu-home-view .garage-panel-copy,
#menu-home-view .garage-notice {
  line-height: 1.35;
}

/* Every visible Garage control keeps a 44px touch target. Explicit selectors
   below override older compact-landscape reductions without affecting scenes. */
#menu-home-view button,
#menu-home-view select,
#menu-home-view input:not([type='hidden']),
#menu-home-view .garage-tab,
#menu-home-view .garage-view-btn,
#menu-home-view .garage-color-grid .color-swatch-btn,
#menu-home-view .garage-bottom-bar .menu-action,
#menu-home-view .garage-world-rank-action {
  min-height: 44px;
}

#menu-home-view .garage-profile-card .profile-select {
  height: 44px;
}

#menu-home-view .garage-add-profile-btn {
  width: 44px;
  height: 44px;
}

#menu-home-view #garage-panel-paint .garage-paint-actions .garage-primary-action {
  min-height: 44px;
}

@media (max-height: 800px) and (orientation: landscape) {
  #menu-home-view #garage-panel-cars .garage-car-name {
    font-size: 19.2px;
  }

  #menu-home-view #garage-panel-cars .garage-progress-card {
    margin-top: 7px;
    padding: 8px;
  }

  #menu-home-view #garage-panel-cars .garage-progress-copy .garage-eyebrow,
  #menu-home-view #garage-panel-cars .garage-progress-note:not([hidden]),
  #menu-home-view #garage-panel-cars .garage-workshop-loadout-head .garage-eyebrow {
    display: block;
  }

  #menu-home-view #garage-panel-cars .garage-workshop-loadout {
    margin-top: 6px;
    padding: 6px;
  }

  #menu-home-view #garage-panel-cars #garage-equip-btn {
    min-height: 44px;
    margin-top: 7px;
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  #menu-home-view #garage-panel-cars .garage-car-name {
    font-size: clamp(21.6px, 6vw, 24px);
  }
}

/* ==========================================================================
   UNIFIED AUDIO CONTROLS — Welcome, Garage, Stage Select, and Pause
   All ranges share AudioManager state. Only the Welcome BGM range is an
   explicit music activation surface; the other ranges are volume-only.
   ========================================================================== */

.audio-volume-box,
.menu-audio-box {
  min-width: 0;
  border: 1px solid rgba(65, 214, 255, 0.28);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(5, 20, 39, 0.96), rgba(13, 29, 52, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.audio-volume-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: #d8e8f7;
  font: 800 10px/1.2 var(--font-ui);
}

.audio-volume-heading label,
.audio-volume-heading output {
  min-width: 0;
}

.audio-volume-heading output {
  color: #67e8f9;
  font-variant-numeric: tabular-nums;
}

input.audio-volume-range {
  width: 100%;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  accent-color: #22d3ee;
  touch-action: pan-x;
}

input.audio-volume-range:focus-visible {
  outline: 3px solid #facc15;
  outline-offset: 1px;
  border-radius: 8px;
}

/* Welcome audio stays in the primary action column. */
.welcome-content {
  min-height: 0;
}

.welcome-menu > .welcome-music-control {
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  grid-column: 1 / -1;
  margin: 0;
}

.welcome-music-control {
  padding: 6px 10px 8px;
}

.welcome-music-control .audio-volume-heading {
  margin-bottom: 1px;
}

.welcome-music-state {
  display: block;
  margin-top: -5px;
  color: #a5f3fc;
  font: 700 10px/1.25 var(--font-ui);
}

.menu-audio-box {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 3px 7px;
  align-self: stretch;
}

.menu-audio-control {
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: auto minmax(52px, 1fr) 32px;
  align-items: center;
  gap: 6px;
}

.menu-audio-control .audio-volume-heading {
  display: contents;
}

.menu-audio-control .audio-volume-heading label { grid-column: 1; }
.menu-audio-control .audio-volume-range { grid-column: 2; grid-row: 1; }
.menu-audio-control .audio-volume-heading output { grid-column: 3; text-align: right; }

.menu-music-player {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(103, 232, 249, .18);
}

.menu-music-symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.menu-music-track {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.menu-music-kicker {
  flex: 0 0 auto;
  color: #67e8f9;
  font: 900 10px/1 var(--font-ui);
  letter-spacing: .08em;
}

.menu-music-title {
  min-width: 0;
  overflow: hidden;
  color: #f8fbff;
  font: 800 11px/1.2 var(--font-ui);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-music-actions {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(44px, 1fr));
  gap: 3px;
}

.menu-music-actions button {
  min-width: 44px;
  min-height: 46px;
  padding: 0 4px;
  border: 1px solid rgba(103, 232, 249, .3);
  border-radius: 8px;
  background: rgba(11, 38, 67, .92);
  color: #dff8ff;
  font: 900 10px/1 var(--font-ui);
  letter-spacing: .02em;
  cursor: pointer;
}

.menu-music-icon {
  width: 23px;
  height: 23px;
  display: block;
  margin: auto;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.menu-music-icon--pause,
.menu-music-icon--repeat {
  display: none;
}

[data-menu-music-action="toggle"][data-menu-music-icon="pause"] .menu-music-icon--play,
[data-menu-music-action="mode"][data-menu-music-icon="repeat"] .menu-music-icon--shuffle {
  display: none;
}

[data-menu-music-action="toggle"][data-menu-music-icon="pause"] .menu-music-icon--pause,
[data-menu-music-action="mode"][data-menu-music-icon="repeat"] .menu-music-icon--repeat {
  display: block;
}

.menu-music-actions button:hover:not(:disabled),
.menu-music-actions button[aria-pressed="true"] {
  border-color: #67e8f9;
  background: rgba(14, 116, 144, .48);
  color: #fff;
}

.menu-music-actions button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.menu-music-actions button:focus-visible {
  outline: 3px solid #facc15;
  outline-offset: 1px;
}

.menu-music-player > [data-menu-music-status] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.menu-audio-box {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(44px, auto));
  position: relative;
  overflow: hidden;
  border-color: rgba(66, 211, 255, .42);
  background:
    radial-gradient(circle at 76% 10%, rgba(34, 211, 238, .09), transparent 36%),
    linear-gradient(135deg, rgba(4, 20, 39, .98), rgba(8, 31, 55, .96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    inset 0 -1px 0 rgba(34, 211, 238, .08),
    0 8px 20px rgba(0, 8, 24, .2);
}

.menu-audio-box::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, .55), transparent);
  pointer-events: none;
}

.menu-audio-box > .menu-audio-control {
  grid-column: 1;
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(30px, auto) minmax(60px, 1fr) minmax(38px, auto);
  gap: 8px;
  padding-inline: 2px;
}

.menu-audio-box .menu-audio-control .audio-volume-heading label {
  color: #c8d9eb;
  letter-spacing: .06em;
  text-shadow: 0 0 10px rgba(103, 232, 249, .2);
}

.menu-audio-box .menu-audio-control .audio-volume-heading output {
  min-width: 38px;
  box-sizing: border-box;
  padding: 3px 5px;
  border: 1px solid rgba(103, 232, 249, .24);
  border-radius: 999px;
  background: rgba(8, 47, 72, .76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  color: #67e8f9;
  line-height: 1;
  text-align: center;
}

.menu-audio-box input.audio-volume-range {
  filter: drop-shadow(0 0 5px rgba(34, 211, 238, .16));
}

.menu-audio-box > .menu-music-player {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: relative;
  z-index: 1;
  padding: 0 0 0 7px;
  border-top: 0;
  border-left: 1px solid rgba(103, 232, 249, .18);
  box-shadow: -8px 0 18px -18px rgba(103, 232, 249, .9);
}

.menu-audio-box .menu-music-actions {
  grid-template-columns: repeat(4, minmax(44px, 1fr));
}

.menu-audio-box .menu-music-icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}

.menu-music-player--console .menu-music-track {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.menu-music-player--console .menu-music-kicker {
  color: #7ddff3;
  font-size: 10px;
  letter-spacing: .1em;
}

.menu-music-player--console .menu-music-title {
  padding: 2px 7px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 999px;
  background: rgba(2, 12, 27, .44);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.menu-music-equalizer {
  width: 14px;
  height: 12px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  flex: 0 0 auto;
}

.menu-music-equalizer > span {
  width: 2px;
  height: 35%;
  border-radius: 999px;
  background: #67e8f9;
  box-shadow: 0 0 5px rgba(34, 211, 238, .72);
  transform-origin: bottom;
}

.menu-music-player--console:has([data-menu-music-action="toggle"][data-menu-music-icon="pause"]) .menu-music-equalizer > span {
  animation: menu-music-meter .72s ease-in-out infinite alternate;
}

.menu-music-player--console:has([data-menu-music-action="toggle"][data-menu-music-icon="pause"]) .menu-music-equalizer > span:nth-child(2) {
  animation-duration: .52s;
  animation-delay: -.18s;
}

.menu-music-player--console:has([data-menu-music-action="toggle"][data-menu-music-icon="pause"]) .menu-music-equalizer > span:nth-child(3) {
  animation-duration: .84s;
  animation-delay: -.34s;
}

@keyframes menu-music-meter {
  from { transform: scaleY(.45); opacity: .72; }
  to { transform: scaleY(2.7); opacity: 1; }
}

.menu-music-player--console .menu-music-actions button {
  height: 48px;
  border-color: rgba(103, 232, 249, .34);
  background: linear-gradient(180deg, rgba(11, 45, 76, .96), rgba(5, 29, 53, .96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .05),
    0 3px 8px rgba(0, 6, 18, .16);
}

.menu-music-player--console [data-menu-music-action="toggle"] {
  border-color: rgba(103, 232, 249, .72);
  background: linear-gradient(180deg, rgba(14, 105, 132, .9), rgba(8, 67, 94, .94));
  color: #f4fdff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 0 12px rgba(34, 211, 238, .14);
}

.menu-music-player--console [data-menu-music-action="mode"][aria-pressed="true"] {
  border-color: rgba(250, 204, 21, .78);
  background: linear-gradient(180deg, rgba(120, 83, 12, .92), rgba(78, 54, 10, .94));
  color: #fef3c7;
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, .16), 0 0 10px rgba(250, 204, 21, .12);
}

.welcome-music-control > .menu-music-player {
  margin-top: 6px;
}

#menu-home-view .garage-bottom-bar {
  grid-template-areas: 'home special audio stage stage';
  grid-template-columns: minmax(90px, .65fr) minmax(150px, 1fr) minmax(420px, 2.2fr) minmax(150px, 1fr) minmax(90px, .65fr) !important;
}

#menu-home-view .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
  grid-template-areas: 'home special audio workshop stage';
  grid-template-columns: minmax(90px, .65fr) minmax(150px, 1fr) minmax(420px, 2.2fr) minmax(150px, 1fr) minmax(90px, .65fr) !important;
}

#home-to-welcome-btn { grid-area: home; }
#home-to-special-vehicles-btn { grid-area: special; }
#garage-audio-control { grid-area: audio; }
#home-to-workshop-btn { grid-area: workshop; }
#home-to-stage-btn { grid-area: stage; }

#menu-home-view #home-to-workshop-btn {
  justify-content: center;
  gap: 8px;
  padding-inline: 10px;
}

#menu-home-view #home-to-workshop-btn .workshop-entry-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1;
  text-align: center;
}

#menu-home-view #home-to-workshop-btn :is(.workshop-entry-primary, .workshop-entry-secondary) {
  display: block;
  width: max-content;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

#menu-home-view #home-to-workshop-btn .workshop-entry-primary {
  font-size: 12px;
  font-weight: 900;
}

#menu-home-view #home-to-workshop-btn .workshop-entry-secondary {
  margin-top: 0;
  color: rgba(235, 245, 255, .78);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}

#menu-home-view .garage-bottom-bar .menu-audio-box,
#menu-home-view .garage-bottom-bar .menu-audio-box :is(label, output) {
  font-size: var(--garage-readable-floor, 10px);
}

#menu-stage-view .stage-bottom-bar {
  grid-template-areas: 'garage special audio rank supporter';
  grid-template-columns: minmax(90px, .65fr) minmax(150px, 1fr) minmax(420px, 2.2fr) minmax(150px, 1fr) minmax(90px, .65fr);
}

#menu-stage-view .stage-bottom-bar input.audio-volume-range {
  min-height: 45px;
}

#close-stage-select-btn { grid-area: garage; }
#stage-to-special-vehicles-btn { grid-area: special; }
#stage-audio-control { grid-area: audio; }
#stage-world-rank-btn { grid-area: rank; }
#supporter-pass-entry { grid-area: supporter; }

#menu-stage-view .stage-bottom-bar > *,
#menu-home-view .garage-bottom-bar > * {
  min-width: 0;
}

@media (max-width: 1180px) and (min-width: 821px) {
  #menu-home-view .garage-bottom-bar,
  #menu-home-view .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
    gap: 5px;
  }

  #menu-home-view .garage-bottom-bar .menu-action,
  #menu-stage-view .stage-bottom-bar .menu-action {
    padding-inline: 6px;
    gap: 5px;
  }

  #menu-home-view .garage-bottom-bar .menu-action small,
  #menu-stage-view .stage-bottom-bar .menu-action small {
    display: none;
  }

  #menu-home-view .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
    grid-template-columns: minmax(70px, .6fr) minmax(120px, 1fr) minmax(340px, 2.2fr) minmax(120px, 1fr) minmax(70px, .6fr) !important;
  }

  #menu-home-view #home-to-workshop-btn .workshop-entry-icon {
    display: none;
  }

  #menu-home-view #home-to-workshop-btn .workshop-entry-secondary {
    display: block;
  }

  #menu-stage-view .stage-bottom-bar {
    grid-template-columns: minmax(70px, .6fr) minmax(120px, 1fr) minmax(340px, 2.2fr) minmax(120px, 1fr) minmax(70px, .6fr);
  }
}

/* At Windows 125% scaling a 1920px display is commonly about 1536 CSS px.
   Reserve a real side gutter so the detached cluster never covers the card. */
@media (min-width: 1360px) and (max-width: 1599px) {
  .welcome-title-overlay {
    padding-right: max(216px, calc(env(safe-area-inset-right) + 204px));
  }
}

/* Narrower layouts reserve a bottom band for the detached support cluster.
   The panel remains independently scrollable on short screens. */
@media (max-width: 1359px) {
  .welcome-title-overlay {
    padding-bottom: max(116px, calc(env(safe-area-inset-bottom) + 104px));
  }

  .welcome-panel {
    max-height: calc(100dvh - max(140px, env(safe-area-inset-top) + env(safe-area-inset-bottom) + 124px));
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  .welcome-title-overlay {
    padding-bottom: max(108px, calc(env(safe-area-inset-bottom) + 100px));
  }

  .welcome-panel {
    max-height: calc(100dvh - max(120px, env(safe-area-inset-top) + env(safe-area-inset-bottom) + 108px));
  }

  #menu-home-view .garage-bottom-bar {
    grid-template-areas: 'home special' 'audio audio' 'stage stage';
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #menu-home-view .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
    grid-template-areas: 'home special' 'audio audio' 'workshop stage';
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #menu-home-view #home-to-workshop-btn .workshop-entry-icon {
    display: none;
  }

  #menu-stage-view .stage-bottom-bar {
    grid-template-areas: 'garage special' 'audio audio' 'rank supporter';
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-audio-box {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(44px, auto)) auto;
  }

  .menu-audio-box > .menu-audio-control {
    grid-column: 1;
  }

  .menu-audio-box > .menu-music-player {
    grid-column: 1;
    grid-row: auto;
    padding: 4px 0 0;
    border-top: 1px solid rgba(103, 232, 249, .18);
    border-left: 0;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  .welcome-title-overlay {
    place-items: start center;
    padding:
      max(6px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(104px, calc(env(safe-area-inset-bottom) + 98px))
      max(8px, env(safe-area-inset-left));
  }

  .welcome-panel {
    width: min(100%, 1120px);
    max-height: calc(100dvh - max(112px, env(safe-area-inset-top) + env(safe-area-inset-bottom) + 104px));
    min-height: 0;
  }

  .welcome-content {
    align-content: start;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .menu-audio-box {
    min-height: 45px;
    grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) minmax(196px, 1.8fr);
    grid-template-rows: minmax(46px, auto);
    gap: 4px;
    padding: 2px 4px;
  }

  .menu-audio-box > .menu-audio-control {
    grid-column: auto;
    grid-row: 1;
    grid-template-columns: auto minmax(44px, 1fr) 28px;
    gap: 1px;
    padding-inline: 0;
  }

  .menu-audio-box .menu-audio-control .audio-volume-heading output {
    min-width: 28px;
    padding-inline: 1px;
  }

  .menu-audio-box > .menu-music-player {
    grid-column: 3;
    grid-row: 1;
    grid-template-columns: minmax(14px, .2fr) minmax(184px, 2fr);
    align-items: center;
    gap: 2px;
    padding-left: 4px;
  }

  .menu-audio-box .menu-music-track {
    display: block;
  }

  .menu-audio-box .menu-music-kicker {
    display: none;
  }

  .menu-audio-box .menu-music-title {
    display: block;
    font-size: 10px;
  }

  .menu-audio-box .menu-music-actions {
    grid-template-columns: repeat(4, minmax(45px, 1fr));
    gap: 1px;
  }

  .menu-audio-box .menu-music-actions button {
    min-width: 45px;
    min-height: 46px;
    height: 46px;
    padding-inline: 1px;
    font-size: 10px;
  }

  .menu-audio-control,
  input.audio-volume-range,
  #menu-home-view input.audio-volume-range {
    min-height: 45px;
  }

  .menu-audio-control {
    grid-template-columns: auto minmax(44px, 1fr) 27px;
    gap: 3px;
  }

  #menu-home-view .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
    min-height: 53px;
    grid-template-areas: 'home special audio workshop stage';
    grid-template-columns: 56px 84px minmax(396px, 1fr) 104px 56px !important;
    gap: 4px;
    padding: 4px;
  }

  #menu-stage-view .stage-bottom-bar {
    min-height: 53px;
    grid-template-areas: 'garage special audio rank supporter';
    grid-template-columns: 56px 84px minmax(416px, 1fr) 84px 56px;
    gap: 4px;
    padding: 4px;
  }

  #menu-home-view .garage-bottom-bar .menu-action,
  #menu-stage-view .stage-bottom-bar .menu-action,
  #menu-stage-view .stage-world-rank-btn {
    min-height: 45px;
    padding-inline: 4px;
    gap: 4px;
    font-size: 10px;
  }

  #menu-home-view .garage-bottom-bar .menu-action small,
  #menu-stage-view .stage-bottom-bar .menu-action small {
    display: none;
  }

  #menu-home-view #home-to-workshop-btn {
    gap: 0;
    padding-inline: 3px;
  }

  #menu-home-view #home-to-workshop-btn .workshop-entry-icon {
    display: none;
  }

  #menu-home-view #home-to-workshop-btn .workshop-entry-secondary {
    display: block;
  }

  #menu-home-view #home-to-workshop-btn .workshop-entry-primary {
    font-size: 11px;
  }
}

@media (forced-colors: active) {
  .audio-volume-box,
  .menu-audio-box,
  input.audio-volume-range,
  .menu-music-actions button {
    border: 1px solid ButtonText;
  }

  input.audio-volume-range:focus-visible {
    outline-color: Highlight;
  }

  .menu-music-actions button:focus-visible {
    outline-color: Highlight;
  }
}

@media (prefers-reduced-motion: reduce) {
  .audio-volume-box,
  .menu-audio-box,
  input.audio-volume-range,
  .menu-music-actions button {
    transition: none !important;
  }

  .menu-music-equalizer > span {
    animation: none !important;
    transform: none !important;
  }
}

/* ======================================================================
   UI READABILITY FLOOR
   The platform UI font is intentionally compact, but player-facing copy
   must not fall back to pixel-sized text. Keep true metadata compact while
   lifting the labels, values, and instructions that players need to read.
   This is appended after the historical responsive cascade so it wins
   without changing the canvas/gameplay typography or icon glyph sizes.
   ====================================================================== */

:root {
  --ui-readable-copy: 12px;
  --ui-readable-meta: 11px;
  --ui-compact-meta: 11px;
}

/* Reuse the currently selected front-door image as a restrained full-screen
   depth layer. The same URL is already loaded by the card image. */
.welcome-title-overlay {
  --welcome-backdrop-art: url("assets/ui/frontdoor/frontdoor_racer_01.webp");
  background:
    radial-gradient(circle at 22% 35%, rgba(32, 198, 238, .1), transparent 34%),
    linear-gradient(90deg, rgba(3, 8, 18, .84), rgba(3, 8, 18, .91)),
    linear-gradient(180deg, rgba(3, 8, 18, .58), #030712 94%),
    var(--welcome-backdrop-art) center / cover no-repeat,
    #050a12;
}

/* Help sits at the far action edge. Dialog close buttons remain one position
   farther right through DOM insertion order. */
#menu-home-view .garage-command-bar:has(#garage-context-help) {
  grid-template-areas: 'brand profile rank balance help';
  grid-template-columns: minmax(210px, 1fr) minmax(500px, auto) minmax(150px, .48fr) auto 44px;
}

#garage-context-help { grid-area: help; }

#menu-special-vehicles-view .special-vehicles-command-bar:has(#special-context-help) {
  grid-template-areas: 'brand special-heading balance help';
  grid-template-columns: minmax(260px, .9fr) minmax(280px, 1fr) minmax(190px, .65fr) 44px;
}

#menu-special-vehicles-view .special-vehicles-command-bar > .garage-brand-lockup { grid-area: brand; }
#menu-special-vehicles-view .special-vehicles-heading { grid-area: special-heading; }
#menu-special-vehicles-view .garage-balance-group { grid-area: balance; }
#special-context-help { grid-area: help; }

/* These screens use column layouts, so explicitly align their contextual
   help to the trailing edge instead of relying on append position. */
#welcome-login-panel .new-game-actions > #login-context-help {
  align-self: flex-end;
  margin-left: auto;
}

#mastery-screen > .mastery-container > #mastery-context-help {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
}

#menu-stage-view .stage-route-summary:has(#stage-context-help) {
  grid-template-columns: minmax(0, 1fr) auto 44px;
}

/* Give long profile names a useful native option width without touching the
   profile/account data contract. */
#menu-home-view .garage-profile-card {
  min-width: 500px;
}

#menu-home-view .garage-profile-card .profile-select {
  width: clamp(190px, 16vw, 240px);
  max-width: 240px;
  font-size: var(--ui-compact-meta);
}

/* Draws use the existing Workshop modal and focus trap. The compact reveal
   shows exact catalog art and never alters the completed transaction. */
.workshop-draw-result-panel {
  width: min(780px, 100%);
  min-height: min(620px, calc(100dvh - 72px));
}

.workshop-draw-reveal {
  gap: 10px;
}

.workshop-fusion-result[data-phase='revealed'] .workshop-draw-reveal {
  animation: workshop-draw-reveal .38s ease-out both;
}

@keyframes workshop-draw-reveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.workshop-draw-result-items {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  max-height: min(330px, 42dvh);
  overflow: auto;
  padding: 4px;
}

.workshop-draw-result-items.is-single {
  grid-template-columns: minmax(180px, 240px);
  justify-content: center;
}

.workshop-draw-result-item {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 9px 7px;
  border: 1px solid color-mix(in srgb, var(--workshop-rarity-color) 52%, transparent);
  border-radius: 14px;
  background: rgba(4, 13, 27, .76);
  box-shadow: inset 0 0 22px color-mix(in srgb, var(--workshop-rarity-color) 12%, transparent);
}

.workshop-draw-result-art {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
}

.workshop-draw-result-art .workshop-part-image {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.workshop-draw-result-items.is-single .workshop-draw-result-art,
.workshop-draw-result-items.is-single .workshop-draw-result-art .workshop-part-image {
  width: 180px;
  height: 180px;
}

.workshop-draw-result-name {
  max-width: 100%;
  color: #fff;
  font-size: var(--ui-readable-meta);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.workshop-draw-result-summary {
  color: #9fe7d4 !important;
  font-weight: 800;
}

@media (max-width: 720px) and (orientation: portrait) {
  .workshop-draw-result-panel {
    min-height: min(650px, calc(100dvh - 28px));
  }

  .workshop-draw-result-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 45dvh;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  .workshop-draw-result-panel {
    width: min(900px, 100%);
    min-height: 0;
  }

  .workshop-draw-reveal {
    display: grid;
    grid-template-columns: minmax(180px, .65fr) minmax(0, 1.35fr);
    grid-template-rows: repeat(5, auto);
    align-items: center;
    text-align: left;
  }

  .workshop-draw-reveal > :not(.workshop-draw-result-items) {
    grid-column: 1;
  }

  .workshop-draw-result-items {
    grid-column: 2;
    grid-row: 1 / -1;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-height: calc(100dvh - 44px);
  }

  .workshop-draw-result-items.is-single {
    grid-template-columns: minmax(150px, 220px);
  }

  .workshop-draw-result-items.is-single .workshop-draw-result-art,
  .workshop-draw-result-items.is-single .workshop-draw-result-art .workshop-part-image {
    width: 142px;
    height: 142px;
  }

  .workshop-draw-result-art,
  .workshop-draw-result-art .workshop-part-image {
    width: 64px;
    height: 64px;
  }

  .workshop-draw-result-panel .workshop-fusion-result-actions .workshop-button {
    min-height: 45px;
  }
}

@media (max-width: 1180px) {
  #menu-home-view .garage-command-bar:has(#garage-context-help) {
    grid-template-columns: minmax(150px, 1fr) minmax(390px, auto) 44px auto 44px;
    gap: 7px;
  }

  #menu-home-view .garage-profile-card {
    min-width: 390px;
  }

  #menu-home-view .garage-profile-card .profile-select {
    width: 180px;
  }

  #menu-special-vehicles-view .special-vehicles-command-bar:has(#special-context-help) {
    grid-template-areas: 'brand special-heading balance help';
    grid-template-columns: minmax(210px, .9fr) minmax(230px, 1fr) minmax(160px, .65fr) 44px;
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  #menu-home-view .garage-command-bar:has(#garage-context-help) {
    grid-template-areas:
      'brand rank balance help'
      'profile profile profile profile';
    grid-template-columns: minmax(0, 1fr) 42px auto 44px;
  }

  #menu-home-view .garage-profile-card {
    min-width: 0;
    width: 100%;
  }

  #menu-home-view .garage-profile-card .profile-select {
    width: min(240px, 48vw);
  }

  #menu-special-vehicles-view .special-vehicles-command-bar:has(#special-context-help) {
    grid-template-areas:
      'brand brand help'
      'special-heading balance balance';
    grid-template-columns: minmax(0, 1fr) auto 44px;
    grid-auto-rows: minmax(44px, auto);
    height: auto !important;
    min-height: 116px;
  }

  #menu-special-vehicles-view .special-vehicles-heading {
    width: auto;
    grid-column: auto;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  #menu-home-view .garage-command-bar:has(#garage-context-help) {
    grid-template-areas: 'brand profile rank balance help';
    grid-template-columns: minmax(130px, .72fr) minmax(250px, .9fr) 40px auto 44px;
    gap: 5px;
  }

  #menu-home-view .garage-profile-card {
    min-width: 250px;
  }

  #menu-home-view .garage-profile-card .profile-select {
    width: 150px;
  }

  #menu-special-vehicles-view .special-vehicles-command-bar:has(#special-context-help) {
    grid-template-areas: 'brand special-heading balance help';
    grid-template-columns: minmax(150px, .9fr) minmax(180px, 1fr) auto 44px;
    min-height: 44px;
    gap: 5px;
    padding: 4px 7px;
  }

  body.special-vehicles-active .menu-screen-unified {
    padding: 4px 6px !important;
  }

  #menu-special-vehicles-view .garage-brand-sub,
  #menu-special-vehicles-view .special-vehicle-catalog-trigger-copy small {
    display: none;
  }

  #menu-special-vehicles-view .special-vehicles-console {
    padding: 6px;
  }

  #menu-special-vehicles-view .special-vehicle-catalog-trigger {
    min-height: 50px;
    grid-template-columns: 34px minmax(0, 1fr) 20px;
    gap: 7px;
    margin-top: 6px;
    padding: 4px 8px;
  }

  #menu-special-vehicles-view .special-vehicle-catalog-trigger-icon {
    width: 34px;
    height: 34px;
  }
}

#menu-home-view :is(
  #active-player-score,
  #garage-vehicle-rarity,
  #garage-theme-label,
  #vehicle-preview-index,
  .garage-view-btn,
  .garage-bottom-bar > .menu-action > span:not([aria-hidden='true']),
  .garage-progress-copy strong,
  .garage-workshop-loadout-head strong,
  .garage-workshop-slot-copy strong,
  .garage-workshop-slot-copy small,
  .garage-workshop-loadout-live,
  .garage-progress-note,
  .garage-panel-copy,
  .garage-notice,
  .garage-shop-card-copy b,
  .garage-shop-card-copy small,
  .garage-collection-card-copy small,
  .garage-special-action small,
  .menu-action-copy small,
  .workshop-entry-secondary
) {
  font-size: var(--ui-readable-meta);
}

#menu-home-view :is(
  #garage-collection-percent,
  .garage-collection-card-copy strong
) {
  font-size: var(--ui-compact-meta);
}

/* Stage Select: keep score/status badges compact, but make route copy and
   selectable labels readable at a glance. */
#menu-stage-view :is(
  .stage-route-summary p,
  .stage-chapter-tab,
  .stage-route-copy > span,
  .stage-route-copy b,
  .stage-route-legend,
  .footer-orientation-label,
  .orientation-btn,
  .stage-nav-action,
  .stage-world-rank-btn
) {
  font-size: var(--ui-readable-meta);
}

#menu-stage-view .stage-bottom-bar .menu-action small {
  font-size: var(--ui-compact-meta);
}

#menu-stage-view :is(
  .stage-route-kicker,
  .stage-route-score-card span,
  .stage-route-score-card small,
  .stage-route-number,
  .stage-route-state,
  .stage-route-copy small
) {
  font-size: var(--ui-compact-meta);
}

/* Workshop copy is allowed to scroll on compact devices. Do not compensate
   for small screens by shrinking readable labels below this floor. */
.workshop-dialog :is(
  .workshop-kicker,
  .workshop-powertrain,
  .workshop-rarity,
  .workshop-stat-card span,
  .workshop-stat-card small,
  .workshop-rating span,
  .workshop-slot span,
  .workshop-filter,
  .workshop-vehicle-hero-badge,
  .workshop-overview-loadout .garage-workshop-loadout-live,
  .workshop-overview-showcase .workshop-stat-card span,
  .workshop-overview-showcase .workshop-stat-card small
) {
  font-size: var(--ui-compact-meta);
}

.workshop-dialog :is(
  .workshop-card p,
  .workshop-mission-card p,
  .workshop-intro p,
  .workshop-slot-copy,
  .workshop-filter select
) {
  font-size: var(--ui-readable-copy);
}

/* The Welcome warning is essential account guidance, not decorative copy. */
.welcome-guest-notice,
.welcome-early-access-badge,
.menu-music-player--console .menu-music-kicker,
.menu-music-player--console .menu-music-title {
  font-size: var(--ui-readable-meta);
}

#menu-home-view #home-to-workshop-btn .workshop-entry-secondary,
#menu-home-view #home-to-welcome-btn > span:not([aria-hidden='true']),
#menu-home-view #home-to-stage-btn > span:not([aria-hidden='true']) {
  font-size: var(--ui-compact-meta);
}

/* Special Vehicles still contains some intentionally dense cards. Raise only
   visible metadata, leaving icons and decorative badges untouched. */
#menu-special-vehicles-view :is(
  .special-vehicles-premium-tag,
  #special-vehicle-preview-index,
  .garage-tag,
  .garage-index-badge,
  .garage-view-label,
  .garage-view-btn,
  .garage-paint-tier,
  .special-vehicles-heading strong,
  .special-vehicle-state-badge,
  .special-market-heading p,
  .special-owned-badge,
  .special-vehicle-card-copy strong,
  .special-vehicle-card-copy small,
  .special-vehicle-card-copy b,
  .special-income-bonus-card span,
  .special-income-bonus-card small,
  .special-market-price-card span,
  .special-market-price-card small,
  .special-vehicle-paint-summary,
  .special-vehicle-paint-action,
  .special-vehicle-equip-action,
  .special-vehicles-bottom-bar p,
  .special-vehicles-disclaimer,
  .special-vehicle-catalog-trigger-copy small,
  .special-vehicle-catalog-grid .special-vehicle-card-copy small,
  .special-vehicle-catalog-grid .special-vehicle-card-copy b
) {
  font-size: var(--ui-compact-meta);
}

@media (max-height: 640px) and (orientation: landscape) {
  /* Preserve one-row rails while retaining the 11px compact floor. */
  #menu-stage-view :is(
    .stage-route-kicker,
    .stage-route-score-card span,
    .stage-route-score-card small,
    .stage-route-number,
    .stage-route-state,
    .stage-route-copy small,
    .stage-route-copy > span,
    .stage-route-copy b,
    .stage-route-legend,
    .footer-orientation-label,
    .orientation-btn,
    .stage-nav-action,
    .stage-world-rank-btn
  ) {
    font-size: var(--ui-compact-meta);
  }
}

/* Final cascade authority for the unified Garage race route. */
#menu-home-view #home-to-workshop-btn[data-race-launcher-superseded='true'],
#menu-home-view #garage-lightspeed-entry[data-race-launcher-superseded='true'] {
  display: none !important;
}

#menu-home-view .garage-bottom-bar,
#menu-home-view .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
  grid-template-areas: 'home special audio stage' !important;
  grid-template-columns:
    minmax(92px, .44fr)
    minmax(155px, .72fr)
    minmax(420px, 2.1fr)
    minmax(190px, .92fr) !important;
}

@media (max-width: 1180px) {
  #menu-home-view .garage-bottom-bar,
  #menu-home-view .garage-bottom-bar:has(.workshop-entry-action:not([hidden])) {
    grid-template-columns:
      minmax(76px, .45fr)
      minmax(125px, .72fr)
      minmax(340px, 2.1fr)
      minmax(170px, .92fr) !important;
  }
}

/* Final command-bar authority: Settings remains a first-class Garage action
   after all legacy and Context Help responsive rules in this stylesheet. */
#menu-home-view .garage-command-bar {
  grid-template-areas: 'brand profile rank settings balance';
  grid-template-columns: minmax(190px, 1fr) minmax(390px, auto) minmax(44px, .42fr) 46px auto;
}
#menu-home-view .garage-command-bar:has(#garage-context-help) {
  grid-template-areas: 'brand profile rank settings balance help';
  grid-template-columns: minmax(180px, 1fr) minmax(390px, auto) minmax(44px, .42fr) 46px auto 44px;
}
@media (max-width: 1180px) {
  #menu-home-view .garage-command-bar,
  #menu-home-view .garage-command-bar:has(#garage-context-help) {
    grid-template-columns: minmax(145px, 1fr) minmax(350px, auto) 44px 44px auto 44px;
    gap: 7px;
  }
}
@media (max-width: 820px) and (orientation: portrait) {
  #menu-home-view .garage-command-bar,
  #menu-home-view .garage-command-bar:has(#garage-context-help) {
    grid-template-areas: 'brand rank settings balance help' 'profile profile profile profile profile';
    grid-template-columns: minmax(0,1fr) 42px 42px auto 44px;
  }
}
