/* Mini Launch: portrait toy racing in a bamboo trench */

:root {
  --cream: #fff4d6;
  --cream-dim: #f4e3ba;
  --gold: #ffcf3a;
  --gold-deep: #e8a300;
  --ink: #14251a;
  --ink-soft: #20382a;
  --blue: #1237b8;
  --blue-deep: #071a5a;
  --leaf: #7ab648;
  --pad: #f3c31d;
  --ui-pad: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a2c1c;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--cream);
}

body { position: fixed; inset: 0; }

#app {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  -webkit-touch-callout: none;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 42%, rgba(0,0,0,0) 46%, rgba(7,20,12,.36) 100%),
    linear-gradient(180deg, rgba(9,22,14,.24) 0%, rgba(9,22,14,0) 26%, rgba(9,22,14,0) 70%, rgba(9,22,14,.3) 100%);
  transition: background .3s ease;
  z-index: 2;
}

.hidden { opacity: 0 !important; pointer-events: none !important; visibility: hidden !important; }

/* ---------- HUD ---------- */

#hud {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
}
#hud.live { opacity: 1; }

#distanceHud {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Rubik', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(44px, 9.2vh, 76px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--cream);
  -webkit-text-stroke: 1.5px rgba(17, 34, 22, .55);
  text-shadow:
    0 2px 0 rgba(38, 24, 10, .35),
    0 5px 14px rgba(5, 16, 9, .55),
    0 0 26px rgba(10, 26, 16, .3);
  paint-order: stroke fill;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#distanceHud .unit {
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: .42em;
  margin-left: .16em;
  letter-spacing: 0;
  -webkit-text-stroke: 0;
  opacity: .95;
}
#distanceHud.pop { animation: distPop .28s ease-out; }
@keyframes distPop {
  0% { transform: translateX(-50%) scale(1); }
  40% { transform: translateX(-50%) scale(1.06); }
  100% { transform: translateX(-50%) scale(1); }
}

#coinHud {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: max(12px, env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 14px 0 10px;
  border-radius: 21px;
  background: linear-gradient(180deg, rgba(34, 56, 35, .72), rgba(14, 30, 19, .66));
  border: 1.5px solid rgba(255, 240, 195, .22);
  box-shadow: 0 4px 14px rgba(5, 15, 8, .38), inset 0 1px 0 rgba(255,255,255,.15);
  font-family: 'Rubik', system-ui, sans-serif;
  font-weight: 800;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
}
.coinIcon {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at 36% 30%, #fff6c9 0 8%, #ffd94f 25%, #f3b10c 62%, #c88700 100%);
  border: 1.5px solid #a96c00;
  box-shadow: inset 0 0 0 2px rgba(255, 245, 196, .5), 0 1px 3px rgba(0,0,0,.35);
  position: relative;
}
.coinIcon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 45%;
  height: 55%;
  transform: translate(-50%, -50%);
  background: #b47400;
  clip-path: polygon(50% 0, 62% 34%, 100% 38%, 70% 62%, 82% 100%, 50% 76%, 18% 100%, 30% 62%, 0 38%, 38% 34%);
  opacity: .85;
}
#coinHud.pop { animation: coinPop .32s cubic-bezier(.2,1.8,.5,1); }
@keyframes coinPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

/* ---------- Start screen ---------- */

#startScreen {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
#startScreen.gone { opacity: 0; }

.brand {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 4.2vh);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: rotate(-2.4deg);
}
.logo {
  margin: 0;
  font-family: 'Lilita One', system-ui, sans-serif;
  font-weight: 400;
  text-align: center;
  line-height: .82;
  letter-spacing: .01em;
  filter: drop-shadow(0 6px 0 rgba(8, 26, 16, .32)) drop-shadow(0 12px 26px rgba(4, 14, 8, .45));
}
.logo .l1 {
  display: block;
  font-size: clamp(30px, 7.6vw, 54px);
  color: var(--gold);
  text-shadow:
    0 2px 0 #9a6100,
    0 4px 0 #6f4300,
    0 0 1px #6f4300;
  transform: translateX(-4%);
}
.logo .l2 {
  display: block;
  font-size: clamp(52px, 14.4vw, 100px);
  color: var(--cream);
  text-shadow:
    0 2px 0 #d8c089,
    0 5px 0 #1b3f91,
    0 8px 0 #0b2362,
    0 12px 18px rgba(5, 16, 9, .45);
  letter-spacing: .005em;
}
.bestLine {
  margin-top: clamp(10px, 1.6vh, 16px);
  font-family: 'Rubik', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(11px, 1.6vh, 14px);
  letter-spacing: .14em;
  color: rgba(255, 244, 214, .8);
  text-shadow: 0 2px 8px rgba(4, 14, 8, .7);
  transform: rotate(2.4deg);
}

