:root {
  --bg: #0c1218;
  --panel: #17222b;
  --panel2: #202e39;
  --ink: #f6f0e2;
  --muted: #a4b6bd;
  --yellow: #ffd23f;
  --red: #e5423a;
  --green: #4fd1a5;
  --pink: #ff6b9d;
  --blue: #5ce1ff;
  --orange: #f0a63a;
  --line: rgba(235, 245, 235, 0.14);
  --font: "Noto Sans TC", "Microsoft JhengHei", "PingFang HK", "Heiti TC", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  height: 100%;
  background: #070b0f;
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 0%, rgba(229, 66, 58, .16), transparent 45%),
    radial-gradient(circle at 85% 100%, rgba(92, 225, 255, .12), transparent 50%),
    #070b0f;
}

#app {
  position: relative;
  width: min(100vw, 56.25vh);
  height: min(177.78vw, 100vh);
  overflow: hidden;
  background: #111a22;
  box-shadow: 0 20px 80px rgba(0, 0, 0, .55);
  isolation: isolate;
  container-type: inline-size;
}

@media (min-width: 800px) {
  #app { border-radius: 26px; border: 1px solid rgba(255, 255, 255, .08); }
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 1;
  pointer-events: none;
}
body.racing #screens { display: none; }

#screens {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 18px calc(26px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 210, 63, .07), transparent 42%),
    linear-gradient(180deg, #121d26 0%, #0b1218 100%);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.screen::-webkit-scrollbar { display: none; }
.screen.active { display: block; animation: fadeIn .2s ease; }
#screen-title.active { display: flex; flex-direction: column; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hidden { display: none !important; }

/* ---------- Title ---------- */

#screen-title {
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: #101821;
  scrollbar-width: none;
}
#screen-title::-webkit-scrollbar { display: none; }

.title-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(255, 196, 95, .55), transparent 34%),
    radial-gradient(ellipse at 50% 30%, rgba(229, 66, 58, .38), transparent 55%),
    linear-gradient(180deg, #243b50 0%, #6b4a58 34%, #d1795b 57%, #7b3e3c 72%, #141d26 72.2%, #0a1016 100%);
}

.title-sky::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12%;
  width: 210px;
  height: 210px;
  margin-left: -105px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffdf7e, #f2a65a 55%, rgba(242, 166, 90, .05) 72%);
  filter: blur(.2px);
  opacity: .8;
}

.title-sky::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 27.8%;
  height: 12%;
  background:
    linear-gradient(90deg, transparent 0 2%, #121c24 2% 8%, transparent 8% 10%, #1b2831 10% 16%, transparent 16% 18%, #101920 18% 24%, transparent 24% 27%, #1e2b34 27% 33%, transparent 33% 36%, #151f27 36% 42%, transparent 42% 46%, #223039 46% 52%, transparent 52% 56%, #101a22 56% 62%, transparent 62% 66%, #1b2831 66% 72%, transparent 72% 76%, #121c24 76% 82%, transparent 82% 86%, #1b2831 86% 92%, transparent 92% 100%);
  clip-path: polygon(0 100%, 0 64%, 4% 58%, 8% 72%, 11% 48%, 15% 62%, 18% 38%, 22% 62%, 26% 54%, 30% 78%, 34% 46%, 38% 65%, 42% 34%, 46% 60%, 50% 50%, 54% 66%, 58% 40%, 62% 70%, 66% 52%, 70% 76%, 74% 44%, 78% 64%, 82% 36%, 86% 60%, 90% 50%, 94% 70%, 98% 56%, 100% 64%, 100% 100%);
  opacity: .9;
}

.title-top {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 0;
}

.tour-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(8, 14, 18, .6);
  border: 1px solid rgba(255, 210, 63, .45);
  color: var(--yellow);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}

.title-main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 14px 20px calc(12px + env(safe-area-inset-bottom));
}

.title-kicker {
  margin-top: 2px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .3em;
}

.logo {
  margin: 2px 0 2px;
  font-size: clamp(44px, 12.5vw, 68px);
  line-height: .94;
  letter-spacing: -0.05em;
  font-weight: 900;
  text-shadow: 0 4px 0 rgba(25, 26, 30, .3), 0 0 28px rgba(255, 210, 63, .16);
}

