:root {
  /* ================= ARMAGEDDON هيرمجدون COLOR PALETTE ================= */
  --bg-deep: #070a10;
  --bg-surface: #0c121c;
  --bg-panel: #111a28;
  --bg-panel-elevated: #162438;
  --border-cyan: rgba(0, 229, 255, 0.35);
  --border-cyan-glow: rgba(0, 229, 255, 0.75);
  --border-red: rgba(255, 51, 68, 0.5);
  --border-metal: #22344d;

  /* Neon Glowing Accents */
  --cyber-cyan: #00e5ff;
  --holo-blue: #0099ff;
  --magma-red: #ff3344;
  --fire-orange: #ff7b00;
  --amber-gold: #ffb703;
  --tactical-green: #00e676;

  /* Role Badges from the Poster */
  --role-attacker: #ff3344;
  --role-defender: #0099ff;
  --role-alliance: #00e676;
  --role-scout: #ffb703;

  /* Typography & Layout */
  --text-primary: #f0f6fc;
  --text-muted: #8ba2c0;
  --font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;

  /* Shadows & Glows */
  --glow-cyan: 0 0 14px rgba(0, 229, 255, 0.35);
  --glow-red: 0 0 14px rgba(255, 51, 68, 0.45);
  --glow-gold: 0 0 12px rgba(255, 183, 3, 0.35);
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-family);
  direction: rtl;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
}

/* ================= TOP TACTICAL HUD (ARMAGEDDON THEMED) ================= */
#hud-top {
  height: 56px;
  background: linear-gradient(180deg, #141f30 0%, #0a1019 100%);
  border-bottom: 2px solid var(--border-cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 229, 255, 0.15);
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Armageddon Logo Badge */
.badge-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, rgba(255, 51, 68, 0.25) 0%, rgba(0, 229, 255, 0.15) 100%);
  border: 1px solid var(--magma-red);
  padding: 5px 14px;
  border-radius: 4px;
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 51, 68, 0.6);
  box-shadow: var(--glow-red);
  position: relative;
  overflow: hidden;
}

.badge-brand::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: translateX(-100%);
  animation: shine 4s infinite;
}

@keyframes shine {
  100% { transform: translateX(100%); }
}

.badge-online {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid var(--cyber-cyan);
  color: var(--cyber-cyan);
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: var(--glow-cyan);
}

/* Unified High-Tech Icon Command Bar (Bigger icons, No words) */
.hud-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.9) 0%, rgba(30, 41, 59, 0.95) 100%);
  border: 1.5px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  user-select: none;
}

.hud-icon-btn:hover {
  border-color: var(--amber-gold);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4), 0 0 8px rgba(255, 215, 0, 0.2);
  transform: translateY(-2px);
}

.hud-icon-btn:active {
  transform: translateY(0);
}

.hud-icon-btn .btn-icon {
  font-size: 22px;
  line-height: 1;
}

.hud-icon-btn .btn-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--tactical-green);
  color: #000;
  font-size: 10px;
  font-weight: 900;
  border-radius: 10px;
  padding: 1px 5px;
  box-shadow: 0 0 6px rgba(0, 230, 118, 0.7);
}

.hud-icon-btn.brand-btn {
  border-color: var(--magma-red);
  background: radial-gradient(circle, rgba(239, 68, 68, 0.3) 0%, rgba(15, 23, 42, 0.95) 100%);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.hud-icon-btn.brand-btn:hover {
  border-color: #ff8787;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.6);
}

.hud-icon-btn.nation-icon-btn {
  width: auto;
  padding: 0 6px;
  gap: 6px;
  border-color: var(--amber-gold);
  background: linear-gradient(135deg, rgba(20, 25, 40, 0.95) 0%, rgba(10, 15, 26, 0.95) 100%);
}

.hud-icon-btn.danger-btn:hover {
  border-color: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
}

.hud-icon-btn.admin-btn {
  border-color: #f59e0b;
}

.hud-icon-btn.alert-btn {
  border-color: #ef4444;
  animation: pulse 0.8s infinite;
}

.hud-icon-stat {
  height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(20, 29, 44, 0.95) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hud-icon-stat:hover {
  border-color: var(--amber-gold);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.3);
  transform: translateY(-2px);
}

.hud-icon-stat .stat-icon {
  font-size: 20px;
  line-height: 1;
}

.hud-icon-stat .stat-val {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  letter-spacing: 0.5px;
}

.hud-icon-stat#stat-credits .stat-val {
  color: var(--amber-gold);
}

.hud-icon-stat.stat-danger .stat-val {
  color: #ef4444;
}

.hud-icon-stat.stat-success .stat-val {
  color: #20c997;
}

.hud-icon-stat .power-bar-wrap {
  width: 50px;
  height: 6px;
  background: #06090e;
  border: 1px solid var(--border-metal);
  margin-top: 0;
  border-radius: 2px;
  overflow: hidden;
}

.power-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--tactical-green);
  box-shadow: 0 0 8px var(--tactical-green);
  transition: width 0.3s, background-color 0.3s;
}

.power-bar-fill.low {
  background: var(--magma-red);
  box-shadow: 0 0 8px var(--magma-red);
}

/* Tactical HUD Buttons (Styled like Poster Action Buttons) */
.btn-hud {
  background: linear-gradient(180deg, #1c2b42 0%, #101928 100%);
  border: 1px solid var(--border-cyan);
  color: var(--text-primary);
  padding: 6px 14px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.btn-hud:hover {
  background: linear-gradient(180deg, #253956 0%, #172439 100%);
  border-color: var(--cyber-cyan);
  color: #fff;
  box-shadow: var(--glow-cyan);
  transform: translateY(-1px);
}

.btn-hud.danger {
  border-color: var(--magma-red);
  background: linear-gradient(180deg, rgba(255, 51, 68, 0.3) 0%, rgba(200, 20, 40, 0.2) 100%);
  color: #ffa8b0;
}

.btn-hud.danger:hover {
  background: var(--magma-red);
  color: #fff;
  box-shadow: var(--glow-red);
}

/* ================= MAIN ARENA LAYOUT ================= */
#main-stage {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

#canvas-wrap {
  flex: 1;
  position: relative;
  background: radial-gradient(ellipse at bottom, #0d1b2a 0%, #050811 50%, #020307 100%);
  cursor: crosshair;
  overflow: hidden;
}

#spaceBgCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
  background: transparent;
}

.world-3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.render-mode-button { position: absolute; left: 14px; top: 14px; z-index: 5; font-size: 11px; border-color: #66ccb9; background: #132b36e8; }
.render-mode-button[aria-pressed="true"] { color: #95f0d5; }

/* Battle Alert Banner */
#battle-alert {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 18, 28, 0.95);
  border: 2px solid var(--magma-red);
  color: #fff;
  padding: 8px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.8), var(--glow-red);
  z-index: 50;
  text-align: center;
}

#battle-alert.active {
  opacity: 1;
}

/* Brush Bar */
#brush-bar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 22, 34, 0.96);
  border: 1px solid var(--cyber-cyan);
  padding: 8px 20px;
  border-radius: 4px;
  display: flex;
  gap: 16px;
  align-items: center;
  z-index: 50;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), var(--glow-cyan);
}

#brush-bar[hidden] {
  display: none;
}

/* Tactical Unit Actions Bar (Stargate, Cloaking, Covert Deployment) */
.tactical-actions-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 18, 30, 0.95);
  border: 1px solid var(--cyber-cyan);
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.85), var(--glow-cyan);
  padding: 8px 18px;
  border-radius: 6px;
  display: flex;
  gap: 12px;
  align-items: center;
  z-index: 45;
}

.tactical-actions-bar[hidden] {
  display: none;
}

.btn-tactical-action {
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.25) 0%, rgba(2, 132, 199, 0.35) 100%);
  border: 1px solid var(--cyber-cyan);
  color: #fff;
  padding: 6px 14px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-tactical-action:hover {
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.45) 0%, rgba(2, 132, 199, 0.6) 100%);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.6);
  transform: translateY(-1px);
}

.btn-tactical-action.stealth-action {
  border-color: #a855f7;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.3) 0%, rgba(126, 34, 206, 0.4) 100%);
}

.btn-tactical-action.stealth-action:hover {
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.7);
}

/* ================= RED ALERT ICONIC ARMAGEDDON SIDEBAR ================= */
#sidebar {
  width: 300px;
  background: linear-gradient(180deg, #182435 0%, #0c121d 100%);
  border-right: 3px solid #d4af37;
  display: flex;
  flex-direction: column;
  z-index: 40;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.85), inset 2px 0 8px rgba(212, 175, 55, 0.2);
  transition: width 0.25s ease, opacity 0.25s ease;
}

#sidebar.collapsed {
  display: none !important;
}

/* Floating Expand Button docked to the left edge of screen */
.btn-sidebar-floating-expand {
  position: absolute;
  top: 70px;
  left: 14px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #d4af37;
  border-radius: 6px;
  color: #facc15;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.85), 0 0 12px rgba(212, 175, 55, 0.4);
  transition: all 0.2s ease;
}

.btn-sidebar-floating-expand:hover {
  background: #334155;
  color: #fff;
  border-color: #fde047;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.95), 0 0 16px rgba(250, 204, 21, 0.6);
}