#launchCue {
  position: absolute;
  left: 0;
  right: 0;
  top: 26.5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity .2s ease, transform .2s ease;
}
#launchCue.pulling { opacity: .35; transform: translateY(-4px); }
.cueText {
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: clamp(26px, 6.4vw, 42px);
  color: var(--cream);
  letter-spacing: .015em;
  text-shadow:
    0 2px 0 #7d5a1b,
    0 4px 0 rgba(30, 42, 16, .6),
    0 8px 20px rgba(4, 14, 8, .55);
  white-space: nowrap;
}
.cueHand {
  margin-top: 4px;
  color: var(--gold);
  filter: drop-shadow(0 3px 2px rgba(5, 16, 9, .5));
  animation: cueBob 1.5s ease-in-out infinite;
}
@keyframes cueBob {
  0%, 100% { transform: translateY(-3px); }
  50% { transform: translateY(7px); }
}
#cueArc { animation: arcRun 1.2s linear infinite; }
@keyframes arcRun { to { stroke-dashoffset: -30; } }
.cueSub {
  display: none;
  margin-top: 2px;
  font-size: clamp(12px, 1.9vh, 15px);
  font-weight: 700;
  letter-spacing: .08em;
  color: rgba(255, 244, 214, .82);
  text-shadow: 0 2px 8px rgba(4, 14, 8, .8);
  text-transform: uppercase;
}

/* ---------- Steering hint ---------- */

#steerHint {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 5.5vh);
  transform: translate(-50%, 8px);
  z-index: 9;
  padding: 7px 16px;
  border-radius: 30px;
  background: rgba(12, 28, 17, .45);
  border: 1px solid rgba(255, 244, 214, .16);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  color: rgba(255, 244, 214, .88);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
  white-space: nowrap;
}
#steerHint.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Zone banner ---------- */

#zoneBanner {
  position: absolute;
  left: 0;
  right: 0;
  top: 18%;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-12px) rotate(-1deg);
  transition: opacity .45s ease, transform .45s cubic-bezier(.2,1.4,.4,1);
}
#zoneBanner.show { opacity: 1; transform: translateY(0) rotate(-1deg); }
.zoneKicker {
  font-family: 'Rubik', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(10px, 1.5vh, 13px);
  letter-spacing: .26em;
  color: #ffd451;
  text-shadow: 0 2px 8px rgba(4, 12, 6, .8);
}
#zoneName {
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: clamp(30px, 7.2vw, 52px);
  line-height: 1;
  margin-top: 3px;
  color: var(--cream);
  text-shadow:
    0 2px 0 rgba(48, 32, 8, .5),
    0 5px 0 rgba(18, 38, 22, .35),
    0 12px 26px rgba(3, 10, 6, .55);
  white-space: nowrap;
}

/* ---------- Result ---------- */

