/**
 * BlazeCraft: Warcraft III Frozen Throne Style
 * RTS Agent Console for Blaze Sports Intel
 *
 * Design: Beveled metal/stone panels, gold accents, classic RTS aesthetic
 */

/* Fonts: Cinzel for headings (Warcraft feel), Inter for body */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800&display=swap');

:root {
  /* BSI Core Palette */
  --bg: #0D0D0D;
  --bg2: #080808;
  --panel: #1A1A1A;
  --panel-dark: #0D0D0D;
  --panel-light: #242424;

  /* Borders & Bevels */
  --border: #2a313b;
  --border-light: #3d4654;
  --border-dark: #1a1f28;
  --bevel-highlight: rgba(255, 255, 255, 0.12);
  --bevel-shadow: rgba(0, 0, 0, 0.65);

  /* BSI Brand Colors */
  --accent: #BF5700;
  --accent-light: #FF6B35;
  --accent-dark: #8B4513;

  /* Gold/Brass (Warcraft UI) */
  --gold: #C9A227;
  --gold-light: #E8C84A;
  --gold-dark: #9A7B1C;

  /* Text */
  --text: rgba(244, 244, 247, 0.94);
  --text-muted: rgba(244, 244, 247, 0.68);
  --text-faint: rgba(244, 244, 247, 0.45);

  /* Status Colors */
  /* ===========================================
     BSI Core Design Tokens (aligned with BlazeSportsIntel.com)
     =========================================== */
  --bsi-burnt-orange: #BF5700;
  --bsi-texas-soil: #8B4513;
  --bsi-charcoal: #1A1A1A;
  --bsi-midnight: #0D0D0D;
  --bsi-ember: #FF6B35;

  /* BSI Text Hierarchy */
  --bsi-text-primary: #FAFAFA;
  --bsi-text-secondary: #A3A3A3;
  --bsi-text-tertiary: #737373;
  --bsi-text-muted: #525252;

  /* ===========================================
     BlazeCraft Theme (WC3-inspired)
     =========================================== */
  --bg: #0b0b0f;
  --bg2: #070709;
  --panel: rgba(16, 16, 22, 0.72);
  --panel2: rgba(20, 20, 28, 0.84);
  --border: rgba(255, 255, 255, 0.08);
  --border2: rgba(255, 255, 255, 0.14);
  --text: rgba(244, 244, 247, 0.92);
  --muted: rgba(244, 244, 247, 0.68);
  --faint: rgba(244, 244, 247, 0.52);

  /* Accent colors - BSI-aligned */
  --accent: var(--bsi-ember);
  --accent2: #FFB17A;
  --good: #37d67a;
  --warn: #f7c948;
  --bad: #ff4d4d;

  /* Shadows */
  --shadow: rgba(0, 0, 0, 0.65);
  --shadow-deep: rgba(0, 0, 0, 0.85);

  /* Fonts */
  --font-display: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-body: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Radii */
  --r: 8px;
  --r2: 12px;
  --r3: 16px;
  --font: 'Plus Jakarta Sans', Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --r: 14px;
  --r2: 18px;

  /* ===========================================
     WC3: Frozen Throne Authentic UI Palette
     =========================================== */

  /* Primary Metals - The WC3 Chrome */
  --wc3-gold: #D4AF37;
  --wc3-gold-light: #FFD700;
  --wc3-gold-bright: #FFEC8B;
  --wc3-gold-dark: #B8860B;
  --wc3-gold-deep: #8B6914;
  --wc3-bronze: #CD7F32;
  --wc3-bronze-dark: #8B4513;
  --wc3-copper: #B87333;
  --wc3-iron: #71706E;
  --wc3-iron-dark: #4A4A4A;
  --wc3-steel: #71797E;

  /* Stone & Surface */
  --wc3-stone: #2D2926;
  --wc3-stone-light: #3D3A36;
  --wc3-stone-dark: #1A1816;
  --wc3-stone-warm: #35302B;
  --wc3-obsidian: #0D0C0B;
  --wc3-slate: #2F3640;

  /* Parchment & Leather */
  --wc3-parchment: #F5E6D3;
  --wc3-parchment-dark: #E8D4B8;
  --wc3-parchment-aged: #D4BC94;
  --wc3-leather: #6B4423;
  --wc3-leather-dark: #3D2817;

  /* Faction Colors */
  --wc3-alliance-blue: #1E3A5F;
  --wc3-alliance-gold: #FFD700;
  --wc3-horde-red: #8B0000;
  --wc3-horde-black: #1A0A0A;
  --wc3-undead-purple: #4A235A;
  --wc3-undead-green: #39FF14;
  --wc3-nightelf-purple: #2D1B69;
  --wc3-nightelf-silver: #C0C0C0;

  /* Magical Effects */
  --wc3-magic-blue: #00BFFF;
  --wc3-magic-gold: #FFD700;
  --wc3-magic-green: #39FF14;
  --wc3-magic-purple: #BF00FF;
  --wc3-frost: #87CEEB;
  --wc3-fire: #FF4500;
  --wc3-holy: #FFFACD;
  --wc3-shadow: #483D8B;
  --wc3-arcane: #9370DB;

  /* UI Chrome */
  --wc3-frame-outer: #1A1614;
  --wc3-frame-inner: #2D2825;
  --wc3-frame-highlight: var(--wc3-gold);
  --wc3-frame-shadow: #0A0908;
  --wc3-bevel-light: rgba(255, 255, 255, 0.15);
  --wc3-bevel-dark: rgba(0, 0, 0, 0.6);

  /* Glow Effects */
  --wc3-glow-gold: 0 0 10px rgba(212, 175, 55, 0.5), 0 0 20px rgba(212, 175, 55, 0.3);
  --wc3-glow-blue: 0 0 10px rgba(0, 191, 255, 0.5), 0 0 20px rgba(0, 191, 255, 0.3);
  --wc3-glow-magic: 0 0 15px rgba(0, 191, 255, 0.6), 0 0 30px rgba(212, 175, 55, 0.4);

  /* Typography */
  --font-display: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
  --font-decorative: 'Cinzel Decorative', 'Cinzel', serif;
  --font-body: 'Lora', Georgia, serif;
  --font-runes: 'MedievalSharp', 'Uncial Antiqua', serif;
}

* { box-sizing: border-box; }

/* ===========================================
   BSI Film Grain Overlay (3.5% opacity)
   =========================================== */
.bsi-grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  mix-blend-mode: overlay;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .bsi-grain-overlay {
    display: none;
  }
}

/* Toggle class for disabling grain */
.bsi-grain-disabled .bsi-grain-overlay {
  display: none;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font-body);
  padding-top: 32px; /* ecosystem bar height */
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

/* Dark stone/metal background texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    /* Subtle vignette */
    radial-gradient(ellipse 100% 100% at 50% 50%, transparent 30%, rgba(0,0,0,0.5) 100%),
    /* Orange glow top-left (BSI brand) */
    radial-gradient(800px 600px at 10% 5%, rgba(191, 87, 0, 0.15), transparent 50%),
    /* Gold glow accent */
    radial-gradient(600px 500px at 90% 20%, rgba(201, 162, 39, 0.08), transparent 55%),
    /* Base gradient */
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  z-index: -1;
}

/* No noise overlay - BSI brand: clean, no visual noise */

/* ============================================
   LAYOUT: Warcraft III Style Grid
   ============================================ */

/* Layout - WC3 Classic Style */
#app {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr 380px;
  grid-template-rows: 56px 1fr 220px;
  gap: 8px;
  padding: 8px;
  grid-template-columns: 1fr;
  grid-template-rows: 48px 1fr 260px;
  gap: 0;
  padding: 0;
}

/* ============================================
   PANELS: Beveled Metal/Stone Style
   ============================================ */

.panel {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: var(--r2);

  /* Multi-layer bevel effect */
  box-shadow:
    /* Outer shadow (depth) */
    0 4px 12px var(--shadow),
    0 8px 24px var(--shadow-deep),
    /* Inner highlight (top-left bevel) */
    inset 1px 1px 0 var(--bevel-highlight),
    /* Inner shadow (bottom-right bevel) */
    inset -1px -1px 0 var(--bevel-shadow);

  background: linear-gradient(180deg, var(--wc3-stone-light) 0%, var(--wc3-stone) 4%, var(--wc3-stone-dark) 100%);
  border: 3px solid var(--wc3-bronze);
  border-top-color: var(--wc3-gold);
  border-left-color: var(--wc3-gold-dark);
  border-radius: 2px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.08),
    inset 0 -2px 0 rgba(0,0,0,0.5),
    0 8px 24px rgba(0,0,0,0.6);
  overflow: hidden;
}

/* Inner panel glow/gradient */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    /* Top highlight strip */
    linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 20%),
    /* Subtle radial glow */
    radial-gradient(ellipse 80% 50% at 30% 10%, rgba(255,255,255,0.04), transparent 60%);
  border-radius: inherit;
}

/* No panel texture - BSI brand: clean surfaces */

/* Panel titles with gold accent */
.panel-title {
  position: relative;
  z-index: 1;
  padding: 10px 14px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);

  background:
    linear-gradient(180deg, rgba(201,162,39,0.12) 0%, rgba(0,0,0,0.25) 100%);
  border-bottom: 1px solid var(--border);

  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wc3-gold);
  text-shadow: 0 2px 4px rgba(0,0,0,0.85);
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(218,165,32,0.18) 0%, rgba(0,0,0,0.35) 100%);
  border-bottom: 2px solid var(--wc3-bronze);
}

/* Gold underline accent */
.panel-title::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold) 0%, transparent 70%);
  opacity: 0.6;
}

/* ============================================
   DATA SYNC PANEL
   ============================================ */

.data-sync {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15, 17, 24, 0.85), rgba(10, 12, 18, 0.7));
  font-size: 12px;
  display: grid;
  gap: 10px;
}

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

.data-sync-title {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.data-sync-status {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.data-sync-status.connected {
  color: var(--good);
  border-color: rgba(55, 214, 122, 0.5);
}

.data-sync-status.degraded {
  color: var(--warn);
  border-color: rgba(247, 201, 72, 0.5);
}

.data-sync-status.offline {
  color: var(--bad);
  border-color: rgba(255, 77, 77, 0.5);
}

.data-sync-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  color: var(--text-muted);
}

.data-sync-meta .label {
  display: inline-block;
  width: 70px;
  color: var(--text-faint);
}

.data-sync-message {
  font-size: 11px;
  color: var(--text-faint);
  padding: 4px 0 2px;
}

.data-sync-leaderboard .label {
  color: var(--text-faint);
  display: block;
  margin-bottom: 6px;
}

.data-sync-list {
  display: grid;
  gap: 4px;
  color: var(--text);
  font-size: 11px;
}

/* ============================================
   FOCUS STATES
   ============================================ */

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============================================
   TOP BAR: Resource Display
   ============================================ */

/* Focus - Enhanced keyboard navigation */
:focus-visible {
  outline: 2px solid rgba(232, 108, 44, 0.85);
  outline-offset: 2px;
  border-radius: 4px;
}

.wc3-cmd:focus-visible,
.wc3-minimap-btn:focus-visible,
.mode-btn:focus-visible {
  outline: 2px solid var(--wc3-gold);
  outline-offset: 2px;
  box-shadow:
    0 0 0 4px rgba(218, 165, 32, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(232, 108, 44, 0.2);
}

#mapCanvas:focus-visible,
#minimapCanvas:focus-visible {
  outline: 2px solid var(--wc3-gold);
  outline-offset: -2px;
}

/* WC3 Resource Bar (Top) */
.wc3-resource-bar {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: 0;
  border-width: 0 0 3px 0;
}

#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;

  /* Extra gold border on top bar */
  border-top: 1px solid var(--gold-dark);
  padding: 6px 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Brand Section */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  text-decoration: none;

  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.15), transparent 50%),
    linear-gradient(145deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: 2px solid var(--gold-dark);
  box-shadow:
    0 4px 12px rgba(191, 87, 0, 0.3),
    inset 1px 1px 0 rgba(255,255,255,0.2),
    inset -1px -1px 0 rgba(0,0,0,0.3);

  transition: all 0.2s ease;
    0 10px 22px rgba(0,0,0,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.06);
}

