:root {
  --bg: #05070a;
  --panel: rgba(14, 17, 22, 0.94);
  --panel-2: rgba(20, 24, 30, 0.96);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --ink: #f2f5f8;
  --dim: #9aa6b2;
  --dim-2: #6b7785;
  --accent: #ff8a3d;
  --accent-2: #ffcf4d;
  --good: #5ee08a;
  --bad: #ff5a5a;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#app { position: fixed; inset: 0; }

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

.noscript {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: #0a0c0f;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}

button { font-family: inherit; }

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

.hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
}

body.in-game .hud { opacity: 1; visibility: visible; }

.hud-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.hud-level {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
}

.hud-level span:first-child {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.hud-level span:last-child {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.hud-progress {
  flex: 1;
  max-width: 520px;
  margin-top: 2px;
}

.hud-progress-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

#hudProgressFill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8a3d, #ffcf4d);
  box-shadow: 0 0 12px rgba(255, 138, 61, 0.5);
}

#hudProgressMarker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35);
}

#hudCheckpointDots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hud-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.4);
}

.hud-dot.on {
  background: var(--good);
  box-shadow: 0 0 8px rgba(94, 224, 138, 0.7);
}

.hud-progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.hud-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.hud-stat b {
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
}

.hud-stat span {
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.hud-stat.coins b { color: var(--accent-2); }

.icon-btn {
  pointer-events: auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(10, 12, 16, 0.6);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.hud-checkpoint {
  position: absolute;
  left: 50%;
  top: 74px;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--dim);
  background: rgba(10, 12, 16, 0.45);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

/* ------------------------------------------------------- touch controls */

.touch-controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  pointer-events: none;
}

body.controls-touch.controls-active .touch-controls { display: flex; }

.touch-cluster {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 10px;
  align-items: end;
  pointer-events: none;
}

.touch-btn {
  pointer-events: auto;
  width: clamp(60px, 9vw, 80px);
  height: clamp(60px, 9vw, 80px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 12, 16, 0.52);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  backdrop-filter: blur(6px);
  transition: transform 0.08s, background 0.08s, border-color 0.08s;
}

.touch-btn .touch-icon { font-size: 20px; line-height: 1; }

.touch-btn.active {
  background: rgba(255, 138, 61, 0.38);
  border-color: var(--accent);
  transform: scale(0.94);
}

.touch-btn.gas { border-color: rgba(255, 138, 61, 0.55); }
.touch-btn.brake { border-color: rgba(255, 90, 90, 0.4); }
.touch-btn.lean-back { grid-column: 2; grid-row: 1; }
.touch-btn.brake { grid-column: 1; grid-row: 2; }
.touch-btn.lean-forward { grid-column: 1; grid-row: 1; }
.touch-btn.gas { grid-column: 2; grid-row: 2; }

/* ------------------------------------------------------------- screens */

.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 138, 61, 0.08), transparent 55%), rgba(4, 6, 10, 0.55);
  backdrop-filter: blur(3px);
  overflow: auto;
}

.screen.active { display: flex; }
.screen.overlay { background: rgba(4, 6, 10, 0.72); }
.menu-screen {
  background: linear-gradient(180deg, rgba(4, 6, 10, 0.12), rgba(4, 6, 10, 0.55));
  backdrop-filter: none;
}

.panel {
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  overflow: auto;
  background: linear-gradient(180deg, rgba(18, 22, 28, 0.97), rgba(9, 11, 15, 0.97));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.panel.wide { max-width: 1040px; }
.panel.small { max-width: 460px; }

.panel-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.head-title { flex: 1; }
.head-title h2 { margin: 0; font-size: 20px; letter-spacing: 0.08em; }
.head-title p { margin: 2px 0 0; font-size: 11px; color: var(--dim); }
.head-stats {
  display: flex;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s, border-color 0.15s;
}

.btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 138, 61, 0.5); }
.btn:active { transform: scale(0.98); }