/* Radar Display: Full High-Tech Rectangular Command Monitor */
.radar-box {
  padding: 8px 10px;
  border-bottom: 2px solid #3b4c68;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #131c2a 0%, #0a0f18 100%);
}

.radar-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #d4af37;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

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

.radar-status-badge {
  color: var(--radar-green);
  font-size: 10px;
}

.btn-collapse-sidebar {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #d4af37;
  color: #f8fafc;
  font-family: var(--font-family);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-collapse-sidebar:hover {
  background: #334155;
  border-color: #facc15;
  color: #facc15;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
}

.radar-screen {
  width: 100%;
  height: 190px;
  border-radius: 6px;
  border: 2px solid #d4af37;
  background: radial-gradient(ellipse at center, #062b1e 0%, #03140e 70%, #010806 100%);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 230, 118, 0.25), 0 0 12px rgba(0, 0, 0, 0.85);
  cursor: crosshair;
}

#radarCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

.radar-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(0, 230, 118, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 230, 118, 0.12) 1px, transparent 1px);
  background-size: 28px 19px;
  pointer-events: none;
}

.radar-sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 230, 118, 0.2) 50%, rgba(0, 230, 118, 0.55) 95%, transparent 100%);
  width: 25%;
  animation: radarScanline 3.2s linear infinite;
  pointer-events: none;
}

