:root {
  color-scheme: light;
  --ink: #102f3a;
  --muted: #58717a;
  --cream: #fff9eb;
  --snow: #f8fdff;
  --teal: #0d8c8d;
  --teal-dark: #086b74;
  --coral: #f26149;
  --yellow: #f6c84e;
  --panel: rgba(255, 253, 247, 0.96);
  --shadow: 0 24px 80px rgba(7, 44, 60, 0.24);
  font-family: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body, #app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  background: #bfe5ed;
  color: var(--ink);
}

button, input { font: inherit; }
button { color: inherit; }
button, a {
  -webkit-tap-highlight-color: transparent;
}

input {
  -webkit-user-select: text;
  user-select: text;
}

img {
  pointer-events: none;
  -webkit-user-drag: none;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #dff5f7;
  touch-action: none;
}

.hidden { display: none !important; }

.start-screen {
  position: fixed;
  inset: 0;
  overflow: hidden;
  color: white;
  background: linear-gradient(90deg, rgba(4, 36, 53, .88) 0%, rgba(5, 52, 70, .57) 38%, rgba(6, 69, 78, .05) 68%);
}

.start-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("/assets/dogski-cover.png");
  background-position: center;
  background-size: cover;
  transform: scale(1.01);
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px clamp(24px, 5vw, 76px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(22px, 2.3vw, 34px);
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
  text-shadow: 0 2px 18px rgba(0, 25, 40, .35);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--coral);
  box-shadow: 0 8px 20px rgba(111, 29, 18, .2);
  font-size: 23px;
  transform: rotate(-7deg);
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.icon-button, .coin-pill {
  height: 42px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 14px;
  background: rgba(9, 48, 63, .4);
  color: white;
  backdrop-filter: blur(12px);
}

.icon-button {
  width: 42px;
  cursor: pointer;
  font-size: 19px;
}

.coin-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
}