.logo span { color: #fff6dd; }
.logo strong {
  color: var(--yellow);
  text-shadow:
    -2px 0 #151c22, 2px 0 #151c22, 0 -2px #151c22, 0 2px #151c22,
    0 5px 0 rgba(0, 0, 0, .28);
  padding: 0 .04em;
}

.logo-sub {
  font-size: 12px;
  font-weight: 700;
  color: #ffe9bb;
  opacity: .92;
  letter-spacing: .02em;
}

.title-showcase {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  margin: 2px -8px 0;
  height: 86px;
}

.title-showcase canvas {
  width: 32%;
  height: 78px;
  filter: drop-shadow(0 12px 10px rgba(0, 0, 0, .35));
}

.title-showcase canvas:nth-child(2) { transform: translateY(8px) scale(1.12); }

.title-mascot {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 4px;
}

.cow { width: 74px; height: 74px; flex: 0 0 auto; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .25)); }

.speech {
  position: relative;
  padding: 6px 10px;
  border-radius: 14px 14px 14px 4px;
  background: #fff8e7;
  color: #2b2a27;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  transform: rotate(-2deg);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
}

.speech::before {
  content: "";
  position: absolute;
  left: -8px;
  bottom: 6px;
  border: 8px solid transparent;
  border-right-color: #fff8e7;
  border-left: 0;
}

.speech span {
  display: block;
  margin-top: 2px;
  color: #a46a1f;
  font-size: 10px;
  letter-spacing: .1em;
}

.title-buttons {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 4px;
}
.title-buttons .big-btn { min-height: 48px; padding: 9px 14px; font-size: 16px; }
.title-buttons .ghost-btn { padding: 7px; font-size: 11px; }

.big-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  border-radius: 15px;
  border: 2px solid rgba(255, 255, 255, .16);
  background: linear-gradient(180deg, rgba(45, 63, 76, .96), rgba(26, 38, 47, .96));
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .22);
  transition: transform .1s ease, filter .1s ease;
}

.big-btn small {
  font-size: 10px;
  font-weight: 700;
  color: rgba(240, 246, 240, .62);
  text-align: right;
  line-height: 1.25;
}

.big-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.big-btn:hover { filter: brightness(1.07); }

.big-btn.primary {
  border-color: #ffe28a;
  background: linear-gradient(180deg, #ffe069, #f5b52e);
  color: #20241f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .26);
  box-shadow: 0 5px 0 #9c6d12, 0 0 24px rgba(255, 210, 63, .22);
}
.big-btn.primary small { color: rgba(40, 42, 30, .62); }

.big-btn.danger {
  border-color: rgba(255, 111, 95, .6);
  color: #ffd5cd;
  background: linear-gradient(180deg, rgba(96, 38, 36, .95), rgba(58, 24, 24, .95));
}

.ghost-btn {
  border: 0;
  background: rgba(8, 14, 18, .34);
  color: #e9e3d5;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  padding: 10px;
  border-radius: 11px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .13);
}

.ghost-btn:hover { background: rgba(255, 255, 255, .08); }

.title-stats {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: #ffe9bb;
  font-size: 11px;
  font-weight: 800;
}

.title-note {
  margin-top: 2px;
  text-align: center;
  color: rgba(255, 241, 210, .5);
  font-size: 9px;
}

.title-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 230, 190, .14);
  color: rgba(255, 240, 214, .66);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  text-align: center;
}

.title-footer span {
  display: inline-block;
  margin-right: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--yellow);
  color: #24261f;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
}

/* ---------- Shared screen ---------- */

.screen-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.screen-head h2 {
  margin: 2px 0 0;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.12;
}

.eyebrow {
  color: var(--yellow);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.back-btn, .icon-btn, .mini-btn {
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(12, 20, 26, .62);
  color: var(--ink);
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 900;
}

.back-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  font-size: 21px;
  line-height: 1;
}

.icon-btn.muted { color: #ffb8ad; border-color: rgba(255, 107, 95, .4); }
button:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.3); }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.back-btn:active, .icon-btn:active, .mini-btn:active { transform: translateY(2px); }

.mini-btn {
  padding: 7px 10px;
  font-size: 11px;
  border-radius: 9px;
  color: #e9efe9;
}
.mini-btn.danger { color: #ffc1b8; border-color: rgba(255, 107, 95, .4); }

.screen-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 14px;
}

.tiny { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 8px 0 0; }
.screen-foot { margin-top: 14px; padding-bottom: 10px; }

/* ---------- Cups ---------- */

.cup-grid { display: grid; gap: 11px; }

.cup-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, .12);
  background: linear-gradient(155deg, rgba(38, 54, 65, .96), rgba(19, 29, 37, .96));
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}

.cup-card:hover { transform: translateY(-1px); }
.cup-card.selected { border-color: var(--yellow); box-shadow: 0 0 0 2px rgba(255, 210, 63, .16), 0 8px 22px rgba(0, 0, 0, .2); }