.brand-mark:hover {
  border-color: var(--gold);
  box-shadow:
    0 6px 16px rgba(191, 87, 0, 0.4),
    0 0 0 3px rgba(201, 162, 39, 0.15),
    inset 1px 1px 0 rgba(255,255,255,0.25),
    inset -1px -1px 0 rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

.brand-logo {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.brand-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Resources Display */
.resources {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* WC3-style Resources */
.wc3-resources {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wc3-res {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--wc3-stone-dark);
  border: 1px solid var(--wc3-bronze);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.wc3-res-ico {
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.wc3-res-ico.gold {
  background: linear-gradient(135deg, #FFD700 0%, #DAA520 50%, #B8860B 100%);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255,215,0,0.6);
}

.wc3-res-ico.lumber {
  background: linear-gradient(135deg, #228B22 0%, #006400 50%, #004d00 100%);
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(34,139,34,0.5);
}

.wc3-res-ico.food {
  background: linear-gradient(135deg, #F4A460 0%, #D2691E 50%, #8B4513 100%);
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(210,105,30,0.5);
}

.wc3-res-num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: var(--wc3-gold-light);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.wc3-res-cap {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.wc3-res-upkeep {
  border-color: rgba(255,77,77,0.4);
}

.wc3-res-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.upkeep-low { color: var(--good); }
.upkeep-mid { color: var(--warn); }
.upkeep-high { color: var(--bad); }

/* Legacy resource styles (keep for compatibility) */
.res {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;

  background: var(--panel-dark);
  border: 1px solid var(--border);
  box-shadow:
    inset 1px 1px 0 var(--bevel-highlight),
    inset -1px -1px 0 var(--bevel-shadow);
  gap: 8px;
  padding: 6px 12px;
  background: var(--wc3-stone-dark);
  border: 1px solid var(--wc3-bronze);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.res-ico {
  width: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--gold);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
  color: var(--wc3-gold);
  text-shadow: 0 0 4px rgba(218,165,32,0.5);
}

.res-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

/* RTS Resource System */
.rts-resources {
  gap: 6px;
}

.res-divider {
  width: 1px;
  height: 28px;
  background: linear-gradient(180deg, transparent, var(--border), transparent);
  margin: 0 4px;
}

/* Resource color coding */
.res-gold .res-ico { color: #ffd700; }
.res-lumber .res-ico { color: #8B4513; }
.res-food .res-ico { color: #90EE90; }
.res-knowledge .res-ico { color: #6495ED; }
.res-morale .res-ico { color: var(--accent); }
.res-tier .res-ico { color: var(--gold); }

/* Morale Bar (inline in resource) */
.res-morale {
  flex-direction: row;
  gap: 8px;
  min-width: 120px;
}

.morale-bar {
  width: 48px;
  height: 6px;
  background: var(--panel-dark);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.morale-fill {
  height: 100%;
  transition: width 0.3s ease, background 0.3s ease;
  border-radius: 2px;
}

/* Morale color states - Texas fire! */
.morale-fill.morale-high {
  background: linear-gradient(90deg, #37d67a, #68D391);
  box-shadow: 0 0 6px rgba(55, 214, 122, 0.5);
}

.morale-fill.morale-mid {
  background: linear-gradient(90deg, #f7c948, #FAF089);
  box-shadow: 0 0 6px rgba(247, 201, 72, 0.5);
}

.morale-fill.morale-low {
  background: linear-gradient(90deg, #ff4d4d, #FC8181);
  box-shadow: 0 0 6px rgba(255, 77, 77, 0.5);
  animation: morale-warning 1.5s ease-in-out infinite;
}

@keyframes morale-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Tech tier badge */
.res-tier {
  background: linear-gradient(180deg, rgba(201,162,39,0.15) 0%, rgba(0,0,0,0.2) 100%);
  border-color: var(--gold-dark);
}

.res-tier .res-num {
  color: var(--gold-light);
  font-weight: 700;
}

/* Top Bar Right */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  padding: 7px 14px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;

  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);

  cursor: pointer;
  box-shadow:
    0 2px 6px var(--shadow),
    inset 1px 1px 0 var(--bevel-highlight),
    inset -1px -1px 0 var(--bevel-shadow);

  transition: all 0.15s ease;
}

.btn:hover {
  border-color: var(--border-light);
  background: var(--panel-light);
}

.btn:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 3px var(--shadow),
    inset 1px 1px 0 var(--bevel-shadow),
    inset -1px -1px 0 var(--bevel-highlight);
}

.btn-accent {
  border-color: var(--gold-dark);
  background:
    linear-gradient(180deg, rgba(201,162,39,0.2) 0%, rgba(0,0,0,0.2) 100%),
    var(--panel);
  color: var(--gold-light);
}

.btn-accent:hover {
  border-color: var(--gold);
  box-shadow:
    0 4px 12px rgba(201, 162, 39, 0.2),
    inset 1px 1px 0 var(--bevel-highlight),
    inset -1px -1px 0 var(--bevel-shadow);
}

/* ============================================
   IDLE ALERT
   ============================================ */

.idle-alert {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;

  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);

  background: var(--panel-dark);
  border: 1px solid var(--warn);
  cursor: pointer;

  animation: pulse-warn 2s infinite;
}

.idle-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 8px var(--warn);
}

.idle-alert-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  padding: 2px 6px;
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
}

.idle-alert.has-blocked {
  border-color: var(--bad);
  animation: pulse-bad 1.5s infinite;
}

.idle-alert.has-blocked .idle-alert-dot {
  background: var(--bad);
  box-shadow: 0 0 8px var(--bad);
}

@keyframes pulse-warn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(247, 201, 72, 0); }
  50% { box-shadow: 0 0 0 4px rgba(247, 201, 72, 0.15); }
}

@keyframes pulse-bad {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
  50% { box-shadow: 0 0 0 4px rgba(255, 77, 77, 0.2); }
}

/* Scout Report */
.scout-report {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--text-muted);
  max-width: 260px;
}

.scout-line {
  line-height: 1.3;
}

.scout-line.muted {
  opacity: 0.5;
}

/* ============================================
   CENTER MAP AREA
   ============================================ */

/* WC3 Game Area (Map + Event Log) */
.wc3-game-area {
  grid-row: 2;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.wc3-map-panel {
  border-radius: 0;
  border-width: 0;
  position: relative;
  min-height: 0; /* Allow shrinking in grid */
  overflow: hidden;
}

/* Map */
#mapWrap {
  padding: 0;

  /* Stronger bevel for main view */
  border: 3px solid var(--border);
  box-shadow:
    0 6px 20px var(--shadow-deep),
    inset 2px 2px 0 var(--bevel-highlight),
    inset -2px -2px 0 var(--bevel-shadow);
}

#mapCanvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #0a0c0e;
}

/* Map HUD overlay */
.hud {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: 11px;
  color: var(--text-muted);

  background: rgba(12, 16, 20, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 6px 10px;

  box-shadow:
    0 2px 8px var(--shadow),
    inset 1px 1px 0 var(--bevel-highlight);
  bottom: 12px;
  left: 12px;
  font-size: 12px;
  color: rgba(244,244,247,0.86);
  background: rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 8px 10px;
}

@supports (backdrop-filter: blur(8px)) {
  .hud {
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
  }
}

.hud-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--gold);
}

.dot { opacity: 0.4; }

/* ============================================
   RIGHT PANEL: EVENT LOG
   ============================================ */

/* WC3 Event Log (Right Sidebar) */
.wc3-event-log {
  border-radius: 0;
  border-width: 0 0 0 3px;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow shrinking in grid */
  overflow: hidden;
}

#logPanel {
  display: flex;
  flex-direction: column;
}

.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  background: rgba(55, 214, 122, 0.15);
  border: 1px solid rgba(55, 214, 122, 0.3);
  border-radius: 4px;
  color: var(--good);
}

.tag-live {
  border-color: rgba(55, 214, 122, 0.55);
  background: rgba(55, 214, 122, 0.15);
  color: var(--good);
}

/* Mode selector */
.mode-selector {
  display: flex;
  gap: 2px;
  border-radius: 10px;
  padding: 2px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
}

.mode-btn {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.mode-btn.active {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(232,108,44,0.25), rgba(0,0,0,0.20));
  border: 1px solid rgba(232,108,44,0.45);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.log-feed {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  overflow: auto;
  flex: 1;
  min-height: 0; /* Allow scrolling instead of expanding */
}

.log-item {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 8px;
  padding: 8px;
  margin-bottom: 8px;

  background: var(--panel-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--r);

  cursor: pointer;
  transition: all 0.15s ease;
}

.log-item:hover {
  border-color: var(--gold-dark);
  background: rgba(201, 162, 39, 0.05);
}

.log-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  color: var(--text-faint);
}

.log-text {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text);
}

.log-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;

  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 12px;
}

/* ============================================
   LEFT COLUMN: PORTRAIT + MINIMAP
   ============================================ */

#leftBottom {
  grid-column: 1 / 2;
  grid-row: 2 / 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#portraitPanel {
  flex: 1;
  min-height: 0;
}

#minimapPanel {
  height: 180px;
}

/* Portrait Section */
.portrait {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 12px;
}

.portrait-frame {
  width: 76px;
  height: 76px;
  border-radius: 50%;

  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.1), transparent 50%),
    linear-gradient(145deg, var(--panel-light) 0%, var(--panel-dark) 100%);

  border: 3px solid var(--gold-dark);
  box-shadow:
    0 4px 12px var(--shadow),
    inset 2px 2px 0 var(--bevel-highlight),
    inset -2px -2px 0 var(--bevel-shadow);

/* WC3 Bottom HUD */
.wc3-hud-bottom {
  grid-row: 3;
  display: grid;
  grid-template-columns: 200px 200px 1fr 220px;
  gap: 0;
  border-radius: 0;
  border-width: 3px 0 0 0;
  padding: 0;
  background: linear-gradient(180deg, var(--wc3-stone) 0%, var(--wc3-stone-dark) 100%);
  overflow: hidden;
}

/* Portrait Panel */
.wc3-portrait-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-right: 2px solid var(--wc3-bronze);
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.4) 100%);
}

.wc3-portrait-frame {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--wc3-gold);
  box-shadow:
    0 0 12px rgba(218,165,32,0.4),
    inset 0 0 20px rgba(0,0,0,0.6);
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.15), transparent 50%),
    linear-gradient(180deg, var(--wc3-stone-light) 0%, var(--wc3-stone-dark) 100%);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.portrait-frame:hover {
  border-color: var(--gold);
}

.portrait-icon {
.wc3-portrait-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;

  background: var(--panel-dark);
  border: 1px solid var(--border);

  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--gold);
}

.portrait-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.portrait-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.portrait-task {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}

/* Progress Meter */
.meter {
  height: 8px;
  margin-top: 10px;
  border-radius: 4px;

  background: var(--panel-dark);
  border: 1px solid var(--border);
  overflow: hidden;

  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
  box-shadow: 0 0 8px rgba(191, 87, 0, 0.4);
  transition: width 0.3s ease;
}

.meter-fill.status-working {
  background: linear-gradient(90deg, var(--good), #68D391);
}

.meter-fill.status-blocked {
  background: linear-gradient(90deg, var(--bad), #FC8181);
}

.meter-fill.status-hold {
  background: linear-gradient(90deg, var(--warn), #FAF089);
}

.meter-fill.status-idle {
  background: linear-gradient(90deg, var(--text-faint), var(--text-muted));
}

/* Key-Value Stats */
.kv {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 24px;
  font-weight: 800;
  color: var(--wc3-gold);
}

.wc3-portrait-info {
  flex: 1;
  min-width: 0;
}

.wc3-portrait-name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--wc3-gold);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc3-health-bar {
  height: 8px;
  margin: 6px 0;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--wc3-bronze);
  border-radius: 1px;
  overflow: hidden;
}

.wc3-health-fill {
  height: 100%;
  background: linear-gradient(180deg, #37d67a 0%, #228B22 100%);
  transition: width 0.3s ease;
}

.wc3-portrait-status {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Minimap Panel */
.wc3-minimap-panel {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.k { color: var(--text-faint); }
.v {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  flex-direction: column;
  padding: 8px;
  border-right: 2px solid var(--wc3-bronze);
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.35) 100%);
}

.wc3-minimap-frame {
  flex: 1;
  border: 2px solid var(--wc3-bronze);
  border-radius: 2px;
  overflow: hidden;
  background: #070709;
}

/* Minimap */
#minimapCanvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #0a0c0e;
  border-radius: 4px;
}

/* ============================================
   BOTTOM: COMMAND CARD (3x3 Grid)
   ============================================ */

#commandPanel {
  grid-column: 2 / 4;
  grid-row: 3 / 4;
}

.cmd-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 6px;
  padding: 10px;
  max-width: 400px;
}

.cmd {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;

  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.08), transparent 50%),
    linear-gradient(145deg, var(--panel-light) 0%, var(--panel-dark) 100%);

  border: 2px solid var(--border);
  border-radius: var(--r);

  color: var(--text);
  cursor: pointer;

  box-shadow:
    0 2px 6px var(--shadow),
    inset 1px 1px 0 var(--bevel-highlight),
    inset -1px -1px 0 var(--bevel-shadow);

  transition: all 0.15s ease;
}

.cmd:hover {
  border-color: var(--gold-dark);
  background:
    radial-gradient(circle at 30% 25%, rgba(201, 162, 39, 0.12), transparent 50%),
    linear-gradient(145deg, var(--panel-light) 0%, var(--panel-dark) 100%);

  box-shadow:
    0 4px 12px var(--shadow),
    0 0 0 1px rgba(201, 162, 39, 0.2),
    inset 1px 1px 0 var(--bevel-highlight),
    inset -1px -1px 0 var(--bevel-shadow);
}

.cmd:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 3px var(--shadow),
    inset 1px 1px 0 var(--bevel-shadow),
    inset -1px -1px 0 var(--bevel-highlight);
}

.cmd:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cmd:disabled:hover {
  border-color: var(--border);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.08), transparent 50%),
    linear-gradient(145deg, var(--panel-light) 0%, var(--panel-dark) 100%);
  box-shadow:
    0 2px 6px var(--shadow),
    inset 1px 1px 0 var(--bevel-highlight),
    inset -1px -1px 0 var(--bevel-shadow);
}

.cmd-ico {
  font-size: 22px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
}

.cmd-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cmd-muted {
  border-color: var(--border-dark);
}

.cmd-hints {
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-faint);
}

.cmd-hints .kbd {
  margin: 0 2px;
}

/* Active/Selected Command */
.cmd.cmd-active {
  border-color: var(--gold);
  animation: cmd-pulse 1.5s ease-in-out infinite;
}

@keyframes cmd-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0); }
  50% { box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.2); }
}

/* ============================================
   COLLAPSED LOG STATE
   ============================================ */

body.log-collapsed #logPanel {
  display: none;
}

.wc3-minimap-btns {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.wc3-minimap-btn {
  flex: 1;
  height: 22px;
  background: var(--wc3-stone-dark);
  border: 1px solid var(--wc3-bronze);
  border-radius: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.wc3-minimap-btn:hover {
  border-color: var(--wc3-gold);
  color: var(--text);
}

/* Ops Feed Panel */
.wc3-ops-panel {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-right: 2px solid var(--wc3-bronze);
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.25) 100%);
}

.wc3-ops-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.wc3-ops-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wc3-gold);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.wc3-ops-feed {
  flex: 1;
  overflow: hidden;
}

.wc3-ops-line {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 4px;
}

.wc3-ops-line.muted {
  color: var(--muted);
  font-size: 11px;
}

/* Loading skeleton for connection state */
.wc3-ops-loading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}

.skeleton-line {
  height: 12px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.06) 0%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0.06) 100%
  );
  background-size: 200% 100%;
  border-radius: 4px;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

/* ============================================
   LIVE MODE INDICATORS
   ============================================ */

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 4px;

  background: rgba(55, 214, 122, 0.1);
  border: 1px solid rgba(55, 214, 122, 0.3);

  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--good);
}

.live-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  animation: live-blink 1.5s ease-in-out infinite;
}

@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.connection-status.connected {
  background: rgba(55, 214, 122, 0.12);
  color: var(--good);
}

.connection-status.disconnected {
  background: rgba(255, 77, 77, 0.12);
  color: var(--bad);
}

.connection-status.connecting {
  background: rgba(247, 201, 72, 0.12);
  color: var(--warn);
}

/* ============================================
   LOADING SCREEN
   ============================================ */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;

  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(12, 16, 20, 0.9), var(--bg)),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 48px 64px;

  background: var(--panel);
  border: 3px solid var(--border);
  border-radius: var(--r3);

  box-shadow:
    0 12px 40px var(--shadow-deep),
    inset 2px 2px 0 var(--bevel-highlight),
    inset -2px -2px 0 var(--bevel-shadow);
}

.loading-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-flame {
  filter: drop-shadow(0 4px 16px rgba(191, 87, 0, 0.4));
  animation: flame-pulse 2s ease-in-out infinite;
}

@keyframes flame-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

.loading-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.loading-bar {
  width: 300px;
  height: 10px;
  background: var(--panel-dark);
  border: 2px solid var(--border);
  border-radius: 5px;
  overflow: hidden;

  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.loading-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  transition: width 0.3s ease-out;
  box-shadow: 0 0 12px rgba(191, 87, 0, 0.5);
}

.loading-text {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-out;
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .idle-alert,
  .cmd.cmd-active,
  .loading-flame,
  .live-indicator::before {
    animation: none;
  }

  .btn:active,
  .cmd:active {
    transform: none;
  }

  /* Disable drawer transitions for reduced motion */
  #leftBottom,
  #logPanel,
  .resources-drawer {
    transition: none;
  }

  .drawer-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ============================================
   MOBILE DRAWER TOGGLES (Hidden on Desktop)
   ============================================ */

.mobile-drawer-toggle,
.resources-drawer,
.drawer-backdrop {
  display: none;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

@media (max-width: 1200px) {
  #app {
    grid-template-columns: 280px 1fr;
    grid-template-rows: 56px 1fr 200px 200px;
  }

  #logPanel {
    grid-column: 1 / 3;
    grid-row: 4 / 5;
    max-height: 200px;
  }

  #commandPanel {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
  }

  .cmd-grid {
    max-width: none;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: 1fr;
  }

  .cmd {
    aspect-ratio: auto;
    padding: 12px 8px;
  }
.skeleton-line.short {
  width: 60%;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.wc3-ops-stats {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.wc3-ops-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wc3-ops-stat-label {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wc3-ops-stat-val {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--wc3-gold-light);
  text-shadow: 0 0 4px rgba(218,165,32,0.3);
}

/* WC3 Command Grid - Bento-style layout */
.wc3-command-panel {
  padding: 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
}

.wc3-command-grid {
  display: grid;
  /* Bento-style: varied column widths for visual interest */
  grid-template-columns: 1.2fr 1fr 1fr 1.2fr;
  grid-template-rows: 1.1fr 1fr 0.9fr;
  gap: 4px;
  height: 100%;
}

/* Bento featured commands - larger, more prominent */
.wc3-cmd[data-cmd="stop"],
.wc3-cmd[data-cmd="resume"] {
  /* Primary action buttons get subtle emphasis */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(212, 175, 55, 0.3);
}

.wc3-cmd[data-cmd="terminate"] {
  /* Danger action - subtle red tint */
  background: linear-gradient(180deg,
    rgba(60, 35, 30, 0.8) 0%,
    var(--wc3-stone) 20%,
    var(--wc3-stone) 80%,
    var(--wc3-stone-dark) 100%
  );
  border-color: rgba(139, 26, 26, 0.6);
}

.wc3-cmd[data-cmd="terminate"]:hover {
  border-color: rgba(255, 77, 77, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4),
    0 0 12px rgba(139, 26, 26, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.5);
}

.wc3-cmd,
.cmd {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--wc3-stone-light) 0%, var(--wc3-stone-dark) 100%);
  border: 2px solid var(--wc3-bronze);
  border-top-color: var(--wc3-stone-light);
  border-left-color: var(--wc3-stone);
  border-radius: 2px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -2px 0 rgba(0,0,0,0.4),
    0 2px 4px rgba(0,0,0,0.5);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

/* Bento depth layers - staggered shadows for depth */
.wc3-cmd::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04) 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.wc3-cmd:hover::before {
  opacity: 1;
}