#resultScreen {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px calc(env(safe-area-inset-bottom, 0px) + 14px);
  pointer-events: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(90% 60% at 50% 30%, rgba(6, 16, 10, .3), rgba(5, 13, 8, .72) 100%);
  opacity: 1;
  transition: opacity .28s ease;
}
.resultCard {
  text-align: center;
  margin-top: 0;
  transform: translateY(0);
  animation: cardIn .4s cubic-bezier(.16, 1.3, .4, 1);
  width: min(92vw, 560px);
  flex: 0 0 auto;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(22px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.resLabel {
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: clamp(13px, 2vh, 17px);
  letter-spacing: .22em;
  color: rgba(255, 244, 214, .78);
  text-shadow: 0 2px 8px rgba(4, 14, 8, .7);
}
.resBig {
  font-family: 'Rubik', system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(72px, 19vw, 136px);
  line-height: .95;
  letter-spacing: -.04em;
  color: var(--cream);
  margin: 2px 0 0;
  -webkit-text-stroke: 2px rgba(33, 42, 16, .4);
  text-shadow:
    0 3px 0 rgba(111, 67, 0, .32),
    0 8px 0 rgba(17, 34, 22, .35),
    0 16px 30px rgba(3, 10, 6, .55);
  font-variant-numeric: tabular-nums;
}
.resBig .resUnit {
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: .34em;
  margin-left: .12em;
  letter-spacing: 0;
  -webkit-text-stroke: 0;
}
.bestRow {
  margin-top: 10px;
  font-family: 'Rubik', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(13px, 2vh, 17px);
  letter-spacing: .12em;
  color: rgba(255, 240, 202, .72);
  text-shadow: 0 2px 8px rgba(4, 14, 8, .7);
}
.recordBadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 18px 9px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffe071, #ffbf17);
  color: #5c3900;
  border: 2.5px solid #8a5b00;
  box-shadow: 0 5px 0 #8a5b00, 0 10px 22px rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.5);
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: clamp(19px, 3.1vh, 26px);
  letter-spacing: .03em;
  transform: rotate(-2deg);
  transition: opacity .25s ease, transform .25s ease;
}
.recordBadge.show { animation: badgeIn .6s cubic-bezier(.2, 1.9, .4, 1); }
@keyframes badgeIn {
  0% { opacity: 0; transform: scale(.3) rotate(-14deg); }
  60% { opacity: 1; transform: scale(1.12) rotate(1deg); }
  100% { transform: scale(1) rotate(-2deg); }
}
.coinGain {
  margin-top: 14px;
  font-family: 'Rubik', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(14px, 2.1vh, 18px);
  color: #ffd95c;
  letter-spacing: .04em;
  text-shadow: 0 2px 8px rgba(8, 18, 6, .8);
}
.againRow {
  margin-top: clamp(24px, 4.2vh, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: clamp(14px, 2.2vh, 19px);
  letter-spacing: .08em;
  color: rgba(255, 244, 214, .92);
  text-shadow: 0 2px 10px rgba(4, 14, 8, .7);
  animation: againPulse 1.7s ease-in-out infinite;
}
@keyframes againPulse {
  0%, 100% { opacity: .62; }
  50% { opacity: 1; }
}
.replayIcon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 244, 214, .85);
  position: relative;
  flex: 0 0 auto;
}
.replayIcon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 0;
  height: 0;
  border-left: 10px solid rgba(255, 244, 214, .92);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.replayIcon::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(255, 244, 214, .3);
  animation: replaySpin 2.6s linear infinite;
}
@keyframes replaySpin { to { transform: rotate(360deg); } }

/* ---------- Help ---------- */

#helpBtn {
  position: absolute;
  left: max(14px, env(safe-area-inset-left, 0px));
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  z-index: 20;
  border: 1.5px solid rgba(255, 244, 214, .32);
  background: rgba(12, 28, 17, .52);
  color: var(--cream);
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(3, 10, 6, .35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  touch-action: manipulation;
  transition: transform .15s ease, background .2s ease;
}
#helpBtn:active { transform: scale(.92); background: rgba(30, 58, 34, .8); }