.btn.primary {
  background: linear-gradient(180deg, #ffa04d, #e86a1f);
  border-color: transparent;
  color: #1a0d04;
  box-shadow: 0 8px 24px rgba(232, 106, 31, 0.35);
}

.btn.primary:hover { background: linear-gradient(180deg, #ffb266, #f07a2a); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--dim); }
.btn.big { padding: 18px 28px; font-size: 16px; border-radius: 14px; }
.btn.tiny { padding: 7px 10px; font-size: 10px; border-radius: 8px; }
.btn.danger { border-color: rgba(255, 90, 90, 0.4); color: var(--bad); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn.back { padding: 8px 12px; font-size: 10px; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.row { flex-direction: row; flex-wrap: wrap; justify-content: center; }

.kicker { font-size: 10px; letter-spacing: 0.24em; color: var(--accent); font-weight: 800; }
.kicker.bad { color: var(--bad); }
.kicker.good { color: var(--good); }

.panel h2 { margin: 6px 0 14px; font-size: clamp(22px, 4vw, 30px); letter-spacing: 0.02em; }
.panel p { color: var(--dim); font-size: 13px; line-height: 1.5; }

/* ---------------------------------------------------------------- menu */

.menu-panel {
  width: 100%;
  max-width: 720px;
  text-align: center;
  padding: 20px;
}

.brand-kicker { font-size: 10px; letter-spacing: 0.3em; color: var(--accent); font-weight: 800; }

.brand h1 {
  margin: 6px 0 0;
  font-size: clamp(48px, 11vw, 96px);
  line-height: 0.9;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #fff 10%, #ffb26b 60%, #e86a1f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 24px rgba(232, 106, 31, 0.25));
}

.brand-sub {
  margin: 6px 0 0;
  font-size: clamp(12px, 2.4vw, 18px);
  letter-spacing: 0.42em;
  color: var(--ink);
  font-weight: 700;
}

.menu-stats {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 5vw, 48px);
  margin: 22px 0;
}

.menu-stats div { display: flex; flex-direction: column; gap: 2px; }
.menu-stats b { font-family: var(--mono); font-size: 24px; }
.menu-stats span { font-size: 10px; letter-spacing: 0.2em; color: #c8d2dc; }

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}

.menu-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.menu-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 22px auto 0;
  max-width: 620px;
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.howto { margin: 18px auto 0; max-width: 620px; text-align: left; }
.howto summary {
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-weight: 800;
  padding: 8px 0;
}

.game-info-page { padding: 4px 2px 8px; }
.game-info-page h2 { font-size: 16px; margin: 8px 0; }
.game-info-page h3 {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 16px 0 6px;
  text-transform: uppercase;
}
.game-info-page p, .game-info-page li { font-size: 12px; color: var(--dim); line-height: 1.55; }
.game-info-page ul { margin: 0; padding-left: 18px; }
.game-info-page b { color: var(--ink); }

/* --------------------------------------------------------------- levels */

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.level-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 170px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(155deg, var(--card-a), var(--card-b));
  color: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.12s, border-color 0.15s;
}

.level-card:hover { transform: translateY(-2px); border-color: var(--card-accent); }
.level-card.locked { filter: grayscale(0.7) brightness(0.65); cursor: not-allowed; }

.level-num {
  position: absolute;
  right: 12px;
  top: 6px;
  font-family: var(--mono);
  font-size: 44px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.14);
  line-height: 1;
}

.level-theme { font-size: 8px; letter-spacing: 0.2em; color: rgba(255, 255, 255, 0.65); }
.level-name { font-size: 20px; font-weight: 900; letter-spacing: 0.01em; }
.level-sub { font-size: 11px; color: rgba(255, 255, 255, 0.72); line-height: 1.35; max-width: 85%; }
.level-stars { display: flex; gap: 3px; margin-top: auto; font-size: 16px; }
.level-stars .star { color: rgba(255, 255, 255, 0.22); }
.level-stars .star.on { color: var(--accent-2); }
.level-best { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.65); }
.level-lock {
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 8px;
  letter-spacing: 0.14em;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 3px 8px;
}

/* --------------------------------------------------------------- garage */

.garage-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

.garage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 4px;
}

.bike-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.bike-card.selected { border-color: var(--accent); background: rgba(255, 138, 61, 0.12); }
.bike-card.locked { opacity: 0.6; }

.bike-swatch {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.bike-card-main { display: flex; flex-direction: column; gap: 1px; }
.bike-card-main b { font-size: 13px; }
.bike-card-main span { font-family: var(--mono); font-size: 9px; color: var(--dim); }

.garage-detail { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

#bikePreview {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #0a0c0f;
}

.bike-title { display: flex; align-items: center; gap: 10px; }
.bike-title h3 { margin: 0; font-size: 22px; }
.bike-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--accent-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
}

#bikeInfo p { margin: 2px 0 8px; font-size: 12px; }

.stat-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.stat-row { display: flex; align-items: center; gap: 8px; font-size: 8px; letter-spacing: 0.1em; color: var(--dim); }
.stat-row > span { width: 70px; flex: none; }
.stat-track { flex: 1; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.stat-track > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ff8a3d, #ffcf4d); }

.garage-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.tab {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 6px 2px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }

.upgrade-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.upgrade-main { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.upgrade-main b { font-size: 12px; }
.upgrade-main span { font-size: 10px; color: var(--dim); }
.pips { display: flex; gap: 4px; }
.pip { width: 8px; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); }
.pip.on { background: var(--accent); }
.max { font-family: var(--mono); font-size: 10px; color: var(--good); }

.style-section { margin-top: 12px; }
.style-section h4 { margin: 0 0 8px; font-size: 9px; letter-spacing: 0.18em; color: var(--dim); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 74px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--dim);
  cursor: pointer;
}
.swatch.selected { border-color: var(--accent); }
.swatch.locked { opacity: 0.4; }
.swatch span { width: 100%; height: 26px; border-radius: 6px; }
.swatch em { font-style: normal; font-size: 8px; letter-spacing: 0.04em; text-align: center; }