.wc3-cmd:hover,
.cmd:hover {
  border-color: var(--wc3-gold);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    inset 0 -2px 0 rgba(0,0,0,0.4),
    0 0 12px rgba(218,165,32,0.45),
    0 2px 4px rgba(0,0,0,0.5);
}

.wc3-cmd:active,
.cmd:active {
  background: linear-gradient(180deg, var(--wc3-stone-dark) 0%, var(--wc3-stone) 100%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

.wc3-cmd:disabled,
.wc3-cmd-muted,
.cmd:disabled,
.cmd-muted {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgba(255,255,255,0.06);
}

.wc3-cmd-ico {
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.wc3-cmd-key {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.7;
}

/* Legacy styles (keep for compatibility) */
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.portrait-mascot {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.2s ease, filter 0.2s ease;
}

[data-mascot-state="working"] .portrait-mascot {
  animation: mascot-pulse 1.5s ease-in-out infinite;
}

[data-mascot-state="error"] .portrait-mascot {
  filter: hue-rotate(-20deg) saturate(1.2);
}

[data-mascot-state="complete"] .portrait-mascot {
  animation: mascot-celebrate 0.5s ease-out;
}

@keyframes mascot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes mascot-celebrate {
  0% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1); }
}

.meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.40);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  margin-top: 10px;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(232,108,44,0.75), rgba(255,177,122,0.65));
  box-shadow: 0 0 14px rgba(232,108,44,0.18);
}

.meter-fill.status-working { background: linear-gradient(90deg, rgba(55,214,122,0.95), rgba(55,214,122,0.55)); }
.meter-fill.status-blocked { background: linear-gradient(90deg, rgba(255,77,77,0.95), rgba(255,77,77,0.55)); }
.meter-fill.status-hold { background: linear-gradient(90deg, rgba(247,201,72,0.95), rgba(247,201,72,0.55)); }
.meter-fill.status-idle { background: linear-gradient(90deg, rgba(244,244,247,0.40), rgba(244,244,247,0.18)); }

/* Legacy .cmd - consolidated with .wc3-cmd */
.cmd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px;
}

/* .cmd now extends .wc3-cmd base styles */
.cmd {
  height: 56px;
  display: grid;
  place-items: center;
}

.cmd-ico {
  font-size: 18px;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.45));
}

.cmd-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cmd-hints {
  padding: 0 12px 12px 12px;
  opacity: 0.72;
  font-size: 12px;
}

/* Scout/Ops feed */
.scout {
  padding: 12px;
  font-size: 14px;
  line-height: 1.28;
}

.scout-line { margin-bottom: 6px; }
.muted { opacity: 0.70; }

/* Collapsed log */
body.log-collapsed .wc3-event-log {
  display: none;
}

body.log-collapsed .wc3-game-area {
  grid-template-columns: 1fr;
}

/* Mode switching: OPS view emphasizes ops panel, dims game area */
body[data-mode="ops"] .wc3-game-area {
  opacity: 0.4;
  pointer-events: none;
}

body[data-mode="ops"] .wc3-ops-panel {
  background: linear-gradient(180deg, rgba(232,108,44,0.08) 0%, rgba(0,0,0,0.30) 100%);
  border-color: var(--wc3-gold);
}

body[data-mode="ops"] .wc3-hud-bottom {
  grid-template-columns: 140px 1fr 1fr 200px;
}

/* Mode switching: RTS view (default) */
body[data-mode="rts"] .wc3-game-area,
body:not([data-mode]) .wc3-game-area {
  opacity: 1;
  pointer-events: auto;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .idle-alert { animation: none; }
  .btn:active, .cmd:active, .wc3-cmd:active { transform: none; }
}

/* Responsive - Medium screens */
@media (max-width: 1400px) {
  .wc3-hud-bottom {
    grid-template-columns: 160px 180px 1fr 200px;
  }

  .wc3-portrait-frame {
    width: 60px;
    height: 60px;
  }

  .wc3-portrait-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
}

/* Responsive - Small screens */
@media (max-width: 1180px) {
  #app {
    grid-template-rows: 48px 1fr 200px;
  }

  .wc3-game-area {
    grid-template-columns: 1fr 280px;
    transition: grid-template-columns 0.3s ease;
  }

  .wc3-event-log {
    border-width: 0 0 0 2px;
  }

  .wc3-hud-bottom {
    grid-template-columns: 140px 160px 1fr 180px;
  }

  .wc3-ops-stats {
    display: none;
  }
}

/* Responsive - Intermediate screens */
@media (max-width: 1024px) {
  #app {
    grid-template-rows: 48px 1fr 160px;
  }

  .wc3-game-area {
    grid-template-columns: 1fr 0;
  }

  .wc3-event-log {
    opacity: 0;
    width: 0;
    overflow: hidden;
    padding: 0;
    border: none;
    transition: opacity 0.2s ease, width 0.3s ease;
  }

  .wc3-hud-bottom {
    grid-template-columns: 120px 140px 1fr 160px;
  }

  .wc3-portrait-frame {
    width: 52px;
    height: 52px;
  }

  .wc3-portrait-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .wc3-command-grid {
    gap: 2px;
  }

  .wc3-cmd-ico {
    font-size: 16px;
  }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr auto;
    gap: 0;
    padding: 0;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
  }

  #topbar {
    grid-column: 1;
    grid-row: 1;
    padding: 6px 10px;
    border-radius: 0;
    z-index: 100;
  }

  /* Main map takes up available space */
  #mapWrap {
    grid-column: 1;
    grid-row: 2;
    border-radius: 0;
    border-width: 1px 0;
    min-height: 0; /* Allow shrinking */
  }

  /* Canvas should scale properly */
  #mapCanvas {
    width: 100%;
    height: 100%;
    touch-action: none; /* Enable custom touch handling */
  }

  /* Command panel as bottom bar */
  #commandPanel {
    grid-column: 1;
    grid-row: 3;
    border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .cmd-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    padding: 8px;
    max-width: none;
  }

  .cmd {
    /* Minimum touch target size */
    min-width: 56px;
    min-height: 56px;
    flex: 0 0 auto;
    aspect-ratio: 1;
    padding: 8px;
  }

  .cmd-ico {
    font-size: 20px;
  }

  .cmd-label {
    font-size: 8px;
  }

  .cmd-hints {
    display: none;
  }

  /* Hide resources on mobile - use drawer instead */
  .resources {
    display: none;
  }

  .brand-sub {
    display: none;
  }

  /* === SLIDE-OUT DRAWERS FOR MOBILE === */

  /* Left drawer: Portrait + Minimap */
  #leftBottom {
    position: fixed;
    left: 0;
    top: 56px;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 200;
    flex-direction: column;
    gap: 0;

    background: var(--bg);
    border-right: 2px solid var(--border);
    box-shadow: 4px 0 20px var(--shadow-deep);

    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #leftBottom.drawer-open {
    transform: translateX(0);
  }

  #portraitPanel,
  #minimapPanel {
    border-radius: 0;
    border-width: 0 0 1px 0;
  }

  #minimapPanel {
    height: 200px;
  }

  /* Right drawer: Event Log */
  #logPanel {
    position: fixed;
    right: 0;
    top: 56px;
    bottom: 0;
    width: 320px;
    max-width: 90vw;
    z-index: 200;

    background: var(--bg);
    border-left: 2px solid var(--border);
    border-radius: 0;
    box-shadow: -4px 0 20px var(--shadow-deep);

    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #logPanel.drawer-open {
    transform: translateX(0);
  }

  /* Drawer backdrop overlay */
  .drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .drawer-backdrop.active {
    display: block;
  }

  /* Mobile drawer toggle buttons */
  .mobile-drawer-toggle {
    display: flex;
    position: fixed;
    z-index: 101;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;

    background: var(--panel);
    border: 2px solid var(--border);
    color: var(--gold-light);
    font-size: 18px;
    cursor: pointer;

    box-shadow:
      0 4px 12px var(--shadow),
      inset 1px 1px 0 var(--bevel-highlight),
      inset -1px -1px 0 var(--bevel-shadow);

    transition: all 0.2s ease;
  }

  .mobile-drawer-toggle:hover,
  .mobile-drawer-toggle:active {
    border-color: var(--gold);
    transform: scale(1.05);
  }

  .mobile-drawer-toggle.toggle-left {
    left: 10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 100px);
  }

  .mobile-drawer-toggle.toggle-right {
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 100px);
  }

  /* Top bar adjustments */
  .topbar-left {
    gap: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    min-width: 44px;
    min-height: 44px;
  }

  .brand-name {
    font-size: 14px;
  }

  /* Buttons need minimum touch targets */
  .btn {
    min-width: 44px;
    min-height: 44px;
    padding: 10px 14px;
  }

  .idle-alert {
    min-height: 44px;
    padding: 8px 14px;
  }

  /* Hide scout report on mobile */
  .scout-report {
    display: none;
  }

  /* HUD adjustments */
  .hud {
    font-size: 10px;
    padding: 4px 8px;
    bottom: 6px;
    left: 6px;
  }

  .kbd {
    font-size: 9px;
    padding: 2px 4px;
  }

  /* Log items need better touch targets */
  .log-item {
    padding: 12px;
    min-height: 48px;
  }

  /* Debug panel mobile adjustments */
  .debug-panel {
    right: 10px;
    top: 70px;
    width: calc(100vw - 20px);
  }
}

/* === EXTRA SMALL SCREENS (< 480px) === */
@media (max-width: 480px) {
  #topbar {
    padding: 4px 8px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 12px;
  }

  .btn {
    padding: 8px 10px;
    font-size: 10px;
  }

  .cmd {
    min-width: 52px;
    min-height: 52px;
  }

  .cmd-ico {
    font-size: 18px;
  }

  .cmd-label {
    font-size: 7px;
  }

  /* Smaller drawer widths */
  #leftBottom {
    width: 260px;
  }

  #logPanel {
    width: calc(100vw - 40px);
  }

  .mobile-drawer-toggle {
    width: 44px;
    height: 44px;
  }
}

/* === LANDSCAPE MOBILE === */
@media (max-width: 768px) and (orientation: landscape) {
  #app {
    grid-template-rows: 48px 1fr auto;
  }

  #topbar {
    padding: 4px 10px;
  }

  #commandPanel {
    padding-bottom: 4px;
  }

  .cmd-grid {
    padding: 4px 8px;
  }

  .cmd {
    min-width: 48px;
    min-height: 48px;
  }

  .mobile-drawer-toggle {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 70px);
  }

  #leftBottom,
  #logPanel {
    top: 48px;
  }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--panel-dark);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
  border: 1px solid var(--panel-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--panel-dark);
}

/* ============================================
   INFRASTRUCTURE DEBUG PANEL
   ============================================ */

.debug-panel {
  position: fixed;
  right: 20px;
  top: 80px;
  width: 320px;
  max-width: calc(100vw - 40px);
  z-index: 1000;

  background:
    radial-gradient(ellipse 120% 80% at 20% 10%, rgba(191, 87, 0, 0.06), transparent 50%),
    linear-gradient(180deg, var(--panel-light) 0%, var(--panel) 30%, var(--panel-dark) 100%);

  border: 3px solid var(--border);
  border-top-color: var(--border-light);
  border-radius: var(--r2);

  box-shadow:
    0 12px 40px var(--shadow-deep),
    0 0 0 1px rgba(0, 0, 0, 0.5),
    inset 2px 2px 0 var(--bevel-highlight),
    inset -2px -2px 0 var(--bevel-shadow);

  overflow: hidden;
  animation: debug-panel-enter 0.3s ease-out;
}

@keyframes debug-panel-enter {
  from {
    opacity: 0;
    transform: translateX(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.debug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;

  background: linear-gradient(180deg, var(--panel-light), var(--panel-dark));
  border-bottom: 2px solid var(--border-dark);
}

.debug-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-light);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.debug-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;

  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.1), transparent 50%),
    linear-gradient(145deg, var(--panel-light), var(--panel-dark));

  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;

  font-size: 18px;
  color: var(--text-muted);

  box-shadow:
    0 2px 4px var(--shadow),
    inset 1px 1px 0 var(--bevel-highlight),
    inset -1px -1px 0 var(--bevel-shadow);

  transition: all 0.15s ease;
}

.debug-close:hover {
  border-color: var(--bad);
  color: var(--bad);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 77, 77, 0.15), transparent 50%),
    linear-gradient(145deg, var(--panel-light), var(--panel-dark));
}

.debug-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.debug-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.debug-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border: 1px solid var(--border-dark);
}

.debug-row .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.debug-row .value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.debug-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.debug-actions .btn {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-size: 12px;
}

.btn-primary {
  background:
    radial-gradient(circle at 30% 25%, rgba(191, 87, 0, 0.2), transparent 50%),
    linear-gradient(145deg, var(--accent), var(--accent-dark));
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 107, 53, 0.3), transparent 50%),
    linear-gradient(145deg, var(--accent-light), var(--accent));
  border-color: var(--accent-light);
  box-shadow:
    0 4px 16px rgba(191, 87, 0, 0.4),
    0 0 0 2px rgba(191, 87, 0, 0.2);
}

.btn-secondary {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.08), transparent 50%),
    linear-gradient(145deg, var(--panel-light), var(--panel-dark));
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--gold-dark);
  color: var(--gold-light);
}

.btn-danger {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 77, 77, 0.15), transparent 50%),
    linear-gradient(145deg, var(--panel-light), var(--panel-dark));
  border-color: var(--border);
  color: var(--bad);
}

.btn-danger:hover {
  border-color: var(--bad);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 77, 77, 0.25), transparent 50%),
    linear-gradient(145deg, var(--panel-light), var(--panel-dark));
  box-shadow:
    0 4px 12px rgba(255, 77, 77, 0.2),
    0 0 0 1px rgba(255, 77, 77, 0.3);
}

/* Status indicators in debug panel */
.debug-row .value[data-status="healthy"] {
  color: var(--good);
}

.debug-row .value[data-status="warning"] {
  color: var(--warn);
}

.debug-row .value[data-status="error"],
.debug-row .value[data-status="dead"] {
  color: var(--bad);
}

/* ============================================
   INFRASTRUCTURE MODE TOGGLE
   ============================================ */

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  background: var(--panel-dark);
  border: 2px solid var(--border);
  border-radius: 6px;
}

.mode-toggle .mode-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-toggle .mode-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.mode-toggle .mode-btn.active {
  background:
    radial-gradient(circle at 30% 25%, rgba(191, 87, 0, 0.15), transparent 50%),
    linear-gradient(145deg, var(--panel-light), var(--panel-dark));
  color: var(--accent);
  box-shadow:
    inset 1px 1px 0 var(--bevel-highlight),
    inset -1px -1px 0 var(--bevel-shadow);
}

/* Infrastructure status bar */
.infra-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  border: 1px solid var(--border-dark);
}

.infra-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}

.infra-stat .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.infra-stat .dot.healthy { background: var(--good); }
.infra-stat .dot.warning { background: var(--warn); }
.infra-stat .dot.error { background: var(--bad); }
.infra-stat .dot.unknown { background: var(--text-faint); }

.infra-stat .count {
  font-family: var(--font-mono);
  color: var(--text);
}

/* ============================================
   INFRASTRUCTURE CANVAS OVERLAY
   ============================================ */

.infra-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.infra-tooltip {
  position: absolute;
  padding: 8px 12px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 12px var(--shadow-deep);

  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.15s ease;
}

.infra-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.infra-tooltip-name {
  font-weight: 700;
  color: var(--gold-light);
}

.infra-tooltip-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
}

.infra-tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.infra-tooltip-dot.healthy {
  background: var(--status-healthy);
}

.infra-tooltip-dot.degraded,
.infra-tooltip-dot.warning {
  background: var(--status-warning);
}

.infra-tooltip-dot.error,
.infra-tooltip-dot.down,
.infra-tooltip-dot.dead {
  background: var(--status-error);
}

/* ============================================
   MOBILE TOUCH INTERACTIONS
   ============================================ */

/* Touch-friendly tap states */
@media (hover: none) and (pointer: coarse) {
  .btn:active,
  .cmd:active,
  .log-item:active,
  .mobile-drawer-toggle:active {
    transform: scale(0.95);
    opacity: 0.9;
  }

  /* Disable hover effects on touch devices */
  .btn:hover,
  .cmd:hover,
  .log-item:hover {
    border-color: inherit;
    background: inherit;
  }

  /* Active states for touch */
  .cmd:active {
    border-color: var(--gold);
    background:
      radial-gradient(circle at 30% 25%, rgba(201, 162, 39, 0.2), transparent 50%),
      linear-gradient(145deg, var(--panel-light) 0%, var(--panel-dark) 100%);
  }
}

