* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }

html, body {
  width: 100%; height: 100%;
  background: #0a0a1a;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  touch-action: none;
  overscroll-behavior: none;
}

#app {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0a0a1a;
}

#game {
  display: block;
  background: #1a1a2e;
  touch-action: none;
  box-shadow: 0 0 40px rgba(0,200,255,0.15);
}

.hidden { display: none !important; }

/* ===== HUD ===== */
#hud {
  position: absolute; top: 0; left: 0; right: 0;
  padding: env(safe-area-inset-top, 12px) 14px 10px;
  z-index: 10;
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
.hud-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 18px; font-weight: 700;
  margin-bottom: 8px;
}
#lives { font-size: 20px; letter-spacing: 2px; }
#coins { color: #ffd24a; }
#score { color: #6fe0ff; }
.progress-wrap {
  height: 6px; background: rgba(255,255,255,0.15);
  border-radius: 3px; overflow: hidden;
}
#progress {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ff6b9d, #ffd24a, #6fe0ff);
  transition: width 0.2s linear;
  border-radius: 3px;
}
#level-label {
  text-align: center; margin-top: 6px;
  font-size: 13px; opacity: 0.8; letter-spacing: 1px;
}

/* ===== SCREENS ===== */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0a0a1a 0%, #1a1a3a 50%, #2a1a4a 100%);
  padding: 24px;
  z-index: 20;
  text-align: center;
  animation: fadein 0.3s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.screen h1 {
  font-size: 42px;
  background: linear-gradient(90deg, #ff6b9d, #ffd24a, #6fe0ff);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  margin-bottom: 8px;
  line-height: 1.1;
  filter: drop-shadow(0 4px 12px rgba(255,107,157,0.3));
}
.screen h1 span { font-size: 32px; }
.screen h2 {
  font-size: 32px; margin-bottom: 20px;
  background: linear-gradient(90deg, #ffd24a, #ff6b9d);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.stats {
  display: flex; gap: 24px; margin: 20px 0 30px;
  font-size: 22px; font-weight: 700;
}
.stats div:first-child { color: #ffd24a; }
.stats div:last-child { color: #6fe0ff; }

.big-stat {
  font-size: 26px; font-weight: 700;
  margin: 8px 0;
}

.btn {
  display: block;
  min-width: 220px;
  padding: 16px 28px;
  margin: 8px 0;
  font-size: 18px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6fe0ff, #ff6b9d);
  border: none; border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(111,224,255,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform 0.1s, box-shadow 0.2s;
  font-family: inherit;
}
.btn:active { transform: translateY(2px) scale(0.98); box-shadow: 0 3px 10px rgba(111,224,255,0.2); }
.btn.big { font-size: 22px; padding: 20px 32px; }
.btn.small {
  background: rgba(255,255,255,0.08);
  font-size: 13px; padding: 10px 20px;
  min-width: 0; box-shadow: none;
}

.hint {
  position: absolute; bottom: 48px;
  font-size: 13px; opacity: 0.5;
  padding: 0 30px;
}

.footer-love {
  position: absolute;
  bottom: 16px;
  left: 0; right: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(90deg, #ff6b9d, #ffd24a, #ff6b9d);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  letter-spacing: 0.5px;
  animation: pulse-love 2s ease-in-out infinite;
}
@keyframes pulse-love {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.04); }
}

/* ===== Pause Button ===== */
#btn-pause {
  position: absolute;
  top: env(safe-area-inset-top, 10px); right: 10px;
  width: 44px; height: 44px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  color: #fff; font-size: 18px;
  z-index: 15;
  cursor: pointer;
}

/* ===== Garage ===== */
#bikes-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%; max-width: 360px;
  margin-bottom: 20px;
}
.bike-card {
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.bike-card.selected { border-color: #6fe0ff; box-shadow: 0 0 16px rgba(111,224,255,0.4); }
.bike-card.locked { opacity: 0.5; }
.bike-preview {
  width: 50px; height: 70px;
  margin: 0 auto 8px;
  border-radius: 8px;
}
.bike-name { font-size: 13px; font-weight: 700; }
.bike-cost { font-size: 11px; color: #ffd24a; margin-top: 4px; }

/* Damage flash */
.flash { animation: flash 0.3s; }
@keyframes flash {
  0%, 100% { background: #1a1a2e; }
  50% { background: #6a1a1a; }
}