.cup-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--cupcolor, var(--yellow));
  color: #1c2228;
  font-size: 22px;
  font-weight: 900;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
}

.cup-card h3 { margin: 0; font-size: 16px; font-weight: 900; }
.cup-card p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.cup-card .cup-stars { color: var(--yellow); font-size: 13px; white-space: nowrap; }
.cup-card .cup-best { display: block; margin-top: 3px; color: rgba(255, 240, 200, .5); font-size: 9px; text-align: right; }
.cup-card.locked {
  cursor: default;
  border-style: dashed;
  background: linear-gradient(155deg, rgba(33, 46, 56, .72), rgba(15, 23, 30, .9));
}
.cup-card.locked:hover { transform: none; }
.cup-card.locked .cup-icon { filter: grayscale(.75); opacity: .5; }
.cup-card.locked h3, .cup-card.locked p { opacity: .62; }
.cup-coming { text-align: right; line-height: 1.25; white-space: nowrap; }
.cup-coming b { display: block; color: var(--yellow); font-size: 9px; letter-spacing: .4px; }
.cup-coming span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 700; }

/* ---------- Vehicles ---------- */

.veh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.garage-layout { display: flex; flex-direction: column; gap: 12px; }

.veh-card {
  position: relative;
  min-width: 0;
  padding: 8px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, .1);
  background: rgba(25, 37, 46, .92);
  cursor: pointer;
  transition: transform .1s ease, border-color .1s ease, opacity .1s ease;
}

.veh-card:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .28); }
.veh-card.selected { border-color: var(--yellow); box-shadow: 0 0 0 2px rgba(255, 210, 63, .16); }
.veh-card.taken { opacity: .45; cursor: not-allowed; }
.veh-card.taken::after {
  content: "已被揀";
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(12, 18, 22, .8);
  color: #ffc1b8;
  font-size: 8px;
  font-weight: 900;
}

.veh-preview {
  display: block;
  width: 100%;
  height: 76px;
  border-radius: 10px;
  background: radial-gradient(ellipse at 50% 62%, rgba(255, 255, 255, .12), transparent 62%), rgba(8, 14, 19, .38);
}

.veh-card h4 {
  margin: 5px 0 0;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.veh-card .veh-sub { color: var(--muted); font-size: 9px; margin-top: 1px; }

.special-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  max-width: 100%;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 210, 63, .1);
  color: var(--yellow);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.special-chip b {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--yellow);
  color: #22251f;
  font-size: 9px;
  flex: 0 0 auto;
}

.stat-row {
  display: grid;
  grid-template-columns: 25px 1fr;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.stat-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.stat-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f0a63a, var(--yellow)); }

.veh-card.compact .veh-preview { height: 58px; }
.veh-card.compact .stat-row { grid-template-columns: 22px 1fr; }

.garage-side {
  position: relative;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(31, 46, 57, .96), rgba(16, 25, 32, .96));
}

.garage-selected { margin-bottom: 10px; }
.garage-selected h3 { margin: 0 0 2px; font-size: 20px; font-weight: 900; }
.garage-selected p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.garage-selected .special-line { margin-top: 8px; color: var(--yellow); font-size: 12px; font-weight: 900; }
.garage-selected .special-desc { color: #d9e6df; margin-top: 2px; }
.garage-selected canvas { width: 100%; height: 95px; margin: 4px 0; }

/* ---------- Online ---------- */

.online-panel {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(30, 44, 55, .96), rgba(14, 23, 30, .96));
}

.field { display: block; margin-bottom: 10px; }
.field span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }

input[type="text"] {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(6, 12, 16, .55);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  outline: none;
}

input[type="text"]:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 210, 63, .12); }