/* ============================================
   MOBILE RESOURCES DRAWER (OPS FEED)
   ============================================ */

@media (max-width: 768px) {
  /* Resources panel as top drawer */
  .resources-drawer {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 180;

    background: var(--panel);
    border-bottom: 2px solid var(--border);
    box-shadow: 0 4px 20px var(--shadow-deep);

    padding: 12px;

    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .resources-drawer.drawer-open {
    transform: translateY(0);
  }

  .resources-drawer .resources {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .resources-drawer .res {
    min-width: 70px;
    padding: 8px 12px;
  }

  /* Toggle button for resources drawer */
  .mobile-drawer-toggle.toggle-top {
    position: fixed;
    top: calc(56px + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: 36px;
    padding: 0 16px;
    border-radius: 18px;
    font-size: 11px;
    font-family: var(--font-display);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    gap: 6px;
  }

  .mobile-drawer-toggle.toggle-top::before {
    content: '◎';
    font-size: 14px;
  }
}

/* ============================================
   CANVAS SCALING FOR MOBILE
   ============================================ */

@media (max-width: 768px) {
  /* Ensure canvas renders properly on high-DPI mobile screens */
  #mapWrap {
    position: relative;
    overflow: hidden;
  }

  #mapCanvas {
    /* Allow canvas to fill container */
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;

    /* Optimize rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }

  #minimapCanvas {
    width: 100%;
    height: auto;
    aspect-ratio: 280 / 180;
  }
}

/* ============================================
   SAFE AREA INSETS (Notch/Home indicator)
   ============================================ */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    #app {
      padding-bottom: env(safe-area-inset-bottom);
    }

    #commandPanel {
      padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }

    #leftBottom,
    #logPanel {
      padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-drawer-toggle.toggle-left,
    .mobile-drawer-toggle.toggle-right {
      bottom: calc(100px + env(safe-area-inset-bottom));
    }
  }
}

/* ============================================
   PREVENT BUILDINGS CUT-OFF ON MOBILE
   ============================================ */

@media (max-width: 768px) {
  /* Ensure buildings/entities in the game canvas are visible */
  #mapWrap {
    /* Prevent overflow clipping */
    overflow: visible;
  }

  /* Inner container should clip */
  #mapWrap::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
  }
}

/* ============================================
   LOADING SCREEN MOBILE
   ============================================ */

@media (max-width: 768px) {
  .loading-content {
    padding: 32px 24px;
    margin: 16px;
    width: calc(100vw - 32px);
    max-width: 320px;
  }

  .loading-bar {
    width: 100%;
    max-width: 260px;
  }

  .loading-title {
    font-size: 24px;
  }

  .loading-flame {
    width: 48px;
    height: 48px;
  }
}

/* ============================================
   PORTRAIT/DETAIL PANEL MOBILE OPTIMIZATION
   ============================================ */

@media (max-width: 768px) {
  .portrait {
    padding: 10px;
    grid-template-columns: 70px 1fr;
    gap: 10px;
  }

  .portrait-frame {
    width: 60px;
    height: 60px;
  }

  .portrait-icon {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .portrait-name {
    font-size: 13px;
  }

  .portrait-task {
    font-size: 11px;
  }

  .meter {
    height: 6px;
    margin-top: 8px;
  }

  .kv-row {
    font-size: 11px;
  }
}

/* ============================================
   PRINT STYLES (hide drawers)
   ============================================ */

@media print {
  .mobile-drawer-toggle,
  .drawer-backdrop,
  #leftBottom,
  #logPanel {
    display: none !important;
  }

  #mapWrap {
    position: static !important;
    width: 100% !important;
    height: auto !important;
  }
}

/* ============================================
   NAVIGATION MENU (Slide-out)
   ============================================ */

.nav-menu-btn {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 2px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.nav-menu-btn:hover,
.nav-menu-btn.active {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.08);
}

.nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 18px;
}

.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--gold-light);
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.25s;
}

.nav-menu-btn.active .nav-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-menu-btn.active .nav-hamburger span:nth-child(2) {
  opacity: 0;
}
.nav-menu-btn.active .nav-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Panel */
.nav-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 360px;
  max-width: 85vw;
  z-index: 300;

  background: var(--panel);
  border-right: 2px solid var(--border);
  box-shadow:
    4px 0 24px var(--shadow-deep),
    inset 1px 0 0 var(--bevel-highlight);

  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav-panel.open {
  transform: translateX(0);
}

/* Backdrop */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 290;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

/* Header */
.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(201,162,39,0.1) 0%, transparent 100%);
}

.nav-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.nav-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.nav-close:hover {
  color: var(--bad);
  border-color: var(--bad);
}

/* Tabs */
.nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--panel-dark);
}

.nav-tab {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.nav-tab:hover {
  color: var(--text);
}

.nav-tab.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

/* Content area */
.nav-content {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.nav-pane {
  display: none;
  padding: 16px;
}

.nav-pane.active {
  display: block;
}

/* Sections */
.nav-section {
  margin-bottom: 20px;
}

.nav-section-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Actions */
.nav-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 6px;
}

.nav-action:hover {
  background: rgba(201, 162, 39, 0.06);
  border-color: var(--gold-dark);
}

.nav-action-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* Leaderboard */
.nav-lb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.nav-lb-tab {
  padding: 6px 10px;
  background: var(--panel-dark);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-lb-tab:hover {
  border-color: var(--gold-dark);
  color: var(--text);
}

.nav-lb-tab.active {
  background: rgba(201, 162, 39, 0.12);
  border-color: var(--gold);
  color: var(--gold-light);
}

.nav-lb-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-lb-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--r);
  font-size: 12px;
  transition: background 0.15s;
}

.nav-lb-row:hover {
  background: rgba(255,255,255,0.03);
}

.nav-lb-row.is-me {
  background: rgba(201, 162, 39, 0.08);
  border: 1px solid var(--gold-dark);
}

.nav-lb-row.rank-1 .nav-lb-rank { font-size: 16px; }
.nav-lb-row.rank-2 .nav-lb-rank { font-size: 15px; }
.nav-lb-row.rank-3 .nav-lb-rank { font-size: 14px; }

.nav-lb-rank {
  text-align: center;
  color: var(--text-muted);
}

.nav-lb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-lb-score {
  font-family: var(--font-mono);
  color: var(--gold-light);
  font-weight: 600;
}

.nav-lb-time {
  color: var(--text-faint);
  font-size: 10px;
}

/* Wallet */
.nav-wallet {
  padding: 16px;
  background: linear-gradient(145deg, rgba(201,162,39,0.06) 0%, transparent 70%);
  border: 1px solid var(--border);
  border-radius: var(--r2);
}

.nav-wallet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

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

.nav-wallet-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-light);
}

.nav-xp-bar {
  height: 6px;
  background: var(--panel-dark);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0 4px;
}

.nav-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.nav-xp-label {
  font-size: 10px;
  color: var(--text-faint);
  text-align: right;
}

/* Transactions */
.nav-tx-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-tx-row {
  display: grid;
  grid-template-columns: 20px 1fr auto auto;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border-radius: var(--r);
  font-size: 12px;
}

.nav-tx-icon { text-align: center; }

.nav-tx-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

.nav-tx-amount {
  font-family: var(--font-mono);
  font-weight: 600;
}

.tx-earn .nav-tx-amount { color: var(--good); }
.tx-spend .nav-tx-amount { color: var(--bad); }

.nav-tx-time {
  color: var(--text-faint);
  font-size: 10px;
}

/* Shop */
.nav-shop-grid {
  display: grid;
  gap: 10px;
}

.nav-shop-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--panel-dark);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  transition: border-color 0.15s;
}

.nav-shop-item:hover {
  border-color: var(--gold-dark);
}

.nav-shop-icon {
  font-size: 28px;
  text-align: center;
}

.nav-shop-name {
  font-size: 13px;
  font-weight: 600;
}

.nav-shop-buy {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: linear-gradient(145deg, var(--gold-dark), var(--gold));
  border: none;
  border-radius: var(--r);
  color: #000;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.nav-shop-buy:hover:not(:disabled) {
  opacity: 0.9;
  transform: scale(1.02);
}

.nav-shop-buy:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-shop-buy.insufficient {
  background: var(--border);
  color: var(--text-faint);
}

.nav-shop-coin {
  font-size: 11px;
}

/* Skeleton loading */
.nav-skeleton {
  height: 36px;
  background: linear-gradient(90deg, var(--panel-dark) 25%, var(--panel-light) 50%, var(--panel-dark) 75%);
  background-size: 200% 100%;
  animation: navShimmer 1.5s ease infinite;
  border-radius: var(--r);
  margin-bottom: 4px;
}

@keyframes navShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.nav-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-faint);
  font-style: italic;
  font-size: 13px;
}

/* Nav responsive */
@media (max-width: 768px) {
  .nav-panel {
    width: 100vw;
    max-width: 100vw;
  }
}

/* Print: hide nav */
@media print {
  .nav-panel,
  .nav-backdrop,
  .nav-menu-btn {
    display: none !important;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .nav-panel {
    transition: none;
  }
  .nav-backdrop {
    transition: none;
  }
  .nav-skeleton {
    animation: none;
  }
  .nav-hamburger span {
    transition: none;
  }
}

/* ============================================================
   MICRO-INTERACTIONS & VISUAL POLISH
   Phase 4 enhancements — subtle feedback animations
   ============================================================ */

/* --- Expanded color tokens (formalize existing usage) --- */
:root {
  --stone-hover: #342a1e;
  --gold-soft: rgba(201, 162, 39, 0.08);
  --success: #37d67a;
  --danger: #ff4d4d;
  --info: #6a9eff;
}

/* --- Resource icon bounce on value change --- */
@keyframes resourceBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.22); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.res-icon.changed {
  animation: resourceBounce 280ms ease-out;
}

/* --- Resource value flash on change --- */
@keyframes valueFlash {
  0%   { color: var(--gold-light); }
  100% { color: var(--text); }
}
.res-val.changed {
  animation: valueFlash 600ms ease-out;
}

/* --- Status badge color transition --- */
.data-sync-status {
  transition: color 300ms ease, background-color 300ms ease;
}

/* --- Event log entry slide-in --- */
@keyframes logSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.log-item {
  animation: logSlideIn 150ms ease-out;
  animation-fill-mode: both;
}
.log-item:nth-child(2) { animation-delay: 30ms; }
.log-item:nth-child(3) { animation-delay: 60ms; }
.log-item:nth-child(4) { animation-delay: 90ms; }
.log-item:nth-child(5) { animation-delay: 120ms; }

/* --- Bottom bar controls fade-in --- */
@keyframes controlsFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#commandPanel .cmd-btn {
  animation: controlsFadeIn 400ms ease-out both;
}
#commandPanel .cmd-btn:nth-child(2)  { animation-delay: 40ms; }
#commandPanel .cmd-btn:nth-child(3)  { animation-delay: 80ms; }
#commandPanel .cmd-btn:nth-child(4)  { animation-delay: 120ms; }
#commandPanel .cmd-btn:nth-child(5)  { animation-delay: 160ms; }
#commandPanel .cmd-btn:nth-child(6)  { animation-delay: 200ms; }
#commandPanel .cmd-btn:nth-child(7)  { animation-delay: 240ms; }
#commandPanel .cmd-btn:nth-child(8)  { animation-delay: 280ms; }
#commandPanel .cmd-btn:nth-child(9)  { animation-delay: 320ms; }
#commandPanel .cmd-btn:nth-child(10) { animation-delay: 360ms; }
#commandPanel .cmd-btn:nth-child(11) { animation-delay: 400ms; }
#commandPanel .cmd-btn:nth-child(12) { animation-delay: 440ms; }

/* --- Panel hover glow --- */
.panel:hover {
  box-shadow:
    inset 1px 1px 0 var(--bevel-highlight),
    inset -1px -1px 0 var(--bevel-shadow),
    0 0 12px rgba(201, 162, 39, 0.06);
  transition: box-shadow 300ms ease;
}

/* --- Gold focus ring for keyboard nav --- */
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* --- Button press feedback --- */
.cmd-btn:active {
  transform: scale(0.95);
  transition: transform 80ms ease;
}

/* --- Typography responsive scale --- */
@supports (font-size: clamp(1px, 1vw, 2px)) {
  .topbar-brand { font-size: clamp(16px, 2vw, 24px); }
  .res-val      { font-size: clamp(12px, 1.5vw, 16px); }
  .res-label    { font-size: clamp(10px, 1.2vw, 13px); }
  .log-text     { font-size: clamp(11px, 1.3vw, 14px); }
  .log-time     { font-size: clamp(9px, 1.1vw, 12px); }
}

/* --- Skeleton loading shimmer (reusable) --- */
@keyframes skeletonShimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}
.skeleton-block {
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-light) 50%, var(--panel) 75%);
  background-size: 400px 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 2px;
}

/* --- Respect reduced motion for all micro-interactions --- */
@media (prefers-reduced-motion: reduce) {
  .res-icon.changed,
  .res-val.changed,
  .log-item,
  #commandPanel .cmd-btn,
  .skeleton-block {
    animation: none;
  }
  .data-sync-status,
  .panel:hover,
  .cmd-btn:active {
    grid-template-rows: 44px 1fr 180px;
  }

  .wc3-resource-bar {
    padding: 4px 8px;
  }

  .wc3-resources {
    gap: 8px;
  }

  .wc3-res {
    padding: 2px 6px;
  }

  .wc3-hud-bottom {
    grid-template-columns: 100px 1fr 160px;
  }

  .wc3-minimap-panel {
    display: none;
  }

  .wc3-ops-panel {
    display: none;
  }
}

/* Responsive - Ultra compact mobile */
@media (max-width: 480px) {
  #app {
    grid-template-rows: 40px 1fr 140px;
  }

  .wc3-resource-bar {
    padding: 2px 6px;
  }

  .wc3-resources {
    gap: 4px;
  }

  .wc3-res {
    padding: 2px 4px;
    gap: 4px;
  }

  .wc3-res-ico {
    width: 16px;
    height: 16px;
  }

  .wc3-res-num {
    font-size: 11px;
  }

  .wc3-res-upkeep .wc3-res-label {
    display: none;
  }

  .topbar-right {
    gap: 4px;
  }

  .mode-selector {
    display: none;
  }

  .btn-sm {
    padding: 4px 8px;
    font-size: 10px;
  }

  .wc3-hud-bottom {
    grid-template-columns: 80px 1fr;
  }

  .wc3-portrait-panel {
    padding: 6px;
  }

  .wc3-portrait-frame {
    width: 48px;
    height: 48px;
    border-width: 2px;
  }

  .wc3-portrait-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .wc3-portrait-info {
    display: none;
  }

  .wc3-command-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
  }

  /* Hide bottom row of commands on ultra-compact */
  .wc3-cmd:nth-child(n+9) {
    display: none;
  }

  .wc3-cmd-ico {
    font-size: 16px;
  }

  .wc3-cmd-key {
    display: none;
  }
}

/* ===========================================
   WC3: THE FROZEN THRONE - ENHANCED UI SYSTEM
   Complete UI overhaul for authentic TFT aesthetic
   =========================================== */

/* ----------------------------------------
   ORNATE FRAME SYSTEM (9-slice inspired)
   ---------------------------------------- */

/* Base ornate frame with multi-layer borders */
.wc3-frame {
  position: relative;
  background: var(--wc3-stone);
  border: 4px solid transparent;
  border-image: linear-gradient(
    135deg,
    var(--wc3-gold) 0%,
    var(--wc3-gold-dark) 25%,
    var(--wc3-bronze) 50%,
    var(--wc3-gold-dark) 75%,
    var(--wc3-gold) 100%
  ) 1;
  box-shadow:
    inset 0 0 0 2px var(--wc3-frame-outer),
    inset 0 0 0 4px var(--wc3-frame-inner),
    0 0 0 1px var(--wc3-frame-shadow),
    0 8px 32px rgba(0, 0, 0, 0.6);
}

/* Frame with rivets (corner decorations) */
.wc3-frame-riveted {
  position: relative;
}

