/* ==========================================================================
   MOB CONTROL - CARTOON ARCADE UI & STYLES
   Faithful to the official mobile game aesthetics: chunky, glossy, vibrant
   ========================================================================== */

:root {
  --primary-blue: #0088ff;
  --primary-blue-dark: #005bb5;
  --primary-red: #ff3344;
  --accent-green: #00e676;
  --accent-green-dark: #00a854;
  --accent-yellow: #ffcc00;
  --accent-orange: #ff8800;
  --accent-purple: #8b5cf6;
  --accent-purple-dark: #6d28d9;
  
  --ui-border-dark: #1e1b4b;
  --ui-bg-card: rgba(255, 255, 255, 0.95);
  --ui-dock-bg: #6366f1;
  --ui-dock-gradient: linear-gradient(180deg, #818cf8 0%, #4f46e5 100%);
  
  --text-dark: #1e293b;
  --text-light: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  font-family: 'Fredoka', 'Nunito', 'Arial Rounded MT Bold', -apple-system, system-ui, sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #38bdf8; /* Bright daylight cartoon sky */
  color: var(--text-dark);
  touch-action: none;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, #38bdf8 0%, #bae6fd 60%, #e0f2fe 100%);
  overflow: hidden;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* UI Overlay Layer */
#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ==========================================================================
   TOP HEADER HUD (Profile, Stars, Coins, Shield) - Exact Match to Screenshots
   ========================================================================== */
.hud-header {
  pointer-events: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  width: 100%;
  z-index: 20;
}

/* Rank Trophy Shield (Leftmost Badge) */
.header-rank-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(180deg, #7c3aed 0%, #4c1d95 100%);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 3px 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.header-rank-badge .rank-icon {
  font-size: 14px;
}

.header-rank-badge .rank-num {
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Center Profile Pill */
.header-profile-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #4f46e5 0%, #3730a3 100%);
  border: 2px solid #a5b4fc;
  border-radius: 22px;
  padding: 3px 10px 3px 3px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.profile-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fbcfe8;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.profile-name {
  font-size: 11px;
  font-weight: 900;
  color: #ffffff;
}

.profile-stars {
  font-size: 12px;
  font-weight: 900;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Blue Tickets Pill */
.header-ticket-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #1e3a8a;
  color: #ffffff;
  border: 2px solid #60a5fa;
  border-radius: 20px;
  padding: 3px 6px 3px 8px;
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.header-ticket-pill .ticket-icon {
  font-size: 14px;
}

/* Gold Coins Pill */
.header-coins-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #1e293b;
  color: #fbbf24;
  border: 2px solid #f59e0b;
  border-radius: 20px;
  padding: 3px 6px 3px 8px;
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.header-coins-pill .coin-icon {
  font-size: 14px;
}

/* Green Circular Plus Badge on Pills */
.pill-plus-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #22c55e;
  color: #ffffff;
  border: 1.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

/* Header Controls Right */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

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

/* ==========================================================================
   SEASON EVENT BANNER (Matching "GIGA CAMP TEMPORADA")
   ========================================================================== */
.season-banner-container {
  pointer-events: auto;
  margin: 0 auto;
  width: min(94%, 420px);
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border: 3px solid #312e81;
  border-radius: 22px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22), inset 0 2px 0 #ffffff;
}

.season-badge-col {
  display: flex;
  flex-direction: column;
}

.season-logo-text {
  font-size: 13px;
  font-weight: 900;
  color: #eab308;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  -webkit-text-stroke: 0.5px #713f12;
}

.season-logo-sub {
  font-size: 9px;
  font-weight: 900;
  color: #0284c7;
  letter-spacing: 1px;
}

.season-meter-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  max-width: 160px;
  margin: 0 10px;
}

.season-meter-header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.season-meter-header .crown-icon {
  font-size: 13px;
}

.season-meter-header .season-timer {
  font-size: 10px;
  font-weight: 800;
  color: #475569;
}

.season-progress-bar {
  width: 100%;
  height: 12px;
  background: #334155;
  border-radius: 10px;
  border: 1.5px solid #ffffff;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.season-progress-fill {
  width: 72%;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 8px;
}

.season-hex-tier {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  border: 2px solid #ffffff;
  border-radius: 8px;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.season-hex-tier .tier-number {
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

/* ==========================================================================
   LEFT FLOATING UPGRADE WIDGET ("Velocidad de Disparo") - Exact Match
   ========================================================================== */
.floating-upgrade-widget {
  position: absolute;
  left: 14px;
  top: 52%;
  transform: translateY(-50%);
  pointer-events: auto;
  background: #ffffff;
  border: 3px solid #1e3a8a;
  border-radius: 20px;
  padding: 8px 10px;
  width: 122px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 2px 0 #ffffff;
  z-index: 15;
  transition: transform 0.2s;
}

.floating-upgrade-widget:hover {
  transform: translateY(-52%) scale(1.03);
}

.widget-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.widget-title {
  font-size: 11px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.1;
  text-align: left;
}

.widget-help-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #facc15;
  color: #713f12;
  font-size: 11px;
  font-weight: 900;
  border: 1.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.widget-icon-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin: 2px 0;
}

.widget-avatar-circle {
  font-size: 26px;
}

.widget-lvl-badge {
  font-size: 11px;
  font-weight: 900;
  color: #ea580c;
  background: #ffedd5;
  border: 1.5px solid #fdba74;
  padding: 1px 6px;
  border-radius: 10px;
}

.widget-upgrade-btn {
  width: 100%;
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  border: 2px solid #ffffff;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  border-radius: 14px;
  padding: 5px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 4px 10px rgba(21, 128, 61, 0.5), inset 0 2px 0 rgba(255,255,255,0.4);
  transition: transform 0.1s;
}

.widget-upgrade-btn:active {
  transform: scale(0.95);
}

.widget-upgrade-btn.disabled {
  background: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

/* ==========================================================================
   3D BASE BUILDING FLOATING BADGES & STATUS OVERLAYS
   ========================================================================== */
.building-badge {
  position: absolute;
  pointer-events: auto;
  background: #ffffff;
  border: 2px solid #0284c7;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 900;
  color: #0369a1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.15s;
  z-index: 12;
}

.building-badge:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Central Plaza Brick Counter Box */
.brick-plaza-counter {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid #0284c7;
  border-radius: 20px;
  padding: 4px 18px;
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 2px 0 #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  z-index: 14;
}

.brick-plaza-counter:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.brick-plaza-counter span.blue-cube {
  font-size: 16px;
}

/* ==========================================================================
   BOTTOM DOCK: LOADOUT CARDS + GIANT GREEN BATTLE BUTTON
   Exact replica of the screenshots!
   ========================================================================== */
.bottom-dock-container {
  pointer-events: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 20;
}

/* Loadout Bar (Purple Rounded Tray) */
.loadout-bar {
  width: min(96%, 440px);
  background: linear-gradient(180deg, #7c3aed 0%, #5b21b6 100%);
  border: 3px solid #a78bfa;
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  padding: 8px 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

/* Individual Loadout Card */
.loadout-card {
  width: 58px;
  height: 66px;
  background: #ffffff;
  border: 3px solid #3b82f6;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 3px 2px 4px;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25), inset 0 2px 0 #ffffff;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}

.loadout-card:active {
  transform: scale(0.92);
}

.loadout-card-lvl {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #f59e0b;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 8px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.loadout-card-icon {
  font-size: 26px;
  margin-top: 6px;
}

.loadout-card-name {
  font-size: 9px;
  font-weight: 900;
  color: #1e293b;
  text-transform: uppercase;
}

.loadout-card.locked {
  background: #94a3b8;
  border-color: #64748b;
  cursor: default;
}

/* GIANT HEXAGONAL / SHIELD GREEN "BATALLA" BUTTON */
.battle-btn-wrapper {
  position: relative;
  margin: 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-battle-main {
  width: 110px;
  height: 82px;
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
  border: 4px solid #ffffff;
  border-radius: 22px;
  clip-path: polygon(15% 0%, 85% 0%, 100% 50%, 85% 100%, 15% 100%, 0% 50%);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(22, 163, 74, 0.6), inset 0 3px 0 rgba(255, 255, 255, 0.6);
  transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: pulse-battle 2s infinite alternate;
}

@keyframes pulse-battle {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.05); filter: brightness(1.1); box-shadow: 0 12px 30px rgba(74, 222, 128, 0.8); }
}

.btn-battle-main:active {
  transform: scale(0.94);
}

.btn-battle-main .swords-icon {
  font-size: 28px;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.btn-battle-main .battle-text {
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  margin-top: 2px;
}

/* Win Streak Flame Meter with Segmented Cells (Under Battle Button) */
.streak-flame-meter {
  position: absolute;
  bottom: -12px;
  background: #1e1b4b;
  border: 2px solid #f97316;
  border-radius: 14px;
  padding: 2px 4px 2px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  z-index: 5;
}

.streak-cells {
  display: flex;
  align-items: center;
  gap: 3px;
}

.streak-cell {
  width: 10px;
  height: 6px;
  background: #475569;
  border-radius: 2px;
}

.streak-cell.active {
  background: linear-gradient(90deg, #22c55e, #a3e635);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 2px;
  background: linear-gradient(135deg, #ea580c 0%, #f59e0b 100%);
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.streak-badge .flame-ico {
  font-size: 11px;
}

/* ==========================================================================
   FLOATING SCORE & COMBAT POPUPS
   ========================================================================== */
.floating-popups-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

.floating-popup {
  position: absolute;
  font-family: 'Arial Black', Impact, sans-serif;
  font-weight: 900;
  font-size: 18px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7), -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  animation: float-up-fade 0.85s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes float-up-fade {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) translateY(0);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.25) translateY(-8px);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.0) translateY(-22px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9) translateY(-48px);
  }
}

/* Bottom Navigation Icons Bar */
.bottom-nav-bar {
  width: 100%;
  background: #ffffff;
  border-top: 3px solid #e2e8f0;
  padding: 6px 16px 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.nav-tab-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 12px;
  transition: all 0.15s;
}

.nav-tab-btn span.tab-icon {
  font-size: 22px;
}

.nav-tab-btn.active {
  color: #3b82f6;
  transform: translateY(-2px);
}

/* ==========================================================================
   BATTLE MODE HUD (Progress bar, Champion Sir Big, Pause)
   ========================================================================== */
.battle-only {
  display: none !important;
}

body.in-battle .battle-only {
  display: flex !important;
}

body.in-battle .menu-only {
  display: none !important;
}

.stage-progress-container {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: min(84%, 350px);
  pointer-events: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 20;
}

.stage-title {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.stage-bar-bg {
  width: 100%;
  height: 14px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 10px;
  border: 2px solid #ffffff;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.stage-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
  border-radius: 8px;
  transition: width 0.2s ease-out;
}

/* Looting Rush Banner */
.looting-banner-container {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(239, 68, 68, 0.95));
  border: 3px solid #fef08a;
  border-radius: 25px;
  padding: 6px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.6);
  z-index: 30;
  animation: pulse-looting 0.8s infinite alternate;
  pointer-events: none;
}

@keyframes pulse-looting {
  0% { transform: translateX(-50%) scale(1); filter: brightness(1); }
  100% { transform: translateX(-50%) scale(1.06); filter: brightness(1.2); }
}

.looting-title {
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.looting-timer-val {
  background: #1e1b4b;
  color: #fde047;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #fef08a;
}

/* Champion Sir Big Trigger */
.champion-trigger {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 3px solid #cbd5e1;
  border-radius: 35px;
  padding: 6px 18px 6px 8px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 25;
}

.champion-trigger.ready {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.8);
  animation: pulse-ready 0.9s infinite alternate;
}

.champion-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 2px solid #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.champion-info {
  display: flex;
  flex-direction: column;
}

.champion-name {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  color: #1e293b;
}

.champion-charge-bar {
  width: 100px;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 3px;
  border: 1px solid #cbd5e1;
}

.champion-charge-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  transition: width 0.15s;
}

.touch-guidance {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  pointer-events: none;
  animation: fade-guide 2.5s infinite;
  white-space: nowrap;
  z-index: 20;
}

@keyframes fade-guide {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ==========================================================================
   MODALS (Armory, Base Construction, Pause, Victory, Defeat)
   ========================================================================== */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(92%, 440px);
  max-height: 85vh;
  background: #ffffff;
  border: 4px solid #3b82f6;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), inset 0 2px 0 #ffffff;
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 2px solid #e2e8f0;
}

.modal-title {
  font-size: 19px;
  font-weight: 900;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: #e2e8f0;
  border: 2px solid #cbd5e1;
  color: #475569;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Upgrade Card Items */
.upgrade-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.upgrade-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.upgrade-icon {
  font-size: 30px;
  width: 48px;
  height: 48px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.upgrade-details h4 {
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
}

.upgrade-details p {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

.upgrade-level {
  display: inline-block;
  background: #e0f2fe;
  color: #0284c7;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 900;
  margin-top: 3px;
}

.upgrade-btn {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  border: 2px solid #ffffff;
  color: white;
  padding: 8px 14px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.4), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform 0.15s;
}

.upgrade-btn:active {
  transform: scale(0.95);
}

.upgrade-btn.disabled {
  background: #cbd5e1;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

.upgrade-btn span.cost {
  font-size: 11px;
  color: #ffedd5;
}

/* Victory / Defeat Modal Cards */
.victory-card {
  text-align: center;
  padding: 24px 20px;
}

.victory-banner {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.defeat-banner {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.reward-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}

.reward-box {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.reward-box span.val {
  font-size: 22px;
  font-weight: 900;
}

.action-btn-main {
  width: 100%;
  padding: 14px;
  border: 3px solid #ffffff;
  border-radius: 18px;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.4), inset 0 2px 0 rgba(255,255,255,0.4);
  transition: transform 0.15s;
}

.action-btn-main:active {
  transform: scale(0.97);
}

.action-btn-secondary {
  width: 100%;
  padding: 12px;
  border: 2px solid #cbd5e1;
  border-radius: 18px;
  background: #f1f5f9;
  color: #475569;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.15s;
}

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