.or-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 13px 0;
  color: rgba(230, 239, 235, .45);
  font-size: 10px;
  font-weight: 800;
}
.or-line::before, .or-line::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.status {
  margin-top: 13px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(255, 210, 63, .07);
  border: 1px solid rgba(255, 210, 63, .15);
  color: #ffe7a8;
  font-size: 10px;
  line-height: 1.55;
}
.status.error { background: rgba(229, 66, 58, .11); border-color: rgba(229, 66, 58, .3); color: #ffc1b8; }
.status code { color: var(--yellow); }

/* ---------- Lobby ---------- */

.lobby-head { justify-content: space-between; }
.lobby-head h2 { display: flex; align-items: center; gap: 8px; }
#lobby-code { letter-spacing: .16em; color: var(--yellow); }

.lobby-grid { display: grid; gap: 10px; }
.lobby-panel {
  padding: 10px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(20, 31, 39, .9);
}
.lobby-panel h3 { margin: 0 0 8px; font-size: 12px; font-weight: 900; letter-spacing: .05em; color: #e9e5d8; }
.lobby-panel h3 span { color: var(--muted); font-weight: 700; }

.lobby-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.slot {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .07);
  font-size: 10px;
  overflow: hidden;
}
.slot .slot-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--muted); }
.slot .slot-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .slot-car { color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .slot-tag { margin-left: auto; font-size: 8px; font-weight: 900; color: var(--green); flex: 0 0 auto; }
.slot.ai { border-style: dashed; opacity: .68; }
.slot.me { border-color: rgba(255, 210, 63, .55); background: rgba(255, 210, 63, .07); }
.slot .host-crown { color: var(--yellow); font-size: 9px; }

.lobby-cups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.lobby-cup {
  padding: 7px 5px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .035);
  color: var(--ink);
  font-family: var(--font);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  line-height: 1.25;
}
.lobby-cup small { display: block; color: var(--muted); font-size: 7px; font-weight: 700; margin-top: 2px; }
.lobby-cup.selected { border-color: var(--yellow); background: rgba(255, 210, 63, .1); }
.lobby-cup:disabled { cursor: default; opacity: .8; }
.lobby-cup.locked { border-style: dashed; opacity: .5; }
.lobby-cup.locked small { color: var(--yellow); }

.lobby-vehicles { max-height: 150px; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }
.lobby-vehicles .veh-preview { height: 44px; }
.lobby-vehicles .stat-row { display: none; }
.lobby-vehicles .special-chip { margin-top: 3px; }
.lobby-vehicles .veh-card h4 { font-size: 11px; }
.lobby-vehicles::-webkit-scrollbar { width: 4px; }
.lobby-vehicles::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 4px; }

.lobby-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding-top: 4px;
}
.lobby-foot .tiny { grid-column: 1 / -1; margin: 0; }
.lobby-foot .big-btn { min-height: 48px; font-size: 14px; justify-content: center; }
#btn-ready { display: none; }
#btn-ready.visible { display: flex; }
#btn-start-race { display: none; }
#btn-start-race.visible { display: flex; }

/* ---------- Results ---------- */

#screen-results { padding-top: 22px; }
.results-wrap { max-width: 100%; padding-bottom: 120px; }
.results-head { text-align: center; margin-bottom: 10px; }
.results-head h2 { margin: 4px 0; font-size: 42px; font-weight: 900; line-height: 1; letter-spacing: -.05em; }
.results-head .eyebrow { font-size: 10px; }
.results-head p { margin: 6px 0 0; color: #e9e0cb; font-size: 12px; line-height: 1.5; }
.stars-row { display: flex; justify-content: center; gap: 6px; margin: 6px 0 4px; font-size: 28px; color: rgba(255, 255, 255, .18); }
.stars-row .on { color: var(--yellow); text-shadow: 0 0 14px rgba(255, 210, 63, .45); }

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 5px;
  margin: 6px 0 12px;
}
.podium-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
}
.podium-card.first { order: 2; transform: translateY(-8px); border-color: rgba(255, 210, 63, .45); background: rgba(255, 210, 63, .08); }
.podium-card.second { order: 1; }
.podium-card.third { order: 3; }
.podium-card canvas { width: 80%; height: 58px; }
.podium-card .pos { font-size: 11px; font-weight: 900; color: var(--yellow); }
.podium-card .pname { font-size: 10px; font-weight: 900; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-card .pcar { font-size: 8px; color: var(--muted); }

.results-table { display: grid; gap: 4px; margin-top: 4px; }
.result-row {
  display: grid;
  grid-template-columns: 24px 1fr 44px 38px;
  gap: 5px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid transparent;
  font-size: 10px;
}
.result-row.me { border-color: rgba(255, 210, 63, .45); background: rgba(255, 210, 63, .075); }
.result-row .rpos { color: var(--yellow); font-weight: 900; }
.result-row .rname { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-row .rname small { display: block; color: var(--muted); font-size: 8px; font-weight: 700; }
.result-row .rtime { color: var(--muted); font-size: 9px; text-align: right; }
.result-row .rpts { color: #ffe9bb; font-size: 9px; text-align: right; font-weight: 800; }

.results-note {
  margin-top: 10px;
  padding: 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.results-note b { color: var(--yellow); }
.next-stage {
  margin-top: 8px;
  padding: 10px;
  border-radius: 11px;
  border: 1px dashed rgba(255, 210, 63, .3);
  color: rgba(255, 235, 185, .7);
  font-size: 10px;
  text-align: center;
}
.results-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom));
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(11, 18, 24, 0), rgba(11, 18, 24, .97) 26%);
}
.results-actions .big-btn { justify-content: center; min-height: 42px; font-size: 12px; padding: 7px 8px; }
.results-wait { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 11px; padding: 4px; }