.wc3-frame-riveted::before,
.wc3-frame-riveted::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle at 35% 35%,
    var(--wc3-gold-light) 0%,
    var(--wc3-gold) 40%,
    var(--wc3-gold-dark) 70%,
    var(--wc3-gold-deep) 100%
  );
  border-radius: 50%;
  box-shadow:
    inset 0 -2px 4px rgba(0, 0, 0, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.wc3-frame-riveted::before {
  top: -6px;
  left: -6px;
}

.wc3-frame-riveted::after {
  top: -6px;
  right: -6px;
}

/* Additional corner rivets via pseudo-elements on inner wrapper */
.wc3-frame-riveted .wc3-frame-inner::before,
.wc3-frame-riveted .wc3-frame-inner::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle at 35% 35%,
    var(--wc3-gold-light) 0%,
    var(--wc3-gold) 40%,
    var(--wc3-gold-dark) 70%,
    var(--wc3-gold-deep) 100%
  );
  border-radius: 50%;
  box-shadow:
    inset 0 -2px 4px rgba(0, 0, 0, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.wc3-frame-riveted .wc3-frame-inner::before {
  bottom: -6px;
  left: -6px;
}

.wc3-frame-riveted .wc3-frame-inner::after {
  bottom: -6px;
  right: -6px;
}

/* Stone texture panel */
.wc3-panel-stone {
  background:
    url("textures/stone.png"),
    linear-gradient(180deg, var(--wc3-stone-light) 0%, var(--wc3-stone-dark) 100%);
  background-blend-mode: overlay;
}

/* Parchment interior panel */
.wc3-panel-parchment {
  background:
    url("textures/parchment.png"),
    linear-gradient(180deg, var(--wc3-parchment) 0%, var(--wc3-parchment-dark) 100%);
  background-blend-mode: multiply;
  color: #2D2418;
}

/* Metal plate panel */
.wc3-panel-metal {
  background:
    url("textures/metal.png"),
    linear-gradient(180deg, var(--wc3-iron) 0%, var(--wc3-iron-dark) 100%);
  background-blend-mode: overlay;
}

/* ----------------------------------------
   WC3 BUTTON SYSTEM (3D Beveled)
   ---------------------------------------- */

.wc3-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wc3-parchment);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  border: none;
  border-radius: 2px;
  transition: all 0.15s ease;

  /* 3D Stone/Metal Base */
  background: linear-gradient(180deg,
    var(--wc3-stone-light) 0%,
    var(--wc3-stone) 15%,
    var(--wc3-stone) 85%,
    var(--wc3-stone-dark) 100%
  );

  /* Multi-layer border for depth */
  box-shadow:
    /* Outer gold frame */
    0 0 0 2px var(--wc3-gold-dark),
    0 0 0 3px var(--wc3-frame-outer),
    /* Inner bevel - light top */
    inset 0 1px 0 var(--wc3-bevel-light),
    inset 1px 0 0 rgba(255, 255, 255, 0.08),
    /* Inner bevel - dark bottom */
    inset 0 -2px 0 var(--wc3-bevel-dark),
    inset -1px 0 0 rgba(0, 0, 0, 0.3),
    /* Drop shadow */
    0 4px 12px rgba(0, 0, 0, 0.5);
}

.wc3-btn:hover {
  background: linear-gradient(180deg,
    var(--wc3-stone-light) 0%,
    #454550 15%,
    #454550 85%,
    var(--wc3-stone) 100%
  );
  box-shadow:
    0 0 0 2px var(--wc3-gold),
    0 0 0 3px var(--wc3-frame-outer),
    inset 0 1px 0 var(--wc3-bevel-light),
    inset 1px 0 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 var(--wc3-bevel-dark),
    inset -1px 0 0 rgba(0, 0, 0, 0.3),
    0 0 20px rgba(212, 175, 55, 0.4),
    0 6px 16px rgba(0, 0, 0, 0.5);
}

.wc3-btn:active {
  background: linear-gradient(180deg,
    var(--wc3-stone-dark) 0%,
    var(--wc3-stone) 15%,
    var(--wc3-stone) 85%,
    var(--wc3-stone-light) 100%
  );
  box-shadow:
    0 0 0 2px var(--wc3-gold-dark),
    0 0 0 3px var(--wc3-frame-outer),
    inset 0 2px 6px rgba(0, 0, 0, 0.6),
    inset 0 1px 2px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.4);
  transform: translateY(1px);
}

.wc3-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow:
    0 0 0 2px var(--wc3-iron-dark),
    0 0 0 3px var(--wc3-frame-outer),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Gold variant button */
.wc3-btn-gold {
  background: linear-gradient(180deg,
    var(--wc3-gold-light) 0%,
    var(--wc3-gold) 15%,
    var(--wc3-gold) 85%,
    var(--wc3-gold-dark) 100%
  );
  color: var(--wc3-frame-outer);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.wc3-btn-gold:hover {
  background: linear-gradient(180deg,
    var(--wc3-gold-bright) 0%,
    var(--wc3-gold-light) 15%,
    var(--wc3-gold-light) 85%,
    var(--wc3-gold) 100%
  );
  box-shadow:
    0 0 0 2px var(--wc3-gold-light),
    0 0 0 3px var(--wc3-frame-outer),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 30px rgba(255, 215, 0, 0.5),
    0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Bronze variant button */
.wc3-btn-bronze {
  background: linear-gradient(180deg,
    var(--wc3-bronze) 0%,
    var(--wc3-bronze-dark) 100%
  );
  box-shadow:
    0 0 0 2px var(--wc3-bronze),
    0 0 0 3px var(--wc3-frame-outer),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ----------------------------------------
   MAGICAL GLOW EFFECTS & ANIMATIONS
   ---------------------------------------- */

/* Magical blue glow on hover */
.wc3-glow-hover {
  transition: box-shadow 0.3s ease, filter 0.3s ease;
}

.wc3-glow-hover:hover {
  box-shadow:
    0 0 0 2px var(--wc3-gold),
    0 0 15px rgba(0, 191, 255, 0.5),
    0 0 30px rgba(0, 191, 255, 0.3),
    0 0 45px rgba(212, 175, 55, 0.2);
  filter: brightness(1.1);
}

/* Pulsing magical glow */
@keyframes wc3-magic-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 2px var(--wc3-gold),
      0 0 10px rgba(0, 191, 255, 0.4),
      0 0 20px rgba(0, 191, 255, 0.2);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      0 0 0 2px var(--wc3-gold-light),
      0 0 20px rgba(0, 191, 255, 0.6),
      0 0 40px rgba(0, 191, 255, 0.4),
      0 0 60px rgba(212, 175, 55, 0.3);
    filter: brightness(1.15);
  }
}

.wc3-magic-pulse {
  animation: wc3-magic-pulse 2s ease-in-out infinite;
}

/* Gold shimmer animation */
@keyframes wc3-gold-shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.wc3-shimmer {
  background: linear-gradient(
    90deg,
    var(--wc3-gold-dark) 0%,
    var(--wc3-gold) 25%,
    var(--wc3-gold-light) 50%,
    var(--wc3-gold) 75%,
    var(--wc3-gold-dark) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: wc3-gold-shimmer 3s linear infinite;
}

/* Runic glow effect */
@keyframes wc3-rune-glow {
  0%, 100% {
    text-shadow:
      0 0 5px var(--wc3-magic-blue),
      0 0 10px var(--wc3-magic-blue),
      0 0 15px rgba(0, 191, 255, 0.5);
    opacity: 0.8;
  }
  50% {
    text-shadow:
      0 0 10px var(--wc3-magic-blue),
      0 0 20px var(--wc3-magic-blue),
      0 0 30px rgba(0, 191, 255, 0.8),
      0 0 40px rgba(0, 191, 255, 0.4);
    opacity: 1;
  }
}

.wc3-rune-glow {
  animation: wc3-rune-glow 2s ease-in-out infinite;
}

/* Frost effect */
@keyframes wc3-frost-pulse {
  0%, 100% {
    box-shadow:
      0 0 10px var(--wc3-frost),
      0 0 20px rgba(135, 206, 235, 0.4);
    border-color: var(--wc3-frost);
  }
  50% {
    box-shadow:
      0 0 20px var(--wc3-frost),
      0 0 40px rgba(135, 206, 235, 0.6),
      0 0 60px rgba(135, 206, 235, 0.3);
    border-color: #B0E0E6;
  }
}

.wc3-frost-effect {
  animation: wc3-frost-pulse 3s ease-in-out infinite;
}

/* ----------------------------------------
   WC3 TOOLTIP SYSTEM
   ---------------------------------------- */

.wc3-tooltip {
  position: absolute;
  z-index: 1000;
  padding: 12px 16px;
  max-width: 320px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--wc3-parchment);

  /* Parchment-style background */
  background:
    linear-gradient(180deg,
      rgba(26, 22, 20, 0.98) 0%,
      rgba(20, 18, 16, 0.98) 100%
    );

  /* Ornate gold border */
  border: 2px solid var(--wc3-gold-dark);
  border-radius: 2px;

  box-shadow:
    0 0 0 1px var(--wc3-frame-outer),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.7);

  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.wc3-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.wc3-tooltip-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--wc3-gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--wc3-gold-dark);
}

.wc3-tooltip-hotkey {
  display: inline-block;
  padding: 2px 6px;
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--wc3-stone-dark);
  border: 1px solid var(--wc3-bronze);
  border-radius: 2px;
  color: var(--wc3-gold-light);
}

.wc3-tooltip-desc {
  color: rgba(245, 230, 211, 0.85);
}

.wc3-tooltip-cost {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wc3-tooltip-cost-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 12px;
}

.wc3-tooltip-cost-item.gold { color: var(--wc3-gold-light); }
.wc3-tooltip-cost-item.lumber { color: #90EE90; }
.wc3-tooltip-cost-item.food { color: #F4A460; }
.wc3-tooltip-cost-item.insufficient { color: var(--bad); }

/* ----------------------------------------
   ENHANCED PORTRAIT FRAME
   ---------------------------------------- */

.wc3-portrait-enhanced {
  position: relative;
  width: 80px;
  height: 80px;
}

.wc3-portrait-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
  background: linear-gradient(135deg, var(--wc3-gold), var(--wc3-gold-dark)) border-box;
  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: wc3-portrait-spin 20s linear infinite;
}

@keyframes wc3-portrait-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.wc3-portrait-inner {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--wc3-stone-dark);
  border: 2px solid var(--wc3-bronze);
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.6),
    0 0 0 1px var(--wc3-frame-shadow);
}

.wc3-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wc3-portrait-level {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--wc3-gold-light);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  background: linear-gradient(180deg, var(--wc3-stone-light), var(--wc3-stone-dark));
  border: 2px solid var(--wc3-gold-dark);
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* ----------------------------------------
   MAGICAL WISP PARTICLES
   ---------------------------------------- */

.wc3-wisps-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.wc3-wisp {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(0, 191, 255, 0.9) 0%,
    rgba(0, 191, 255, 0.4) 40%,
    transparent 70%
  );
  box-shadow:
    0 0 10px rgba(0, 191, 255, 0.8),
    0 0 20px rgba(0, 191, 255, 0.4),
    0 0 30px rgba(0, 191, 255, 0.2);
  animation: wc3-wisp-float 8s ease-in-out infinite;
}

@keyframes wc3-wisp-float {
  0% {
    transform: translateY(100vh) translateX(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
    transform: translateY(80vh) translateX(20px) scale(1);
  }
  30% {
    transform: translateY(60vh) translateX(-30px) scale(0.9);
    opacity: 0.7;
  }
  50% {
    transform: translateY(40vh) translateX(40px) scale(0.8);
    opacity: 0.6;
  }
  70% {
    transform: translateY(20vh) translateX(-20px) scale(0.6);
    opacity: 0.4;
  }
  100% {
    transform: translateY(-10vh) translateX(10px) scale(0.3);
    opacity: 0;
  }
}

/* Gold wisp variant */
.wc3-wisp-gold {
  background: radial-gradient(circle,
    rgba(255, 215, 0, 0.9) 0%,
    rgba(218, 165, 32, 0.4) 40%,
    transparent 70%
  );
  box-shadow:
    0 0 10px rgba(255, 215, 0, 0.8),
    0 0 20px rgba(218, 165, 32, 0.4),
    0 0 30px rgba(184, 134, 11, 0.2);
}

/* Fire wisp variant */
.wc3-wisp-fire {
  background: radial-gradient(circle,
    rgba(255, 69, 0, 0.9) 0%,
    rgba(255, 107, 53, 0.4) 40%,
    transparent 70%
  );
  box-shadow:
    0 0 10px rgba(255, 69, 0, 0.8),
    0 0 20px rgba(255, 69, 0, 0.4),
    0 0 30px rgba(255, 107, 53, 0.2);
}

/* ----------------------------------------
   LOADING & CONNECTING ANIMATIONS
   ---------------------------------------- */

/* Runic loading circle */
.wc3-loading-runes {
  position: relative;
  width: 80px;
  height: 80px;
}

.wc3-loading-runes::before {
  content: "᛭᛫᛬᛭᛫᛬᛭᛫";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--wc3-magic-blue);
  animation: wc3-rune-spin 4s linear infinite;
  text-shadow:
    0 0 10px var(--wc3-magic-blue),
    0 0 20px rgba(0, 191, 255, 0.5);
}

@keyframes wc3-rune-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.wc3-loading-runes::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--wc3-gold);
  border-right-color: var(--wc3-gold-dark);
  animation: wc3-rune-spin 2s linear infinite reverse;
}

/* Charging orb animation */
.wc3-loading-orb {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    var(--wc3-magic-blue) 0%,
    rgba(0, 100, 150, 0.8) 50%,
    rgba(0, 50, 80, 0.9) 100%
  );
  box-shadow:
    inset 0 0 20px rgba(0, 191, 255, 0.5),
    0 0 20px rgba(0, 191, 255, 0.6),
    0 0 40px rgba(0, 191, 255, 0.3);
  animation: wc3-orb-pulse 1.5s ease-in-out infinite;
}

@keyframes wc3-orb-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      inset 0 0 20px rgba(0, 191, 255, 0.5),
      0 0 20px rgba(0, 191, 255, 0.6),
      0 0 40px rgba(0, 191, 255, 0.3);
  }
  50% {
    transform: scale(1.1);
    box-shadow:
      inset 0 0 30px rgba(0, 191, 255, 0.7),
      0 0 40px rgba(0, 191, 255, 0.8),
      0 0 60px rgba(0, 191, 255, 0.5),
      0 0 80px rgba(0, 191, 255, 0.2);
  }
}

/* Connection status indicator */
.wc3-connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--wc3-stone-dark);
  border: 2px solid var(--wc3-bronze);
  border-radius: 2px;
}

.wc3-connection-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--wc3-magic-green);
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
  animation: wc3-connection-pulse 2s ease-in-out infinite;
}

.wc3-connection-dot.connecting {
  background: var(--wc3-gold);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  animation: wc3-connection-blink 0.8s ease-in-out infinite;
}

.wc3-connection-dot.disconnected {
  background: var(--bad);
  box-shadow: 0 0 8px rgba(255, 77, 77, 0.6);
  animation: none;
}

@keyframes wc3-connection-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.9); }
}

@keyframes wc3-connection-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ----------------------------------------
   RUNIC DECORATIONS & DIVIDERS
   ---------------------------------------- */

.wc3-divider {
  position: relative;
  height: 2px;
  margin: 16px 0;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--wc3-bronze) 15%,
    var(--wc3-gold) 50%,
    var(--wc3-bronze) 85%,
    transparent 100%
  );
}

.wc3-divider::before,
.wc3-divider::after {
  content: "◆";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--wc3-gold);
  text-shadow: 0 0 4px rgba(212, 175, 55, 0.5);
}

.wc3-divider::before { left: 10%; }
.wc3-divider::after { right: 10%; }

/* Ornate section header */
.wc3-section-header {
  position: relative;
  text-align: center;
  padding: 12px 24px;
  margin-bottom: 16px;
}

.wc3-section-header::before,
.wc3-section-header::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--wc3-gold));
}

.wc3-section-header::before {
  left: 0;
}

.wc3-section-header::after {
  right: 0;
  background: linear-gradient(90deg, var(--wc3-gold), transparent);
}