@keyframes radarScanline {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.radar-controls { display:flex; align-items:center; justify-content:center; gap:7px; margin-top:7px; direction:ltr; }
.radar-controls button { min-width:29px; height:27px; border:1px solid #314b49; border-radius:7px; background:#102822; color:#bdeed8; font-size:16px; font-weight:700; cursor:pointer; }
.radar-controls button:hover { border-color:#5bdaaa; background:#173b30; }
.radar-controls button:disabled { opacity:.35; cursor:default; }
.radar-controls button[aria-pressed="true"] { border-color:#dcb65f; background:#383121; }
#radarZoomValue { min-width:44px; text-align:center; font:11px ui-monospace,monospace; color:#c2d9cf; }
.radar-circular-scan { position:absolute; width:150%; aspect-ratio:1; left:50%; top:50%; border-radius:50%; pointer-events:none; background:conic-gradient(from 0deg,transparent 0deg,transparent 280deg,rgba(72,228,159,.08) 320deg,rgba(88,243,173,.35) 358deg,rgba(183,255,220,.7) 360deg); animation:radarCircularSweep 5s linear infinite; will-change:transform; }
.radar-origin { position:absolute; width:4px; height:4px; left:50%; top:50%; border-radius:50%; background:#b9f9d5; transform:translate(-50%,-50%); box-shadow:0 0 7px #91e6b7; pointer-events:none; }
@keyframes radarCircularSweep { from { transform:translate(-50%,-50%) rotate(0deg); } to { transform:translate(-50%,-50%) rotate(360deg); } }
.radar-legend { display:flex; justify-content:center; gap:17px; margin-top:6px; font-size:9px; color:#a6bbb3; }
.radar-legend span::before { content:""; display:inline-block; width:5px; height:5px; border-radius:50%; margin-inline-end:5px; background:#57e2b0; }
.radar-legend .ally::before { background:#69b9ff; }
.radar-legend .enemy::before { background:#ff697d; }
#radarCanvas { touch-action:none; cursor:crosshair; }
#radarTooltip { position:fixed; z-index:2500; max-width:min(460px,calc(100vw - 16px)); padding:9px 12px; border:1px solid #375b4d; border-radius:8px; background:rgba(4,21,17,.96); color:#dbf6e8; box-shadow:0 6px 22px #0007; font-size:11px; line-height:1.6; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; pointer-events:none; }
#radarTooltip[hidden] { display:none; }
@media (prefers-reduced-motion:reduce) { .radar-circular-scan { animation-duration:15s; } }

/* Red Alert Classic Action Toolbar (Repair 🔧 & Sell 💲) */
.ra-action-toolbar {
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  background: #0f1622;
  border-bottom: 2px solid #2a3a50;
  justify-content: center;
}

.btn-ra-tool {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  background: linear-gradient(180deg, #23344a 0%, #15202e 100%);
  border: 1px solid #d4af37;
  border-radius: 4px;
  color: #fff;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: all 0.15s ease;
}

.btn-ra-tool:hover {
  background: linear-gradient(180deg, #334b6b 0%, #1f2f45 100%);
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.btn-ra-tool.active {
  background: linear-gradient(180deg, #b8860b 0%, #8c6507 100%);
  border-color: #fff;
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.75);
  transform: translateY(1px);
}

.btn-ra-tool .tool-icon {
  font-size: 14px;
}

/* Sidebar Build Tabs */
.sidebar-tabs {
  display: flex;
  border-bottom: 2px solid #2a3a50;
  background: #0d1420;
}

.tab-btn {
  flex: 1;
  padding: 8px 3px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.18s;
  text-align: center;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(212, 175, 55, 0.08);
}

.tab-btn.active {
  color: #ffd700;
  border-bottom-color: #ffd700;
  background: rgba(212, 175, 55, 0.15);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* Sidebar Build Area & Vertical Power Strip Layout */
.sidebar-build-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Red Alert 2 Iconic Vertical Power Meter Strip */
#ra-power-strip {
  width: 26px;
  background: #090e16;
  border-left: 2px solid #202e42;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 2px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8);
}

.power-meter-label {
  font-size: 9px;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #d4af37;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.power-meter-track {
  flex: 1;
  width: 12px;
  background: #141d29;
  border: 1px solid #33445c;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#ra-power-fill {
  width: 100%;
  height: 75%;
  background: linear-gradient(to top, #00e676, #69db7c);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.6);
  transition: height 0.3s ease, background 0.3s;
}

#ra-power-fill.low {
  background: linear-gradient(to top, #ff3344, #ff8787);
  box-shadow: 0 0 10px rgba(255, 51, 68, 0.8);
  animation: powerBlink 0.6s infinite alternate;
}

@keyframes powerBlink {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

#ra-power-bolt {
  font-size: 13px;
  margin-top: 4px;
  color: #ffd700;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.7));
}

/* Items List - Compact Icon Grid Layout */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  align-content: start;
}

.build-card.compact-icon-card {
  position: relative;
  background: linear-gradient(180deg, #131d2c 0%, #0c121c 100%);
  border: 1px solid var(--border-metal);
  border-radius: 4px;
  padding: 6px 4px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.18s;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.build-card.compact-icon-card:hover:not(:disabled) {
  border-color: var(--cyber-cyan);
  background: #19273c;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
  transform: translateY(-2px);
}

.build-card.compact-icon-card:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

.compact-icon-card .icon-badge {
  font-size: 20px;
  margin-bottom: 2px;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

.compact-icon-card .card-title-mini {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  z-index: 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.compact-icon-card .price-mini {
  font-family: var(--font-mono);
  color: var(--amber-gold);
  font-size: 11px;
  font-weight: 800;
  z-index: 2;
  margin-top: 2px;
}

.compact-icon-card .card-status {
  font-size: 9px;
  color: var(--text-muted);
  z-index: 2;
  margin-top: 1px;
}

.build-card .card-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  z-index: 2;
}

.build-card .price {
  font-family: var(--font-mono);
  color: var(--amber-gold);
  font-size: 13px;
  font-weight: 800;
}

.build-card .card-status {
  position: relative;
  font-size: 11px;
  color: var(--text-muted);
  z-index: 2;
  margin-top: 4px;
}

.build-card .card-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: rgba(0, 229, 255, 0.3);
  pointer-events: none;
  transition: width 0.1s linear;
}

.build-card.ready {
  border-color: var(--tactical-green);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.4);
}

.build-card.ready .card-status {
  color: var(--tactical-green);
  font-weight: 800;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* ================= FULL-WIDTH BOTTOM TACTICAL CHAT & COMMS BAR ================= */
#chat-bar-full {
  width: 100vw;
  background: linear-gradient(180deg, rgba(14, 22, 34, 0.98) 0%, rgba(7, 10, 16, 0.99) 100%);
  border-top: 2px solid var(--border-cyan);
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.8), 0 -1px 8px rgba(0, 229, 255, 0.2);
  z-index: 90;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  transition: max-height 0.25s ease-in-out;
}

.chat-bar-header {
  height: 32px;
  background: linear-gradient(90deg, #162438 0%, #0c121c 100%);
  border-bottom: 1px solid var(--border-metal);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}

.chat-bar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.chat-status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyber-cyan);
  box-shadow: 0 0 8px var(--cyber-cyan);
  animation: pulse 2s infinite;
}

.chat-bar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-channel-badge {
  font-size: 11px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid var(--border-cyan);
  color: var(--cyber-cyan);
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
}

.btn-hud.mini {
  padding: 2px 8px;
  font-size: 10px;
  min-height: 20px;
}

.chat-bar-body {
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.chat-bar-body.collapsed {
  display: none;
}

.chat-messages {
  height: 110px;
  overflow-y: auto;
  padding: 8px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  background: rgba(4, 7, 12, 0.6);
  scrollbar-width: thin;
  scrollbar-color: var(--border-cyan) #090e17;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-cyan);
  border-radius: 3px;
}

.msg-line {
  line-height: 1.45;
  word-break: break-word;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.msg-line .sender {
  font-weight: 800;
  color: var(--cyber-cyan);
  background: rgba(0, 229, 255, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  white-space: nowrap;
}

.msg-line .text {
  color: var(--text-primary);
}

.msg-line.system {
  color: var(--amber-gold);
  background: rgba(255, 183, 3, 0.07);
  padding: 3px 8px;
  border-radius: 4px;
  border-right: 3px solid var(--amber-gold);
  font-weight: 500;
}

.chat-input-bar {
  padding: 8px 16px;
  border-top: 1px solid var(--border-metal);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #090e17;
}

.chat-input-bar .input-icon {
  font-size: 16px;
  color: var(--cyber-cyan);
}

.chat-input-bar input {
  flex: 1;
  background: #05080e;
  border: 1px solid var(--border-cyan);
  color: #fff;
  font-family: var(--font-family);
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 4px;
  outline: none;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-bar input:focus {
  border-color: var(--cyber-cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
}

.chat-input-bar button {
  background: linear-gradient(180deg, var(--cyber-cyan) 0%, #0099ff 100%);
  color: #070a10;
  border: none;
  padding: 7px 22px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

.chat-input-bar button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.7);
}

.chat-input-bar button:active {
  transform: translateY(1px);
}

/* ================= MODALS & POSTER HERO SCREEN ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(8px);
}

.modal-overlay[hidden] {
  display: none;
}

.auth-status {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid #52667c;
  border-radius: 6px;
  background: #152436;
  color: #d5e7ed;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.auth-status[data-state="error"] {
  border-color: #a75050;
  background: #351e27;
  color: #ffd7d7;
}
.auth-retry {
  margin: 0 0 14px;
  padding: 9px 14px;
  border: 1px solid #58b9cc;
  border-radius: 5px;
  color: #def5f7;
  background: #173742;
  cursor: pointer;
}
.auth-status[hidden], .auth-retry[hidden] { display: none; }
.btn-google-auth:disabled { opacity: .5; cursor: default; }
#btnDoLogin:disabled, #btnDoRegister:disabled { opacity: .7; cursor: wait; }

.modal-card {
  background: linear-gradient(180deg, #131c2a 0%, #0a1019 100%);
  border: 2px solid var(--border-cyan);
  border-radius: 8px;
  padding: 24px;
  width: min(580px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), var(--glow-cyan);
  position: relative;
}

.modal-card.wide {
  width: min(940px, 96vw);
}

/* ================= COMMANDERS DOSSIER & WAR ACADEMY ================= */
#commanders-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px;
}

.commander-card-item {
  background: linear-gradient(180deg, #121c2c 0%, #0a111a 100%);
  border: 1px solid var(--border-metal);
  border-right: 4px solid var(--border-cyan);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.commander-card-item:hover {
  border-color: var(--cyber-cyan);
  background: #172437;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.25);
}

.commander-avatar-box {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--cyber-cyan);
  background: #080d14;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
  position: relative;
  flex-shrink: 0;
}

.commander-avatar-box .status-dot {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tactical-green);
  border: 2px solid #080d14;
}

.commander-info-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.commander-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.commander-name-row b {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.commander-power-rating {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--amber-gold);
}

.commander-stars {
  color: #ffb703;
  font-size: 13px;
  letter-spacing: 2px;
}

.commander-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  margin-top: 2px;
}

.badge-tag {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
}

.badge-tag.veteran {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid #c084fc;
}

.badge-tag.recruit {
  background: rgba(0, 229, 255, 0.15);
  color: var(--cyber-cyan);
  border: 1px solid var(--cyber-cyan);
}

.badge-tag.medals {
  background: rgba(255, 183, 3, 0.15);
  color: #ffd166;
  border: 1px solid #ffd166;
}

/* Poster Header Banner */
.poster-hero {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--border-cyan);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.poster-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.poster-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10, 16, 25, 0.95) 0%, rgba(10, 16, 25, 0.4) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
}

.poster-hero-overlay h2 {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 51, 68, 0.8);
  margin-bottom: 2px;
}

.poster-hero-overlay p {
  font-size: 13px;
  color: var(--cyber-cyan);
  font-weight: 600;
}

/* Pillars Grid (The 5 items from the poster) */
.poster-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.pillar-item {
  background: rgba(22, 36, 56, 0.6);
  border: 1px solid var(--border-metal);
  padding: 8px;
  border-radius: 4px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

.pillar-item .icon {
  font-size: 18px;
  color: var(--cyber-cyan);
  margin-bottom: 3px;
}

.pillar-item b {
  display: block;
  color: #fff;
  font-size: 12px;
  margin-bottom: 2px;
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: #090e16;
  border: 1px solid var(--border-metal);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 4px;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--cyber-cyan);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

/* Poster Call to Action Button */
.btn-primary {
  background: linear-gradient(90deg, #e52b38 0%, #ff5500 100%);
  color: #fff;
  border: 1px solid #ff7b00;
  padding: 10px 24px;
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 800;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--glow-red);
}

.btn-primary:hover {
  background: linear-gradient(90deg, #ff3344 0%, #ff6a00 100%);
  box-shadow: 0 0 20px rgba(255, 51, 68, 0.8);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #1c2638;
  color: var(--text-primary);
  border: 1px solid var(--border-metal);
  padding: 8px 18px;
  font-family: var(--font-family);
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #25334a;
  border-color: var(--text-muted);
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}

/* ================= 3D ADMIN STUDIO ================= */
#admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 16, 0.96);
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#admin-overlay[hidden] {
  display: none;
}

#admin-overlay.min {
  inset: auto 0 0 0;
  height: auto;
  background: transparent;
  pointer-events: none;
}

#admin-overlay.min .admin-body {
  display: none;
}

#admin-overlay.min .admin-header {
  pointer-events: auto;
}

.admin-header {
  background: #101826;
  border-bottom: 2px solid var(--border-cyan);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.admin-header h3 {
  font-size: 16px;
  color: var(--amber-gold);
}

.admin-body {
  display: flex;
  gap: 12px;
  padding: 16px;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.admin-header-identity { flex: 1; min-width: 0; }
#admin-overlay button[hidden] { display: none !important; }
.admin-header-identity h3 { margin: 0 0 4px; }
.admin-header-identity #aMsg { color: #8caabd; font-size: 12px; }
.admin-sidebar { flex: 0 0 276px; width: 276px; min-height: 0; display: flex; flex-direction: column; padding: 14px; box-sizing: border-box; background: linear-gradient(155deg, #142734, #0b1823 65%); border: 1px solid #2b4554; border-radius: 12px; overflow: hidden; }
.admin-side-navigation { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 0 0 6px 4px; scrollbar-width: thin; scrollbar-color: #426674 transparent; }
.admin-nav-group { margin: 0 0 14px; }
.admin-nav-group:last-child { margin-bottom: 0; }
.admin-nav-group-label { margin: 0 8px 7px; color: #7797aa; font-size: 10px; font-weight: 700; letter-spacing: .4px; }
.admin-nav-button { width: 100%; min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin: 3px 0; text-align: right; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #b7cad7; font: inherit; font-size: 12px; cursor: pointer; transition: background .15s, border-color .15s; }
.admin-nav-button:hover { background: #1c3543; color: #f4f9fc; }
.admin-nav-button.active { background: #25443f; color: #eaf5dc; border-color: #9c9b58; box-shadow: inset -3px 0 #e3c77e; }
.admin-nav-button:focus-visible { outline: 2px solid #7ddcc6; outline-offset: -2px; }
.admin-nav-icon { flex: 0 0 27px; width: 27px; height: 27px; display: grid; place-items: center; background: #172f3e; color: #87b2c4; border-radius: 7px; font-size: 18px; }
.admin-nav-button.active .admin-nav-icon { background: #3b5140; color: #eed48b; }
.admin-nav-label { flex: 1; min-width: 0; line-height: 1.5; }
.admin-sidebar-items-heading { flex-shrink: 0; margin: 12px 0 8px; padding-top: 12px; border-top: 1px solid #2a414e; color: #cbdde7; font-size: 11px; }
.admin-sidebar #aItems { flex: 1 1 auto; min-height: 90px; max-height: none; margin: 0; padding: 0 0 3px 4px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #426674 transparent; }
.admin-sidebar[data-content="people"] .admin-side-navigation { max-height: 52%; }
.admin-sidebar[data-content="items"] .admin-side-navigation { max-height: 72%; }
.admin-sidebar #aItems[hidden], .admin-sidebar-items-heading[hidden], .admin-item-actions[hidden] { display: none; }
.admin-item-actions { flex-shrink: 0; display: flex; gap: 5px; padding-top: 10px; }
.admin-item-actions button { flex: 1; min-height: 32px; color: #b4cad9; background: #172e3b; border: 1px solid #385263; border-radius: 6px; font: inherit; font-size: 11px; cursor: pointer; }
.admin-item-actions button:disabled { opacity: .45; cursor: default; }
.admin-main { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); align-content: start; align-items: start; gap: 12px; overflow-y: auto; padding-left: 5px; scrollbar-width: thin; scrollbar-color: #41616f transparent; }
.admin-main[data-service-tab="true"] { grid-template-columns: minmax(0, 1fr); }
.admin-main > .admin-box { min-width: 0; border-radius: 10px; }
.admin-sidebar .admin-people-user { padding: 9px 7px; gap: 8px; }
.admin-sidebar .admin-people-flag { width: 32px; height: 32px; font-size: 23px; }
.admin-sidebar .admin-people-user-names strong { font-size: 12px; }
@media (max-width: 1120px) { .admin-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .admin-header { padding: 10px; gap: 7px; flex-wrap: wrap; }
  .admin-header-identity { flex-basis: 100%; }
  .admin-header h3 { font-size: 14px; }
  .admin-header .btn-hud { font-size: 11px; padding: 7px 9px; }
  .admin-body { flex-direction: column; padding: 8px; gap: 8px; }
  .admin-sidebar { flex: 0 1 auto; width: 100%; max-height: 38%; padding: 9px; }
  .admin-side-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; }
  .admin-nav-group { margin-bottom: 5px; }
  .admin-nav-group-label { margin-bottom: 4px; }
  .admin-nav-button { min-height: 36px; font-size: 11px; gap: 7px; padding: 5px 7px; }
  .admin-nav-icon { width: 23px; height: 23px; flex-basis: 23px; font-size: 16px; }
  .admin-sidebar[data-content="people"] { max-height: 44%; }
  .admin-sidebar[data-content="people"] .admin-side-navigation { max-height: 105px; min-height: 75px; flex-shrink: 0; }
  .admin-sidebar[data-content="items"] .admin-side-navigation { max-height: 115px; min-height: 75px; flex-shrink: 0; }
  .admin-sidebar #aItems { min-height: 80px; }
  .admin-sidebar-items-heading { margin: 7px 0 5px; padding-top: 7px; }
  .admin-item-actions { padding-top: 6px; }
  .admin-main { padding-left: 0; }
}

.admin-box {
  background: #0e1624;
  border: 1px solid var(--border-metal);
  border-radius: 4px;
  padding: 12px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.admin-tabs button {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 3px;
  border: 1px solid var(--border-metal);
  background: #152032;
  color: var(--text-primary);
  cursor: pointer;
}

.admin-tabs button.active {
  background: var(--holo-blue);
  color: #fff;
  border-color: var(--cyber-cyan);
  box-shadow: var(--glow-cyan);
}

.admin-items-list {
  display: grid;
  gap: 5px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.admin-items-list button {
  text-align: right;
  padding: 7px 12px;
  font-size: 13px;
  background: #121c2c;
  border: 1px solid var(--border-metal);
  color: var(--text-primary);
  border-radius: 3px;
  cursor: pointer;
}

.admin-items-list button.active {
  border-color: var(--amber-gold);
  background: #1c2b42;
  box-shadow: var(--glow-gold);
}

.pv-wrap canvas {
  background: #080d14;
  border: 1px solid var(--border-cyan);
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.views-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.views-grid canvas {
  background: #080d14;
  border: 1px solid var(--border-metal);
  width: 100%;
  height: auto;
  border-radius: 3px;
}

.views-grid div {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* Parts Table */
.parts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 10px;
}

.parts-table th, .parts-table td {
  padding: 5px 6px;
  border: 1px solid var(--border-metal);
  text-align: center;
}

.parts-table input, .parts-table select {
  width: 52px;
  background: #080d14;
  border: 1px solid var(--border-metal);
  color: var(--text-primary);
  font-size: 12px;
  padding: 3px;
}

.parts-table select {
  width: auto;
}

.parts-table tr.selected {
  background: rgba(0, 229, 255, 0.18);
}

/* ================= ZOOM CONTROLS TOOLBAR ================= */
.tactical-zoom-bar {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 16, 26, 0.88);
  border: 1px solid var(--border-metal);
  backdrop-filter: blur(8px);
  padding: 5px 8px;
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.btn-zoom {
  background: #142033;
  color: var(--text-primary);
  border: 1px solid var(--border-metal);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-zoom:hover {
  background: #1e3352;
  border-color: var(--cyber-cyan);
  color: #fff;
  transform: translateY(-1px);
}

.btn-zoom-fit {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-energy);
  border-color: rgba(255, 183, 3, 0.4);
}

.btn-zoom-fit:hover {
  border-color: var(--gold-energy);
  background: rgba(255, 183, 3, 0.15);
}

.zoom-display {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: var(--cyber-cyan);
  min-width: 52px;
  text-align: center;
  user-select: none;
}

.zoom-slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 140px;
  margin: 0 4px;
}

.zoom-slider-wrap input[type="range"] {
  width: 100%;
  height: 6px;
  background: #0f172a;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  border: 1px solid var(--border-metal);
}

.zoom-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cyber-cyan);
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.85);
  cursor: pointer;
  transition: transform 0.1s;
}

.zoom-slider-wrap input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.zoom-slider-center-tick {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 12px;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

/* ================= OCCUPATION STATUS BANNER ================= */
.occupation-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: linear-gradient(90deg, rgba(224, 49, 49, 0.95), rgba(160, 20, 20, 0.95));
  border: 1px solid #ff8787;
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(224, 49, 49, 0.5);
  animation: pulse 2s infinite ease-in-out;
}

.occupation-banner .occ-icon {
  font-size: 18px;
}

/* ================= REBUILDING & PEACE SHIELD ADVISOR PANEL ================= */
.advisor-panel {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 45;
  width: 380px;
  background: rgba(8, 14, 24, 0.94);
  border: 1px solid var(--gold-energy);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(255, 183, 3, 0.25);
  backdrop-filter: blur(10px);
  overflow: hidden;
  animation: fadeIn 0.3s ease;
}

.advisor-header {
  background: linear-gradient(90deg, #1f1b0a 0%, #121008 100%);
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 183, 3, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.advisor-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-energy);
  display: flex;
  align-items: center;
  gap: 6px;
}

.advisor-timer {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: #ffe066;
  background: rgba(255, 183, 3, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 183, 3, 0.4);
}

.advisor-body {
  padding: 12px 14px;
}

.advisor-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.advisor-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.advisor-check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f1826;
  border: 1px solid #1a293d;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
}

.advisor-check-item.done {
  border-color: rgba(32, 201, 151, 0.5);
  background: rgba(32, 201, 151, 0.08);
}

.advisor-check-item .item-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}

.advisor-check-item .item-status {
  font-weight: 700;
  font-size: 11px;
}

.advisor-check-item.done .item-status {
  color: var(--tactical-green);
}

.advisor-check-item:not(.done) .item-status {
  color: #ff922b;
}

.advisor-progress-wrap {
  margin-top: 8px;
}

.advisor-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #fff;
  margin-bottom: 4px;
  font-weight: 600;
}

.advisor-progress-bar {
  height: 8px;
  background: #142033;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #1e3352;
}

#advisor-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff922b, var(--gold-energy), var(--tactical-green));
  transition: width 0.3s ease;
}

/* ================= CASUALTIES & WAR LOSSES REGISTRY ================= */
@media (max-width: 720px) {
  #casualties-columns-wrap {
    grid-template-columns: 1fr !important;
  }
}

/* ================= ICONIC HUD STATS & DATA BADGES ================= */
.hud-stat.hud-stat-icon {
  flex-direction: row;
  align-items: center;
  gap: 7px;
  min-width: unset;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  border-radius: 4px;
}

.hud-stat.hud-stat-icon:hover {
  background: rgba(0, 229, 255, 0.12);
  border-color: var(--cyber-cyan);
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.hud-stat.hud-stat-icon .stat-icon {
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.4));
}

.hud-stat.hud-stat-icon .value {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ================= BUILD CARDS WITH THUMBNAIL & QUEUES ================= */
.build-card.compact-icon-card {
  position: relative;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  overflow: hidden;
  border-radius: 6px;
  background: #090e18;
  border: 1px solid var(--border-metal);
  transition: all 0.18s ease;
  cursor: pointer;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.7);
}

.build-card.compact-icon-card:hover {
  border-color: var(--cyber-cyan);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.45), inset 0 0 8px rgba(0, 229, 255, 0.15);
  transform: translateY(-2px);
}

.card-preview-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.08) 0%, rgba(10, 16, 26, 0.6) 100%);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.card-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.9));
  transition: transform 0.2s ease;
}

.build-card.compact-icon-card:hover .card-preview-thumb img {
  transform: scale(1.08);
}

.queue-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0b0f19;
  font-size: 13px;
  font-weight: 900;
  min-width: 22px;
  height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 11px;
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  z-index: 10;
  line-height: 1;
}

/* Unaffordable / Insufficient Funds Deactivated State */
.build-card.disabled-unaffordable {
  opacity: 0.48;
  filter: grayscale(0.65);
  cursor: not-allowed !important;
}

.build-card.disabled-unaffordable .price-mini {
  color: #ef4444 !important;
  font-weight: 800;
}

.build-card.disabled-unaffordable:hover {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
  transform: none;
}

/* ================= FLOATING TACTICAL ITEM TOOLTIP ================= */
.tactical-item-tooltip {
  position: fixed;
  z-index: 9999;
  background: rgba(10, 15, 25, 0.96);
  border: 1px solid var(--border-cyan);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85), 0 0 15px rgba(0, 229, 255, 0.25);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  padding: 12px 14px;
  width: 275px;
  pointer-events: none;
  direction: rtl;
  color: #fff;
  font-family: var(--font-family);
  animation: fadeInTooltip 0.15s ease-out;
}

@keyframes fadeInTooltip {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.tactical-item-tooltip .tt-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.25);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.tactical-item-tooltip .tt-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #060a12;
  border: 1px solid rgba(0, 229, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.tactical-item-tooltip .tt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tactical-item-tooltip .tt-title {
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  line-height: 1.3;
}

.tactical-item-tooltip .tt-cat {
  font-size: 10px;
  color: var(--cyber-cyan);
}

.tactical-item-tooltip .tt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 10px;
  font-size: 11px;
  margin-bottom: 8px;
}

.tactical-item-tooltip .tt-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tactical-item-tooltip .tt-stat-label {
  color: var(--text-muted);
}

.tactical-item-tooltip .tt-stat-val {
  font-weight: 700;
  color: #fff;
}

.tactical-item-tooltip .tt-req {
  font-size: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 6px;
}

/* Assembled Atlas Uploader & Slicer */
.checkerboard-bg {
  background-color: #0c1017;
  background-image:
    linear-gradient(45deg, #161b24 25%, transparent 25%),
    linear-gradient(-45deg, #161b24 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #161b24 75%),
    linear-gradient(-45deg, transparent 75%, #161b24 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.atlas-drop-zone {
  border: 2px dashed rgba(0, 229, 255, 0.45);
  border-radius: 8px;
  padding: 16px;
  background: rgba(0, 229, 255, 0.04);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.atlas-drop-zone:hover, .atlas-drop-zone.dragover {
  border-color: var(--amber-gold);
  background: rgba(255, 215, 0, 0.08);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.facet-slice-card {
  background: #0f141f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s;
}

.facet-slice-card:hover {
  border-color: var(--cyber-cyan);
}

/* ================= NATION FLAG & COMMANDER AVATAR ================= */
.hud-stat-nation {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.hud-stat-nation:hover {
  border-color: var(--amber-gold);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.25);
  transform: translateY(-1px);
}

.hud-avatar-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--amber-gold);
  overflow: hidden;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b101b;
  flex-shrink: 0;
}

.hud-avatar-thumb img, .hud-avatar-thumb svg, .hud-avatar-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hud-flag-thumb {
  width: 28px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #111;
}

.hud-flag-thumb img, .hud-flag-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hud-nation-details {
  display: flex;
  flex-direction: column;
  text-align: right;
  line-height: 1.15;
}

.hud-country-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--amber-gold);
  white-space: nowrap;
}

.hud-commander-title {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.flag-preview-box {
  width: 76px;
  height: 50px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  background: #090d16;
  flex-shrink: 0;
}

.flag-preview-box.large {
  width: 110px;
  height: 70px;
  border-color: var(--amber-gold);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.2);
}

.flag-preview-box canvas, .flag-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-preview-box {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--cyber-cyan);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
  background: #090d16;
  flex-shrink: 0;
}

.avatar-preview-box.large {
  width: 82px;
  height: 82px;
  border-color: var(--amber-gold);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.35);
}

.avatar-preview-box canvas, .avatar-preview-box img, .avatar-preview-box svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ================= GOOGLE AUTH & SOCIAL SIGN-IN ================= */
.btn-google-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: #ffffff;
  color: #1f2937;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 12px;
}

.btn-google-auth:hover {
  background: #f3f4f6;
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
  transform: translateY(-1px);
}

.btn-google-auth:active {
  transform: translateY(0);
}

.btn-google-auth .google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.google-auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 12px 0 16px;
  color: var(--text-muted);
  font-size: 11px;
}

.google-auth-divider::before,
.google-auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.google-auth-divider span {
  padding: 0 12px;
}

/* ================= USER SETTINGS MODAL & TABS ================= */
.hud-icon-btn.settings-btn {
  border-color: rgba(0, 229, 255, 0.5);
}

.hud-icon-btn.settings-btn:hover {
  border-color: var(--cyber-cyan);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.6);
  transform: scale(1.1);
}

.settings-nav-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  overflow-x: auto;
}

.settings-tab-btn {
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.settings-tab-btn:hover {
  background: rgba(0, 229, 255, 0.1);
  color: #fff;
  border-color: var(--cyber-cyan);
}

.settings-tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25) 0%, rgba(2, 132, 199, 0.2) 100%);
  color: #fff;
  border-color: var(--cyber-cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.settings-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.2s ease-in-out;
}

.settings-tab-pane[hidden] {
  display: none !important;
}


.negotiation-button{position:absolute;z-index:8;top:52px;left:12px;background:#bd4738;padding:10px 24px}
.recovery-status{position:absolute;z-index:8;top:52px;left:12px;background:#123d4ee8;color:#b9f5df;padding:10px;border:1px solid #61cbb5;border-radius:6px}
.economy-dialog{max-width:500px;background:#132334;color:#e3eff5;padding:25px;border:1px solid #578d9c;border-radius:12px;line-height:1.8}
.economy-dialog::backdrop{background:#0009}.economy-dialog button{padding:8px 16px;cursor:pointer}.economy-dialog a{color:#85d8db}

.wood-button{position:absolute;z-index:7;top:90px;left:12px}.wood-balance{position:absolute;z-index:7;top:130px;left:12px;color:#d4e9bc;background:#1f3327cc;padding:4px 8px}
#btnMilitaryAid{position:absolute;z-index:8;top:168px;left:12px;cursor:pointer;background:#183a4ded;border-color:#70c5d4}
#aidBadge:not(:empty){display:inline-block;min-width:18px;border-radius:12px;background:#d84c3e;color:#fff;padding:0 5px}
#militaryAidDialog select{width:100%;padding:8px;background:#1d3448;color:#e3eff5;border:1px solid #578d9c;border-radius:6px}
#btnSendAid:disabled{opacity:.55;cursor:not-allowed}

.ledger-table{width:100%;border-collapse:collapse;font-size:12px}.ledger-table td{padding:7px 4px;border-bottom:1px solid #416072}.economy-dialog{max-height:80vh;overflow:auto}
.payment-method-card{margin:16px 0;padding:16px;border:1px solid #416072;border-radius:10px;background:#193044}
.payment-method-card h3{margin:0 0 8px}.payment-method-card .form-group{margin:10px 0}
.payment-method-card input{box-sizing:border-box;width:100%;padding:10px;border:1px solid #578d9c;border-radius:6px;color:#e3eff5;background:#102437}
.payment-method-card strong[dir=ltr]{display:inline-block;letter-spacing:1px;color:#a8f0dc}
.vodafone-request-row{margin:10px 0;padding:12px;border:1px solid #416072;border-radius:8px;background:#102437;overflow-wrap:anywhere}
.vodafone-request-row p{margin:4px 0}.payment-method-card button:disabled{opacity:.6;cursor:wait}

/* Artwork covers the page; only the account form sits in a quiet dark panel. */
#modal-auth{background:#000;padding:28px clamp(20px,6vw,100px);overflow:auto;justify-content:flex-start;isolation:isolate;backdrop-filter:none}
#modal-auth .login-backdrop{position:fixed;inset:0;width:100%;height:100%;margin:0;border:0;border-radius:0;box-shadow:none;overflow:hidden;background:#000;z-index:-1;pointer-events:none}
#modal-auth .login-backdrop>img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:center}
#modal-auth .login-backdrop::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#0000000a,#00000018 50%,#00000057)}
#loginImageStage{position:absolute;inset:0;overflow:hidden}
.login-background-image{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;opacity:0;transition:opacity 1.2s ease}
.login-background-image.is-active{opacity:1}
#modal-auth .login-card{position:relative;width:min(410px,100%);max-height:calc(100dvh - 56px);overflow:auto;overscroll-behavior:contain;border:1px solid #ffffff24;background:#000000c9;border-radius:18px;box-shadow:0 22px 70px #0006;padding:28px;color:#f3f3f3;backdrop-filter:blur(10px);scrollbar-width:thin;scrollbar-color:#ffffff38 transparent}
#modal-auth .login-brand{margin-bottom:24px;text-align:center}
#modal-auth .login-brand>span{display:block;font-size:11px;font-weight:700;letter-spacing:4px;color:#bcbcbc;line-height:1.7}
#modal-auth .login-brand h1{margin:3px 0 0;font-size:30px;font-weight:800;letter-spacing:0;color:#fff;line-height:1.35;text-shadow:none}
#auth-tabs{display:flex;gap:6px;border:1px solid #ffffff1c;background:#ffffff07;border-radius:9px;padding:4px}
#auth-tabs button{flex:1;padding:10px;border:0;border-radius:6px;background:transparent;color:#a9a9a9;font-family:inherit;font-size:14px;box-shadow:none}
#auth-tabs button.active{background:#f0f0f0;color:#111;border:0;box-shadow:none}
#modal-auth .form-group{gap:7px;margin-bottom:16px}
#modal-auth .form-group label{font-size:12px;color:#d5d5d5}
#modal-auth .form-group input,#modal-auth .form-group select{width:100%;min-width:0;padding:12px;border-radius:8px;background:#111111d9;border:1px solid #ffffff24;color:#f0f0f0;font-size:14px}
#modal-auth .form-group input::placeholder{color:#717171;opacity:1}
#modal-auth .form-group input:focus,#modal-auth .form-group select:focus{border-color:#ffffff9c;outline:2px solid #ffffff19;box-shadow:none}
#modal-auth .google-auth-divider{margin:13px 0;color:#888;font-size:12px}
#modal-auth .google-auth-divider::before,#modal-auth .google-auth-divider::after{background:#ffffff1c}
#modal-auth .btn-google-auth{margin:0;background:#fff;color:#171717;box-shadow:none;border:1px solid #fff;border-radius:8px;padding:11px;min-height:43px;font-size:14px}
#modal-auth .btn-google-auth:disabled{opacity:.45}
#modal-auth .btn-google-auth:not(:disabled):hover{background:#eaeaea;border-color:#eaeaea;box-shadow:none}
#modal-auth .btn-row{margin-top:18px}
#modal-auth .btn-primary{width:100%;padding:12px;border-radius:8px;background:#f0f0f0;border:1px solid #f0f0f0;color:#111;box-shadow:none;font-size:15px}
#modal-auth .btn-primary:hover{background:#fff;border-color:#fff;box-shadow:none;transform:none}
#modal-auth .auth-link-button{display:block;margin:14px auto 0;padding:4px 0;font-size:12px;color:#bababa;text-align:center}
#modal-auth .auth-link-button:hover{color:#fff}
#modal-auth .auth-status{background:#181818e6;border-color:#ffffff32;color:#eee;font-size:12px;padding:10px 12px}
#modal-auth .auth-status[data-state="error"]{background:#30181bcc;border-color:#a75050;color:#ffd7d7}
#modal-auth .auth-retry{background:#171717;color:#eee;border-color:#ffffff40;font-size:12px}
#modal-auth h3{font-size:19px;font-weight:700;margin:22px 0 8px;color:#fff}
#modal-auth #form-forgot p,#modal-auth #form-password-reset p{color:#999;font-size:12px;line-height:1.7;margin:0 0 20px}
#modal-auth #form-register>.form-group:has(#reg-flag-preview),#modal-auth #form-register>.form-group:has(#reg-avatar-preview){background:#111111a6!important;border-color:#ffffff24!important}
#modal-auth #form-register>.form-group:has(#reg-flag-preview)>label,#modal-auth #form-register>.form-group:has(#reg-avatar-preview)>label{color:#d5d5d5!important}
#modal-auth #form-register .btn-hud{color:#ddd;background:#1c1c1c;border-color:#ffffff32;box-shadow:none}
.auth-link-button{background:transparent;border:0;color:#9bd7cb;text-decoration:underline;text-underline-offset:4px;cursor:pointer;font-family:inherit;padding:10px 0}

/* Native tactical cursors: one dataset change, no frame-by-frame DOM follower. */
:root {
  --cursor-default: url('../images/cursors/default.svg') 4 3, default;
  --cursor-select: url('../images/cursors/select.svg') 4 3, pointer;
  --cursor-selected: url('../images/cursors/selected.svg') 4 3, pointer;
  --cursor-attack: url('../images/cursors/attack.svg') 16 16, crosshair;
  --cursor-move: url('../images/cursors/move.svg') 4 3, crosshair;
  --cursor-blocked: url('../images/cursors/blocked.svg') 4 3, not-allowed;
  --cursor-build: url('../images/cursors/build.svg') 4 3, crosshair;
  --cursor-repair: url('../images/cursors/repair.svg') 4 3, crosshair;
  --cursor-sell: url('../images/cursors/sell.svg') 4 3, pointer;
  --cursor-gather: url('../images/cursors/gather.svg') 4 3, pointer;
  --cursor-inspect: url('../images/cursors/inspect.svg') 4 3, help;
  --cursor-drag: url('../images/cursors/drag.svg') 16 16, crosshair;
  --cursor-pan: url('../images/cursors/pan.svg') 16 16, grab;
  --cursor-pan-active: url('../images/cursors/pan-active.svg') 16 16, grabbing;
}
body, #canvas-wrap { cursor: var(--cursor-default); }
#gameCanvas { cursor: var(--cursor-default); }
#gameCanvas[data-cursor="default"] { cursor: var(--cursor-default); }
#gameCanvas[data-cursor="select"] { cursor: var(--cursor-select); }
#gameCanvas[data-cursor="selected"] { cursor: var(--cursor-selected); }
#gameCanvas[data-cursor="attack"] { cursor: var(--cursor-attack); }
#gameCanvas[data-cursor="move"] { cursor: var(--cursor-move); }
#gameCanvas[data-cursor="blocked"] { cursor: var(--cursor-blocked); }
#gameCanvas[data-cursor="build"] { cursor: var(--cursor-build); }
#gameCanvas[data-cursor="repair"] { cursor: var(--cursor-repair); }
#gameCanvas[data-cursor="sell"] { cursor: var(--cursor-sell); }
#gameCanvas[data-cursor="gather"] { cursor: var(--cursor-gather); }
#gameCanvas[data-cursor="inspect"] { cursor: var(--cursor-inspect); }
#gameCanvas[data-cursor="drag"] { cursor: var(--cursor-drag); }
#gameCanvas[data-cursor="pan"], #gameCanvas[data-cursor="grab"] { cursor: var(--cursor-pan); }
#gameCanvas[data-cursor="pan-active"], #gameCanvas[data-cursor="grabbing"] { cursor: var(--cursor-pan-active); }
input:not([type]), input:is([type="text"], [type="password"], [type="email"], [type="number"], [type="search"], [type="url"], [type="tel"]), textarea, [contenteditable="true"] { cursor: text; }

#cursor-hint {
  --cursor-hint-accent: #b3c7d4;
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 6;
  max-width: min(320px, calc(100% - 32px));
  padding: 8px 13px;
  border: 1px solid color-mix(in srgb, var(--cursor-hint-accent) 55%, transparent);
  border-radius: 10px;
  background: #081522ed;
  color: var(--cursor-hint-accent);
  box-shadow: 0 3px 14px #0006;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  text-align: right;
  pointer-events: none;
  user-select: none;
}
#cursor-hint[hidden] { display: none; }
#cursor-hint[data-state="blocked"], #cursor-hint[data-state="attack"] { --cursor-hint-accent: #ff97a3; }
#cursor-hint[data-state="build"], #cursor-hint[data-state="gather"] { --cursor-hint-accent: #9af6bd; }
#cursor-hint[data-state="select"], #cursor-hint[data-state="drag"] { --cursor-hint-accent: #8cebd6; }
#cursor-hint[data-state="selected"], #cursor-hint[data-state="sell"] { --cursor-hint-accent: #ffe18b; }
#cursor-hint[data-state="move"], #cursor-hint[data-state="repair"] { --cursor-hint-accent: #a2e7fb; }
@media (max-width: 640px) {
  #cursor-hint { left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 6px 10px; font-size: 11px; }
}
#form-forgot p,#form-password-reset p{color:#bed0d8;line-height:1.8}#settings-save-status{line-height:1.8;padding:10px;border-radius:8px;background:#152e3d}
@media(max-width:600px){#modal-auth{padding:16px;justify-content:center}#modal-auth .login-card{width:min(410px,100%);max-height:calc(100dvh - 32px);padding:24px 20px;border-radius:14px;background:#000000d1}#modal-auth .login-brand{margin-bottom:20px}#modal-auth .login-brand h1{font-size:27px}#modal-auth .login-backdrop::after{background:#00000028}}
@media(prefers-reduced-motion:reduce){.login-background-image{transition:none}}

/* ================= MOBILE & TOUCH ADAPTIVE SYSTEM (ARMAGEDDON هيرمجدون) ================= */

/* Default desktop state for mobile tactical bar and backdrop */
.mobile-tactical-bar {
  display: none !important;
}

.sidebar-backdrop {
  display: none;
}

/* Base enhancements for touch & mobile usability */
#canvas-wrap {
  touch-action: none;
  -webkit-touch-callout: none;
}

/* Responsive breakpoint for Tablets and Mobile devices */
@media (max-width: 860px) {
  /* Top Tactical HUD on Mobile: Horizontal scrollable strip */
  #hud-top {
    height: 50px;
    padding: 0 8px;
    border-bottom: 1.5px solid var(--border-cyan);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #hud-top::-webkit-scrollbar {
    display: none;
  }

  .hud-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: max-content;
    padding: 2px 0;
  }

  .hud-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 6px;
  }
  .hud-icon-btn .btn-icon {
    font-size: 18px;
  }

  .hud-icon-stat {
    height: 38px;
    padding: 0 8px;
    border-radius: 6px;
    gap: 5px;
    font-size: 12px;
  }
  .hud-icon-stat .stat-icon {
    font-size: 16px;
  }
  .hud-icon-stat .stat-val {
    font-size: 12px;
  }
  .power-bar-wrap {
    width: 36px;
    height: 6px;
  }

  /* Red Alert Sidebar: Tactical slide-over drawer */
  #sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 300;
    width: min(320px, 86vw);
    max-width: 100vw;
    background: linear-gradient(180deg, #182435 0%, #0c121d 100%);
    border-left: 2px solid #d4af37;
    border-right: none;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.9);
    transform: translateX(105%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex !important;
    overflow-y: auto;
  }

  #sidebar.mobile-open {
    transform: translateX(0);
  }

  #sidebar.collapsed {
    transform: translateX(105%) !important;
    display: flex !important;
  }

  /* Backdrop Overlay for mobile drawer */
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
    z-index: 295;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Floating desktop sidebar expand button hidden on mobile in favor of tactical bar */
  .btn-sidebar-floating-expand {
    display: none !important;
  }

  /* Desktop zoom bar hidden on mobile in favor of dock zoom controls */
  .tactical-zoom-bar {
    display: none !important;
  }

  /* Mobile Tactical Dock: Sleek floating glassmorphism control bar */
  .mobile-tactical-bar {
    display: flex !important;
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 55;
    align-items: center;
    gap: 6px;
    max-width: calc(100vw - 16px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 6px 10px;
    background: rgba(10, 18, 30, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid var(--border-cyan);
    border-radius: 35px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85), var(--glow-cyan);
    user-select: none;
  }
  .mobile-tactical-bar::-webkit-scrollbar {
    display: none;
  }

  .btn-mob-tac {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 44px;
    min-width: 46px;
    padding: 2px 8px;
    border-radius: 18px;
    background: rgba(22, 34, 54, 0.9);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #f0f6fc;
    font-family: var(--font-family);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
  }

  .btn-mob-tac:active {
    transform: scale(0.94);
  }

  .btn-mob-tac .mob-tac-icon {
    font-size: 17px;
    line-height: 1;
  }

  .btn-mob-tac .mob-tac-label {
    font-size: 9.5px;
    letter-spacing: -0.2px;
    white-space: nowrap;
  }

  .btn-mob-tac.active {
    background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
    border-color: var(--cyber-cyan);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
    color: #fff;
  }

  .btn-mob-tac.btn-mob-build {
    background: linear-gradient(180deg, rgba(202, 138, 4, 0.4) 0%, rgba(161, 98, 7, 0.5) 100%);
    border-color: var(--amber-gold);
    color: #fef08a;
  }
  .btn-mob-tac.btn-mob-build:active {
    background: linear-gradient(180deg, #ca8a04 0%, #a16207 100%);
  }

  .btn-mob-tac.btn-mob-cancel {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
  }

  .mob-tac-zoom-group {
    display: flex;
    gap: 3px;
    align-items: center;
  }

  .btn-mob-tac.btn-mob-mini {
    min-width: 32px;
    height: 44px;
    font-size: 17px;
    font-weight: 900;
    padding: 0 4px;
  }

  /* Unit Tactical Action Bar floating nicely above the mobile bar */
  .tactical-actions-bar {
    bottom: 68px;
    padding: 6px 12px;
    max-width: 92vw;
    overflow-x: auto;
    font-size: 11px;
  }

  /* Stack Wood, Aid & 3D render mode buttons neatly on top-left */
  .render-mode-button {
    top: 8px;
    left: 8px;
    font-size: 10px;
    padding: 4px 8px;
  }
  .wood-button {
    top: 40px;
    left: 8px;
    font-size: 10px;
    padding: 4px 8px;
  }
  .wood-balance {
    top: 72px;
    left: 8px;
    font-size: 10px;
    padding: 2px 6px;
  }
  #btnMilitaryAid {
    top: 98px;
    left: 8px;
    font-size: 10px;
    padding: 4px 8px;
  }

  /* Battle alert banner */
  #battle-alert {
    top: 8px;
    font-size: 12px;
    padding: 6px 14px;
    max-width: 90vw;
  }

  /* Touch optimizations for modals and dialogs */
  .modal-card {
    width: min(96vw, 540px);
    max-height: 88vh;
    padding: 16px;
  }
  .modal-card.wide {
    width: min(96vw, 540px);
  }

  .economy-dialog {
    width: min(96vw, 480px);
    max-height: 84vh;
    padding: 16px;
    margin: auto;
  }

  /* Prevent auto zoom on iOS input focus */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Radar monitor inside mobile sidebar */
  .radar-box {
    padding: 6px 8px;
  }
  .radar-screen {
    max-height: 170px;
  }
  #radarCanvas {
    max-height: 170px;
    width: 100% !important;
    height: auto !important;
  }

  /* Touch hint hidden on pure touch devices */
  @media (hover: none) {
    #cursor-hint {
      display: none !important;
    }
  }
}

/* ==========================================================================
   ADMIN STICKY FLOATING BANNER (معلق بالأسفل لحين الضغط على تم العلم)
   ========================================================================== */
.admin-sticky-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  width: calc(100% - 32px);
  max-width: 860px;
  animation: adminBannerSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(245, 158, 11, 0.4);
}

@keyframes adminBannerSlideUp {
  from { opacity: 0; transform: translate(-50%, 60px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.admin-sticky-banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(26, 21, 14, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 14px 18px;
  backdrop-filter: blur(12px);
  color: #fff;
}

.admin-sticky-banner-icon {
  font-size: 32px;
  line-height: 1;
  animation: adminIconPulse 1.5s infinite;
  flex-shrink: 0;
}

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

.admin-sticky-banner-text-box {
  flex: 1;
  min-width: 0;
}

.admin-sticky-banner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #f59e0b;
  margin-bottom: 4px;
}

.admin-sticky-banner-badge {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fcd34d;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
}

.admin-sticky-banner-body {
  font-size: 13.5px;
  line-height: 1.45;
  color: #f1f5f9;
  font-weight: 500;
  word-break: break-word;
}

.admin-banner-ack-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border: 1px solid #34d399 !important;
  color: #fff !important;
  font-weight: 800 !important;
  padding: 10px 18px !important;
  font-size: 14px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
  transition: all 0.2s ease !important;
}

.admin-banner-ack-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.6) !important;
}

/* ==========================================================================
   ADMIN USERS MANAGEMENT STYLES
   ========================================================================== */
.admin-users-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}

.admin-users-header-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: #11141c;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}

.admin-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1e2433;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.admin-stat-pill strong {
  color: var(--amber-gold);
  font-family: monospace;
  font-size: 13px;
}

.admin-users-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-search-input {
  background: #090c13;
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  min-width: 200px;
}

.admin-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 230px);
  padding-bottom: 20px;
}

