/* ============================================================================================
   Menus: pit-lane main menu, Free Race, showroom overlay, settings, pause, loading (see menu.js).
   Everything is scoped under .km / .km-pause / .km-loading so it can't collide with HUD classes.
   ============================================================================================ */
.km, .km-pause, .km-loading {
  --ink: #10253f;
  --ink-soft: #3a5673;
  --paper: #f6f0e6;
  --paper-hi: #fffdf8;
  --blue: #1774c9;
  --signal: #f5b82e;
  --signal-hi: #ffd15c;
  --rust: #d5522f;
  --line: rgba(16, 37, 63, 0.16);
  --shadow: 0 24px 70px rgba(5, 19, 34, 0.3);
  --cond: "Barlow Condensed", sans-serif;
  color: var(--ink);
  font: 500 15px/1.4 "Barlow", sans-serif;
}
.km button, .km-pause button { cursor: pointer; }
.km :focus, .km-pause :focus { outline: none; } /* highlight is the .hl class (menu.js) */
.km h1, .km-pause h1 { margin: 0; }

.km { display: flex; flex-direction: column; isolation: isolate; background: var(--ink); }
.km.is-showroom { background: transparent; }

/* ---------- pit-lane scene: one stage in backdrop pixels (986 x 548) so actors stay glued to the floor ---------- */
.km-scene {
  position: absolute; z-index: -1; right: 0; bottom: 0;
  width: max(100%, calc(100vh * 986 / 548)); aspect-ratio: 986 / 548; /* cover; overflow goes off the top (sky) */
  background: url("../assets/menu/pitlane.jpg") center / 100% 100%;
  pointer-events: none;
}
.km.is-showroom .km-scene { display: none; }
.km-shade {
  position: absolute; inset: 0; z-index: 3;
  background: linear-gradient(90deg, rgba(8, 27, 47, .9) 0%, rgba(8, 27, 47, .66) 30%, rgba(8, 27, 47, 0) 44%);
  mask: linear-gradient(180deg, transparent 18%, #000 52%);
  transition: opacity .4s;
}
.km:not(.is-main) .km-shade { mask: none; }
/* sub-pages: a heavier wash so the panel reads, same scene underneath */
.km-shade::after { content: ""; position: absolute; inset: 0; background: rgba(8, 27, 47, .45); opacity: 1; transition: opacity .4s; }
.km.is-main .km-shade::after { opacity: 0; }

/* each racer on the apron in front of their own pit, sized by depth; sizes are widths, heights follow the sprite */
.actor { position: absolute; transform-origin: 50% 100%; }
.actor img { display: block; width: 100%; }
.actor::after { content: ""; position: absolute; z-index: -1; left: -4%; right: -4%; bottom: -4%; height: 10%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(10, 12, 18, .55), rgba(10, 12, 18, .2) 60%, transparent); }
/* karts touch the ground at all four wheels: shadow spans the whole footprint, not just the front edge */
.actor[class*="kart-"]::after { left: -8%; right: -6%; bottom: -6%; height: 46%;
  background: radial-gradient(closest-side, rgba(8, 10, 14, .78), rgba(8, 10, 14, .42) 50%, transparent); }
/* same late-morning sun as the backdrop: warm key from the upper right */
.actor.pit img { filter: saturate(1.12) contrast(1.04) brightness(1.02) drop-shadow(-3px 0 4px rgba(255, 214, 150, .18)); }

.kart-skye   { left: 44%;   bottom: 26.2%; width: 7.5%; }
.skye        { left: 52.3%; bottom: 27%;   width: 5%; }
.kart-bjorn  { left: 60%;   bottom: 20.6%; width: 9.5%; }
.bjorn       { left: 69.3%; bottom: 21.5%; width: 7.2%; }
.kart-barley { left: 78%;   bottom: 18.6%; width: 10.2%; }
.barley      { left: 88.6%; bottom: 18%;   width: 6.8%; }
.barley img  { transform: scaleX(-1); } /* facing his tractor */
.skye, .bjorn, .barley { animation: kmBreathe 3.6s ease-in-out infinite; }
.bjorn { animation-delay: -1.3s; }
.barley { animation-delay: -2.1s; }