.ds-coin {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  overflow: hidden;
  place-items: center;
  border: 2px solid #ffe58a;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 27%, #fff4a8 0 7%, transparent 8%),
    linear-gradient(145deg, #ffe273 0%, #f5b92f 47%, #c98612 100%);
  box-shadow:
    inset 0 0 0 2px rgba(126, 73, 4, .18),
    inset -3px -4px 5px rgba(116, 62, 0, .2),
    0 2px 5px rgba(73, 39, 0, .24);
  color: #744207;
  font-family: "Fredoka", sans-serif;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}
.ds-coin::before,
.ds-coin::after {
  position: absolute;
  width: 3px;
  height: 82%;
  border: 1px solid rgba(119, 69, 4, .2);
  border-radius: 99px;
  background: rgba(255, 239, 151, .22);
  content: "";
}
.ds-coin::before { transform: rotate(35deg) translateX(-2px); }
.ds-coin::after { transform: rotate(-35deg) translateX(2px); }
.ds-coin > span { position: relative; z-index: 1; text-shadow: 0 1px rgba(255,255,255,.45); }
.ds-coin.small { width: 20px; height: 20px; border-width: 1px; font-size: 6px; }
.ds-coin.mini { width: 15px; height: 15px; border-width: 1px; font-size: 5px; box-shadow: inset 0 0 0 1px rgba(126, 73, 4, .16); }
.ds-coin.mini::before,
.ds-coin.mini::after { width: 2px; border-width: 0; }
.coin-pill .ds-coin { color: #744207; }

.hero-copy {
  position: absolute;
  left: clamp(24px, 7vw, 108px);
  top: 50%;
  width: min(560px, 45vw);
  transform: translateY(-50%);
}

.eyebrow {
  margin: 0 0 12px;
  color: #8ce4dc;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
}

.eyebrow.dark { color: var(--teal); }

h1, h2, h3 {
  margin: 0;
  font-family: "Fredoka", sans-serif;
}

h1 {
  font-size: clamp(50px, 6.2vw, 92px);
  line-height: .92;
  letter-spacing: -.045em;
  text-shadow: 0 8px 32px rgba(0, 32, 44, .22);
}

h1 em {
  color: #ffd765;
  font-style: normal;
}

.intro {
  max-width: 470px;
  margin: 24px 0 28px;
  color: rgba(255,255,255,.86);
  font-size: clamp(15px, 1.3vw, 19px);
  line-height: 1.6;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.primary-button, .secondary-button {
  min-height: 54px;
  padding: 0 22px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-button {
  border: 0;
  background: var(--coral);
  color: white;
  box-shadow: 0 12px 28px rgba(147, 44, 29, .28);
}

.secondary-button {
  border: 1px solid rgba(255,255,255,.42);
  background: rgba(255,255,255,.12);
  color: inherit;
  backdrop-filter: blur(14px);
}

.primary-button:hover, .secondary-button:hover { transform: translateY(-2px); }
.primary-button:active, .secondary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: not-allowed; filter: grayscale(.6); opacity: .6; }

.controls-hint {
  margin-top: 20px;
  color: rgba(255,255,255,.58);
  font-size: 11px;
  font-weight: 700;
}

.controls-hint span {
  display: inline-grid;
  min-width: 25px;
  height: 23px;
  margin: 0 2px;
  padding: 0 5px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 6px;
  background: rgba(4, 35, 46, .28);
  color: white;
  font-size: 10px;
}

.friends-card {
  position: absolute;
  right: clamp(22px, 5vw, 76px);
  bottom: 34px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  min-width: 340px;
  padding: 14px 17px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 18px;
  background: rgba(4, 39, 52, .52);
  color: white;
  cursor: pointer;
  text-align: left;
  backdrop-filter: blur(16px);
}

.friends-card small { display: block; margin-top: 3px; color: rgba(255,255,255,.62); }
.friends-card b { font-size: 23px; }
.avatar-stack { display: flex; }
.avatar-stack i {
  display: grid;
  width: 36px;
  height: 36px;
  margin-left: -8px;
  place-items: center;
  border: 2px solid #e8faf9;
  border-radius: 50%;
  background: #8ed3d2;
  font-style: normal;
}
.avatar-stack i:first-child { margin-left: 0; background: #f6c577; }
.avatar-stack i:last-child { background: #ef6a54; font-weight: 800; }

.panel-screen {
  position: fixed;
  inset: 0;
  display: grid;
  overflow: auto;
  padding: 28px;
  place-items: center;
  background: rgba(5, 32, 44, .62);
  backdrop-filter: blur(14px);
}

#customizer-screen {
  place-items: start center;
}

#customizer-screen .panel-shell {
  margin: auto;
}

.panel-shell {
  position: relative;
  width: min(580px, 100%);
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.wide-panel { width: min(980px, 100%); }
.panel-shell h2 { margin-bottom: 25px; font-size: clamp(31px, 4vw, 49px); letter-spacing: -.03em; }
.panel-shell > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }

.close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: #e8f1ef;
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
}

.mountain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.mountain-card {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  padding: 18px;
  border: 3px solid transparent;
  border-radius: 21px;
  background: linear-gradient(160deg, var(--sky), #f8ffff 65%);
  cursor: pointer;
  text-align: left;
}

.mountain-card::before {
  position: absolute;
  right: -20%;
  bottom: -7%;
  width: 135%;
  height: 65%;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(155deg, rgba(255,255,255,.95), rgba(181,223,230,.95));
  content: "";
  transform: rotate(-8deg);
}

.mountain-card.selected { border-color: var(--coral); box-shadow: 0 12px 25px rgba(11, 80, 92, .12); }
.mountain-card > * { position: relative; z-index: 1; }
.mountain-card .mountain-emoji { display: block; margin: 44px 0 25px; font-size: 48px; filter: drop-shadow(0 8px 8px rgba(15,63,78,.13)); }
.mountain-card h3 { font-size: 22px; }
.mountain-card p { margin: 5px 0 10px; color: var(--muted); font-size: 12px; }
.difficulty { color: var(--coral); letter-spacing: 3px; }

.full-button { width: 100%; }

.customizer-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -12px 0 20px;
  padding: 10px 13px;
  border-radius: 13px;
  background: #eaf4f3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customizer-balance strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-family: "Fredoka", sans-serif;
  font-size: 17px;
}

.dog-house-label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dog-house-secret {
  display: inline-grid;
  width: 27px;
  height: 27px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #e4f1ef;
  cursor: pointer;
  font-size: 16px;
  transition: transform .12s ease, background .12s ease;
}

.dog-house-secret:hover { background: #d4ebe7; transform: rotate(-5deg) scale(1.06); }
.dog-house-secret:active { transform: scale(.9); }

.dog-preview {
  position: relative;
  display: grid;
  height: 250px;
  margin: -5px 0 22px;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  background: radial-gradient(circle at 50% 35%, #fefcf3 0 28%, #d7f0ed 72%);
}

.dog-preview canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.dog-preview canvas.dragging { cursor: grabbing; }

.preview-label {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(8, 62, 71, .58);
  color: white;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  backdrop-filter: blur(8px);
}

.custom-section { margin: 20px 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.section-heading h3 { font-size: 18px; }
.section-heading span { color: var(--muted); font-size: 12px; font-weight: 700; }
.option-row, .color-row {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}

.option-button {
  display: flex;
  position: relative;
  flex: 0 0 92px;
  flex-direction: column;
  gap: 3px;
  min-width: 82px;
  height: 76px;
  padding: 8px 9px;
  align-items: center;
  justify-content: center;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #eaf4f3;
  cursor: pointer;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}
.option-button .option-icon { font-size: 20px; line-height: 1; }
.option-button small { color: var(--coral); font-size: 9px; font-weight: 800; }
.option-price { display: inline-flex; align-items: center; gap: 3px; }
.option-button.selected { border-color: var(--coral); background: #fff4ec; }
.option-button.locked {
  border-color: #dbe6e5;
  background: #f4f7f6;
}
.option-button.locked::after {
  position: absolute;
  top: 5px;
  right: 6px;
  content: "🔒";
  font-size: 10px;
}

.color-button {
  width: 35px;
  height: 35px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px #c6d8d7;
  cursor: pointer;
}
.color-button.selected { box-shadow: 0 0 0 3px var(--coral); }

.purchase-dialog {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  padding: 22px;
  place-items: center;
  background: rgba(5, 32, 44, .7);
  backdrop-filter: blur(14px);
}

.purchase-card {
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 25px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.purchase-card h2 {
  margin: 0 0 12px;
  font-size: 34px;
}

.purchase-card > p:not(.eyebrow, .purchase-warning) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.purchase-icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin: -4px auto 16px;
  place-items: center;
  border-radius: 20px;
  background: #eaf4f3;
  font-size: 30px;
}

.purchase-preview {
  position: relative;
  height: 175px;
  margin: 18px 0 0;
  overflow: hidden;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 35%, #fefcf3 0 28%, #d7f0ed 72%);
}
.purchase-preview canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.purchase-preview canvas.dragging { cursor: grabbing; }

.purchase-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 10px;
  padding: 12px 14px;
  border-radius: 13px;
  background: #eaf4f3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.purchase-balance strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-family: "Fredoka", sans-serif;
  font-size: 17px;
}

.purchase-warning {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
}

.purchase-actions {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 10px;
  margin-top: 18px;
}
.purchase-actions .primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }

.purchase-actions .secondary-button {
  border-color: #c4d7d5;
  background: white;
  color: var(--teal);
}

.divider { display: flex; align-items: center; gap: 10px; margin: 20px 0; color: #91a3a5; font-size: 12px; }
.divider::before, .divider::after { flex: 1; height: 1px; background: #dbe6e5; content: ""; }
.join-row { display: flex; gap: 9px; margin-top: 7px; }
.join-row input {
  width: 100%;
  min-width: 0;
  border: 2px solid #d6e4e3;
  border-radius: 15px;
  padding: 0 16px;
  color: var(--ink);
  font-family: "Fredoka", sans-serif;
  font-size: 21px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.room-panel .secondary-button { border-color: #c4d7d5; background: white; color: var(--teal); }
.room-status { min-height: 24px; margin: 16px 0 0; text-align: center; }
.room-status strong { color: var(--coral); font-size: 24px; letter-spacing: .12em; }

.game-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.hud-top {
  position: absolute;
  top: 22px;
  left: 22px;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.round-button, .challenge-pill, .race-delta, .hud-stat, .player-chip, .score-chip, .emote-button {
  border: 1px solid rgba(255,255,255,.66);
  background: rgba(4, 48, 62, .72);
  color: white;
  box-shadow: 0 10px 24px rgba(8,44,53,.14);
  backdrop-filter: blur(10px);
}

.round-button {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  pointer-events: auto;
  cursor: pointer;
  font-weight: 800;
}

.challenge-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  height: 54px;
  padding: 0 15px;
  border-radius: 17px;
}
.challenge-icon { font-size: 22px; }
.challenge-pill small, .hud-stat small { display: block; color: #9de4dd; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.challenge-pill strong { font-family: "Fredoka"; font-size: 18px; }
.race-delta {
  display: grid;
  min-width: 104px;
  padding: 8px 13px;
  border-radius: 15px;
  text-align: center;
}
.race-delta small { color: #9de4dd; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.race-delta strong { font-family: "Fredoka"; font-size: 15px; }
.race-delta i { color: rgba(255,255,255,.66); font-size: 8px; font-style: normal; }
.race-delta i.ahead { color: #72f0b2; }
.race-delta i.behind { color: #ff9f8d; }
.hud-stat { margin-left: auto; padding: 9px 16px; border-radius: 16px; text-align: right; }
.hud-stat strong { display: block; font-family: "Fredoka"; font-size: 21px; }
.hud-stat i { color: rgba(255,255,255,.65); font-family: "DM Sans"; font-size: 10px; font-style: normal; }

.hud-side { position: absolute; top: 94px; right: 22px; display: grid; gap: 7px; }
.score-chip {
  display: flex;
  justify-content: space-between;
  gap: 13px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
}
.score-chip span { color: #9de4dd; }
.score-chip strong { display: block; color: white; font-family: "Fredoka"; font-size: 15px; letter-spacing: 0; }
.ghost-status {
  padding: 7px 10px;
  border: 1px solid rgba(166,248,255,.6);
  border-radius: 10px;
  background: rgba(23,128,139,.42);
  color: #c9fbff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-align: center;
  backdrop-filter: blur(10px);
}
.player-chip { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 12px; font-size: 10px; }
.player-chip > span { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 9px; background: #f5d184; font-size: 19px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #57e6a5; box-shadow: 0 0 0 3px rgba(87,230,165,.14); }

.hud-bottom {
  position: absolute;
  right: 22px;
  bottom: 25px;
  left: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-track {
  position: relative;
  width: min(460px, 48vw);
  height: 9px;
  overflow: visible;
  border: 2px solid rgba(255,255,255,.65);
  border-radius: 99px;
  background: rgba(7,54,68,.38);
}
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--yellow); }
.progress-track span { position: absolute; top: 50%; left: 0; font-size: 24px; transform: translate(-50%, -50%); transition: left .2s linear; }
.emote-button { position: absolute; right: 0; min-height: 45px; padding: 0 14px; border-radius: 14px; pointer-events: auto; cursor: pointer; font-size: 11px; font-weight: 800; }

.touch-controls {
  position: absolute;
  bottom: 82px;
  left: 50%;
  display: none;
  gap: 10px;
  pointer-events: auto;
  transform: translateX(-50%);
}
.touch-controls button {
  width: 65px;
  height: 58px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 18px;
  background: rgba(5,56,68,.58);
  color: white;
  font-size: 24px;
  backdrop-filter: blur(8px);
}

.air-feedback {
  position: absolute;
  top: 16%;
  left: 50%;
  display: grid;
  min-width: 205px;
  padding: 10px 18px 12px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  background: rgba(5, 47, 61, .72);
  color: white;
  box-shadow: 0 15px 38px rgba(4, 31, 42, .2);
  opacity: 0;
  transform: translate(-50%, 12px) scale(.94);
  transition: opacity .16s ease, transform .16s ease, background .18s ease;
  backdrop-filter: blur(12px);
}
.air-feedback.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.air-feedback small { color: #9de4dd; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.air-feedback strong { font-family: "Fredoka"; font-size: clamp(27px, 4vw, 44px); line-height: 1.05; text-shadow: 0 4px 16px rgba(0,0,0,.16); }
.air-feedback span { margin-top: 3px; color: rgba(255,255,255,.72); font-size: 9px; font-weight: 800; letter-spacing: .11em; }
.air-feedback.landing-window { background: rgba(117, 69, 25, .78); }
.air-feedback.ready, .air-feedback.landed { background: rgba(8, 111, 87, .82); }
.air-feedback.missed { background: rgba(142, 48, 38, .84); }
.air-feedback.recognized strong { animation: trick-pop .32s ease; }

@keyframes trick-pop {
  50% { transform: scale(1.16) rotate(-1deg); color: #ffd765; }
}

.finish-panel { text-align: center; }
.finish-badge { margin: -85px auto 10px; font-size: 76px; filter: drop-shadow(0 12px 10px rgba(10,55,67,.16)); }
.result-time { margin: 20px 0; }
.result-time small, .result-grid small { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.result-time strong { font-family: "Fredoka"; font-size: 46px; }
.record-message { margin: -12px 0 18px !important; color: var(--coral) !important; font-family: "Fredoka"; font-weight: 700; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 22px; }
.result-grid span { padding: 13px 5px; border-radius: 13px; background: #eaf4f3; }
.result-grid strong { display: block; margin-top: 4px; font-size: 13px; }
.text-button { margin: 15px 0 -12px; border: 0; background: none; color: var(--muted); cursor: pointer; font-weight: 700; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  max-width: calc(100% - 40px);
  padding: 12px 17px;
  border-radius: 13px;
  background: #0c3542;
  color: white;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: .22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .start-screen { background: linear-gradient(0deg, rgba(3,34,47,.94), rgba(3,34,47,.18) 76%); }
  .start-art { background-position: 61% center; }
  .topbar { padding: 20px; }
  .hero-copy { top: auto; right: 22px; bottom: 132px; left: 22px; width: auto; transform: none; }
  h1 { font-size: clamp(46px, 14vw, 68px); }
  .intro { margin: 15px 0 20px; font-size: 14px; }
  .controls-hint { display: none; }
  .friends-card { right: 20px; bottom: 20px; left: 20px; min-width: 0; }
  .mountain-grid { grid-template-columns: 1fr; }
  .mountain-card { min-height: 150px; }
  .mountain-card .mountain-emoji { display: inline-block; margin: 20px 15px 10px 0; }
  .panel-screen { align-items: start; padding: 14px; }
  .panel-shell { margin: auto; padding: 27px 21px; border-radius: 22px; }
  .purchase-card { padding: 28px 21px; }
  .touch-controls { display: flex; }
  .touch-controls button { width: 60px; }
  .hud-bottom { bottom: 19px; }
  .progress-track { width: 58vw; }
  .emote-button { display: none; }
  .hud-side { top: 76px; right: auto; left: 12px; display: block; }
  .hud-side .player-chip, .hud-side #remote-player-list { display: none; }
  .hud-top { top: 12px; right: 12px; left: 12px; }
  .challenge-pill { min-width: 0; }
  .challenge-pill small { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .race-delta { min-width: 78px; padding: 7px 8px; }
  .hud-stat { padding: 8px 10px; }
  .air-feedback { top: 17%; min-width: 180px; padding: 9px 14px 11px; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
}