.admin-user-card {
  background: #131722;
  border: 1px solid #1e2638;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
  position: relative;
}

.admin-user-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.admin-user-card.is-banned {
  border-color: #ef4444;
  background: #181114;
}

.admin-user-card.is-occupied {
  border-color: #f59e0b;
  background: #181510;
}

.admin-user-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-user-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-flag-icon {
  width: 38px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

.admin-user-name-box {
  display: flex;
  flex-direction: column;
}

.admin-user-country-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-user-handle {
  font-size: 12px;
  color: var(--text-muted);
}

.admin-user-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.admin-stars-display {
  color: #facc15;
  font-size: 14px;
  letter-spacing: 2px;
}

.admin-badges-pill-preview {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  background: #1e2433;
  padding: 2px 6px;
  border-radius: 4px;
}

.admin-user-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #0c0f17;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
}

.admin-user-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  border-top: 1px solid #1e2638;
  padding-top: 8px;
}

.btn-admin-action {
  background: #1e2638;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn-admin-action:hover {
  background: #2a3449;
  border-color: #38bdf8;
  color: #fff;
}

.btn-admin-action.highlight-liberate {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(220, 38, 38, 0.3) 100%);
  border-color: #f59e0b;
  color: #fde68a;
  font-weight: 700;
}

.btn-admin-action.danger {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-admin-action.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

.btn-admin-action.success {
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
}

/* ==========================================================================
   20 BADGES COLLECTION SELECTOR & GRID
   ========================================================================== */
.badges-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
}