#helpPanel {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 14, 8, .62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 1;
  transition: opacity .25s ease;
}
.helpCard {
  width: min(86vw, 400px);
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #fff7dd, #f6e7bd);
  color: #25361f;
  border-radius: 22px;
  border: 3px solid #d8bd7a;
  box-shadow: 0 16px 40px rgba(0,0,0,.4), inset 0 2px 0 #fff;
  padding: 22px 22px 18px;
  transform: rotate(-.6deg);
}
.helpCard h2 {
  margin: 0 0 10px;
  font-family: 'Lilita One', system-ui, sans-serif;
  font-weight: 400;
  font-size: 27px;
  color: #2c4c22;
  letter-spacing: .01em;
}
.helpCard p {
  margin: 0 0 9px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.42;
  color: #3a5130;
}
.helpCard b { color: #1e3a13; }
#helpClose {
  margin-top: 8px;
  width: 100%;
  border: none;
  border-radius: 13px;
  padding: 12px;
  background: linear-gradient(180deg, #ffd45c, #f3b31b);
  color: #5a3c00;
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: 18px;
  border-bottom: 3px solid #a97600;
  cursor: pointer;
  touch-action: manipulation;
}

/* ---------- Confetti ---------- */

#confetti {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  overflow: hidden;
}
.confetti-bit {
  position: absolute;
  top: -8vh;
  width: 9px;
  height: 15px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall linear forwards;
  will-change: transform, opacity;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translate3d(0, -10vh, 0) rotate(0deg); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--dx, 0px), 112vh, 0) rotate(var(--rot, 540deg)); }
}

/* ---------- Boot ---------- */

#boot {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(80% 60% at 50% 38%, #4c6d3e 0%, #27452c 55%, #132318 100%);
  transition: opacity .35s ease, visibility .35s;
}
#boot.gone { opacity: 0; visibility: hidden; }
.bootInner { text-align: center; transform: translateY(-4vh); }
.bootLogo {
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: clamp(38px, 11vw, 64px);
  color: var(--cream);
  text-shadow: 0 4px 0 #173a1d, 0 10px 24px rgba(0,0,0,.35);
  transform: rotate(-2deg);
  margin-bottom: 18px;
}
.bootBar {
  width: 140px;
  height: 6px;
  margin: 0 auto;
  border-radius: 4px;
  background: rgba(255, 244, 214, .16);
  overflow: hidden;
}
.bootBar i {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: 4px;
  background: var(--gold);
  animation: bootSlide 1.1s ease-in-out infinite;
}
@keyframes bootSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(380%); }
}
.bootNote {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 244, 214, .55);
}

/* ---------- Narrow / landscape adjustments ---------- */

@media (max-aspect-ratio: 0.62) {
  #launchCue { top: 27.5%; }
}

@media (min-aspect-ratio: 1/1) {
  .brand { top: calc(env(safe-area-inset-top, 0px) + 3vh); }
  .logo .l1 { font-size: clamp(26px, 3.4vw, 40px); }
  .logo .l2 { font-size: clamp(44px, 6vw, 72px); }
  #launchCue { top: 30%; }
  #distanceHud { font-size: clamp(40px, 10vh, 68px); }
  #steerHint { bottom: calc(env(safe-area-inset-bottom, 0px) + 3vh); }
  .resBig { font-size: clamp(64px, 20vh, 118px); }
  .resultCard { margin-top: 0; }
  .againRow { margin-top: 16px; }
}

