/* Snow Boarder — UI Styles (GDD §7: DOM overlay, crisp text) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
  overflow: hidden; 
  background: #000; 
  font-family: 'Inter', system-ui, sans-serif;
  color: white;
  user-select: none;
}

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

canvas {
  display: block;
  border-radius: 12px;
  box-shadow:
    0 0 40px rgba(0, 255, 100, 0.08),
    0 0 80px rgba(0, 255, 100, 0.04),
    inset 0 0 30px rgba(0, 0, 0, 0.3);
}

/* ── UI Root ──────────────────────────────────────── */
#ui-root {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 10;
}
#ui-root > div { pointer-events: auto; }

/* ── Loading Screen ──────────────────────────────── */
#loading-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #1a2a3a 0%, #0a1530 100%);
  flex-direction: column;
  z-index: 100;
}
#loading-content { text-align: center; }
#loading-content h1 {
  font-size: 52px; font-weight: 900; letter-spacing: 6px;
  color: #b8e4ff;
  text-shadow:
    0 0 20px rgba(100,200,255,0.4),
    0 0 60px rgba(80,160,255,0.2),
    0 2px 0 #0a1628;
  margin-bottom: 8px;
  position: relative;
}
#loading-content h1::after {
  content: '✦'; display: block; font-size: 18px;
  color: rgba(150,220,255,0.4); letter-spacing: 0; margin-top: -4px;
}
#loading-content .sub {
  font-size: 11px; color: rgba(150,200,255,0.35);
  letter-spacing: 8px; text-transform: uppercase;
  margin-bottom: 30px;
}
#loading-bar-track {
  width: 240px; height: 4px; background: rgba(255,255,255,0.08);
  border-radius: 2px; overflow: hidden; margin: 0 auto 12px;
}
#loading-bar-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, #4488cc, #88ddff, #4488cc);
  background-size: 200% 100%;
  border-radius: 2px; transition: width 0.3s ease;
}
#loading-text {
  font-size: 12px; color: rgba(255,255,255,0.3); letter-spacing: 2px;
}

/* ── Menu Screen ─────────────────────────────────── */
#menu-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  z-index: 90;
  pointer-events: auto;
}
#menu-content {
  text-align: center;
  background: rgba(8,16,32,0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(100,200,255,0.08);
  border-radius: 16px;
  padding: 36px 44px 32px;
  box-shadow:
    0 8px 48px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(150,220,255,0.06);
  max-width: 420px;
  position: relative;
  overflow: hidden;
}
#menu-content::before {
  content: ''; position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(80,180,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}
#menu-content h1 {
  font-size: 48px; font-weight: 900; letter-spacing: 10px;
  color: #c0e8ff;
  text-shadow:
    0 0 30px rgba(100,200,255,0.3),
    0 0 80px rgba(60,160,255,0.15),
    0 2px 0 #0a1628;
  margin-bottom: 2px;
  position: relative;
}
#menu-content .frost-symbol {
  font-size: 20px; color: rgba(150,220,255,0.3);
  letter-spacing: 0; margin-bottom: 4px;
}
#menu-content .tagline {
  font-size: 11px; color: rgba(150,200,255,0.3);
  letter-spacing: 6px; text-transform: uppercase;
  margin-bottom: 20px;
}
#menu-seed-row, #menu-tier-row, #menu-name-row {
  margin: 8px 0; font-size: 14px; color: #aaccdd;
}
#menu-seed-row label, #menu-tier-row label, #menu-name-row label {
  margin-right: 8px; opacity: 0.8;
}
#menu-seed-input, #menu-name-input {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px; color: white; padding: 8px 12px; width: 140px;
  font-family: inherit; font-size: 16px; touch-action: manipulation;
}
#menu-tier-select {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px; color: white; padding: 4px 8px;
  font-family: inherit; font-size: 14px;
}
#menu-buttons {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 24px; align-items: center;
}
#menu-buttons button {
  width: 220px; padding: 12px 0;
  background: linear-gradient(135deg, #3366aa, #4488cc);
  border: none; border-radius: 6px; color: white;
  font-family: inherit; font-size: 16px; font-weight: 700;
  cursor: pointer; letter-spacing: 1px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#menu-buttons button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(68,136,204,0.5);
}
#menu-buttons button:active { transform: scale(0.97); }
#menu-best-daily {
  margin-top: 12px; font-size: 13px; color: rgba(255,255,255,0.4);
}
#menu-footer { margin-top: 20px; }
.small-btn {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px; color: rgba(255,255,255,0.7); padding: 8px 20px;
  font-family: inherit; font-size: 13px; cursor: pointer; transition: background 0.2s;
}
.small-btn:hover { background: rgba(255,255,255,0.2); }