.wc3-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--wc3-gold);
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.8),
    0 0 10px rgba(212, 175, 55, 0.3);
}

/* Corner ornaments */
.wc3-corner-ornament {
  position: absolute;
  width: 24px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23D4AF37' d='M0 0L12 0L12 2L2 2L2 12L0 12Z'/%3E%3Cpath fill='%23B8860B' d='M0 0L2 0L2 2L0 2Z M10 0L12 0L12 2L10 2Z M0 10L2 10L2 12L0 12Z'/%3E%3C/svg%3E");
}

.wc3-corner-ornament.top-left { top: 0; left: 0; }
.wc3-corner-ornament.top-right { top: 0; right: 0; transform: scaleX(-1); }
.wc3-corner-ornament.bottom-left { bottom: 0; left: 0; transform: scaleY(-1); }
.wc3-corner-ornament.bottom-right { bottom: 0; right: 0; transform: scale(-1); }

/* ----------------------------------------
   SOUND EFFECT HOOKS (CSS Classes)
   ---------------------------------------- */

/* These classes can be used with JavaScript to trigger sounds */
[data-wc3-sound="click"] { /* stone click */ }
[data-wc3-sound="hover"] { /* subtle whoosh */ }
[data-wc3-sound="error"] { /* negative tone */ }
[data-wc3-sound="success"] { /* positive chime */ }
[data-wc3-sound="magic"] { /* arcane effect */ }
[data-wc3-sound="gold"] { /* coin clink */ }

/* Visual feedback classes that pair with sounds */
.wc3-click-feedback {
  transition: transform 0.1s ease;
}

.wc3-click-feedback:active {
  transform: scale(0.97);
}

/* ----------------------------------------
   ENHANCED COMMAND GRID ICONS
   ---------------------------------------- */

.wc3-cmd-enhanced {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-height: 48px;

  /* Stone button base */
  background:
    linear-gradient(180deg,
      var(--wc3-stone-light) 0%,
      var(--wc3-stone) 20%,
      var(--wc3-stone) 80%,
      var(--wc3-stone-dark) 100%
    );

  /* Gold frame border */
  border: 2px solid var(--wc3-gold-dark);
  border-top-color: var(--wc3-gold);
  border-left-color: var(--wc3-gold);
  border-radius: 2px;

  /* 3D depth */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.5);

  cursor: pointer;
  transition: all 0.15s ease;
}

.wc3-cmd-enhanced:hover {
  border-color: var(--wc3-gold-light);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4),
    0 0 15px rgba(212, 175, 55, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.5);
}

.wc3-cmd-enhanced:active {
  background:
    linear-gradient(180deg,
      var(--wc3-stone-dark) 0%,
      var(--wc3-stone) 20%,
      var(--wc3-stone) 80%,
      var(--wc3-stone-light) 100%
    );
  border-color: var(--wc3-gold-dark);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

.wc3-cmd-enhanced.on-cooldown {
  opacity: 0.6;
  pointer-events: none;
}

.wc3-cmd-enhanced.on-cooldown::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.4) 100%
  );
  animation: wc3-cooldown-sweep 5s linear forwards;
}

@keyframes wc3-cooldown-sweep {
  from {
    clip-path: polygon(0 100%, 100% 100%, 100% 0%, 0 0%);
  }
  to {
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
  }
}

/* ----------------------------------------
   REDUCED MOTION SUPPORT
   ---------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .wc3-magic-pulse,
  .wc3-shimmer,
  .wc3-rune-glow,
  .wc3-frost-effect,
  .wc3-portrait-ring,
  .wc3-wisp,
  .wc3-loading-runes::before,
  .wc3-loading-runes::after,
  .wc3-loading-orb,
  .wc3-connection-dot {
    animation: none;
  }

  .wc3-tooltip {
    transition: none;
  }

  .wc3-btn,
  .wc3-glow-hover,
  .wc3-cmd-enhanced {
    transition: none;
  }
}

/* ----------------------------------------
   WC3 CURSOR EFFECTS
   ---------------------------------------- */

/**
 * Custom WC3-themed cursor styles
 * Applies on devices with fine pointer (mouse/trackpad)
 */

@media (pointer: fine) {
  /* Custom cursor container - WC3 gauntlet style */
  .wc3-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    width: 24px;
    height: 24px;
    transform: translate(-4px, -2px);
    transition: transform 0.1s ease-out;
  }

  /* Cursor inner dot - magical glow point */
  .wc3-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle,
      var(--wc3-gold-light) 0%,
      var(--wc3-gold) 50%,
      transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
    transition: transform 0.15s ease-out, opacity 0.15s ease-out;
  }

  /* Cursor ring - magical aura */
  .wc3-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    border: 2px solid var(--wc3-gold);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    opacity: 0.6;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
    transition: transform 0.08s ease-out, width 0.2s ease-out, height 0.2s ease-out, border-color 0.2s ease;
  }

  /* Cursor hover state - expands for clickable elements */
  .wc3-cursor-dot.hovering {
    transform: scale(1.5);
    background: radial-gradient(circle,
      var(--wc3-magic-blue) 0%,
      rgba(0, 191, 255, 0.6) 50%,
      transparent 70%
    );
    box-shadow: 0 0 12px rgba(0, 191, 255, 0.8);
  }

  .wc3-cursor-ring.hovering {
    width: 40px;
    height: 40px;
    opacity: 0.85;
    border-color: var(--wc3-magic-blue);
    box-shadow: 0 0 16px rgba(0, 191, 255, 0.5);
  }

  /* Cursor click state - contracts on click */
  .wc3-cursor-dot.clicking {
    transform: scale(0.7);
  }

  .wc3-cursor-ring.clicking {
    width: 20px;
    height: 20px;
    opacity: 1;
    border-width: 3px;
  }

  /* Hide default cursor on map canvas */
  #mapCanvas.custom-cursor,
  .wc3-custom-cursor {
    cursor: none;
  }
}

/* Click ripple effect on map */
.wc3-click-ripple {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid var(--wc3-gold);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: scale(0);
  animation: wc3-ripple-expand 0.6s ease-out forwards;
}

@keyframes wc3-ripple-expand {
  0% {
    opacity: 0.8;
    transform: scale(0);
  }
  100% {
    opacity: 0;
    transform: scale(2.5);
  }
}

/* Magic click effect - for command buttons */
.wc3-magic-click {
  position: absolute;
  width: 30px;
  height: 30px;
  pointer-events: none;
  opacity: 0;
}

.wc3-magic-click::before,
.wc3-magic-click::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: wc3-magic-burst 0.5s ease-out forwards;
}

.wc3-magic-click::before {
  background: radial-gradient(circle, rgba(0, 191, 255, 0.6) 0%, transparent 70%);
}

.wc3-magic-click::after {
  border: 2px solid var(--wc3-magic-blue);
  animation-delay: 0.05s;
}

@keyframes wc3-magic-burst {
  0% {
    opacity: 1;
    transform: scale(0.5);
  }
  100% {
    opacity: 0;
    transform: scale(2);
  }
}

/* ----------------------------------------
   MACRO ANIMATIONS - Big visual feedback
   ---------------------------------------- */

/**
 * Large-scale animations for significant events
 * Task completion, critical alerts, region upgrades
 */

/* Screen flash effect */
.wc3-screen-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
}

.wc3-screen-flash.success {
  background: radial-gradient(circle at center, rgba(74, 156, 45, 0.3) 0%, transparent 70%);
  animation: screen-flash-success 0.5s ease-out forwards;
}

.wc3-screen-flash.error {
  background: radial-gradient(circle at center, rgba(139, 26, 26, 0.4) 0%, transparent 70%);
  animation: screen-flash-error 0.4s ease-out forwards;
}

.wc3-screen-flash.gold {
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.35) 0%, transparent 70%);
  animation: screen-flash-gold 0.6s ease-out forwards;
}

@keyframes screen-flash-success {
  0% { opacity: 0; }
  15% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes screen-flash-error {
  0% { opacity: 0; transform: scale(1); }
  10% { opacity: 1; }
  20% { opacity: 0.8; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes screen-flash-gold {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

/* Screen shake effect */
.wc3-screen-shake {
  animation: screen-shake 0.4s ease-out;
}

@keyframes screen-shake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-4px); }
  20% { transform: translateX(4px); }
  30% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  50% { transform: translateX(-2px); }
  60% { transform: translateX(2px); }
  70% { transform: translateX(-1px); }
  80% { transform: translateX(1px); }
}

/* Task complete celebration burst */
.wc3-celebration-burst {
  position: absolute;
  pointer-events: none;
  width: 100px;
  height: 100px;
}

.wc3-celebration-burst::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid var(--wc3-gold);
  border-radius: 50%;
  animation: celebration-ring 0.8s ease-out forwards;
}

.wc3-celebration-burst::after {
  content: '';
  position: absolute;
  inset: 20px;
  background: radial-gradient(circle,
    rgba(74, 156, 45, 0.8) 0%,
    rgba(74, 156, 45, 0.4) 30%,
    transparent 60%
  );
  border-radius: 50%;
  animation: celebration-glow 0.8s ease-out forwards;
}

@keyframes celebration-ring {
  0% {
    opacity: 1;
    transform: scale(0.3);
  }
  100% {
    opacity: 0;
    transform: scale(2);
  }
}

@keyframes celebration-glow {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  30% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

/* Region upgrade dramatic effect */
.wc3-upgrade-flash {
  position: absolute;
  inset: -10px;
  pointer-events: none;
  border-radius: 4px;
  animation: upgrade-flash-sequence 1.2s ease-out forwards;
}

@keyframes upgrade-flash-sequence {
  0% {
    box-shadow: inset 0 0 0 0 var(--wc3-gold), 0 0 0 0 var(--wc3-gold);
    opacity: 0;
  }
  10% {
    box-shadow: inset 0 0 40px var(--wc3-gold), 0 0 60px var(--wc3-gold);
    opacity: 1;
  }
  30% {
    box-shadow: inset 0 0 20px var(--wc3-gold-dark), 0 0 40px var(--wc3-gold);
  }
  100% {
    box-shadow: inset 0 0 0 0 transparent, 0 0 0 0 transparent;
    opacity: 0;
  }
}

/* Critical alert pulse - aggressive attention getter */
.wc3-critical-alert {
  animation: critical-alert-pulse 0.6s ease-in-out infinite;
}

@keyframes critical-alert-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(139, 26, 26, 0);
    border-color: var(--bad);
  }
  50% {
    box-shadow: 0 0 20px 5px rgba(139, 26, 26, 0.6);
    border-color: rgba(255, 77, 77, 1);
  }
}

/* Number counter animation */
.wc3-counter-bump {
  animation: counter-bump 0.3s ease-out;
}

@keyframes counter-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); color: var(--wc3-gold-light); }
  100% { transform: scale(1); }
}

/* Gold gain effect */
.wc3-gold-gain {
  position: absolute;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--wc3-gold-light);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
  pointer-events: none;
  animation: gold-float-up 1.2s ease-out forwards;
}

@keyframes gold-float-up {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(0.8);
  }
}

/* Worker spawn entrance */
.wc3-spawn-entrance {
  animation: spawn-entrance 0.5s ease-out;
}

@keyframes spawn-entrance {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* ===========================================
   BLAZECRAFT ENHANCED UI - Reference Image Match
   Task-focused metrics, ornate frames, 3x3 commands
   =========================================== */

/* ----------------------------------------
   TASK METRICS BAR (Top Resource Bar)
   ---------------------------------------- */

.wc3-task-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wc3-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(180deg,
    rgba(45, 41, 38, 0.95) 0%,
    rgba(26, 24, 22, 0.98) 100%
  );
  border: 2px solid var(--wc3-bronze);
  border-top-color: var(--wc3-gold-dark);
  border-radius: 3px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -2px 0 rgba(0,0,0,0.4),
    0 2px 6px rgba(0,0,0,0.5);
}

.wc3-metric-ico {
  font-size: 16px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.wc3-metric-ico.tasks { color: #FFD700; }
.wc3-metric-ico.files { color: #87CEEB; }
.wc3-metric-ico.workers { color: #FFD700; }
.wc3-metric-ico.failed { color: #FF6B6B; }
.wc3-metric-ico.tokens { color: #FFD700; }

.wc3-metric-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--wc3-parchment);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  letter-spacing: 0.02em;
}

.wc3-metric-num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
  color: var(--wc3-gold-light);
  text-shadow: 0 0 6px rgba(212,175,55,0.4);
  min-width: 40px;
  text-align: right;
}

.wc3-metric-failed {
  border-color: rgba(139, 26, 26, 0.6);
}

.wc3-metric-failed .wc3-metric-num {
  color: var(--bad);
  text-shadow: 0 0 6px rgba(255,77,77,0.4);
}

/* Topbar center - Idle Alert */
.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.idle-alert-enhanced {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(180deg,
    rgba(55, 80, 55, 0.9) 0%,
    rgba(30, 50, 30, 0.95) 100%
  );
  border: 2px solid #4a9c2d;
  border-radius: 4px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 2px 8px rgba(0,0,0,0.4);
  transition: all 0.2s ease;
}

.idle-alert-enhanced:hover {
  border-color: #6bbd4a;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    0 0 12px rgba(74,156,45,0.4),
    0 2px 8px rgba(0,0,0,0.4);
}

.idle-alert-icon {
  font-size: 18px;
}

.idle-alert-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: #8BC34A;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.idle-alert-num {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: #CDDC39;
  text-shadow: 0 0 8px rgba(205,220,57,0.5);
}

/* ----------------------------------------
   ENHANCED BOTTOM HUD LAYOUT
   ---------------------------------------- */

.wc3-hud-bottom-enhanced {
  grid-row: 3;
  display: grid;
  grid-template-columns: 220px 220px 200px 1fr 240px;
  gap: 0;
  border-radius: 0;
  border-width: 3px 0 0 0;
  padding: 0;
  background:
    url("textures/stone.png"),
    linear-gradient(180deg, var(--wc3-stone) 0%, var(--wc3-stone-dark) 100%);
  background-blend-mode: overlay, normal;
}

/* ----------------------------------------
   ENHANCED PORTRAIT PANEL - Ornate Frame
   ---------------------------------------- */

.wc3-portrait-panel-enhanced {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-right: 3px solid var(--wc3-bronze);
  background:
    radial-gradient(ellipse at 20% 30%, rgba(212,175,55,0.08) 0%, transparent 50%),
    linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.45) 100%);
  position: relative;
}

/* Ornate Portrait Frame */
.wc3-portrait-frame-ornate {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.wc3-portrait-frame-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--wc3-gold) 0deg,
    var(--wc3-gold-dark) 45deg,
    var(--wc3-bronze) 90deg,
    var(--wc3-gold-dark) 135deg,
    var(--wc3-gold) 180deg,
    var(--wc3-gold-dark) 225deg,
    var(--wc3-bronze) 270deg,
    var(--wc3-gold-dark) 315deg,
    var(--wc3-gold) 360deg
  );
  padding: 4px;
  -webkit-mask: radial-gradient(transparent 55%, black 56%);
  mask: radial-gradient(transparent 55%, black 56%);
  animation: portrait-ring-rotate 30s linear infinite;
}

@keyframes portrait-ring-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.wc3-portrait-frame-inner {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: linear-gradient(180deg,
    var(--wc3-stone-light) 0%,
    var(--wc3-stone-dark) 100%
  );
  border: 3px solid var(--wc3-bronze-dark);
  box-shadow:
    inset 0 4px 12px rgba(0,0,0,0.7),
    inset 0 -2px 6px rgba(255,255,255,0.05),
    0 0 0 1px rgba(0,0,0,0.5);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wc3-portrait-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%,
    rgba(0,100,150,0.4) 0%,
    rgba(0,50,80,0.8) 50%,
    rgba(0,30,50,0.95) 100%
  );
}

.wc3-portrait-icon-img {
  font-size: 36px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.8));
}

/* Corner ornaments */
.wc3-portrait-frame-corners::before,
.wc3-portrait-frame-corners::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 35% 35%,
    var(--wc3-gold-light) 0%,
    var(--wc3-gold) 40%,
    var(--wc3-gold-dark) 70%,
    var(--wc3-gold-deep) 100%
  );
  border-radius: 50%;
  box-shadow:
    inset 0 -2px 4px rgba(0,0,0,0.5),
    0 2px 4px rgba(0,0,0,0.4);
  z-index: 10;
}