@media (max-height: 560px) {
  #launchCue { top: 24%; }
  .cueHand { display: none; }
  .cueSub { display: none; }
  .bestLine { margin-top: 6px; }
  .brand { top: calc(env(safe-area-inset-top, 0px) + 2vh); }
  .recordBadge { margin-top: 8px; }
  .coinGain { margin-top: 8px; }
  .againRow { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cueHand, #cueArc, .againRow, .replayIcon::after, .bootBar i { animation: none; }
}

/* ---------- Garage ---------- */

.garageCard {
  width: min(92vw, 560px);
  flex: 0 0 auto;
  margin-bottom: 6px;
  padding: 12px 12px 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(24, 44, 27, .92), rgba(13, 27, 16, .94));
  border: 2px solid rgba(255, 226, 154, .28);
  box-shadow: 0 14px 34px rgba(2, 8, 4, .5), inset 0 1px 0 rgba(255, 244, 214, .16);
  animation: cardIn .45s cubic-bezier(.16, 1.3, .4, 1);
}
.garageHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
}
.garageTitle {
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: 26px;
  color: var(--cream);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .35);
  letter-spacing: .01em;
}
.garageBank {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .32);
  border: 1.5px solid rgba(255, 208, 74, .4);
  font-family: 'Rubik', system-ui, sans-serif;
  font-weight: 800;
  font-size: 17px;
  color: #ffd95c;
  font-variant-numeric: tabular-nums;
}
.upgradeList {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.upTile {
  border-radius: 14px;
  padding: 9px 10px 10px;
  background: linear-gradient(180deg, rgba(255, 246, 219, .1), rgba(255, 246, 219, .04));
  border: 1.5px solid rgba(255, 238, 196, .16);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.upName {
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.05;
  color: var(--cream);
}
.upBlurb {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(238, 244, 220, .62);
  min-height: 14px;
}
.upDots {
  display: flex;
  gap: 2px;
  margin: 2px 0 1px;
}
.upDots i {
  flex: 1 1 0;
  height: 5px;
  border-radius: 2px;
  background: rgba(255, 244, 214, .16);
}
.upDots i.on { background: linear-gradient(90deg, #ffe071, #f3b31b); }
.upBuy {
  margin-top: 2px;
  border: none;
  border-radius: 9px;
  padding: 7px 6px;
  background: linear-gradient(180deg, #ffd45c, #f3b31b);
  color: #5a3c00;
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1;
  border-bottom: 2.5px solid #a97600;
  cursor: pointer;
  touch-action: manipulation;
  font-variant-numeric: tabular-nums;
}
.upBuy:active { transform: translateY(1px); border-bottom-width: 1.5px; }
.upBuy:disabled {
  background: rgba(255, 244, 214, .12);
  color: rgba(255, 244, 214, .45);
  border-bottom: 2.5px solid rgba(0, 0, 0, .2);
  cursor: default;
}
.upBuy.maxed { background: rgba(122, 182, 72, .28); color: #d9f3bf; border-bottom-color: rgba(0,0,0,.2); }
.skinHead {
  margin: 11px 4px 6px;
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: 17px;
  color: rgba(255, 244, 214, .8);
}
.skinList {
  display: flex;
  gap: 7px;
}
.skinBtn {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 4px 7px;
  border-radius: 12px;
  border: 2px solid rgba(255, 244, 214, .14);
  background: rgba(0, 0, 0, .2);
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.skinBtn.on { border-color: #ffd451; box-shadow: 0 0 0 2px rgba(255, 212, 81, .22); }
.skinSwatch {
  width: 100%;
  height: 26px;
  border-radius: 7px;
  background: var(--swatch, #1746d6);
  position: relative;
  overflow: hidden;
}
.skinSwatch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 6px;
  margin-left: -3px;
  background: var(--stripe, #f7f2df);
}
.skinLabel {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .01em;
  color: rgba(255, 244, 214, .85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.skinBtn.locked .skinSwatch { filter: grayscale(.35) brightness(.62); }
.skinBtn.owned { cursor: pointer; }
.raceBtn {
  margin-top: 12px;
  width: 100%;
  border: none;
  border-radius: 15px;
  padding: 13px 12px;
  background: linear-gradient(180deg, #ffe071, #ffb512);
  color: #5a3c00;
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: 22px;
  letter-spacing: .03em;
  border-bottom: 4px solid #a97600;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .5);
  cursor: pointer;
  touch-action: manipulation;
}
.raceBtn:active { transform: translateY(1px); border-bottom-width: 2px; }

/* ---------- Graphics reset ---------- */

#glLost {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 14, 8, .82);
  transition: opacity .25s ease;
  pointer-events: auto;
}
.glLostCard {
  text-align: center;
  max-width: 320px;
}
.glLostTitle {
  font-family: 'Lilita One', system-ui, sans-serif;
  font-size: 26px;
  color: var(--cream);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .4);
}
.glLostNote {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(255, 244, 214, .7);
}

@media (max-height: 720px) {
  .garageTitle { font-size: 22px; }
  .upName { font-size: 13.5px; }
  .upBlurb { font-size: 10.5px; }
  .raceBtn { font-size: 19px; padding: 11px; }
}
#resultScreen { touch-action: pan-y; }