/* ---------- How to ---------- */

.howto { display: grid; gap: 10px; padding-bottom: 10px; }
.howto-card {
  padding: 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(24, 36, 45, .9);
}
.howto-card h3 { margin: 0 0 6px; font-size: 13px; font-weight: 900; color: var(--yellow); }
.howto-card p { margin: 0; color: #d6e0da; font-size: 11px; line-height: 1.65; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 7px; border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  font-size: 9px; font-weight: 800; color: #e9e3d5;
}
.chip b { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 4px; background: var(--chip, var(--yellow)); color: #222; font-size: 9px; }
.spec-list { display: grid; gap: 5px; }
.spec-item { display: grid; grid-template-columns: 20px 72px 1fr; gap: 5px; align-items: start; font-size: 9px; line-height: 1.45; color: var(--muted); }
.spec-item b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--yellow); color: #222; font-size: 9px; }
.spec-item strong { color: var(--ink); font-size: 9px; }

/* ---------- Race UI ---------- */

#race-ui { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
body.racing #race-ui { display: block; }
body:not(.racing) #race-ui { display: none; }

#race-actions {
  position: absolute;
  top: calc(146px + env(safe-area-inset-top));
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: auto;
}
#race-actions .icon-btn { width: 36px; height: 36px; font-size: 15px; background: rgba(10, 17, 22, .55); }

#touch-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: none;
  justify-content: space-between;
  padding: 0 12px;
  pointer-events: none;
  z-index: 6;
}
.touch-side { display: flex; align-items: flex-end; gap: 8px; pointer-events: auto; }
.touch-btn {
  position: relative;
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .22);
  background: rgba(12, 21, 28, .58);
  color: var(--ink);
  font-family: var(--font);
  font-size: 21px;
  font-weight: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  touch-action: none;
  user-select: none;
  backdrop-filter: blur(5px);
}
.touch-btn b { font-size: 19px; line-height: 1; font-weight: 900; }
.touch-btn small { min-height: 9px; font-size: 8px; font-weight: 700; margin-top: 3px; color: var(--muted); }
.touch-btn.boost { border-color: rgba(255, 179, 71, .62); color: #ffbd5c; font-size: 13px; --ring: #ffb347; }
.touch-btn.skill { border-color: rgba(124, 240, 193, .58); color: #7cf0c1; font-size: 13px; --ring: #7cf0c1; }
.touch-btn.item { border-color: rgba(255, 210, 63, .55); color: var(--yellow); font-size: 15px; width: 62px; height: 62px; }
.touch-btn.active { transform: scale(.94); background: rgba(255, 210, 63, .22); }
.touch-btn.steer { width: 62px; height: 62px; }
.touch-btn.boost::after, .touch-btn.skill::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(var(--ring) calc(var(--charge, 1) * 1turn), rgba(255, 255, 255, .08) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  pointer-events: none;
}
.touch-btn.boost.ready { box-shadow: 0 0 16px rgba(255, 179, 71, .4); }
.touch-btn.skill.ready { box-shadow: 0 0 16px rgba(124, 240, 193, .35); }
.touch-btn.boost.cooling, .touch-btn.skill.cooling { color: rgba(255, 255, 255, .54); }
.touch-btn.boost.cooling small, .touch-btn.skill.cooling small { color: rgba(255, 255, 255, .48); }

@media (pointer: coarse) {
  body.racing #touch-controls { display: flex; }
}

@media (pointer: fine) {
  #touch-controls { display: none !important; }
}

/* ---------- Overlays ---------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 11, .68);
  backdrop-filter: blur(4px);
}
.overlay.hidden { display: none; }

.pause-card, .modal-card {
  width: 100%;
  max-width: 340px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: linear-gradient(165deg, #22323e, #111b23);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.pause-card h2, .modal-card h2 { margin: 0 0 4px; font-size: 24px; font-weight: 900; }
.pause-card .big-btn, .modal-card .big-btn { min-height: 48px; margin-top: 8px; justify-content: center; font-size: 15px; }
.pause-card .tiny { margin-bottom: 5px; }
.modal-actions { display: grid; gap: 7px; margin-top: 12px; }
.modal-actions .big-btn { justify-content: center; font-size: 14px; min-height: 46px; }

#toast {
  position: absolute;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  max-width: 86%;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(9, 16, 21, .92);
  border: 1px solid rgba(255, 210, 63, .35);
  color: #fff3cf;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transition: opacity .2s ease, transform .2s ease;
}
#toast.hidden { display: none; }

/* ---------- Small responsive ---------- */

@media (max-height: 760px) {
  .logo { font-size: 42px; }
  .title-showcase { height: 88px; }
  .title-showcase canvas { height: 76px; }
  .cow { width: 74px; height: 74px; }
  .speech { font-size: 11px; padding: 6px 9px; }
  .big-btn { min-height: 52px; font-size: 15px; }
  .title-buttons { gap: 7px; }
  .title-buttons .big-btn small { font-size: 9px; }
  .title-stats { margin-top: 7px; }
}

@container (min-width: 620px) {
  .veh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .garage-layout { display: grid; grid-template-columns: 1fr 220px; align-items: start; }
  .garage-side { position: sticky; top: 0; }
  .lobby-grid { grid-template-columns: 1fr 1fr; }
  .lobby-panel:first-child { grid-column: 1 / -1; }
  .lobby-vehicles { max-height: 430px; }
}

@media (max-width: 370px) {
  .veh-grid { gap: 7px; }
  .veh-card { padding: 6px; }
  .veh-preview { height: 62px; }
  .veh-card h4 { font-size: 11px; }
  .stat-row { grid-template-columns: 21px 1fr; font-size: 7px; }
  .cup-card { grid-template-columns: 42px 1fr auto; padding: 11px; }
  .cup-icon { width: 42px; height: 42px; font-size: 19px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================
   Mobile landscape
   ========================================================= */

.title-hero, .title-menu { display: contents; }

/* Portrait mobile: full-screen rotate gate */
.rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 210, 63, .12), transparent 45%),
    radial-gradient(circle at 20% 100%, rgba(229, 66, 58, .18), transparent 50%),
    #080d12;
  color: var(--ink);
  text-align: center;
}
body.mobile-portrait .rotate-overlay { display: flex; }

.rotate-card {
  max-width: 380px;
  padding: 22px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 210, 63, .3);
  background: linear-gradient(165deg, #202f3a, #101920);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
}
.rotate-card h2 { margin: 2px 0 6px; font-size: 26px; font-weight: 900; letter-spacing: -.04em; }
.rotate-card p { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.rotate-card .big-btn { justify-content: center; margin-bottom: 8px; }
.rotate-card .tiny { margin: 0; font-size: 9px; }

.rotate-phone {
  position: relative;
  width: 128px;
  height: 74px;
  margin: 2px auto 16px;
  border: 3px solid var(--yellow);
  border-radius: 14px;
  transform: rotate(-8deg);
  box-shadow: 0 0 28px rgba(255, 210, 63, .18);
}
.rotate-phone::before,
.rotate-phone::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 4px;
  height: 18px;
  margin-top: -9px;
  border-radius: 3px;
  background: var(--yellow);
}
.rotate-phone::before { left: -8px; }
.rotate-phone::after { right: -8px; }
.rotate-screen {
  position: absolute;
  inset: 8px 14px;
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 210, 63, .3), transparent 45%),
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(92, 225, 255, .14) 12px 18px),
    #16242d;
}