/* exhaust from the idling tractor */
.puff { position: absolute; left: 30%; top: -4%; width: 9%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(rgba(210, 214, 220, .55), transparent 70%); opacity: 0; animation: kmPuff 2.4s ease-out infinite; }
.puff:nth-of-type(2) { animation-delay: .8s; }
.puff:nth-of-type(3) { animation-delay: 1.6s; }

.bubble {
  position: absolute; bottom: 104%; left: 50%; width: max-content; max-width: 24vh; margin: 0;
  padding: 8px 12px; border-radius: 14px; background: var(--paper-hi); box-shadow: 0 10px 30px rgba(5, 19, 34, .3);
  font: 700 clamp(11px, 1.6vh, 14px)/1.25 "Barlow", sans-serif; color: var(--ink);
  opacity: 0; transform: translate(-50%, 8px) scale(.9); transform-origin: 50% 100%; transition: opacity .25s, transform .25s;
}
.bubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top-color: var(--paper-hi); }
.bubble.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
/* Barley stands at the right edge: his bubble hangs to the left */
.bubble.b3 { left: auto; right: 20%; transform: translate(0, 8px) scale(.9); transform-origin: 80% 100%; }
.bubble.b3.on { transform: none; }
.bubble.b3::after { left: 80%; }
.km:not(.is-main) .bubble { display: none; }