/* ── Settings ────────────────────────────────────── */
#settings-panel {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.8);
  z-index: 95;
}
#settings-content {
  background: #1a2a3a; border-radius: 12px; padding: 32px;
  min-width: 280px; max-width: 90vw; text-align: left;
}
#settings-content h2 {
  font-size: 24px; font-weight: 700; margin-bottom: 20px;
  text-align: center;
}
.setting-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; font-size: 14px; gap: 16px;
}
.setting-row label { flex: 1; opacity: 0.8; }
.setting-row input[type="range"] { flex: 2; }
.setting-row select { 
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px; color: white; padding: 4px 8px;
  font-family: inherit;
}
#btn-settings-done {
  width: 100%; margin-top: 20px;
}

/* ── Countdown ───────────────────────────────────── */
#countdown-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
#countdown-number {
  font-size: 120px; font-weight: 900; color: white;
  text-shadow: 0 0 40px rgba(100,180,255,0.8);
  animation: countPulse 0.8s ease-out;
}
@keyframes countPulse {
  0% { transform: scale(1.5); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ── HUD ─────────────────────────────────────────── */
#hud { pointer-events: none; }
#hud-top-right {
  position: fixed; top: 20px; right: 24px;
  text-align: right; z-index: 30;
}
#hud-score {
  font-size: 32px; font-weight: 900;
  color: white; text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
#hud-multiplier {
  font-size: 16px; color: #88ccff; font-weight: 700;
}
#hud-bottom-center {
  position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%);
  text-align: center; z-index: 30;
}
#hud-speed {
  font-size: 42px; font-weight: 900;
  color: white; text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  letter-spacing: 2px;
}
#hud-boost-track {
  width: 180px; height: 6px;
  margin: 6px auto 0;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}
#hud-boost-fill {
  height: 100%; width: 30%;
  background: #44aaff;
  border-radius: 3px;
  transition: width 0.2s ease;
}
#hud-health {
  position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%);
  font-size: 22px; z-index: 30;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}
#hud-trick-toast {
  position: fixed; top: 35%; left: 50%; transform: translateX(-50%);
  font-size: 28px; font-weight: 700; color: #ffcc44;
  text-shadow: 0 0 20px rgba(255,200,50,0.5);
  opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 30; white-space: nowrap;
}
#hud-trick-toast.visible {
  opacity: 1; transform: translateX(-50%) translateY(-10px);
}
#hud-combo-toast {
  position: fixed; top: 28%; left: 50%; transform: translateX(-50%);
  font-size: 36px; font-weight: 900; color: #ffcc00;
  text-shadow: 0 0 30px rgba(255,200,0,0.6), 0 2px 8px rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 30; white-space: nowrap; pointer-events: none;
}
#hud-combo-toast.visible {
  opacity: 1; transform: translateX(-50%) translateY(-12px);
}
#hud-gate-indicator {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 30;
}
#hud-zen-recover {
  position: fixed; bottom: 45%; left: 50%; transform: translateX(-50%);
  text-align: center; z-index: 35; display: none;
}
#hud-zen-text {
  font-size: 32px; font-weight: 800; color: #cc88ff;
  text-shadow: 0 0 20px rgba(180,100,255,0.6), 0 2px 4px rgba(0,0,0,0.6);
  display: block; margin-bottom: 8px;
}
#hud-zen-bar {
  width: 200px; height: 14px;
  background: rgba(0,0,0,0.4);
  border: 3px solid rgba(255,255,255,0.2);
  border-radius: 7px; margin: 0 auto;
  overflow: hidden;
}
#hud-zen-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #9944ff, #44ccff);
  border-radius: 5px;
  box-shadow: 0 0 12px rgba(130,80,255,0.5);
  transition: width 0.1s linear;
}

/* ── Pause ───────────────────────────────────────── */
#pause-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(5,8,20,0.75);
  backdrop-filter: blur(8px);
  z-index: 70;
}
#pause-content {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20,25,45,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 48px 56px;
  text-align: center; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