.wc3-portrait-frame-corners::before {
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
}

.wc3-portrait-frame-corners::after {
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
}

/* Portrait Details */
.wc3-portrait-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wc3-portrait-name-large {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--wc3-gold);
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc3-portrait-task {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--wc3-parchment-dark);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

/* Progress Bar */
.wc3-progress-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.wc3-progress-bar {
  flex: 1;
  height: 12px;
  background: rgba(0,0,0,0.6);
  border: 2px solid var(--wc3-bronze-dark);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.wc3-progress-fill {
  height: 100%;
  background: linear-gradient(180deg,
    #4CAF50 0%,
    #2E7D32 50%,
    #1B5E20 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 0 6px rgba(76,175,80,0.4);
  transition: width 0.3s ease;
}

.wc3-progress-pct {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--wc3-gold-light);
  min-width: 32px;
  text-align: right;
}

/* Portrait Stats */
.wc3-portrait-stats {
  display: flex;
  gap: 16px;
}

.wc3-portrait-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wc3-stat-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wc3-stat-value {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--wc3-gold-light);
  text-shadow: 0 0 4px rgba(212,175,55,0.3);
}

/* Expand Button */
.wc3-portrait-expand {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: linear-gradient(180deg, var(--wc3-stone-light), var(--wc3-stone-dark));
  border: 2px solid var(--wc3-gold-dark);
  border-radius: 50%;
  color: var(--wc3-gold);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 2px 4px rgba(0,0,0,0.4);
  transition: all 0.15s ease;
}

.wc3-portrait-expand:hover {
  border-color: var(--wc3-gold);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    0 0 8px rgba(212,175,55,0.4),
    0 2px 4px rgba(0,0,0,0.4);
}

/* ----------------------------------------
   SELECTION SUMMARY PANEL
   ---------------------------------------- */

.wc3-selection-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-right: 3px solid var(--wc3-bronze);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(212,175,55,0.06) 0%, transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.45) 100%);
  position: relative;
}

.wc3-selection-panel[hidden] {
  display: none;
}

.wc3-selection-panel.is-pulsing {
  animation: selection-panel-pulse 0.18s ease-out;
}

.wc3-selection-panel.is-shake {
  animation: selection-panel-shake 0.24s ease-in-out;
}

@keyframes selection-panel-pulse {
  0% { box-shadow: 0 0 0 rgba(212,175,55,0); }
  50% { box-shadow: 0 0 12px rgba(212,175,55,0.45); }
  100% { box-shadow: 0 0 0 rgba(212,175,55,0); }
}

@keyframes selection-panel-shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.wc3-selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wc3-selection-heading {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.wc3-selection-count {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--wc3-gold);
  text-shadow: 0 2px 4px rgba(0,0,0,0.7);
}

.wc3-selection-label {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--wc3-parchment-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wc3-selection-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
}

.wc3-selection-feedback.is-command {
  color: var(--good);
  border-color: rgba(55,214,122,0.4);
  box-shadow: 0 0 8px rgba(55,214,122,0.25);
}

.wc3-selection-feedback.is-invalid {
  color: var(--bad);
  border-color: rgba(255,77,77,0.45);
  box-shadow: 0 0 10px rgba(255,77,77,0.35);
}

.wc3-selection-feedback-icon {
  font-size: 12px;
}

.wc3-selection-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wc3-selection-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--wc3-parchment);
}

.wc3-selection-type.is-primary {
  border-color: rgba(212,175,55,0.6);
  box-shadow: 0 0 10px rgba(212,175,55,0.35);
}

.wc3-selection-type-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.6);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.2);
}

.wc3-selection-type-icon.status-idle { background: #4a6fa5; }
.wc3-selection-type-icon.status-moving { background: #5a88c5; }
.wc3-selection-type-icon.status-working { background: #2d7a4f; }
.wc3-selection-type-icon.status-blocked { background: #8b3030; }
.wc3-selection-type-icon.status-complete { background: #8b7d30; }
.wc3-selection-type-icon.status-terminated { background: #5a5a5a; }
.wc3-selection-type-icon.status-hold { background: #8b6b30; }

.wc3-selection-type-count {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--wc3-gold-light);
}

.wc3-selection-stats {
  display: flex;
  gap: 12px;
}

.wc3-selection-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wc3-selection-stat-label {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wc3-selection-stat-value {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--wc3-gold-light);
}

/* ----------------------------------------
   3x3 COMMAND GRID WITH TEXT LABELS
   ---------------------------------------- */

.wc3-command-panel-3x3 {
  padding: 10px;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(212,175,55,0.06) 0%, transparent 50%),
    linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.35) 100%);
}

.wc3-command-grid-3x3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 5px;
  height: 100%;
}

.wc3-cmd-labeled {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  background: linear-gradient(180deg,
    var(--wc3-stone-light) 0%,
    var(--wc3-stone) 20%,
    var(--wc3-stone) 80%,
    var(--wc3-stone-dark) 100%
  );
  border: 2px solid var(--wc3-bronze);
  border-top-color: var(--wc3-stone-light);
  border-left-color: var(--wc3-stone);
  border-radius: 3px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -2px 0 rgba(0,0,0,0.4),
    0 2px 4px rgba(0,0,0,0.5);
  transition: all 0.15s ease;
}

.wc3-cmd-labeled:hover {
  border-color: var(--wc3-gold);
  background: linear-gradient(180deg,
    var(--wc3-stone-light) 0%,
    #454540 20%,
    #454540 80%,
    var(--wc3-stone) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    inset 0 -2px 0 rgba(0,0,0,0.4),
    0 0 12px rgba(218,165,32,0.45),
    0 2px 4px rgba(0,0,0,0.5);
}

.wc3-cmd-labeled:active {
  background: linear-gradient(180deg,
    var(--wc3-stone-dark) 0%,
    var(--wc3-stone) 100%
  );
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
  transform: translateY(1px);
}

.wc3-cmd-text {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--wc3-parchment);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  text-align: center;
  line-height: 1.2;
}

.wc3-cmd-key {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  opacity: 0.8;
}

/* Danger button (Terminate) */
.wc3-cmd-danger {
  background: linear-gradient(180deg,
    rgba(60, 35, 30, 0.9) 0%,
    var(--wc3-stone) 20%,
    var(--wc3-stone) 80%,
    var(--wc3-stone-dark) 100%
  );
  border-color: rgba(139, 26, 26, 0.6);
}

.wc3-cmd-danger:hover {
  border-color: rgba(255, 77, 77, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -2px 0 rgba(0,0,0,0.4),
    0 0 12px rgba(139, 26, 26, 0.5),
    0 2px 4px rgba(0,0,0,0.5);
}

/* ----------------------------------------
   ENHANCED EVENT LOG WITH AVATARS
   ---------------------------------------- */

.wc3-event-log .panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Log item with avatar */
.log-item {
  display: grid;
  grid-template-columns: 36px 58px 1fr;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.25);
  margin-bottom: 8px;
  cursor: pointer;
  align-items: center;
  text-align: left;
}

.log-item:hover {
  border-color: rgba(232,108,44,0.4);
  background: rgba(0,0,0,0.35);
}

/* Worker Avatar Masks */
.log-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid var(--wc3-bronze);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.4),
    0 2px 4px rgba(0,0,0,0.3);
}

/* Avatar color variants based on status */
.log-avatar-working {
  background: linear-gradient(180deg, #4a9c2d 0%, #2d5a1a 100%);
  border-color: #6bbd4a;
}

.log-avatar-complete {
  background: linear-gradient(180deg, #D4AF37 0%, #8B6914 100%);
  border-color: var(--wc3-gold);
}

.log-avatar-error {
  background: linear-gradient(180deg, #c0392b 0%, #7b241c 100%);
  border-color: #e74c3c;
}

.log-avatar-spawn {
  background: linear-gradient(180deg, #3498db 0%, #1a5276 100%);
  border-color: #5dade2;
}

.log-avatar-default {
  background: linear-gradient(180deg, var(--wc3-stone-light) 0%, var(--wc3-stone-dark) 100%);
  border-color: var(--wc3-bronze);
}

/* Timestamp formatting */
.log-time {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.log-time::before {
  content: "[";
}

.log-time::after {
  content: "]";
}

/* Log text */
.log-text {
  font-size: 12px;
  line-height: 1.3;
  color: rgba(244,244,247,0.92);
}

/* Error state text */
.log-item.err .log-text {
  color: #ff6b6b;
}

.log-item.err .log-text::before {
  content: "Error: ";
  color: #ff4d4d;
  font-weight: 700;
}

/* Success state text */
.log-item.ok .log-text {
  color: #69db7c;
}

/* Log icon - hidden when using avatars */
.log-ico {
  display: none;
}

/* ----------------------------------------
   RESPONSIVE ADJUSTMENTS
   ---------------------------------------- */

@media (max-width: 1400px) {
  .wc3-metric-label {
    display: none;
  }

  .wc3-task-metrics {
    gap: 6px;
  }

  .wc3-metric {
    padding: 4px 8px;
  }

  .wc3-hud-bottom-enhanced {
    grid-template-columns: minmax(180px, 240px) minmax(180px, 220px) minmax(160px, 200px) 1fr minmax(180px, 240px);
  }
}

@media (max-width: 1180px) {
  .wc3-metric-label {
    display: none;
  }

  .idle-alert-label {
    display: none;
  }

  .wc3-portrait-stats {
    flex-direction: column;
    gap: 4px;
  }

  .wc3-hud-bottom-enhanced {
    grid-template-columns: minmax(160px, 200px) minmax(150px, 190px) minmax(140px, 180px) 1fr minmax(160px, 200px);
  }
}

@media (max-width: 1024px) {
  .wc3-metric:nth-child(n+4) {
    display: none;
  }

  .topbar-center {
    display: none;
  }

  .wc3-portrait-task {
    display: none;
  }

  .wc3-hud-bottom-enhanced {
    grid-template-columns: minmax(140px, 180px) minmax(130px, 170px) minmax(120px, 160px) 1fr minmax(140px, 180px);
  }
}

@media (max-width: 768px) {
  .wc3-task-metrics {
    gap: 4px;
  }

  .wc3-metric {
    padding: 3px 6px;
  }

  .wc3-metric:nth-child(n+3) {
    display: none;
  }

  .wc3-portrait-details {
    display: none;
  }

  .wc3-portrait-expand {
    display: none;
  }

  .wc3-hud-bottom-enhanced {
    grid-template-columns: minmax(100px, 120px) 1fr minmax(140px, 180px);
  }

  .wc3-selection-panel {
    display: none;
  }

  .wc3-minimap-panel,
  .wc3-ops-panel {
    display: none;
  }
}

@media (max-width: 480px) {
  .wc3-metric:nth-child(n+2) {
    display: none;
  }

  .wc3-portrait-frame-ornate {
    width: 60px;
    height: 60px;
  }

  .wc3-portrait-icon-img {
    font-size: 24px;
  }

  .wc3-command-grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 3px;
  }

  .wc3-cmd-labeled:nth-child(n+7) {
    display: none;
  }

  .wc3-cmd-text {
    font-size: 10px;
  }

  .wc3-cmd-key {
    display: none;
  }

  .wc3-hud-bottom-enhanced {
    grid-template-columns: minmax(80px, 100px) 1fr;
  }
}

/* ----------------------------------------
   WELCOME OVERLAY
   ---------------------------------------- */

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  animation: welcomeFadeIn 0.3s ease;
}

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

@keyframes welcomeFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.welcome-card {
  max-width: 480px;
  width: 90%;
  padding: 2rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
  border: 1px solid var(--wc3-gold, #d4af37);
  border-radius: 12px;
  box-shadow: 
    0 0 0 1px rgba(212, 175, 55, 0.3),
    0 0 30px rgba(212, 175, 55, 0.15),
    0 20px 50px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: welcomeSlideUp 0.4s ease;
}

@keyframes welcomeSlideUp {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.welcome-header {
  margin-bottom: 1.5rem;
}

.welcome-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.welcome-title {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--wc3-gold, #d4af37);
  margin: 0 0 0.25rem 0;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.welcome-tagline {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.welcome-content {
  margin-bottom: 1.5rem;
}

.welcome-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  margin: 0 0 1.25rem 0;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.welcome-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  text-align: left;
}

.welcome-feature-icon {
  font-size: 1.25rem;
}

.welcome-feature-text {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
}

.welcome-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.welcome-actions .btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  min-width: 120px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.welcome-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

.welcome-hint kbd {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* Hide overlay after dismissed */
.welcome-overlay.dismissed {
  animation: welcomeFadeOut 0.3s ease forwards;
  pointer-events: none;
}

@keyframes welcomeFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ===========================================
   Health Panel Styles
   =========================================== */

.wc3-health-panel {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 193, 37, 0.15);
}

.wc3-health-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.wc3-health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
  transition: background 0.3s ease;
}

.wc3-health-dot[data-status="up"] {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.wc3-health-dot[data-status="down"] {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
  animation: healthPulse 1s ease-in-out infinite;
}

.wc3-health-dot[data-status="degraded"] {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.wc3-health-dot[data-status="unknown"] {
  background: #666;
}

@keyframes healthPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.wc3-health-label {
  color: var(--bsi-text-secondary, #a3a3a3);
}

.wc3-health-status {
  color: var(--bsi-text-primary, #fafafa);
  font-weight: 600;
  text-transform: capitalize;
}

.wc3-health-details {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--bsi-text-tertiary, #737373);
}

.wc3-health-latency {
  font-family: 'JetBrains Mono', monospace;
}

/* ===========================================
   Accessibility: Focus States
   =========================================== */

/* Universal focus outline for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--bsi-ember, #FF6B35);
  outline-offset: 2px;
}

/* Remove focus outline on mouse click */
:focus:not(:focus-visible) {
  outline: none;
}

/* Enhanced focus for buttons */
.btn:focus-visible,
.wc3-cmd-labeled:focus-visible,
.mode-btn:focus-visible {
  outline: 2px solid var(--bsi-ember, #FF6B35);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.25);
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bsi-ember);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 8px 8px;
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* ===========================================
   Accessibility: Reduced Motion
   =========================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .wc3-health-dot[data-status="down"] {
    animation: none;
  }
}

/* ===========================================
   Mobile Responsiveness
   =========================================== */

/* Tablet and smaller (< 1024px) */
@media (max-width: 1023px) {
  .wc3-resource-bar {
    flex-wrap: wrap;
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .topbar-left {
    order: 1;
    width: 100%;
  }

  .topbar-center {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .topbar-right {
    order: 2;
    width: 100%;
    justify-content: flex-end;
  }

  .wc3-task-metrics {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .wc3-metric {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .wc3-game-area {
    flex-direction: column;
  }

  .wc3-event-log {
    width: 100%;
    max-height: 200px;
    order: 2;
  }

  .wc3-map-panel {
    order: 1;
    height: auto;
    min-height: 300px;
  }

  .wc3-hud-bottom-enhanced {
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.75rem;
  }

  .wc3-portrait-panel-enhanced {
    width: 100%;
    flex-direction: row;
  }

  .wc3-minimap-panel {
    display: none;
  }

  .wc3-ops-panel {
    width: 100%;
  }

  .wc3-command-panel-3x3 {
    width: 100%;
  }

  .wc3-command-grid-3x3 {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.25rem;
  }
}

/* Mobile (< 640px) */
@media (max-width: 639px) {
  .topbar-left,
  .topbar-center,
  .topbar-right {
    justify-content: center;
  }

  .wc3-metric-label {
    display: none;
  }

  .wc3-metric-num {
    font-size: 0.9rem;
  }

  .welcome-card {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }

  .welcome-features {
    flex-direction: column;
    gap: 0.75rem;
  }

  .welcome-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .welcome-actions .btn {
    width: 100%;
  }

  .wc3-portrait-panel-enhanced {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .wc3-portrait-frame-ornate {
    width: 80px;
    height: 80px;
  }

  .wc3-command-grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .wc3-event-log {
    max-height: 150px;
  }

  .log-entry {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }

  .wc3-health-panel {
    padding-top: 0.5rem;
    margin-top: 0.5rem;
  }

  .wc3-health-indicator {
    flex-wrap: wrap;
    font-size: 0.75rem;
  }
}

/*/* Small mobile (< 375px) */
@media (max-width: 374px) {
  .wc3-metric {
    padding: 0.2rem 0.35rem;
    font-size: 0.7rem;
  }

  .wc3-task-metrics {
    gap: 0.25rem;
  }

  .mode-selector {
    gap: 0.25rem;
  }

  .mode-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }

  .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }
}

/* ============================================
   LOADING / EMPTY / ERROR STATES
   ============================================ */

/* Base state container */
.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  gap: 0.5rem;
}

/* Loading state */
.state-loading {
  color: var(--muted);
}

.state-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border2);
  border-top-color: var(--wc3-gold);
  border-radius: 50%;
  animation: state-spin 0.8s linear infinite;
}

@keyframes state-spin {
  to { transform: rotate(360deg); }
}

.state-loading-text {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
}

/* Empty state */
.state-empty {
  color: var(--faint);
}

.state-empty-icon {
  font-size: 1.5rem;
  opacity: 0.6;
}

.state-empty-text {
  font-size: 0.75rem;
  color: var(--faint);
  max-width: 180px;
  line-height: 1.4;
}

/* Error state */
.state-error {
  color: var(--bad);
}

.state-error-icon {
  font-size: 1.25rem;
}

.state-error-text {
  font-size: 0.75rem;
  color: var(--bad);
  max-width: 180px;
  line-height: 1.4;
}

.state-retry-btn {
  margin-top: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.7rem;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(180deg, var(--wc3-stone-light) 0%, var(--wc3-stone-dark) 100%);
  border: 1px solid var(--wc3-bronze);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.state-retry-btn:hover {
  background: linear-gradient(180deg, var(--wc3-stone) 0%, var(--wc3-stone-dark) 100%);
  border-color: var(--wc3-gold);
}

.state-retry-btn:active {
  transform: scale(0.97);
}

/* Event Log states */
.log-feed .state-container {
  min-height: 120px;
}

/* Ops Feed states */
.wc3-ops-feed .state-container {
  min-height: 60px;
  padding: 0.5rem;
}

.wc3-ops-feed .state-loading-spinner {
  width: 18px;
  height: 18px;
}

.wc3-ops-feed .state-empty-text,
.wc3-ops-feed .state-error-text,
.wc3-ops-feed .state-loading-text {
  font-size: 0.7rem;
  max-width: 160px;
}

/* Health Panel states */
.wc3-health-panel .state-container {
  padding: 0.25rem;
  min-height: auto;
  flex-direction: row;
  gap: 0.5rem;
}

.wc3-health-panel .state-loading-spinner {
  width: 14px;
  height: 14px;
}

.wc3-health-panel .state-loading-text,
.wc3-health-panel .state-error-text {
  font-size: 0.7rem;
}

/* Job Panel states (for Task 1) */
.job-panel .state-container {
  min-height: 80px;
}

.job-list .state-empty {
  padding: 1rem;
}

/* Hide states when not active */
.state-container[hidden] {
  display: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .state-loading-spinner {
    animation: none;
    border-top-color: var(--wc3-gold);
    opacity: 0.7;
  }
}

/* ============================================
   JOB PANEL (Task 1)
   ============================================ */

.wc3-job-panel {
  background: linear-gradient(180deg, var(--wc3-stone-light) 0%, var(--wc3-stone-dark) 100%);
  border: 2px solid var(--wc3-bronze);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 260px;
}

.wc3-job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(180deg, var(--wc3-stone) 0%, var(--wc3-stone-dark) 100%);
  border-bottom: 1px solid var(--wc3-bronze-dark);
}

.wc3-job-title {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--wc3-gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.wc3-job-toggle {
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wc3-job-toggle:hover {
  color: var(--text);
  border-color: var(--wc3-gold);
}

.wc3-job-panel.collapsed .wc3-job-content {
  display: none;
}

.wc3-job-panel.collapsed .wc3-job-toggle span {
  transform: rotate(0);
}

.wc3-job-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Job Form */
.wc3-job-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}

.wc3-job-input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text);
  background: var(--wc3-obsidian);
  border: 1px solid var(--border2);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s ease;
}

.wc3-job-input:focus {
  border-color: var(--wc3-gold);
}

.wc3-job-input::placeholder {
  color: var(--faint);
}

.wc3-job-submit {
  padding: 0.4rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(180deg, #4a9c2d 0%, #2d5a1a 100%);
  border: 1px solid #6bbd4a;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wc3-job-submit:hover {
  background: linear-gradient(180deg, #5ab83d 0%, #367021 100%);
  border-color: #7dd55a;
}

.wc3-job-submit:active {
  transform: scale(0.97);
}

.wc3-job-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Job List */
.wc3-job-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem;
  min-height: 60px;
  max-height: 120px;
}

.wc3-job-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.25rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wc3-job-item:hover {
  background: rgba(0, 0, 0, 0.35);
  border-color: var(--border2);
}

.wc3-job-item.selected {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--wc3-gold-dark);
}

.wc3-job-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wc3-job-status[data-status="pending"] {
  background: var(--warn);
  animation: job-pulse 1.5s ease-in-out infinite;
}

.wc3-job-status[data-status="running"] {
  background: var(--wc3-magic-blue);
  animation: job-pulse 0.8s ease-in-out infinite;
}

.wc3-job-status[data-status="completed"] {
  background: var(--good);
}

.wc3-job-status[data-status="failed"] {
  background: var(--bad);
}

@keyframes job-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.wc3-job-command {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc3-job-time {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Job Logs Viewer */
.wc3-job-logs {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--wc3-obsidian);
  border-top: 1px solid var(--border2);
  max-height: 150px;
}

.wc3-job-logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
}

.wc3-job-logs-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--wc3-gold);
}

.wc3-job-logs-close {
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.wc3-job-logs-close:hover {
  color: var(--bad);
}

.wc3-job-logs-feed {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  line-height: 1.4;
}

.wc3-job-log-line {
  margin-bottom: 0.15rem;
  color: var(--muted);
}

.wc3-job-log-line[data-level="info"] {
  color: var(--text);
}

.wc3-job-log-line[data-level="warn"] {
  color: var(--warn);
}

.wc3-job-log-line[data-level="error"] {
  color: var(--bad);
}

.wc3-job-log-line[data-level="debug"] {
  color: var(--faint);
}

/* Job Unavailable */
.wc3-job-unavailable {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  font-size: 0.75rem;
  color: var(--warn);
  text-align: center;
}

/* Job Panel in HUD layout */
.wc3-hud-bottom-enhanced {
  grid-template-columns: minmax(200px, 280px) minmax(180px, 240px) minmax(160px, 200px) 1fr minmax(200px, 280px) minmax(180px, 240px);
}

/* Reduced motion for job panel */
@media (prefers-reduced-motion: reduce) {
  .wc3-job-status[data-status="pending"],
  .wc3-job-status[data-status="running"] {
    animation: none;
  }
}

/* Responsive job panel */
@media (max-width: 1400px) {
  .wc3-job-panel {
    max-height: 220px;
  }
}

@media (max-width: 1024px) {
  .wc3-job-panel {
    display: none;
  }
}

/* ============================================
   ONBOARDING TOUR (Task 2)
   ============================================ */

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.75);
  animation: tour-fade-in 0.3s ease;
}

@keyframes tour-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tour-spotlight {
  position: absolute;
  border-radius: 8px;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.75),
    0 0 20px 4px var(--wc3-gold);
  transition: all 0.3s ease;
  pointer-events: none;
}

.tour-tooltip {
  position: absolute;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: linear-gradient(180deg, var(--wc3-stone-light) 0%, var(--wc3-stone-dark) 100%);
  border: 2px solid var(--wc3-gold);
  border-radius: 8px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: tour-tooltip-in 0.3s ease;
}

@keyframes tour-tooltip-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.tour-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.tour-close:hover {
  color: var(--text);
}

.tour-content {
  padding: 1.25rem 1.25rem 0.75rem;
}

.tour-title {
  margin: 0 0 0.5rem;
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--wc3-gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.tour-desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
}

.tour-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border);
  border-radius: 0 0 6px 6px;
}

.tour-btn {
  padding: 0.5rem 1rem;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(180deg, var(--wc3-stone) 0%, var(--wc3-stone-dark) 100%);
  border: 1px solid var(--wc3-bronze);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tour-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--wc3-stone-light) 0%, var(--wc3-stone) 100%);
  border-color: var(--wc3-gold);
}

