/* Orbit Breaker — Ultra-Clean Minimalist Deep-Navy Aesthetic */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: #090d16;
  color: #e2e8f0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 34%, #0f172a 0%, #090d16 68%);
}

/* Minimalist Top HUD Strip */
.hud-bar {
  flex: 0 0 auto;
  height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(9, 13, 22, 0.78);
  border-bottom: 1px solid rgba(148, 180, 216, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 20;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.hud-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: #cbd5e1;
}

.metric-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.metric-label {
  color: #64748b;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-val {
  color: #f8fafc;
  font-weight: 600;
}

.metric-val.pct {
  color: #f3a26d;
}

.metric-val.balls {
  color: #6ee7b7;
}

.hearts-display {
  letter-spacing: 1px;
  color: #fb7185;
  font-size: 13px;
}

.hearts-display.zen {
  color: #7dd3fc;
  font-size: 15px;
}

.hud-btn {
  appearance: none;
  border: 1px solid rgba(148, 180, 216, 0.22);
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  border-radius: 8px;
  height: 30px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.hud-btn:hover {
  border-color: rgba(243, 162, 109, 0.7);
  background: rgba(30, 41, 59, 0.9);
}

.hud-btn:active {
  transform: scale(0.96);
}

.hud-btn.icon-only {
  width: 30px;
  padding: 0;
  font-size: 14px;
}

.stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #eba78e;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.mode-btn.is-zen {
  border-color: rgba(125, 211, 252, 0.5);
  color: #7dd3fc;
}

/* Main Full-Bleed Playfield */
.stage-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Subtle Floating Launch Prompt */
.launch-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 180, 216, 0.22);
  color: #94a3b8;
  font-size: 11px;
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.22s ease;
}

.launch-hint.hidden {
  opacity: 0;
}

/* Minimalist Overlays (Stage Select, Victory, Game Over) */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 16, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 30;
  opacity: 1;
  transition: opacity 0.2s ease;
}

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

.modal-card {
  width: 100%;
  max-width: 360px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(148, 180, 216, 0.26);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.modal-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #f3a26d;
  margin-bottom: 6px;
}

.modal-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: #f8fafc;
}

.modal-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: #94a3b8;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.stat-box {
  background: rgba(9, 13, 22, 0.7);
  border: 1px solid rgba(148, 180, 216, 0.15);
  border-radius: 10px;
  padding: 10px 6px;
}

.stat-box-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 4px;
}

.stat-box-val {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn-primary, .btn-secondary {
  flex: 1 1 0;
  height: 38px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s ease, filter 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #f3a26d 0%, #e07a5f 100%);
  color: #090d16;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  border-color: rgba(148, 180, 216, 0.25);
}

.btn-secondary:hover {
  border-color: rgba(243, 162, 109, 0.6);
}

.btn-primary:active, .btn-secondary:active {
  transform: scale(0.97);
}

/* Stage Picker List */
.stage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  text-align: left;
}

.stage-row {
  appearance: none;
  width: 100%;
  background: rgba(9, 13, 22, 0.72);
  border: 1px solid rgba(148, 180, 216, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.stage-row:hover {
  border-color: rgba(243, 162, 109, 0.65);
  background: rgba(30, 41, 59, 0.65);
}

.stage-row.active {
  border-color: #f3a26d;
  background: rgba(243, 162, 109, 0.12);
}

.stage-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stage-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.stage-row-name {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
}

.stage-row-sub {
  font-size: 11px;
  color: #94a3b8;
}

.stage-row-meta {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 11px;
  color: #6ee7b7;
  white-space: nowrap;
}

/* Mobile Compact Tuning (390px) */
@media (max-width: 520px) {
  .hud-bar {
    padding: 0 8px;
    gap: 4px;
    height: 46px;
  }
  .hud-metrics {
    gap: 8px;
    font-size: 12px;
  }
  .metric-label {
    display: none;
  }
  .stage-btn-name {
    display: none;
  }
  .hud-btn {
    padding: 0 7px;
    font-size: 11px;
    height: 28px;
  }
  .hud-btn.icon-only {
    width: 28px;
  }
  .launch-hint {
    font-size: 10px;
    bottom: 10px;
  }
}
