/* =========================================================
   SKY RUSH: ONE-TAP RUNNER - VIBRANT DAYLIGHT DESIGN SYSTEM
   Bright, Eye-Catching, High-Energy Visual Aesthetic
   Clean Modern Frosted Glass UI (No Dark Theme)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800;900&display=swap');

:root {
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sky-top: #0284c7;
  --sky-mid: #38bdf8;
  --sky-bot: #c084fc;
  --card-bg: rgba(255, 255, 255, 0.94);
  --card-border: rgba(255, 255, 255, 0.9);
  --card-shadow: 0 24px 48px rgba(15, 23, 42, 0.18), 0 8px 16px rgba(15, 23, 42, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --primary-blue: #2563eb;
  --primary-gradient: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
  --primary-shadow: 0 8px 24px rgba(255, 71, 87, 0.4);
  --revive-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --revive-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
  --gold: #f59e0b;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0f0c29;
  font-family: var(--font-family);
  color: var(--text-primary);
  touch-action: manipulation;
}

/* ================== GAME CANVAS ================== */
#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  background: linear-gradient(180deg, #0f0c29 0%, #241442 30%, #5b146f 55%, #9d174d 72%, #f97316 96%, #fbbf24 100%);
}

/* ================== HUD OVERLAY ================== */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: env(safe-area-inset-top, 20px) 20px 10px;
  pointer-events: none;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.score-chip {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #ffffff;
  backdrop-filter: blur(12px);
  padding: 6px 18px;
  border-radius: 30px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 4px;
}

.score-num {
  font-size: 28px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.sparks-chip {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #ffffff;
  backdrop-filter: blur(12px);
  padding: 6px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: #d97706;
  font-size: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.sector-chip {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #ffffff;
  backdrop-filter: blur(12px);
  padding: 6px 14px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  font-weight: 900;
  color: #db2777;
  font-size: 13px;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.icon-spark {
  color: #f59e0b;
  font-size: 18px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #ffffff;
  color: #1e293b;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  transition: transform 0.1s;
}

.btn-icon:active {
  transform: scale(0.9);
}

/* ================== MODALS & OVERLAYS ================== */
.screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(8px);
  opacity: 1;
  transition: opacity 0.2s ease;
}

.screen-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

.panel-card {
  background: var(--card-bg);
  border: 3px solid var(--card-border);
  border-radius: 28px;
  padding: 34px 28px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--card-shadow);
  position: relative;
  animation: cardPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cardPop {
  from { transform: scale(0.88); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ================== MODERN BUTTONS ================== */
.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-weight: 900;
  font-size: 20px;
  padding: 16px 32px;
  border-radius: 22px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 6px 0 #d63031, var(--primary-shadow);
  transition: transform 0.08s, box-shadow 0.08s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #d63031, 0 4px 12px rgba(255, 71, 87, 0.3);
}

.btn-revive {
  background: var(--revive-gradient);
  color: #78350f;
  border: none;
  font-family: inherit;
  font-weight: 900;
  font-size: 16px;
  padding: 14px 24px;
  border-radius: 20px;
  cursor: pointer;
  width: 100%;
  margin-bottom: 12px;
  box-shadow: 0 5px 0 #b45309, var(--revive-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: revivePulse 1.8s infinite ease-in-out;
}

.btn-revive:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #b45309;
}

@keyframes revivePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.btn-secondary {
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  color: #334155;
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: 18px;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* ================== MENU SCREEN ================== */
.game-title {
  font-size: 42px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1px;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-subtitle {
  font-size: 12px;
  font-weight: 900;
  color: #ff4757;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.menu-stats-row {
  display: flex;
  justify-content: space-around;
  background: #f8fafc;
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 22px;
  border: 1.5px solid #e2e8f0;
}

.stat-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
}

.stat-val {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-primary);
}

.instruction-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ================== GAME OVER MODAL ================== */
.go-title {
  font-size: 34px;
  font-weight: 900;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.rage-quote-box {
  background: #fef2f2;
  border: 1.5px dashed #fca5a5;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 14px;
  font-style: italic;
  font-weight: 700;
  color: #b91c1c;
  margin-bottom: 20px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.35;
}

.scores-display {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
}

.score-card {
  flex: 1;
  background: #f8fafc;
  border-radius: 18px;
  padding: 14px 10px;
  border: 2px solid #e2e8f0;
  position: relative;
}

.score-card.main {
  border-color: #2563eb;
  background: #eff6ff;
}

.score-card-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-card-val {
  font-size: 38px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
  margin-top: 4px;
}

.new-badge {
  position: absolute;
  top: -10px;
  right: -6px;
  background: #f59e0b;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4);
}

.quick-restart-hint {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 14px;
}

/* ================== SHOP MODAL (AIRCRAFT HANGAR) ================== */
.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.shop-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-height: 390px;
  overflow-y: auto;
  padding: 4px;
  margin-bottom: 20px;
}

.shop-item {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.shop-item.equipped {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}

.shop-canvas-preview {
  width: 74px;
  height: 74px;
  border-radius: 16px;
  background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-item-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: -4px;
}

.shop-item-tier {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.status-badge.active {
  font-size: 11px;
  font-weight: 900;
  color: #2563eb;
  text-transform: uppercase;
  padding: 5px 12px;
  background: #dbeafe;
  border-radius: 12px;
}

.btn-skin-action {
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
  border-radius: 14px;
  padding: 7px 16px;
  border: none;
  cursor: pointer;
  transition: transform 0.08s;
}

.btn-skin-action.equip {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-skin-action.buy.can-buy {
  background: var(--revive-gradient);
  color: #78350f;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-skin-action.buy.cant-buy {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

/* ================== YOUTUBE DEV TEST BAR (LOCAL TEST) ================== */
#yt-dev-test-bar {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid #e2e8f0;
  border-radius: 30px;
  padding: 6px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  font-size: 12px;
}

.dev-bar-title {
  color: #2563eb;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.dev-bar-buttons {
  display: flex;
  gap: 6px;
}

.dev-bar-buttons button {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.dev-bar-buttons button:hover {
  background: #e2e8f0;
}