.badge-card-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #11141c;
  border: 1px solid #1e2638;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  position: relative;
}

.badge-card-item:hover {
  background: #1a2030;
  border-color: #38bdf8;
}

.badge-card-item.selected {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.badge-card-icon {
  font-size: 26px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #1e2433;
}

.badge-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.badge-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-card-tier {
  font-size: 10px;
  color: var(--amber-gold);
}

/* Stars Picker Control */
.stars-picker-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  cursor: pointer;
}

.star-picker-unit {
  color: #475569;
  transition: transform 0.15s, color 0.15s;
}

.star-picker-unit.active {
  color: #facc15;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}

.star-picker-unit:hover {
  transform: scale(1.25);
}

/* Administrative country profiles and acknowledgements. */
.admin-people-panel { padding: 6px; color: #e4edf5; }
.admin-people-panel > h3 { margin: 0 0 12px; color: #e9c978; }
.admin-people-status { min-height: 22px; color: #8ee4d1; font-size: 13px; }
.admin-people-count { color: #97afbf; font-size: 12px; margin: 9px 0; }
.admin-people-list { display: grid; gap: 7px; margin: 12px 0; }
.admin-people-list .admin-people-user { display: flex; gap: 10px; align-items: center; width: 100%; text-align: right; background: #101f2b; border: 1px solid #29414e; border-radius: 9px; padding: 10px; }
.admin-people-list .admin-people-user:hover, .admin-people-list .admin-people-user.active { background: #18333c; border-color: #d3b263; }
.admin-people-flag { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; font-size: 32px; background: #09151f; border: 1px solid; border-radius: 50%; }
.admin-people-user-names { display: grid; gap: 4px; flex: 1; min-width: 0; }
.admin-people-user-names strong, .admin-people-user-names small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-people-user-names small, .admin-people-state { color: #91aebd; font-size: 11px; }
.admin-people-section { margin: 16px 0; padding: 16px; border: 1px solid #2a404d; border-radius: 10px; background: #101d28; }
.admin-people-section h4 { margin: 0 0 15px; color: #e9c978; }
.admin-people-section > .btn-hud { margin-top: 12px; }
.admin-people-profile-heading { display: flex; align-items: center; gap: 13px; }
.admin-people-profile-heading h3 { margin: 0; }
.admin-people-profile-heading p { margin: 6px 0; font-size: 13px; color: #9bb6c6; }
.admin-people-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 9px; }
.admin-people-details > div { background: #0a1520; padding: 10px; border-radius: 6px; }
.admin-people-details dt { color: #89a2b3; font-size: 11px; }
.admin-people-details dd { margin: 6px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.admin-people-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.admin-people-field { display: grid; gap: 7px; font-size: 12px; color: #aac1cf; margin: 8px 0; }
.admin-people-field input, .admin-people-field select, .admin-people-field textarea { min-width: 0; width: 100%; box-sizing: border-box; background: #08141e; border: 1px solid #38515e; border-radius: 6px; padding: 10px; color: #edf6fc; font: inherit; }
.admin-people-field textarea { resize: vertical; min-height: 78px; }
.admin-people-check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 15px; }
.admin-people-check-grid label, .admin-people-confirm { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.admin-people-check-grid input, .admin-people-confirm input, .admin-people-medal input { accent-color: #d5b462; }
.admin-people-badges { display: grid; grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); gap: 8px; margin-top: 15px; }
.admin-people-medal { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid #2c404d; border-radius: 8px; background: #091822; font-size: 12px; }
.admin-people-medal:has(input:checked) { border-color: #ddbd65; background: #253129; }
.admin-people-medal-icon { display: grid; place-items: center; width: 38px; height: 46px; flex-shrink: 0; font-size: 26px; border-radius: 4px 4px 16px 16px; box-shadow: inset 0 -5px 0 #0004; }
.admin-people-medal strong { display: block; font-weight: 600; }
.admin-people-medal small, .admin-people-hint { display: block; color: #8fa7b7; font-size: 11px; margin-top: 5px; }
.admin-people-awarded { display: flex; flex-wrap: wrap; gap: 7px; font-size: 12px; }
.admin-people-awarded span { background: #273524; color: #e4ce8b; border: 1px solid #817149; border-radius: 6px; padding: 7px; }
.player-admin-notice { position: fixed; inset-inline: 24px; bottom: 12px; z-index: 9000; display: flex; align-items: center; gap: 14px; padding: 15px 18px; background: #102733f5; border: 1px solid #d3b164; border-radius: 12px; color: #e9f3f9; box-shadow: 0 9px 35px #0009; }
.player-admin-notice[hidden] { display: none !important; }
.player-admin-notice-icon { font-size: 28px; color: #e7c980; }
.player-admin-notice-content { flex: 1; min-width: 0; }
.player-admin-notice-content strong { color: #e5c87c; font-size: 12px; }
#playerAdminNoticeCount { font-size: 10px; margin-inline-start: 9px; color: #a6c3d5; }
.player-admin-notice-content p { margin: 6px 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow-y: auto; }
.player-admin-notice-content small { color: #efb08f; }
.player-admin-notice button { flex-shrink: 0; border: 1px solid #dec178; background: #dac17c; border-radius: 7px; padding: 11px 18px; color: #16232e; font: inherit; font-weight: 700; }
.player-admin-notice button:disabled { opacity: .6; }
@media (max-width: 600px) {
  .player-admin-notice { inset-inline: 8px; bottom: 8px; padding: 10px; gap: 10px; }
  .player-admin-notice-icon { display: none; }
  .player-admin-notice button { padding: 10px; }
  .admin-people-section { padding: 12px; }
  .admin-people-badges { grid-template-columns: minmax(0, 1fr); }
}

/* Medal catalog and paged administrative users. */
.admin-sidebar[data-content="medals"] .admin-side-navigation { max-height: 50%; }
.admin-medal-list-hint { color: #9eb9c8; font-size: 12px; margin: 4px 0 12px; }
.admin-medal-list { display: grid; gap: 7px; }
.admin-medal-list .admin-medal-list-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px; text-align: right; border: 1px solid #304856; border-radius: 8px; background: #10202b; color: #e6f1f7; }
.admin-medal-list-item:hover, .admin-medal-list .admin-medal-list-item.active { background: #263a32; border-color: #ddbd68; }
.admin-medal-list-item > span:last-child { display: grid; gap: 5px; min-width: 0; }
.admin-medal-list-item strong { font-size: 12px; font-weight: 600; }
.admin-medal-list-item small { color: #a7bdc7; font-size: 10px; }
.admin-medal-thumbnail, .admin-medal-default-icon { width: 42px; height: 42px; border-radius: 9px; object-fit: contain; flex-shrink: 0; background: #08151e; }
.admin-medal-default-icon { display: grid; place-items: center; font-size: 29px; }
.admin-medal-editor { padding: 8px; max-width: 880px; color: #deebf3; }
.admin-medal-editor > h3 { margin: 0 0 12px; color: #e7c779; }
.admin-medal-status { min-height: 24px; color: #96dbc9; font-size: 13px; }
.admin-medal-preview { display: flex; gap: 17px; align-items: center; padding: 16px; border: 1px solid #3c5260; border-radius: 12px; margin: 17px 0; background: #11212b; }
.admin-medal-preview .admin-medal-thumbnail, .admin-medal-preview .admin-medal-default-icon { width: 80px; height: 80px; font-size: 52px; }
.admin-medal-preview h3 { margin: 0 0 8px; color: #f0d38c; font-size: 16px; }
.admin-medal-preview p { margin: 0; color: #a8c0ce; line-height: 1.7; font-size: 12px; overflow-wrap: anywhere; }
.admin-medal-field { display: grid; gap: 7px; color: #b9cdda; font-size: 12px; margin: 14px 0; }
.admin-medal-field input, .admin-medal-field textarea, .admin-medal-field select { width: 100%; min-width: 0; box-sizing: border-box; color: #edf4f9; background: #0a1720; border: 1px solid #3a5363; border-radius: 7px; padding: 11px; font: inherit; }
.admin-medal-field textarea { min-height: 90px; resize: vertical; }
.admin-medal-field input:focus, .admin-medal-field textarea:focus, .admin-medal-field select:focus { outline: 2px solid #92d8c9; outline-offset: 2px; }
.admin-medal-fields-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.admin-medal-note { font-size: 12px; line-height: 1.8; color: #a8bbc6; margin: 18px 0; }
.admin-people-table-wrap { width: 100%; overflow-x: auto; border: 1px solid #314c5d; border-radius: 11px; }
.admin-people-table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 12px; text-align: right; }
.admin-people-table th { background: #203849; color: #c3d9e5; padding: 12px 10px; font-weight: 600; white-space: nowrap; }
.admin-people-table td { border-top: 1px solid #294453; padding: 10px; color: #cbdce6; vertical-align: middle; }
.admin-people-table tbody tr { background: #0e202c; }
.admin-people-table tbody tr:nth-child(even) { background: #122836; }
.admin-people-table tbody tr:hover { background: #1e3744; }
.admin-people-table .admin-people-flag { display: inline-grid; width: 31px; height: 31px; font-size: 22px; vertical-align: middle; margin-inline-end: 8px; }
.admin-people-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-people-row-actions button { padding: 6px 10px; white-space: nowrap; font-size: 11px; }
.admin-people-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 15px 0; font-size: 12px; color: #abc7d7; }
.admin-people-pagination button { padding: 7px 12px; }
.admin-people-pagination-buttons { display: flex; align-items: center; gap: 7px; }
.admin-people-detail-nav { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.admin-people-delete-confirm { border: 1px solid #c37070; border-radius: 9px; padding: 16px; margin: 15px 0; background: #382229; color: #f2c4c4; font-size: 12px; line-height: 1.8; }
.admin-people-delete-confirm h4 { color: #ffd0c9; margin: 0 0 10px; }
.admin-people-delete-confirm .admin-people-field input { border-color: #a15f65; }
.admin-people-delete-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.admin-people-danger { border-color: #b96169 !important; color: #ffc5c8 !important; background: #512733 !important; }
.admin-people-medal-progress { display: grid; gap: 6px; min-width: 0; }
.admin-people-medal-progress progress { width: 100%; height: 6px; accent-color: #e1bd64; border-radius: 9px; }
.admin-people-medal-state { color: #a4cfbb; }
@media (max-width: 680px) {
  .admin-medal-fields-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .admin-medal-preview { align-items: flex-start; padding: 12px; gap: 10px; }
  .admin-medal-preview .admin-medal-thumbnail, .admin-medal-preview .admin-medal-default-icon { width: 58px; height: 58px; font-size: 39px; }
  .admin-sidebar[data-content="medals"] .admin-side-navigation { max-height: 115px; min-height: 75px; flex-shrink: 0; }
  .admin-people-pagination { align-items: stretch; }
}