#pause-content h2 {
  font-size: 32px; font-weight: 800; margin-bottom: 8px;
  color: #8899cc; letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(100,140,220,0.3);
}
#pause-content button {
  width: 220px; padding: 12px 0;
  background: rgba(80,100,180,0.15);
  border: 1px solid rgba(100,120,200,0.3);
  border-radius: 8px;
  color: #aabbdd; font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  letter-spacing: 0.5px;
}
#pause-content button:hover {
  background: rgba(100,130,220,0.3);
  color: #ffffff;
  border-color: rgba(140,170,255,0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(80,120,200,0.2);
}
#pause-content button:active { transform: translateY(0); }
#pause-content button:last-child {
  margin-top: 8px;
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: #8899aa;
  font-size: 13px;
}
#pause-content button:last-child:hover {
  background: rgba(255,100,80,0.15);
  color: #dd9999;
  border-color: rgba(255,120,100,0.3);
}

/* ── Crash ───────────────────────────────────────── */
#crash-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(80,0,0,0.5); z-index: 55;
}
#crash-content {
  text-align: center; animation: crashIn 0.3s ease-out;
}
@keyframes crashIn {
  0% { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
#crash-content h2 {
  font-size: 42px; font-weight: 900; color: #ff4444;
  text-shadow: 0 0 30px rgba(255,50,50,0.5);
}
#crash-content p {
  margin-top: 12px; font-size: 16px; color: rgba(255,255,255,0.6);
}

/* ── Score Screen ────────────────────────────────── */
#score-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,12,24,0.88);
  z-index: 70;
  overflow: hidden;
}
#score-scanlines {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.08) 3px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none; z-index: 1;
}
#score-bg-image {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: url('assets/snow-bg.png') center/cover no-repeat;
  opacity: 0.10; z-index: 1;
  filter: blur(2px);
}
#score-card {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, rgba(10,18,35,0.92) 0%, rgba(8,12,24,0.96) 100%);
  border: 1px solid rgba(100,180,255,0.12);
  border-radius: 16px;
  padding: 36px 44px;
  text-align: center;
  min-width: 520px;
  max-width: 600px;
  max-height: 90vh;
  box-sizing: border-box;
  box-shadow:
    0 0 40px rgba(0,150,255,0.06),
    inset 0 0 60px rgba(0,100,200,0.03);
  overflow-y: auto;
}
#score-card::-webkit-scrollbar { width: 4px; }
#score-card::-webkit-scrollbar-track { background: transparent; }
#score-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
#score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(100,180,255,0.08);
}
#score-grade {
  font-size: 72px; font-weight: 900;
  letter-spacing: 0;
}
#score-title {
  font-size: 16px; font-weight: 700; letter-spacing: 4px;
  color: rgba(100,180,255,0.45);
}
#score-subtitle {
  font-size: 9px; font-weight: 400; color: rgba(100,180,220,0.2);
  letter-spacing: 5px; text-transform: uppercase;
  margin-top: 2px;
}
#score-total {
  font-size: 56px; font-weight: 900;
  color: #e8f4ff;
  text-shadow: 0 0 30px rgba(100,180,255,0.25);
  margin: 8px 0 2px;
  letter-spacing: 1px;
}
#score-new-best {
  display: none;
  font-size: 14px; font-weight: 700; letter-spacing: 3px;
  color: #ffdd44;
  text-shadow: 0 0 20px rgba(255,200,50,0.4);
  margin-bottom: 12px;
  animation: pulse 0.6s ease-in-out infinite alternate;
}
@keyframes pulse { to { opacity: 0.7; } }
#score-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 24px;
  margin: 12px auto 16px;
  max-width: 460px;
}
.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  font-size: 12px; color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
}
.score-row .score-icon { width: 20px; text-align: center; margin-right: 4px; }
.score-row .score-label { flex: 1; text-align: left; font-size: 11px; letter-spacing: 1px; font-weight: 600; color: rgba(255,255,255,0.35); }
.score-row .score-value { font-family: monospace; font-weight: 700; font-size: 14px; color: rgba(255,255,255,0.65); }
.score-row.bonus { background: rgba(255,200,100,0.03); }
.score-row.bonus .score-value { color: rgba(255,200,100,0.7); }
#score-best {
  font-size: 12px; color: rgba(255,255,255,0.25);
  margin: 4px 0 8px;
  letter-spacing: 1px;
}
#score-seed {
  font-size: 12px; color: rgba(255,255,255,0.3);
  margin-bottom: 10px;
}
#score-leaderboard {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(100,180,255,0.08);
}
#lb-title {
  font-size: 12px; font-weight: 700; letter-spacing: 3px;
  color: rgba(100,180,255,0.45);
  margin-bottom: 6px;
}
#lb-entries {
  max-height: 110px;
  overflow-y: auto;
}
#lb-entries::-webkit-scrollbar { width: 3px; }
#lb-entries::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.lb-entry {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  border-radius: 3px;
}
.lb-entry:nth-child(odd) { background: rgba(255,255,255,0.02); }
.lb-highlight {
  background: rgba(255,204,0,0.08) !important;
  color: #ffcc44 !important;
  font-weight: 700;
}
.lb-rank { width: 26px; text-align: center; }
.lb-name { flex: 1; text-align: left; margin-left: 6px; font-weight: 600; }
.lb-score { font-family: monospace; }
.lb-empty { color: rgba(255,255,255,0.3); font-style: italic; text-align: center; padding: 6px; }
#score-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(100,180,255,0.08);
}
#score-buttons button {
  padding: 10px 20px;
  background: rgba(100,180,255,0.05);
  border: 1px solid rgba(100,180,255,0.12);
  border-radius: 6px;
  color: rgba(180,220,255,0.6);
  font-family: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 90px;
}
#score-buttons button:hover {
  background: rgba(100,180,255,0.12);
  color: #c0e0ff;
  border-color: rgba(100,180,255,0.25);
}
#score-buttons button:active { transform: scale(0.96); }
#btn-retry { background: rgba(68,200,120,0.08); border-color: rgba(68,200,120,0.15); color: rgba(68,200,120,0.6); }
#btn-retry:hover { background: rgba(68,200,120,0.18); color: #88ffaa; border-color: rgba(68,200,120,0.3); }
#btn-new-seed { background: rgba(100,180,255,0.05); border-color: rgba(100,180,255,0.12); }
#btn-new-seed:hover { background: rgba(100,180,255,0.12); }
#btn-score-menu { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.08); color: rgba(255,255,255,0.35); }
#btn-score-menu:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); }
#btn-heli-gallery { background: rgba(200,150,80,0.08); border-color: rgba(200,150,80,0.15); color: rgba(255,200,100,0.6); font-size:13px; }
#btn-heli-gallery:hover { background: rgba(200,150,80,0.18); color: #ffcc66; }

