:root {
  --bg-primary: #050811;
  --bg-secondary: #0c1220;
  --cyan-primary: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.45);
  --red-crimson: #ff003c;
  --red-glow: rgba(255, 0, 60, 0.45);
  --green-matrix: #00ff66;
  --glass-bg: rgba(12, 18, 32, 0.88);
  --glass-border: rgba(0, 240, 255, 0.2);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

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

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ambient-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: var(--cyan-primary);
  top: -120px;
  left: -120px;
}

.glow-2 {
  width: 550px;
  height: 550px;
  background: var(--red-crimson);
  bottom: -150px;
  right: -150px;
}

/* Nav */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  background: rgba(5, 8, 17, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-back-link:hover { color: #fff; }
.back-arrow { font-size: 1.4rem; line-height: 1; }
.nav-divider { color: var(--text-muted); opacity: 0.35; }

.game-badge {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 0, 60, 0.1));
  border: 1px solid var(--cyan-primary);
  color: var(--cyan-primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 12px;
  text-shadow: 0 0 8px var(--cyan-glow);
}

.nav-icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.nav-icon-btn:hover {
  border-color: var(--cyan-primary);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #f59e0b;
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 1.1rem;
}

/* Main Container */
.game-container {
  position: relative;
  z-index: 10;
  margin: 66px auto 16px auto;
  max-width: 860px;
  width: 100%;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Reactors HUD */
.reactors-hud {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.reactor-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.player-reactor {
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.1);
}

.enemy-reactor {
  border-color: rgba(255, 0, 60, 0.35);
  box-shadow: 0 4px 16px rgba(255, 0, 60, 0.1);
}

.reactor-icon { font-size: 1.8rem; }
.reactor-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.reactor-info.right-aligned { align-items: flex-end; }

.reactor-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.bar-outer {
  width: 100%;
  height: 9px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
}

.bar-inner {
  height: 100%;
  width: 100%;
  transition: width 0.2s ease;
}

.player-fill {
  background: linear-gradient(90deg, #0284c7, #00f0ff);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.enemy-fill {
  background: linear-gradient(90deg, #b91c1c, #ff003c);
  box-shadow: 0 0 10px var(--red-glow);
}

.hp-digits {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: #fff;
}

/* Nanite Energy Display */
.energy-display {
  background: rgba(8, 14, 26, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.5);
  border-radius: 14px;
  padding: 6px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.energy-label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--cyan-primary);
}

.energy-meter {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.energy-digits {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 10px var(--cyan-glow);
}

.energy-max {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Lane Selector Bar */
.lane-selector-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  background: rgba(12, 18, 32, 0.6);
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.lane-hint {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.lane-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.lane-btn:hover {
  color: #fff;
  border-color: rgba(0, 240, 255, 0.4);
}

.lane-btn.active {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
  text-shadow: 0 0 8px var(--cyan-glow);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

/* Canvas Wrapper */
.canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 840 / 360;
  background: #03060c;
  border: 2px solid rgba(0, 240, 255, 0.35);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 240, 255, 0.15), inset 0 0 40px rgba(0,0,0,0.8);
  touch-action: none;
  cursor: crosshair;
}

#battleCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Deployment Dock */
.deployment-dock {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.unit-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.unit-card:hover:not(:disabled) {
  border-color: var(--cyan-primary);
  transform: translateY(-4px);
  box-shadow: 0 6px 20px var(--cyan-glow);
}

.unit-card:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.card-cost {
  position: absolute;
  top: 6px;
  right: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--cyan-primary);
}

.hotkey-hint {
  position: absolute;
  top: 6px;
  left: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.unit-symbol {
  font-size: 2rem;
  margin: 6px 0 4px 0;
  filter: drop-shadow(0 2px 8px rgba(0, 240, 255, 0.4));
}

.card-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.unit-title {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.unit-role {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Screen Overlays */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 17, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 70;
}

.overlay-card {
  text-align: center;
  max-width: 420px;
  width: 100%;
  background: rgba(12, 18, 32, 0.9);
  padding: 32px 24px;
  border-radius: 20px;
  border: 1px solid var(--cyan-primary);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.3);
}

.overlay-title {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  color: var(--cyan-primary);
  margin-bottom: 8px;
  text-shadow: 0 0 20px var(--cyan-glow);
}

.overlay-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.cta-btn {
  background: linear-gradient(135deg, var(--cyan-primary) 0%, #0284c7 100%);
  color: #000;
  border: none;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 20px var(--cyan-glow);
}

.cta-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 30px var(--cyan-glow);
}

@media (max-width: 768px) {
  .deployment-dock { grid-template-columns: repeat(2, 1fr); }
  .reactor-label { font-size: 0.52rem; }
  .energy-digits { font-size: 1.15rem; }
  .hotkey-hint { display: none; }
  .ambient-wrapper { display: none !important; }
}

/* Auth Bar Start Styles */
.auth-bar-start {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
  min-height: 40px;
}
.auth-bar-start .skibidi-logged-out {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.auth-bar-start .skibidi-google-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  width: 100%;
}
.skibidi-google-custom-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  background: #ffffff !important;
  color: #1f2937 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 9999px !important;
  padding: 7px 16px !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
  width: auto !important;
  line-height: normal !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
}
.skibidi-google-custom-btn:hover {
  background: #f3f4f6 !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45) !important;
  transform: translateY(-1px) !important;
}
.skibidi-google-custom-btn:active {
  transform: translateY(1px) !important;
}
.skibidi-user-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(6, 182, 212, 0.18) !important;
  border: 1.5px solid var(--cyan-primary) !important;
  color: #a5f3fc !important;
  padding: 5px 12px !important;
  border-radius: 9999px !important;
  font-size: 0.85rem !important;
  font-weight: 800 !important;
}
.skibidi-logout-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  padding: 5px 12px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  background: rgba(239, 68, 68, 0.2) !important;
  color: #fca5a5 !important;
  border: 1.5px solid #ef4444 !important;
  border-radius: 9999px !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}
.skibidi-logout-btn:hover {
  background: rgba(239, 68, 68, 0.35) !important;
  color: #ffffff !important;
}