.tour-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.tour-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tour-btn.tour-next {
  background: linear-gradient(180deg, #4a9c2d 0%, #2d5a1a 100%);
  border-color: #6bbd4a;
}

.tour-btn.tour-next:hover:not(:disabled) {
  background: linear-gradient(180deg, #5ab83d 0%, #367021 100%);
  border-color: #7dd55a;
}

.tour-progress {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* BlazeCraft Academy Panel */
.wc3-academy-panel {
  background: linear-gradient(160deg, rgba(13, 15, 26, 0.92), rgba(8, 9, 16, 0.95));
  border: 1px solid rgba(155, 130, 255, 0.35);
  border-radius: 18px;
  padding: 18px 20px;
  min-width: 320px;
  max-width: 520px;
  box-shadow: 0 16px 40px rgba(8, 10, 22, 0.4);
}

.academy-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #eef0ff;
  font-family: var(--sans);
}

.academy-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.academy-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 203, 148, 0.85);
  font-weight: 700;
}

.academy-title {
  margin: 4px 0 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.academy-meta {
  text-align: right;
  font-size: 0.75rem;
  color: rgba(214, 220, 255, 0.7);
}

.academy-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.academy-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.academy-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 174, 78, 0.9), rgba(255, 99, 142, 0.95));
  transition: width 0.3s ease;
}

.academy-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(214, 220, 255, 0.8);
}

.academy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 14px;
}

.academy-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.academy-step {
  border: 1px solid rgba(155, 130, 255, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(12, 14, 26, 0.7);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.academy-step.is-complete {
  border-color: rgba(106, 230, 170, 0.5);
  background: rgba(20, 44, 34, 0.55);
}

.academy-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.academy-step-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.academy-step-tag {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f9f4ff;
  font-weight: 700;
}

.academy-step-tag.tag-command {
  background: rgba(99, 156, 255, 0.25);
}

.academy-step-tag.tag-review {
  background: rgba(241, 196, 80, 0.2);
}

.academy-step-tag.tag-ship {
  background: rgba(255, 107, 129, 0.22);
}

.academy-step-tag.tag-focus {
  background: rgba(122, 216, 199, 0.22);
}

.academy-step-desc {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(214, 220, 255, 0.8);
}

.academy-step-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.academy-step-reward {
  font-size: 0.7rem;
  color: rgba(255, 204, 127, 0.9);
  font-weight: 600;
}

.academy-step-toggle {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #f8f7ff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  cursor: pointer;
}

.academy-step.is-complete .academy-step-toggle {
  background: rgba(106, 230, 170, 0.2);
  border-color: rgba(106, 230, 170, 0.6);
  color: #d9ffea;
}

.academy-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.academy-card {
  background: rgba(11, 12, 20, 0.75);
  border: 1px solid rgba(155, 130, 255, 0.2);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.academy-card-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.academy-card-value {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffdd96;
}

.academy-card-sub {
  margin: 0;
  font-size: 0.7rem;
  color: rgba(214, 220, 255, 0.7);
}

.academy-action {
  border: none;
  background: linear-gradient(120deg, rgba(255, 147, 80, 0.85), rgba(255, 99, 142, 0.85));
  color: #fff8f0;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 1200px) {
  .wc3-academy-panel {
    max-width: 100%;
  }

  .academy-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .academy-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .academy-meta {
    text-align: left;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tour-overlay,
  .tour-tooltip {
    animation: none;
  }

  .tour-spotlight {
    transition: none;
  }
}

/* ===========================================
   RTS Upgrades — Resource Icons, Production Panel,
   Control Group Badges, Construction Progress
   =========================================== */

/* WC3 Resource Icons (gold, lumber, food) */
.wc3-metric-ico.gold-ico {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd700 0%, #DAA520 50%, #B8860B 100%);
  box-shadow: 0 0 4px rgba(218, 165, 32, 0.5);
  flex-shrink: 0;
}

.wc3-metric-ico.lumber-ico {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: linear-gradient(135deg, #8B4513 0%, #A0522D 40%, #6B3410 100%);
  box-shadow: 0 0 3px rgba(139, 69, 19, 0.4);
  position: relative;
  flex-shrink: 0;
}
.wc3-metric-ico.lumber-ico::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px; right: 3px; bottom: 3px;
  border: 1px solid rgba(160, 82, 45, 0.6);
  border-radius: 1px;
}

.wc3-metric-ico.food-ico {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #f0e68c 0%, #daa520 60%, #b8860b 100%);
  box-shadow: 0 0 3px rgba(240, 230, 140, 0.4);
  position: relative;
  flex-shrink: 0;
}
.wc3-metric-ico.food-ico::after {
  content: '';
  position: absolute;
  top: 2px; left: 6px;
  width: 4px; height: 8px;
  background: #8B6914;
  border-radius: 2px;
  transform: rotate(-15deg);
}

.wc3-metric-gold .wc3-metric-num {
  color: #DAA520;
}

.wc3-metric-lumber .wc3-metric-num {
  color: #A0522D;
}

.wc3-metric-food .wc3-metric-num {
  color: #f0e68c;
}

/* Production Panel */
.wc3-production-panel {
  background: var(--panel2);
  border: 1px solid var(--wc3-gold-dark, rgba(180, 140, 30, 0.4));
  border-radius: var(--r);
  padding: 8px;
  min-width: 180px;
  max-width: 220px;
}

.wc3-production-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.wc3-production-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wc3-gold, #D4AF37);
}

.wc3-production-queue {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.wc3-production-units {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.wc3-train-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: var(--text);
}

.wc3-train-btn:hover:not(:disabled) {
  border-color: var(--wc3-gold, #D4AF37);
  background: rgba(212, 175, 55, 0.08);
}

.wc3-train-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wc3-train-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border2);
}

.wc3-train-icon.scout-ico {
  background: radial-gradient(circle at 40% 40%, #6aafe8, #3a7ab8);
  border-color: #4dc9f6;
}

.wc3-train-icon.builder-ico {
  background: radial-gradient(circle at 40% 40%, #4cc870, #2d8a4f);
  border-color: #37d67a;
}

.wc3-train-icon.specialist-ico {
  background: radial-gradient(circle at 40% 40%, #daa520, #b8862d);
  border-color: #ffd700;
}

.wc3-train-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wc3-train-cost {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--faint);
}

.wc3-production-bar {
  height: 4px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.wc3-production-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--wc3-gold, #D4AF37), #ffd700);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.wc3-production-cancel {
  width: 100%;
  padding: 3px 0;
  background: rgba(139, 48, 48, 0.2);
  border: 1px solid rgba(139, 48, 48, 0.4);
  border-radius: 4px;
  color: var(--bad);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s;
}

.wc3-production-cancel:hover {
  background: rgba(139, 48, 48, 0.35);
}

/* Control Group Badge (rendered on canvas, but backup CSS for overlay badges) */
.wc3-group-badge {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.6);
  font-family: 'Cinzel', serif;
  font-size: 8px;
  font-weight: 700;
  color: #1A0A0A;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Assign mode cursor */
.wc3-map-panel.assign-mode {
  cursor: crosshair;
}

/* Portrait grid for multi-select (up to 12 unit icons) */
.wc3-portrait-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 4px;
}

.wc3-portrait-grid-item {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.12s;
}

.wc3-portrait-grid-item:hover {
  border-color: var(--wc3-gold, #D4AF37);
}

.wc3-portrait-grid-item .type-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.wc3-portrait-grid-item .type-dot.scout { background: #3a7ab8; }
.wc3-portrait-grid-item .type-dot.builder { background: #2d8a4f; }
.wc3-portrait-grid-item .type-dot.specialist { background: #b8862d; }

.wc3-portrait-grid-item .status-pip {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.wc3-portrait-grid-item .status-pip.working { background: #37d67a; }
.wc3-portrait-grid-item .status-pip.idle { background: #4a6fa5; }
.wc3-portrait-grid-item .status-pip.blocked { background: #ff4d4d; }
.wc3-portrait-grid-item .status-pip.moving { background: #5a88c5; }
.wc3-portrait-grid-item .status-pip.hold { background: #f7c948; }
.wc3-portrait-grid-item .status-pip.complete { background: #D4AF37; }