/* sky life: a small drifting cloud and a few gulls */
.cloud { position: absolute; left: 30%; top: 7%; width: 9%; aspect-ratio: 2.4; animation: kmDrift 260s ease-in-out infinite alternate;
  background: radial-gradient(closest-side, #fff, rgba(255, 255, 255, .85) 55%, transparent) 8% 70% / 42% 60% no-repeat,
    radial-gradient(closest-side, #fff, rgba(255, 255, 255, .85) 55%, transparent) 38% 20% / 48% 80% no-repeat,
    radial-gradient(closest-side, #fff, rgba(240, 246, 255, .85) 55%, transparent) 72% 55% / 44% 66% no-repeat,
    radial-gradient(closest-side, rgba(214, 228, 245, .9), transparent) 50% 100% / 90% 34% no-repeat;
  filter: blur(.6px); opacity: .95; }
.birds { position: absolute; inset: 0; }
.birds i { position: absolute; aspect-ratio: 2.2; translate: -50% -50%; animation: kmFlap .45s ease-in-out infinite alternate;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 10'%3E%3Cpath d='M1 7Q6 1 11 7Q16 1 21 7' fill='none' stroke='%2322344d' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.birds i.glide { animation-play-state: paused; }
/* the backdrop with its sky cut out: birds and cloud pass behind the roof, sign and trees */
.km-scene .front { position: absolute; left: 0; top: 0; width: 100%; }
@keyframes kmDrift { to { translate: 420% 0; } }
@keyframes kmFlap { to { scale: 1 .35; } }
@keyframes kmBreathe { 0%, 100% { scale: 1 1; } 50% { scale: 1.006 1.014; } }
@keyframes kmPuff { 0% { opacity: 0; translate: 0 0; scale: .5; } 15% { opacity: 1; } 100% { opacity: 0; translate: -60% -260%; scale: 2.6; } }

/* ---------- menu chrome ---------- */
.km-top { flex: none; display: flex; align-items: center; height: clamp(48px, 10vh, 88px); padding: 8px clamp(16px, 4vw, 64px); color: #fff; }
.km.is-main .brand { visibility: hidden; }
.km .brand { display: flex; flex-direction: column; padding: 0; border: 0; background: none; transform: skew(-6deg); text-align: left; font: italic 900 clamp(24px, 3vw, 44px)/1 var(--cond); letter-spacing: -.02em; }
.km .brand span + span { color: var(--signal); font-size: .8em; }
.km-page { flex: 1; min-height: 0; overflow: hidden; }
.km:not(.is-main):not(.is-showroom) .km-page { display: flex; align-items: center; padding: 12px clamp(16px, 4vw, 64px) 24px; }
.km-page.in > * { animation: kmIn .25s ease-out; }
@keyframes kmIn { from { translate: -12px 0; } }
.km button:focus-visible, .km-pause button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.km ::selection, .km-pause ::selection { background: var(--signal); color: var(--ink); }

/* ---------- main ---------- */
.km.is-main .km-page { display: flex; flex-direction: column; justify-content: flex-end; }
.km .main { width: min(500px, 100%); padding: 16px 16px clamp(24px, 9vh, 110px) clamp(16px, 7vw, 118px); color: #fff; }
.mlist { display: flex; flex-direction: column; }
.mbtn { position: relative; isolation: isolate; display: grid; grid-template-columns: 1fr auto; align-items: center; width: 100%; min-height: clamp(44px, 6.4vh, 58px); padding: 0 16px; overflow: hidden; border: 0; border-bottom: 1px solid rgba(255,255,255,.2); background: none; color: inherit; text-align: left; font: 700 clamp(22px, 2.1vw, 28px)/1 var(--cond); text-transform: uppercase; transition: color .18s; }
.mbtn::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--signal); transform: translateX(-101%); transition: transform .2s ease; }
.mbtn.hl { color: var(--ink); }
.mbtn.hl::before { transform: none; }
.ma { font-size: 20px; }

/* ---------- shared panels ---------- */
.km .panel { width: min(1040px, 100%); max-height: 100%; min-height: 0; padding: clamp(12px, 2.5vh, 28px) clamp(16px, 3vw, 36px); border-top: 5px solid var(--signal); background: var(--paper); box-shadow: var(--shadow); }
.km[data-page='careerfile'] .panel, .km[data-page='setup'] .panel { width: min(820px, 100%); }
.km .back { display: block; margin: 0 0 12px; padding: 4px 0; border: 0; background: none; color: var(--ink-soft); font: 700 14px/1 var(--cond); text-transform: uppercase; }
.km .back:hover, .km .back.hl { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
.km .panel-title, .km-pause .panel-title { margin-bottom: 16px; font: 800 clamp(30px, min(5vw, 6vh), 56px)/1 var(--cond); letter-spacing: -.03em; text-transform: uppercase; }
.km .primary { display: flex; width: 100%; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 10px 18px; border: 0; background: var(--signal); color: var(--ink); font: 800 22px/1.1 var(--cond); text-transform: uppercase; transition: background .15s; }
.km .primary.hl, .km .primary:hover { background: var(--signal-hi); outline: 3px solid var(--ink); outline-offset: -3px; }
.km .primary.alt { background: var(--paper-hi); box-shadow: inset 0 0 0 1px var(--line); }
.km .primary.alt span { font-size: 13px; }
.km .primary.alt.hl, .km .primary.alt:hover { background: var(--signal-hi); }
.km .cf-note { max-width: 55ch; margin: 8px 0 20px; color: var(--ink-soft); }
.km .cf-msg { min-height: 20px; margin-top: 10px; font-size: 14px; color: var(--rust); }
.file-actions { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
.km .file-actions .primary { margin: 0; }

/* ---------- racer: portraits carry the screen ---------- */
.racer-layout { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0,1fr); gap: 20px; height: clamp(240px, 43vh, 460px); }
.detail { position: relative; min-width: 0; min-height: 0; overflow: hidden; color: #fff; background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--c) 70%, white), var(--c) 50%, color-mix(in srgb, var(--c) 55%, black)); }
.detail::before { content: ''; position: absolute; inset: auto 0 0; height: 34%; background: rgba(0,0,0,.18); }
.d-racer { position: absolute; left: 7%; bottom: 0; height: 94%; max-width: 64%; object-fit: contain; object-position: bottom; }
.d-kart { position: absolute; right: 2%; bottom: 5%; width: 50%; max-height: 44%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(0,0,0,.3)); }
.d-copy { position: absolute; right: 5%; top: 7%; width: 43%; text-shadow: 0 2px 6px rgba(0,0,0,.65); }
.d-copy strong { display: block; margin-bottom: 12px; font: 900 clamp(28px, 3.4vw, 44px)/1 var(--cond); text-transform: uppercase; }
.stat { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 8px; margin-top: 7px; font: 700 11px/1 var(--cond); text-transform: uppercase; }
.stat i { height: 7px; background: linear-gradient(90deg, var(--signal) calc(var(--v) * 20%), rgba(255,255,255,.25) 0); mask: repeating-linear-gradient(90deg, #000 0 calc(20% - 3px), transparent 0 20%); }
.km .grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); grid-template-rows: repeat(2, minmax(0,1fr)); gap: 10px; min-width: 0; min-height: 0; }
.km .card { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0; border: 0; background: var(--paper-hi); color: var(--ink); }
.km .card img { flex: 1; min-height: 0; width: 100%; height: 0; object-fit: contain; object-position: center bottom; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 60%, white), var(--c)); }
.km .card span { flex: none; padding: 7px 2px; font: 800 15px/1 var(--cond); text-transform: uppercase; text-align: center; }
.km .card.sel, .km .card.hl { outline: 3px solid var(--signal); outline-offset: -3px; }
.km .card.sel span, .km .card.hl span { background: var(--signal); }
.racer-actions { display: flex; align-items: stretch; gap: 12px; margin-top: 16px; }
.racer-actions > * { flex: 1; min-width: 0; }
.km .racer-actions .primary { margin: 0; }

/* ---------- options and battle arenas ---------- */
.box { background: var(--paper-hi); }
.km .opt, .km-pause .opt { display: grid; grid-template-columns: 130px 24px minmax(0,1fr) 24px; align-items: center; width: 100%; min-height: 52px; padding: 8px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left; font-weight: 700; }
.km .opt:last-child, .km-pause .opt:last-child { border-bottom: 0; }
.km .opt.hl, .km-pause .opt.hl { background: color-mix(in srgb, var(--signal) 28%, var(--paper-hi)); }
.ol { font-size: 14px; }
.oa { color: var(--rust); text-align: center; font-size: 12px; }
.ov { text-align: center; font: 800 20px/1.1 var(--cond); text-transform: uppercase; overflow-wrap: anywhere; }
.ov.bump { animation: kmBump .2s ease; }
@keyframes kmBump { 50% { scale: 1.04; } }
.arena-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 4px 0 20px; }
.arena-card { display: flex; flex-direction: column; min-width: 0; padding: 0; border: 0; background: var(--paper-hi); color: var(--ink); text-align: left; }
.arena-card img { width: 100%; height: clamp(150px, 27vh, 290px); object-fit: cover; }
.arena-card strong { display: flex; align-items: center; min-height: 60px; padding: 10px 12px; font: 800 22px/1.1 var(--cond); text-transform: uppercase; }
.arena-card.sel, .arena-card.hl { outline: 3px solid var(--signal); outline-offset: -3px; }
.arena-card.sel strong { background: var(--signal); }
.arena-card.hl { outline-color: var(--blue); }
.battle-rules { margin: 12px 0 0; color: var(--ink-soft); text-align: center; font-weight: 700; }
.battle-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.km .battle-actions .primary { margin: 0; }

/* ---------- settings: short control pages instead of a scroll list ---------- */
.km .settings { display: grid; grid-template-columns: .85fr 1.3fr; gap: 24px; background: none; }
.km .sec { min-width: 0; }
.km .sec .opt { grid-template-columns: minmax(0,1fr) 24px 70px 24px; padding: 8px 12px; background: var(--paper-hi); }
.km .st { display: block; margin: 0 0 12px; color: var(--ink-soft); font-weight: 800; font-size: 12px; }
.graphics-settings { margin-top: 24px; }
.graphics-detail { margin: 10px 4px 0; color: var(--ink-soft); font-size: 12px; line-height: 1.4; }
.control-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; margin-bottom: 12px; }
.control-tabs button { min-height: 44px; padding: 6px 4px; border: 0; background: var(--paper-hi); color: var(--ink-soft); font: 800 16px/1.1 var(--cond); }
.control-tabs button[aria-pressed='true'], .control-tabs button.hl { background: var(--ink); color: var(--paper-hi); }
.ctls .ctl { display: grid; grid-template-columns: 1fr 1fr 1.2fr; align-items: center; gap: 8px; min-height: 48px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.ctls .ctl-head { min-height: 24px; padding: 0 0 8px; color: var(--ink-soft); font-size: 11px; }
.ctls .ctl-head span:not(:first-child) { text-align: center; }
.ctls kbd { padding: 5px 4px; background: var(--paper-hi); color: var(--ink); font: 700 12px/1.25 'Barlow', sans-serif; text-align: center; }

/* ---------- showroom ---------- */
.km.is-showroom .km-page { display: flex; flex-direction: column; justify-content: flex-end; }
.sr-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 20px clamp(16px,4vw,64px); background: linear-gradient(0deg,rgba(8,27,47,.9),rgba(8,27,47,0)); color: #fff; }
.km .sr-bar .back { margin: 0; color: #fff; justify-self: start; }
.sr-name { display: flex; align-items: center; gap: 18px; text-align: center; }
.sr-name span { min-width: 140px; }
.sr-name strong { font: 900 44px/1 var(--cond); text-transform: uppercase; }
.sr-arrow { width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; background: #10253f; color: #fff; font-size: 16px; }
.sr-arrow.hl { border-color: var(--signal); color: var(--signal); }
.km .sr-bar .primary { width: auto; margin: 0; justify-self: end; }

/* ---------- pause ---------- */
.km-pause { display: flex; align-items: center; justify-content: center; background: rgba(8,27,47,.65); }
.km-card { width: min(640px,calc(100% - 32px)); max-height: calc(100% - 32px); padding: clamp(16px,3vh,28px); border-top: 5px solid var(--signal); background: var(--paper); box-shadow: var(--shadow); }
.km-pause .stack { display: grid; gap: 8px; }
.km-pause .mbtn { min-height: 48px; padding: 0 18px; background: var(--paper-hi); border: 0; font-size: 22px; }
.pause-graphics { margin-top: 16px; background: var(--paper-hi); }
.pause-graphics .graphics-detail { margin: 0; padding: 8px 16px; }
.km-pause .save-line { margin-top: 8px; color: var(--ink-soft); font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.save-line:empty { display: none; }
.help-button { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px; margin-top: 12px; padding: 8px 12px; border: 0; background: transparent; color: var(--ink-soft); text-align: left; font-weight: 700; }
.help-button.hl { background: var(--signal); color: var(--ink); }
.km-card:has(.ctls) .stack, .km-card:has(.ctls) .pause-graphics, .km-card:has(.ctls) .save-line { display: none; }

/* ---------- loading ---------- */
.km-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: #10253f; color: #fff; }
.km-loading .flag { width: 64px; height: 44px; background: repeating-conic-gradient(#fff 0 25%,#10253f 0 50%) 0 0 / 16px 16px; border: 2px solid #fff; animation: kmWave 1s ease-in-out infinite alternate; transform-origin: 0 50%; }
.km-loading .loading-text { font: italic 900 30px/1 var(--cond); letter-spacing: .08em; color: var(--signal); }
@keyframes kmWave { from { transform: skewY(-6deg) scaleX(.94); } to { transform: skewY(6deg); } }

@media (max-width: 760px) and (min-height: 601px) {
  .km:not(.is-main):not(.is-showroom) .km-page { padding: 8px 12px 16px; }
  .km .panel { padding: 16px; }
  .racer-layout { grid-template-columns: 1fr; grid-template-rows: minmax(0,1.2fr) minmax(0,1fr); height: min(53vh,460px); gap: 12px; }
  .d-racer { left: 10%; }
  .d-kart { right: 3%; width: 45%; }
  .d-copy { top: 9%; }
  .racer-actions { flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .racer-actions .box { flex-basis: 100%; }
  .km .racer-actions .primary { font-size: 18px; padding-inline: 10px; }
  .km .settings { grid-template-columns: 1fr; gap: 20px; }
  .graphics-settings { margin-top: 12px; }
  .km .st { margin-bottom: 8px; }
  .arena-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
  .arena-card { display: grid; grid-template-columns: 48% 1fr; }
  .arena-card img { height: clamp(92px,14vh,140px); }
  .arena-card strong { font-size: 22px; }
  .battle-actions { grid-template-columns: 1fr; gap: 8px; }
  .sr-bar { grid-template-columns: 1fr auto; gap: 14px; padding: 16px; }
  .sr-name { grid-column: 1 / -1; grid-row: 1; justify-content: center; }
  .sr-name strong { font-size: 36px; }
}
@media (max-height: 700px) {
  .km .panel { padding-block: 12px; }
  .km .panel-title, .km-pause .panel-title { margin-bottom: 12px; font-size: 34px; }
  .km .back { margin-bottom: 8px; }
  .km .opt, .km-pause .opt { min-height: 44px; }
  .racer-layout { height: 36vh; }
  .km .primary { min-height: 44px; }
}
@media (max-height: 600px) {
  .km-top { height: 48px; }
  .km:not(.is-main):not(.is-showroom) .km-page { padding: 8px 16px 12px; }
  .km .panel { padding: 10px 16px; }
  .file-actions { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .km .panel-title, .km-pause .panel-title { font-size: 30px; margin-bottom: 10px; }
  .racer-layout { height: calc(100dvh - 205px); gap: 14px; }
  .km .card span { padding: 5px 2px; font-size: 13px; }
  .d-copy { width: 40%; }
  .d-copy strong { font-size: 26px; margin-bottom: 8px; }
  .stat { grid-template-columns: 42px 1fr; gap: 4px; margin-top: 5px; font-size: 10px; }
  .racer-actions { margin-top: 10px; gap: 8px; }
  .km .racer-actions .primary { font-size: 18px; padding-inline: 10px; }
  .km .racer-actions .opt { grid-template-columns: 1fr 18px 1fr 18px; padding-inline: 6px; }
  .km .racer-actions .ol { font-size: 12px; }
  .km .racer-actions .ov { font-size: 16px; }
  .km .settings { gap: 16px; grid-template-columns: .8fr 1.4fr; }
  .ctls .ctl { min-height: 36px; padding: 4px 0; font-size: 12px; }
  .control-tabs { margin-bottom: 8px; }
  .control-tabs button { min-height: 36px; font-size: 14px; }
  .graphics-settings { margin-top: 12px; }
  .arena-card img { height: max(70px,calc(100dvh - 295px)); }
  .arena-card strong { min-height: 50px; font-size: 18px; padding: 8px; }
  .arena-grid { margin-bottom: 12px; }
  .km-card { width: min(720px,calc(100% - 24px)); padding: 14px 18px; }
  .km-pause .stack { grid-template-columns: 1fr 1fr; }
  .pause-graphics { margin-top: 10px; }
  .sr-bar { padding-block: 12px; }
  .sr-name strong { font-size: 32px; }
  .sr-name span { min-width: 100px; }
}
@media (max-width: 480px) {
  .km .opt, .km-pause .opt { grid-template-columns: 100px 20px minmax(0,1fr) 20px; padding-inline: 10px; }
  .km.is-main .main { padding-left: 20px; padding-bottom: 36px; }
  .km-shade { background: linear-gradient(0deg,rgba(8,27,47,.95) 20%,rgba(8,27,47,.5) 75%); }
  .bubble { display: none; }
  .control-tabs button { font-size: 14px; }
}
@media (max-width: 760px) and (min-height: 601px) and (max-height: 700px) {
  .racer-layout { height: 42vh; }
  .km .settings { gap: 12px; }
  .km .settings .ctl { min-height: 40px; padding-block: 4px; }
  .km .settings .ctl-head { min-height: 24px; }
  .graphics-detail { margin-top: 6px; }
}
@media (max-height: 420px) {
  .ctls .ctl { min-height: 30px; padding-block: 3px; }
  .ctls .ctl-head { min-height: 20px; }
  .km-card:has(.ctls) .help-button { margin-top: 0; min-height: 36px; }
  .km-card:has(.ctls) .control-tabs button { min-height: 32px; }
  .control-tabs button { min-height: 32px; }
  .km .panel-title { margin-bottom: 8px; }
  .battle-rules { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .km *, .km *::before, .km *::after, .km-pause *, .km-loading * { animation: none !important; transition: none !important; }
}