/* ── Heli Gallery ────────────────────────────────── */
#heli-gallery-header button {
  font-family: inherit; font-size: 12px; cursor: pointer;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  color: #ccc; padding: 4px 12px; border-radius: 4px;
}
#heli-gallery-header button:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}
#heli-gallery-grid img {
  image-rendering: auto; /* photos should be smooth */
}
#heli-gallery-grid::-webkit-scrollbar { width: 6px; }
#heli-gallery-grid::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
#heli-gallery-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

/* ── Dev Overlay ─────────────────────────────────── */
/* ── Mobile Touch Controls ─────────────────────── */
#mobile-controls {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 180px; z-index: 80;
  display: none; /* hidden on desktop */
  pointer-events: none;
}
#mobile-controls * { pointer-events: auto; }

.touch-panel {
  position: absolute; bottom: 24px;
  display: flex; gap: 16px; align-items: flex-end;
}
.touch-left  { left: 16px; }
.touch-right { right: 16px; }

.touch-btn {
  border: none; border-radius: 50%;
  font-family: inherit; font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.dir-btn {
  width: 140px; height: 140px;
  background: rgba(255,255,255,0.14);
  border: 3px solid rgba(255,255,255,0.3);
  color: white; font-size: 52px;
  display: flex; align-items: center; justify-content: center;
}
.dir-btn:active { background: rgba(255,255,255,0.35); transform: scale(0.9); }

.jump-btn {
  width: 160px; height: 160px;
  background: rgba(68,136,255,0.3);
  border: 3px solid rgba(68,136,255,0.6);
  color: #aaccff; font-size: 26px; letter-spacing: 4px;
}
.jump-btn:active { background: rgba(68,136,255,0.6); transform: scale(0.9); }

.boost-btn {
  width: 110px; height: 110px;
  background: rgba(255,136,68,0.3);
  border: 3px solid rgba(255,136,68,0.6);
  color: #ffbb88; font-size: 32px;
}
.boost-btn:active { background: rgba(255,136,68,0.6); transform: scale(0.9); }

/* ── Mobile: smaller HUD, bigger controls ─────── */
@media (hover: none) and (pointer: coarse) {
  #mobile-controls { display: block; }
  #hud-speed { font-size: 28px !important; }
  #hud-health { font-size: 14px !important; bottom: 90px !important; }
  #hud-score { font-size: 22px !important; }
  #hud-multiplier { font-size: 12px !important; }
}

/* ── Mobile death/score screen — swipe-up panel ─── */
@media (hover: none) and (pointer: coarse) {
  #score-screen {
    align-items: flex-end;
    background: rgba(5,8,20,0.8);
  }
  #score-card {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 28px 20px 36px;
    background: rgba(12,18,36,0.96);
    border: none;
    border-top: 2px solid rgba(100,180,255,0.15);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.6);
  }
  #score-header { flex-direction: row; }
  #score-grade { font-size: 48px !important; }
  #score-title { font-size: 13px !important; }
  #score-total { font-size: 36px !important; }
  #score-breakdown { grid-template-columns: 1fr; max-width: 100%; margin: 10px auto; }
  .score-row { font-size: 13px !important; padding: 5px 10px !important; }
  #score-buttons { flex-direction: row; gap: 8px; flex-wrap: wrap; justify-content: center; }
  #score-buttons button {
    width: auto; min-width: 80px; padding: 12px 16px !important;
    font-size: 13px !important; font-weight: 700;
    border-radius: 8px;
  }
  #btn-retry { background: rgba(68,200,120,0.2) !important; border-color: rgba(68,200,120,0.3) !important; }
  #score-best { font-size: 11px !important; }
  #score-new-best { font-size: 13px !important; }
  #lb-title { font-size: 11px !important; }
  .lb-entry { font-size: 11px !important; }
}

