/* ==========================================================
   Cosmic Orbit: Synthwave Space Glassmorphism Styles
   ========================================================== */

:root {
  --bg-space: #030308;
  --accent-cyan: #00f0ff;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-gold: #facc15;
  --accent-red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --panel-bg: rgba(15, 23, 42, 0.75);
  --border-glow: rgba(0, 240, 255, 0.3);
  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-space);
  color: var(--text-main);
  font-family: var(--font-family);
}

#gameContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: radial-gradient(circle at 50% 50%, #0d0c22 0%, #030308 100%);
}

/* ==========================================
   TOP HEADER & HUD
   ========================================== */
.cosmic-header {
  width: 100%;
  max-width: 620px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glow);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-back-btn {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.portal-back-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.game-logo {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hud-stats-group {
  display: flex;
  gap: 12px;
}

.hud-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hud-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
}

.text-cyan { color: var(--accent-cyan); }
.text-gold { color: var(--accent-gold); }

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: white;
  padding: 5px 8px;
  font-size: 14px;
  cursor: pointer;
}

.lang-dropdown {
  background: #0f172a;
  border: 1px solid var(--border-glow);
  color: white;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
}

/* ==========================================
   ORBIT CANVAS STAGE
   ========================================== */
.orbit-stage-wrapper {
  position: relative;
  width: 100%;
  max-width: 580px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.15);
}

#cosmicCanvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* Next Planet Badge */
.next-planet-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.next-title {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.next-content {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.next-icon {
  font-size: 18px;
}

.next-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
}

/* Combo Banner */
.combo-banner {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

/* Overflow Warning Alert */
.horizon-warning {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(239, 68, 68, 0.9);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  animation: pulseWarning 0.6s infinite alternate;
  pointer-events: none;
}

@keyframes pulseWarning {
  from { transform: translateX(-50%) scale(1); opacity: 0.8; }
  to { transform: translateX(-50%) scale(1.05); opacity: 1; }
}

/* ==========================================
   BOTTOM CONTROLS & EVOLUTION LADDER
   ========================================== */
.cosmic-powers-bar {
  width: 100%;
  max-width: 580px;
  display: flex;
  gap: 10px;
}

.power-btn {
  flex: 1;
  background: var(--panel-bg);
  border: 1px solid var(--border-glow);
  border-radius: 12px;
  padding: 10px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.power-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.evolution-ladder-bar {
  width: 100%;
  max-width: 580px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.4);
  padding: 6px 12px;
  border-radius: 10px;
}

.ladder-title {
  font-weight: 700;
  color: var(--accent-cyan);
}

.ladder-chain {
  letter-spacing: 1px;
}

/* ==========================================
   MODALS & OVERLAYS
   ========================================== */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 3, 8, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-content {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  padding: 28px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

.rules-card {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 20px;
  color: #cbd5e1;
}

.primary-start-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-cyan), #3b82f6);
  color: black;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.primary-start-btn:hover {
  transform: scale(1.02);
}

.results-stats-box {
  display: flex;
  justify-content: space-around;
  background: rgba(15, 23, 42, 0.6);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.res-label {
  font-size: 12px;
  color: var(--text-muted);
}

.res-val {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.secondary-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
}
