/* 奇趣狂奔 · 三轨列车跑酷 */
:root {
  --ink: #0E2A56;
  --ink-deep: #091D3D;
  --navy: #12305E;
  --navy-soft: #1B3F76;
  --sky: #5EC8F5;
  --cream: #FFF7E6;
  --cream-dim: #F4DFC0;
  --orange: #FF8A3D;
  --orange-hot: #FFB25E;
  --orange-deep: #E75A1D;
  --gold: #FFC93C;
  --gold-deep: #D98B14;
  --mint: #63E6BE;
  --pink: #FF7BA9;
  --violet: #7C5CFF;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --sat: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #071833;
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
button { font-family: inherit; border: 0; cursor: pointer; }
b, em { font-style: normal; }

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: #0B2C55;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(125% 82% at 50% 42%, transparent 48%, rgba(5, 18, 42, 0.36) 100%),
    linear-gradient(180deg, rgba(5, 18, 42, 0.18), transparent 22%, transparent 78%, rgba(5, 18, 42, 0.3));
}
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(3, 14, 34, 0.05) 0 1px, transparent 1px 5px);
  mix-blend-mode: soft-light;
}

/* ───────── HUD ───────── */
.hud {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  padding: calc(14px + var(--safe-t)) calc(16px + var(--sar)) 0 calc(16px + var(--sat));
}
.hud-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.pause-btn {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #FFF7E6;
  background: linear-gradient(160deg, rgba(30, 64, 118, 0.92), rgba(10, 32, 68, 0.84));
  border: 1px solid rgba(255, 224, 170, 0.38);
  box-shadow: 0 8px 20px rgba(4, 16, 38, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.09s ease, background 0.15s ease;
}
.pause-btn .mp-icon { width: 25px; height: 25px; }
.pause-btn:active { transform: scale(0.93); background: rgba(255, 138, 61, 0.34); }

.hud-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.hud-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 16px;
  padding: 7px 12px;
  background: linear-gradient(160deg, rgba(28, 60, 112, 0.9), rgba(9, 29, 61, 0.82));
  border: 1px solid rgba(255, 224, 170, 0.34);
  box-shadow: 0 8px 20px rgba(4, 16, 38, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hud-pill b {
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #FFF7E6;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(4, 14, 34, 0.45);
}
.hud-pill em { font-size: 10px; font-weight: 800; color: #FFD98C; }
.pill-cap {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(255, 226, 178, 0.72);
}
.coin-pill { padding-right: 10px; }
.coin-pill .mp-icon {
  width: 19px;
  height: 19px;
  color: var(--gold);
  filter: drop-shadow(0 0 7px rgba(255, 201, 60, 0.62));
}
.coin-pill b { color: #FFE28E; font-size: 19px; }
.dist-pill b { font-size: 25px; min-width: 58px; text-align: right; }
.coin-pill.pop { animation: coinPop 0.34s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes coinPop {
  0% { transform: scale(1); }
  38% { transform: scale(1.12); border-color: rgba(255, 201, 60, 0.75); }
  100% { transform: scale(1); }
}

.tap-hint {
  position: absolute;
  left: 50%;
  bottom: calc(18px + var(--safe-b));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255, 247, 230, 0.92);
  background: rgba(8, 27, 56, 0.58);
  border: 1px solid rgba(255, 224, 170, 0.24);
  box-shadow: 0 8px 22px rgba(4, 14, 34, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.tap-hint .mp-icon { width: 17px; height: 17px; color: #FFD98C; }
.tap-hint.fade { opacity: 0; transform: translate(-50%, 8px); }

/* ───────── overlays ───────── */
.overlay { position: absolute; inset: 0; }

/* home cover */
.home {
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: #0B2C55;
  overflow: hidden;
}
.cover-art {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  object-fit: cover;
  object-position: 42% 42%;
  filter: saturate(1.08) contrast(1.03);
  transform: scale(1.02);
  animation: coverDrift 22s ease-in-out infinite alternate;
}
@keyframes coverDrift {
  0% { transform: scale(1.02) translate3d(0, 0, 0); }
  100% { transform: scale(1.07) translate3d(-6px, -8px, 0); }
}
.cover-tint {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(40% 38% at 102% -2%, rgba(4, 17, 39, 0.9) 0%, rgba(4, 17, 39, 0.62) 46%, rgba(4, 17, 39, 0.16) 70%, transparent 86%),
    linear-gradient(180deg, rgba(5, 22, 48, 0.8) 0%, rgba(5, 22, 48, 0.22) 14%, transparent 34%, rgba(4, 17, 39, 0.16) 58%, rgba(4, 17, 39, 0.92) 100%),
    radial-gradient(70% 42% at 50% 100%, rgba(255, 138, 61, 0.26), transparent 72%);
}
.cover-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(14px + var(--safe-t)) calc(16px + var(--sar)) 0 calc(16px + var(--sat));
}
.cover-top::before {
  content: "";
  position: absolute;
  top: calc(-18px - var(--safe-t));
  right: calc(-22px - var(--sar));
  width: 220px;
  height: 136px;
  background: radial-gradient(ellipse at 92% 4%, rgba(4, 17, 39, 0.98) 0%, rgba(4, 17, 39, 0.84) 48%, rgba(4, 17, 39, 0.22) 72%, transparent 86%);
  pointer-events: none;
  z-index: -1;
}
.brand-chip, .live-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(255, 247, 230, 0.9);
  background: rgba(8, 27, 56, 0.42);
  border: 1px solid rgba(255, 224, 170, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px rgba(4, 14, 34, 0.25);
}
.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 201, 60, 0.18), 0 0 10px rgba(255, 201, 60, 0.9);
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.16), 0 0 9px rgba(255, 138, 61, 0.9);
  animation: livePulse 1.8s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 0.55; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1.12); }
}

.cover-bottom {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 40px calc(18px + var(--sar)) calc(16px + var(--safe-b)) calc(18px + var(--sat));
  background: linear-gradient(180deg, transparent 0%, rgba(4, 17, 39, 0.62) 26%, rgba(4, 17, 39, 0.94) 62%);
}
.cover-copy { animation: copyIn 0.75s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
@keyframes copyIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: #FFE1A8;
  background: rgba(255, 138, 61, 0.18);
  border: 1px solid rgba(255, 178, 94, 0.46);
  box-shadow: 0 6px 16px rgba(4, 14, 34, 0.22);
}
.logo {
  position: relative;
  margin: 10px 0 0;
  font-size: clamp(52px, 16.6vw, 80px);
  line-height: 0.92;
  font-weight: 900;
  letter-spacing: -0.055em;
  color: var(--cream);
  -webkit-text-stroke: 1.6px #0C2447;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 #FFB25E,
    0 5px 0 #E75A1D,
    0 8px 0 #A93B12,
    0 12px 0 #0C2447,
    0 20px 30px rgba(0, 0, 0, 0.45);
  transform: rotate(-1.2deg);
  transform-origin: left center;
  white-space: nowrap;
}
.logo-light { color: #FFF9EC; }
.logo-warm {
  color: #FFC45E;
  text-shadow:
    0 2px 0 #FFF2D2,
    0 5px 0 #FF8A3D,
    0 8px 0 #C44714,
    0 12px 0 #0C2447,
    0 20px 32px rgba(0, 0, 0, 0.5);
}
.tagline {
  display: inline-block;
  width: fit-content;
  margin: 11px 0 0;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 248, 232, 0.96);
  background: rgba(4, 18, 40, 0.46);
  border: 1px solid rgba(255, 224, 170, 0.12);
  text-shadow: 0 2px 8px rgba(4, 16, 38, 0.9);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.hero-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.best-chip, .voice-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.best-chip {
  color: rgba(255, 247, 230, 0.86);
  background: rgba(8, 27, 56, 0.48);
  border: 1px solid rgba(255, 244, 218, 0.2);
  box-shadow: 0 8px 20px rgba(4, 14, 34, 0.24);
}
.best-chip .mp-icon { width: 14px; height: 14px; color: var(--gold); }
.best-chip b { font-size: 15px; font-weight: 900; color: #FFF7E6; letter-spacing: 0; }
.best-unit { color: #FFD98C; font-size: 10px; }
.voice-chip {
  color: rgba(214, 255, 238, 0.94);
  background: rgba(20, 74, 65, 0.5);
  border: 1px solid rgba(99, 230, 190, 0.38);
  box-shadow: 0 8px 20px rgba(4, 14, 34, 0.22);
}
.voice-chip .mp-icon {
  width: 14px;
  height: 14px;
  color: var(--mint);
  filter: drop-shadow(0 0 6px rgba(99, 230, 190, 0.5));
}

.start-dock {
  position: relative;
  margin-top: 14px;
  animation: dockIn 0.8s 0.08s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@keyframes dockIn {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
.dock-card {
  padding: 12px;
  border-radius: 24px;
  background: linear-gradient(175deg, rgba(30, 64, 118, 0.74), rgba(7, 24, 52, 0.94));
  border: 1px solid rgba(255, 224, 170, 0.28);
  box-shadow:
    0 24px 50px rgba(2, 10, 26, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.cta {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 18px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #3B1605;
  background: linear-gradient(180deg, #FFD286 0%, #FF9B4A 46%, #F46A21 100%);
  box-shadow:
    0 7px 0 #A93B12,
    0 15px 30px rgba(255, 122, 40, 0.42),
    inset 0 2px 0 rgba(255, 255, 255, 0.58),
    inset 0 -2px 0 rgba(155, 48, 12, 0.3);
  transition: transform 0.09s ease, box-shadow 0.09s ease;
}
.cta::after {
  content: "";
  position: absolute;
  top: -130%;
  left: -42%;
  width: 32%;
  height: 360%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.58), transparent);
  transform: rotate(22deg);
  animation: ctaShine 4.4s ease-in-out infinite;
}
@keyframes ctaShine {
  0%, 62% { left: -46%; }
  84%, 100% { left: 120%; }
}
.cta .mp-icon { width: 27px; height: 27px; color: #3B1605; }
.cta:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #A93B12, 0 7px 16px rgba(255, 122, 40, 0.34), inset 0 2px 0 rgba(255, 255, 255, 0.45);
}
.how {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 11px;
}
.how-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 240, 214, 0.88);
}
.how-item .mp-icon { width: 13px; height: 13px; color: #FFC45E; }
.how-sep { width: 3px; height: 3px; border-radius: 50%; background: rgba(255, 197, 143, 0.5); }
.tiny {
  margin: 7px 0 0;
  text-align: center;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: rgba(255, 234, 204, 0.52);
}

/* ───────── modals ───────── */
.modal {
  position: absolute;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: calc(20px + var(--safe-t)) 20px calc(20px + var(--safe-b));
  background: radial-gradient(120% 82% at 50% 38%, rgba(10, 34, 72, 0.48), rgba(3, 13, 30, 0.8));
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn 0.2s ease both;
  overflow: hidden;
}
.modal::before {
  content: "";
  position: absolute;
  inset: -16px;
  background: url("images/gen/gptimg_1795239034_look.png") center 38% / cover no-repeat;
  opacity: 0.26;
  filter: blur(5px) saturate(1.15);
  transform: scale(1.04);
  pointer-events: none;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  padding: 22px 20px 20px;
  border-radius: 28px;
  text-align: center;
  background:
    radial-gradient(140% 80% at 50% 0%, rgba(255, 154, 74, 0.18), transparent 58%),
    linear-gradient(175deg, #1B3F76, #102A56 70%, #0B2147);
  border: 1px solid rgba(255, 224, 170, 0.28);
  box-shadow:
    0 34px 80px rgba(2, 8, 22, 0.66),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.24);
  animation: cardIn 0.32s cubic-bezier(0.2, 1.2, 0.35, 1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  color: #FFE1A8;
  background: rgba(255, 138, 61, 0.16);
  border: 1px solid rgba(255, 178, 94, 0.36);
}
.modal-badge.warm { color: #FFE7A7; background: rgba(255, 201, 60, 0.14); border-color: rgba(255, 201, 60, 0.4); }
.modal-title {
  margin: 13px 0 0;
  font-size: 27px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #FFF7E6;
  text-shadow: 0 3px 0 rgba(4, 14, 34, 0.4);
}
.modal-sub {
  margin: 8px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(255, 231, 198, 0.7);
}
.new-record {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 11px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #3B1605;
  background: linear-gradient(140deg, #FFE08A, #FFB347);
  box-shadow: 0 6px 16px rgba(255, 179, 71, 0.32);
}
.new-record .mp-icon { width: 14px; height: 14px; color: #5A2A00; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 16px;
  padding: 12px 2px;
  border-radius: 18px;
  background: rgba(8, 27, 56, 0.42);
  border: 1px solid rgba(255, 224, 170, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.stat { min-width: 0; }
.stat + .stat { border-left: 1px solid rgba(255, 224, 170, 0.12); }
.stat-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(255, 226, 178, 0.58);
}
.stat-val { display: flex; align-items: baseline; justify-content: center; gap: 2px; margin-top: 4px; }
.stat-val b {
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #FFF7E6;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(4, 14, 34, 0.4);
}
.stat-val em { font-size: 9px; color: #FFD98C; font-weight: 800; }
.over-best { margin: 11px 0 0; font-size: 11px; letter-spacing: 0.08em; color: rgba(255, 233, 202, 0.58); }
.over-best b { color: #FFD98C; font-weight: 900; font-variant-numeric: tabular-nums; }
.modal-actions { margin-top: 16px; }
.btn-primary {
  width: 100%;
  height: 53px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 17px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #3B1605;
  background: linear-gradient(180deg, #FFD286 0%, #FF9B4A 46%, #F46A21 100%);
  box-shadow: 0 6px 0 #A93B12, 0 12px 24px rgba(255, 122, 40, 0.34), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.09s ease, box-shadow 0.09s ease;
}
.btn-primary .mp-icon { width: 21px; height: 21px; color: #3B1605; }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 3px 0 #A93B12, 0 6px 14px rgba(255, 122, 40, 0.3); }
.btn-row { display: flex; gap: 9px; margin-top: 9px; }
.btn-ghost {
  flex: 1;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(255, 240, 214, 0.92);
  background: rgba(255, 244, 218, 0.07);
  border: 1px solid rgba(255, 224, 186, 0.22);
  transition: transform 0.09s ease, background 0.15s ease;
}
.btn-ghost .mp-icon { width: 18px; height: 18px; color: #FFC58F; }
.btn-ghost:active { transform: scale(0.965); background: rgba(255, 138, 61, 0.18); }
.btn-ghost.wide { width: 100%; margin-top: 9px; flex: none; }
.sound-row {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 240, 214, 0.82);
  background: transparent;
  border: 1px dashed rgba(255, 224, 186, 0.2);
}
.sound-row .mp-icon { width: 18px; height: 18px; color: #FFC58F; }
.sound-row span:nth-child(2) { flex: 1; text-align: left; }
.switch {
  width: 40px;
  height: 23px;
  border-radius: 999px;
  padding: 2px;
  background: rgba(255, 138, 61, 0.7);
  transition: background 0.18s ease;
  display: block;
}
.switch .knob {
  display: block;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #FFF7E6;
  box-shadow: 0 2px 5px rgba(4, 14, 34, 0.45);
  transform: translateX(17px);
  transition: transform 0.18s ease;
}
.sound-row.off .switch { background: rgba(255, 255, 255, 0.16); }
.sound-row.off .switch .knob { transform: translateX(0); }

.over-card { padding-top: 21px; }

/* ───────── landscape game layout ───────── */
@media (min-aspect-ratio: 1/1) {
  .cover-art { object-position: 50% 42%; }
  .cover-bottom {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 22px;
    padding: 28px calc(22px + var(--sar)) calc(18px + var(--safe-b)) calc(22px + var(--sat));
    background: linear-gradient(180deg, transparent 0%, rgba(4, 17, 39, 0.5) 34%, rgba(4, 17, 39, 0.94) 100%);
  }
  .cover-copy { flex: 1 1 auto; min-width: 0; }
  .start-dock { flex: 0 0 auto; width: min(350px, 42vw); margin-top: 0; }
  .logo { font-size: clamp(44px, 8.2vw, 78px); }
  .tagline { margin-top: 8px; }
  .hero-chips { margin-top: 10px; }
  .cover-top { padding-top: calc(12px + var(--safe-t)); }
  .hud-stats { flex-direction: row; align-items: center; }
  .hud-pill b { font-size: 20px; }
  .dist-pill b { font-size: 23px; min-width: 50px; }
  .tap-hint { bottom: calc(10px + var(--safe-b)); }
  .modal { padding: 10px 16px; }
  .modal-card {
    max-width: 620px;
    padding: 16px 20px;
    max-height: calc(100% - 10px);
    overflow-y: auto;
  }
  .modal-title { font-size: 25px; margin-top: 10px; }
  .modal-sub { margin-top: 6px; font-size: 12px; }
  .stat-grid { margin-top: 12px; padding: 10px 2px; }
  .modal-actions { margin-top: 12px; }
  .new-record { margin-top: 8px; }
  .over-best { margin-top: 8px; }
  .over-card { padding-top: 16px; }
  .sound-row { margin-top: 9px; padding: 8px 12px; }
  .btn-primary { height: 48px; font-size: 16px; }
  .btn-ghost { min-height: 42px; }
}

@media (max-height: 430px) and (min-aspect-ratio: 1/1) {
  .cover-art { object-position: 50% 43%; }
  .cover-bottom { padding-top: 14px; gap: 14px; }
  .cover-copy { flex: 1 1 auto; }
  .start-dock { width: min(310px, 40vw); }
  .logo { font-size: clamp(38px, 7.4vw, 58px); margin-top: 6px; }
  .tagline { font-size: 11px; margin-top: 5px; }
  .eyebrow { padding: 4px 9px; font-size: 9px; }
  .hero-chips { margin-top: 6px; gap: 5px; }
  .best-chip, .voice-chip { padding: 5px 9px; font-size: 9.5px; }
  .dock-card { padding: 8px; border-radius: 18px; }
  .cta { height: 46px; font-size: 16px; border-radius: 14px; }
  .cta .mp-icon { width: 23px; height: 23px; }
  .how, .tiny { display: none; }
  .brand-chip, .live-chip { padding: 5px 9px; font-size: 9px; }
  .pause-btn { width: 42px; height: 42px; border-radius: 13px; }
  .hud-pill { padding: 5px 10px; }
  .hud-pill b { font-size: 18px; }
  .dist-pill b { font-size: 21px; min-width: 46px; }
  .modal-card { padding: 12px 16px; }
  .modal-badge { padding: 4px 10px; font-size: 9px; }
  .modal-title { font-size: 21px; margin-top: 7px; }
  .modal-sub { font-size: 11px; margin-top: 4px; }
  .stat-grid { margin-top: 8px; padding: 7px 2px; }
  .stat-val b { font-size: 19px; }
  .stat-label { font-size: 8px; }
  .over-best { margin-top: 6px; font-size: 10px; }
  .modal-actions { margin-top: 9px; }
  .btn-primary { height: 42px; font-size: 15px; }
  .btn-row { margin-top: 7px; }
  .btn-ghost { min-height: 36px; font-size: 11px; }
  .btn-ghost.wide { margin-top: 7px; }
  .sound-row { margin-top: 7px; padding: 6px 10px; font-size: 11px; }
}

/* portrait fallback stays usable if the link is opened upright */
@media (max-aspect-ratio: 1/1) and (max-height: 720px) {
  .cover-bottom { padding-top: 24px; }
  .logo { font-size: clamp(46px, 14.6vw, 68px); }
  .tagline { font-size: 12px; margin-top: 8px; }
  .hero-chips { margin-top: 9px; }
  .start-dock { margin-top: 10px; }
  .dock-card { padding: 10px; border-radius: 22px; }
  .cta { height: 52px; font-size: 18px; }
  .how { margin-top: 8px; }
  .tiny { margin-top: 5px; }
  .modal-card { padding: 18px 18px 16px; }
  .modal-title { font-size: 24px; margin-top: 10px; }
  .stat-grid { margin-top: 12px; padding: 10px 2px; }
  .modal-actions { margin-top: 13px; }
}
@media (max-aspect-ratio: 1/1) and (max-height: 620px) {
  .tagline { display: none; }
  .logo { font-size: clamp(40px, 12.8vw, 58px); }
  .cover-bottom { padding-top: 16px; }
  .how { display: none; }
  .tiny { display: none; }
  .hero-chips { margin-top: 7px; }
  .best-chip, .voice-chip { padding: 6px 9px; font-size: 9.5px; }
  .cta { height: 48px; font-size: 17px; }
  .modal-sub { font-size: 11.5px; }
}
@media (max-aspect-ratio: 1/1) and (max-height: 560px) {
  .eyebrow { display: none; }
  .cover-top { padding-top: calc(10px + var(--safe-t)); }
  .logo { margin-top: 4px; }
  .hero-chips { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cover-art, .logo, .cta::after, .cover-copy, .start-dock, .modal-card, .new-record, .live-dot {
    animation: none !important;
  }
}