/* ── Floating score popups ─────────────────────── */
.score-popup {
  position: fixed;
  font-size: 22px; font-weight: 800;
  color: #ffcc44;
  text-shadow: 0 0 10px rgba(255,200,50,0.5), 0 2px 4px rgba(0,0,0,0.5);
  pointer-events: none; z-index: 50;
  opacity: 1; transform: translateY(0);
  transition: all 1s ease-out;
}
.score-popup.fly {
  opacity: 0; transform: translateY(-60px);
}
.score-popup.gate-pop { color: #88ccff; }
.score-popup.trick-pop { color: #ffcc44; font-size: 28px; }
  #pause-content { padding: 28px 36px !important; }
  #pause-content h2 { font-size: 24px !important; }
  #pause-content button { width: 180px !important; padding: 10px 0 !important; font-size: 13px !important; }
  #hud-trick-toast { font-size: 20px !important; }
  #hud-combo-toast { font-size: 24px !important; }
  #menu-content h1 { font-size: 28px !important; }
  #menu-content button { padding: 8px 16px !important; font-size: 13px !important; }
  #menu-content { max-width: 95vw; max-height: 90vh; overflow-y: auto; }
  #menu-seed-row, #menu-tier-row, #menu-name-row { font-size: 13px !important; }
  #menu-seed-row input, #menu-tier-row select, #menu-name-row input { font-size: 14px !important; padding: 6px !important; }
  #loading-content h1 { font-size: 28px !important; }
  #settings-content { max-width: 90vw; padding: 16px !important; }
  #settings-content h2 { font-size: 22px !important; }
  .setting-row { font-size: 13px !important; }
}

/* Landscape phone */
@media (max-height: 500px) {
  .dir-btn { width: 120px; height: 120px; font-size: 44px; }
  .jump-btn { width: 140px; height: 140px; font-size: 22px; }
  .boost-btn { width: 96px; height: 96px; font-size: 32px; }
  #mobile-controls { height: 160px; }
  .touch-panel { bottom: 10px; gap: 12px; }
}

/* ── Error Screen ────────────────────────────────── */
#error-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #1a0a0a; z-index: 200; text-align: center;
}
#error-content h2 { font-size: 24px; color: #ff4444; margin-bottom: 12px; }
#error-content p { font-size: 14px; color: rgba(255,255,255,0.6); margin-bottom: 20px; }
#btn-reload {
  padding: 10px 30px; background: #4488cc; border: none; border-radius: 6px;
  color: white; font-family: inherit; font-size: 14px; cursor: pointer;
}

#menu-high-scores {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 8px; font-size: 13px; color: #aabbcc;
}
#menu-high-scores span { opacity: 0.8; }
#btn-copy-seed {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px; color: white; padding: 4px 8px;
  cursor: pointer; font-size: 14px;
}
#btn-copy-seed:hover { background: rgba(255,255,255,0.2); }