/* ------------------------------------------------------------- settings */

.settings-body { display: flex; flex-direction: column; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.setting-row > div { display: flex; flex-direction: column; gap: 2px; }
.setting-row b { font-size: 12px; letter-spacing: 0.08em; }
.setting-row span { font-size: 10px; color: var(--dim); }
.setting-row.danger b { color: var(--bad); }

.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--line);
  transition: background 0.15s;
}
.switch span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

select, input[type=range] { accent-color: var(--accent); }
select {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 11px;
}
input[type=range] { width: 160px; }

/* ------------------------------------------------------- pause / crash */

.pause-progress { margin: 8px 0 18px; }
.pause-bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.pause-bar > div { height: 100%; background: linear-gradient(90deg, #ff8a3d, #ffcf4d); }
.pause-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}

.crash-panel { border-color: rgba(255, 90, 90, 0.35); box-shadow: 0 30px 90px rgba(120, 20, 20, 0.35); }
.crash-panel h2 { color: #ffd6d6; }

.complete-panel { border-color: rgba(255, 207, 77, 0.35); box-shadow: 0 30px 90px rgba(120, 90, 10, 0.3); }

.stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 12px;
  font-size: clamp(44px, 9vw, 68px);
  line-height: 1;
}
.star { color: rgba(255, 255, 255, 0.14); transition: color 0.2s; }
.star.on {
  color: var(--accent-2);
  text-shadow: 0 0 24px rgba(255, 207, 77, 0.55);
  animation: starPop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes starPop {
  from { transform: scale(0.2) rotate(-18deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.badge {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--dim);
}
.badge.good { color: var(--good); border-color: rgba(94, 224, 138, 0.4); }
.badge.accent { color: var(--accent-2); border-color: rgba(255, 207, 77, 0.4); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin: 14px 0 18px;
}
.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.stat-box b { font-family: var(--mono); font-size: 16px; }
.stat-box span { font-size: 8px; letter-spacing: 0.12em; color: var(--dim); }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  top: max(84px, calc(env(safe-area-inset-top) + 70px));
  transform: translate(-50%, -8px);
  z-index: 40;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.92);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { border-color: rgba(94, 224, 138, 0.5); color: var(--good); }
.toast.bad { border-color: rgba(255, 90, 90, 0.5); color: var(--bad); }
.toast.accent { border-color: rgba(255, 207, 77, 0.5); color: var(--accent-2); }

/* ---------------------------------------------------------- orientation */

.orientation { z-index: 50; }
.rotate-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border: 2px solid var(--accent);
  border-radius: 14px;
  position: relative;
  transform: rotate(90deg);
}
.rotate-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}
.rotate-icon span {
  position: absolute;
  right: -14px;
  top: -14px;
  width: 22px;
  height: 22px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  border-radius: 0 10px 0 0;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .panel { padding: 16px; border-radius: 16px; }
  .panel-head { flex-wrap: wrap; gap: 8px; }
  .head-title { order: 3; flex-basis: 100%; }
  .head-stats { margin-left: auto; }
  .garage-layout { grid-template-columns: 1fr; }
  .garage-list { flex-direction: row; overflow-x: auto; max-height: none; }
  .bike-card { min-width: 170px; }
  .level-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .hud-top { gap: 8px; }
  .hud-level { min-width: 0; }
  .hud-level span:first-child { font-size: 10px; }
  .hud-level span:last-child { display: none; }
  .hud-stat b { font-size: 13px; }
  .hud-stat span { font-size: 7px; }
  .hud-progress { max-width: none; }
  .menu-foot { flex-direction: column; align-items: center; gap: 4px; }
  .menu-row { grid-template-columns: 1fr; }
  .stat-bars { grid-template-columns: 1fr; }
  .stack.row { flex-direction: column; }
  .stack.row .btn { width: 100%; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .brand h1 { font-size: clamp(36px, 8vw, 64px); }
  .menu-stats { margin: 10px 0; }
  .menu-actions { max-width: 420px; }
  .menu-foot { display: none; }
  .howto { display: none; }
  .panel { padding: 14px; }
  .touch-btn { width: 76px; height: 76px; }
  .hud-checkpoint { display: none; }
}


@media (orientation: portrait) and (max-width: 600px) {
  .hud-top { flex-wrap: wrap; }
  .hud-level { order: 1; flex: 1; }
  .hud-stats { order: 2; }
  .hud-progress { order: 3; flex-basis: 100%; margin-top: 6px; }
  .hud-level span:first-child { font-size: 11px; }
  .hud-stat b { font-size: 13px; }
  .hud-stat span { font-size: 7px; }
  .hud-checkpoint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