/* Hide touch on desktop; show explicitly in mobile landscape race */
#touch-controls { display: none !important; }
body.racing.mobile-landscape #touch-controls { display: flex !important; }

/* Landscape app fills the full device viewport */
body.mobile-landscape #app {
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}
body.mobile-landscape #game-canvas { width: 100%; height: 100%; }
body.mobile-landscape #screens { inset: 0; }
body.mobile-landscape .screen {
  padding: 10px 22px calc(10px + env(safe-area-inset-bottom));
}
body.mobile-landscape .screen-head { margin-bottom: 8px; gap: 9px; }
body.mobile-landscape .screen-head h2 { font-size: 19px; }
body.mobile-landscape .eyebrow { font-size: 8px; }
body.mobile-landscape .back-btn { width: 34px; height: 34px; font-size: 18px; border-radius: 9px; }
body.mobile-landscape .screen-sub { font-size: 10px; margin-bottom: 8px; line-height: 1.45; }
body.mobile-landscape .tiny { font-size: 9px; margin-top: 5px; }

/* Landscape title: two columns inside one screen height */
body.mobile-landscape #screen-title .title-top { padding: 7px 22px 0; }
body.mobile-landscape .title-main {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
  gap: 18px;
  align-items: center;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px calc(8px + env(safe-area-inset-bottom));
  flex: 1;
  min-height: 0;
}
body.mobile-landscape .title-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
body.mobile-landscape .title-menu {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 100%;
  max-width: 390px;
  justify-self: end;
}
body.mobile-landscape .title-kicker { font-size: 9px; margin-top: 0; letter-spacing: .24em; }
body.mobile-landscape .logo { font-size: clamp(34px, 4.6vw, 46px); line-height: .9; }
body.mobile-landscape .logo-sub { font-size: 10px; margin-top: 1px; }
body.mobile-landscape .title-showcase { height: 58px; margin: 1px 0 0 -6px; justify-content: flex-start; }
body.mobile-landscape .title-showcase canvas { height: 54px; }
body.mobile-landscape .title-showcase canvas:nth-child(2) { transform: translateY(5px) scale(1.1); }
body.mobile-landscape .title-mascot { margin: 0; gap: 4px; }
body.mobile-landscape .cow { width: 54px; height: 54px; }
body.mobile-landscape .speech { padding: 4px 8px; border-radius: 10px; font-size: 9px; }
body.mobile-landscape .speech span { font-size: 7px; }
body.mobile-landscape .title-buttons { margin-top: 0; gap: 5px; padding-top: 0; }
body.mobile-landscape .title-buttons .big-btn { min-height: 40px; padding: 6px 11px; font-size: 14px; border-radius: 12px; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
body.mobile-landscape .title-buttons .big-btn small { font-size: 8px; }
body.mobile-landscape .title-buttons .ghost-btn { padding: 6px; font-size: 10px; }
body.mobile-landscape .title-stats { margin-top: 3px; font-size: 10px; }
body.mobile-landscape .title-note { font-size: 8px; margin-top: 1px; }
body.mobile-landscape .title-footer { margin-top: 4px; padding-top: 5px; font-size: 8px; }

/* Landscape cups */
body.mobile-landscape .cup-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
body.mobile-landscape .cup-card {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 7px;
  padding: 9px;
  border-radius: 12px;
}
body.mobile-landscape .cup-icon { width: 34px; height: 34px; font-size: 16px; border-radius: 9px; }
body.mobile-landscape .cup-card h3 { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.mobile-landscape .cup-card h3 small { font-size: 8px; }
body.mobile-landscape .cup-card p { font-size: 9px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body.mobile-landscape .cup-stars { font-size: 10px; }
body.mobile-landscape .screen-foot { margin-top: 8px; padding-bottom: 0; }
body.mobile-landscape .screen-foot .big-btn { min-height: 42px; font-size: 14px; }
body.mobile-landscape .screen-foot .tiny { display: none; }

/* Landscape garage: summary + 4-column vehicle grid */
body.mobile-landscape .garage-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}
body.mobile-landscape .garage-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
body.mobile-landscape .veh-card { padding: 6px; border-radius: 11px; }
body.mobile-landscape .veh-preview { height: 52px; }
body.mobile-landscape .veh-card h4 { font-size: 11px; margin-top: 3px; }
body.mobile-landscape .veh-sub { font-size: 8px; }
body.mobile-landscape .special-chip { font-size: 8px; padding: 2px 4px; margin-top: 3px; }
body.mobile-landscape .special-chip b { width: 12px; height: 12px; font-size: 8px; }
body.mobile-landscape .stat-row { font-size: 7px; grid-template-columns: 21px 1fr; margin-top: 2px; }
body.mobile-landscape .garage-side {
  position: sticky;
  top: 0;
  padding: 10px;
  border-radius: 13px;
}
body.mobile-landscape .garage-selected canvas { height: 58px; margin: 0; }
body.mobile-landscape .garage-selected h3 { font-size: 16px; }
body.mobile-landscape .garage-selected p { font-size: 9px; line-height: 1.35; }
body.mobile-landscape .garage-selected .special-line { margin-top: 5px; font-size: 10px; }
body.mobile-landscape .garage-side .big-btn { min-height: 40px; font-size: 13px; margin-top: 6px; }
body.mobile-landscape .garage-side .tiny { display: none; }

/* Landscape online/lobby */
body.mobile-landscape .online-panel { max-width: 520px; margin: 0 auto; padding: 12px; }
body.mobile-landscape .field { margin-bottom: 7px; }
body.mobile-landscape input[type="text"] { height: 38px; font-size: 14px; }
body.mobile-landscape .online-panel .big-btn { min-height: 42px; }

body.mobile-landscape .lobby-grid { grid-template-columns: 1.06fr .94fr; gap: 8px; }
body.mobile-landscape .lobby-panel:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
body.mobile-landscape .lobby-panel:nth-child(2) { grid-column: 2; grid-row: 1; }
body.mobile-landscape .lobby-panel:nth-child(3) { grid-column: 2; grid-row: 2; }
body.mobile-landscape .lobby-panel { padding: 8px; }
body.mobile-landscape .lobby-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
body.mobile-landscape .slot { min-height: 29px; padding: 3px 5px; }
body.mobile-landscape .lobby-cups { grid-template-columns: repeat(3, 1fr); }
body.mobile-landscape .lobby-cup { padding: 5px 3px; font-size: 8px; }
body.mobile-landscape .lobby-vehicles { max-height: 150px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.mobile-landscape .lobby-vehicles .veh-preview { height: 38px; }
body.mobile-landscape .lobby-foot { margin-top: 6px; }
body.mobile-landscape .lobby-foot .big-btn { min-height: 40px; font-size: 12px; }

/* Landscape results / howto */
body.mobile-landscape #screen-results { padding-top: 10px; }
body.mobile-landscape .results-head h2 { font-size: 32px; }
body.mobile-landscape .results-head p { font-size: 10px; }
body.mobile-landscape .stars-row { font-size: 22px; margin: 3px 0; }
body.mobile-landscape .podium { margin: 4px 0 8px; }
body.mobile-landscape .podium-card canvas { height: 42px; }
body.mobile-landscape .results-table { grid-template-columns: 1fr 1fr; gap: 4px 6px; }
body.mobile-landscape .result-row { grid-template-columns: 20px 1fr 42px 34px; padding: 5px 6px; }
body.mobile-landscape .results-note { font-size: 9px; }
body.mobile-landscape .results-actions { grid-template-columns: repeat(2, 1fr); }
body.mobile-landscape .howto { grid-template-columns: 1fr 1fr; gap: 8px; }
body.mobile-landscape .howto-card { padding: 9px; }
body.mobile-landscape .howto-card p { font-size: 9px; line-height: 1.45; }

/* Landscape race chrome */
body.mobile-landscape #race-actions {
  top: 8px;
  left: 12px;
  right: auto;
  flex-direction: row;
  gap: 6px;
}
body.mobile-landscape #race-actions .icon-btn { width: 32px; height: 32px; font-size: 13px; }
body.mobile-landscape #touch-controls {
  bottom: calc(8px + env(safe-area-inset-bottom));
  padding: 0 14px;
}
body.mobile-landscape .touch-btn { width: 58px; height: 58px; font-size: 18px; }
body.mobile-landscape .touch-btn.steer { width: 56px; height: 56px; }
body.mobile-landscape .touch-btn.item { width: 56px; height: 56px; font-size: 13px; }
body.mobile-landscape .touch-btn.boost, body.mobile-landscape .touch-btn.skill { font-size: 11px; }
body.mobile-landscape .touch-btn b { font-size: 16px; }
body.mobile-landscape .touch-side { gap: 14px; }
body.mobile-landscape .touch-btn small { font-size: 7px; }

/* Landscape pause/modal */
body.mobile-landscape .pause-card { max-width: 460px; padding: 14px; }
body.mobile-landscape .pause-card h2 { font-size: 20px; }
body.mobile-landscape .pause-card .big-btn { min-height: 38px; margin-top: 5px; font-size: 13px; }
body.mobile-landscape .modal-card { max-width: 420px; padding: 14px; }
body.mobile-landscape .modal-card .big-btn { min-height: 38px; font-size: 13px; }

/* Touch buttons must also show in mobile landscape under mouse-emulated testing */
@media (pointer: fine) {
  body.mobile-landscape #touch-controls { display: flex !important; }
}

/* ---------- Race map screen ---------- */

.cup-foot-actions { display: grid; gap: 7px; }
.cup-foot-actions .big-btn { justify-content: center; }
.map-open-btn { min-height: 42px; font-size: 14px; justify-content: center !important; }

.map-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 210, 63, .3);
  background: #10232a;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .28);
}
#race-map-canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: auto;
}
.map-head { margin-bottom: 6px; }

body.mobile-landscape .cup-foot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
body.mobile-landscape .cup-foot-actions .big-btn { min-height: 38px; font-size: 12px; }
body.mobile-landscape #screen-map { padding: 8px 16px; }
body.mobile-landscape #screen-map .screen-head { margin-bottom: 3px; }
body.mobile-landscape #screen-map .screen-head h2 { font-size: 15px; }
body.mobile-landscape #screen-map .eyebrow { font-size: 7px; }
body.mobile-landscape .map-wrap {
  border-radius: 7px;
  background: #0c1b21;
  margin: 0 auto;
  max-width: calc((100dvh - 58px) * 2.17391);
}
body.mobile-landscape #race-map-canvas {
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 58px);
  object-fit: contain;
}
body.mobile-landscape .map-open-btn { min-height: 38px; font-size: 11px; }
