/* ==========================================================================
   Silicon Conflict: Compute Dominion // 智械霸权：算力争夺战
   Cyber Warfare & Network Dominion RTS Theme
   ========================================================================== */

:root {
  --neon-cyan: #00f0ff;
  --neon-cyan-glow: rgba(0, 240, 255, 0.45);
  --neon-blue: #0088ff;
  --neon-red: #ff3344;
  --neon-red-glow: rgba(255, 51, 68, 0.45);
  --neon-amber: #ffaa00;
  --neon-green: #00ff88;
  --neon-purple: #b044ff;
  
  --bg-deep: #050811;
  --bg-panel: rgba(8, 14, 26, 0.92);
  --bg-panel-solid: #090e1a;
  --bg-panel-light: rgba(16, 26, 46, 0.75);
  --bg-card: rgba(12, 20, 36, 0.85);
  --bg-card-hover: rgba(0, 240, 255, 0.12);
  
  --border-cyan: rgba(0, 240, 255, 0.35);
  --border-bright: #00f0ff;
  --border-subtle: rgba(255, 255, 255, 0.1);
  
  --font-display: 'Orbitron', 'Rajdhani', sans-serif;
  --font-ui: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Share Tech Mono', monospace;

  /* Semantic Typography Hierarchy */
  --font-xs: 13px;   /* Minimum font size across whole game */
  --font-sm: 14px;   /* Secondary labels, units, rates, card desc */
  --font-base: 15px; /* Body text, button titles, stats values */
  --font-md: 17px;   /* Entity names, tab labels, card titles, section headers */
  --font-lg: 20px;   /* Primary numbers, timer, dialog titles */
  --font-xl: 24px;   /* Modal titles, game over headlines */

  --sidebar-width: 320px;
  --topbar-height: 60px;
  --console-height: 168px;
  --minimap-size: 220px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: #e2e8f0;
  font-family: var(--font-ui);
  font-size: 16px;
}

/* ==========================================================================
   Root Layout & Canvas
   ========================================================================== */

#gameContainer {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  z-index: 5;
  pointer-events: auto;
}

/* Scanlines & Atmosphere Overlay */
#scanlineOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none !important;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  z-index: 10;
  opacity: 0.6;
}

#matrixGridOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none !important;
  background: radial-gradient(circle at 50% 50%, transparent 60%, rgba(5, 8, 17, 0.75) 100%);
  z-index: 10;
}

/* ==========================================================================
   Top Status Bar
   ========================================================================== */

#topStatusBar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-cyan);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(0, 240, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

/* Top Left Section: Brand & Clash-of-Clans Style Resources */
.top-left-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mini-badge {
  display: flex;
  align-items: center;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 4px 10px;
  border-radius: 2px;
}

.brand-mini-badge .logo-glitch {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 1.5px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan-glow);
  white-space: nowrap;
}

.brand-sub {
  font-size: var(--font-xs);
  color: #7e8b9b;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Resources Indicator Group - Clash of Clans Horizontal Style */
.resources-group.coc-resources {
  display: flex;
  align-items: center;
  gap: 10px;
}

.resource-pill.coc-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 20, 36, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 3px solid var(--neon-cyan);
  padding: 4px 12px;
  border-radius: 3px;
  min-width: 155px;
  height: 44px;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.resource-pill.coc-pill:hover {
  background: rgba(18, 30, 52, 0.98);
  border-color: var(--border-cyan);
}

#resEnergyPill {
  border-left-color: var(--neon-amber);
}

#resSiliconPill {
  border-left-color: #f59e0b;
}

.res-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.compute-icon { color: var(--neon-cyan); }
.energy-icon { color: var(--neon-amber); }
.silicon-icon { color: #f59e0b; }

.res-icon svg {
  width: 100%;
  height: 100%;
}

.res-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.res-label {
  font-size: var(--font-xs);
  color: #8b9bb4;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1.1;
}

.res-val-wrapper {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1.1;
}

.res-value {
  font-family: var(--font-mono);
  font-size: var(--font-lg);
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.res-unit {
  font-size: var(--font-xs);
  color: #94a3b8;
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1;
}

.res-rate {
  font-family: var(--font-mono);
  font-size: var(--font-sm);
  color: var(--neon-green);
  margin-left: 4px;
  font-weight: 700;
  line-height: 1;
}

/* Blackout Warning Badge */
.blackout-warning-badge {
  display: none;
  position: absolute;
  top: -10px;
  right: -5px;
  background: var(--neon-red);
  color: #ffffff;
  font-size: var(--font-xs);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  animation: pulse-red 1s infinite alternate;
  box-shadow: 0 0 10px var(--neon-red);
}

@keyframes pulse-red {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.05); opacity: 1; }
}

/* Top Right Match Controls */
.top-right-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
}

.pop-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 22, 38, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: var(--font-base);
  height: 44px;
  box-sizing: border-box;
}

.pop-icon {
  font-size: var(--font-md);
}

.pop-count {
  color: var(--neon-cyan);
  font-weight: 800;
  font-size: var(--font-lg);
}

.pop-sep {
  color: #475569;
  font-size: var(--font-base);
}

.pop-cap {
  color: #94a3b8;
  font-weight: 700;
  font-size: var(--font-base);
}

.timer-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 22, 38, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 2px;
  height: 44px;
  box-sizing: border-box;
}

.timer-icon {
  font-size: var(--font-base);
  color: var(--neon-cyan);
}

.timer-text {
  font-family: var(--font-mono);
  font-size: var(--font-lg);
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 1px;
  line-height: 1;
}

.top-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-cyber-btn {
  background: rgba(14, 22, 38, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #cbd5e1;
  padding: 4px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  height: 44px;
  border-radius: 2px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.top-cyber-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px var(--neon-cyan-glow);
}

.top-cyber-btn .btn-sub {
  font-size: var(--font-xs);
  color: #7e8b9b;
  text-transform: uppercase;
  font-weight: 600;
  line-height: 1;
}

.top-cyber-btn .btn-main {
  font-family: var(--font-display);
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--neon-cyan);
  line-height: 1.1;
  margin-top: 2px;
}

.top-cyber-btn.menu-btn-top {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
}

.top-cyber-btn.menu-btn-top:hover {
  background: rgba(0, 240, 255, 0.25);
  box-shadow: 0 0 14px var(--neon-cyan);
}

.top-cyber-btn.help-btn {
  border-color: var(--neon-amber);
}

.top-cyber-btn.help-btn .btn-main {
  color: var(--neon-amber);
}

/* ==========================================================================
   Objective Banner (Top Floating)
   ========================================================================== */

.objective-banner {
  position: absolute;
  top: calc(var(--topbar-height) + 12px);
  left: 20px;
  max-width: 480px;
  background: rgba(8, 14, 26, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-cyan);
  border-left: 4px solid var(--neon-cyan);
  padding: 10px 16px;
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 45;
  pointer-events: auto;
  animation: slide-in-top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-in-top {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.obj-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.obj-badge {
  font-family: var(--font-display);
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 1px;
}

.obj-step {
  font-family: var(--font-mono);
  font-size: var(--font-sm);
  color: var(--neon-amber);
  background: rgba(255, 170, 0, 0.15);
  padding: 2px 8px;
  border-radius: 2px;
  font-weight: 700;
}

.obj-content {
  font-size: var(--font-base);
  line-height: 1.5;
  color: #f1f5f9;
  font-weight: 600;
}

.tut-directive-text {
  font-size: var(--font-base);
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.45;
}

.tut-hint-text {
  font-size: var(--font-xs) !important;
  line-height: 1.4;
}

/* ==========================================================================
   Notification Toasts Stack
   ========================================================================== */

.toast-container {
  position: absolute;
  top: calc(var(--topbar-height) + 12px);
  right: calc(var(--sidebar-width) + 20px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
  pointer-events: none;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-collapsed .toast-container {
  right: 20px;
}

.cyber-toast {
  pointer-events: auto;
  background: rgba(9, 15, 28, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 4px solid var(--neon-cyan);
  padding: 8px 14px;
  border-radius: 2px;
  min-width: 260px;
  max-width: 380px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-sm);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

@keyframes toast-in {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.cyber-toast.toast-warning { border-left-color: var(--neon-amber); }
.cyber-toast.toast-danger { border-left-color: var(--neon-red); }
.cyber-toast.toast-success { border-left-color: var(--neon-green); }

.toast-icon { font-size: var(--font-md); }
.toast-msg { color: #f1f5f9; line-height: 1.3; }

/* ==========================================================================
   Bottom Command Console
   ========================================================================== */

#bottomConsole {
  position: absolute;
  bottom: 0;
  left: 0;
  right: calc(var(--sidebar-width) + var(--minimap-size) + 10px);
  height: var(--console-height);
  max-height: var(--console-height);
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-cyan);
  border-right: 1px solid var(--border-cyan);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
  display: grid;
  grid-template-columns: 280px 1fr 270px;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 50;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-collapsed #bottomConsole {
  right: calc(var(--minimap-size) + 10px);
}

/* Left: Portrait */
.console-portrait-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
  width: 280px;
  max-width: 280px;
  overflow: hidden;
  box-sizing: border-box;
}

.portrait-frame {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  background: #060a14;
  border: 1px solid var(--border-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#portraitCanvas {
  width: 100%;
  height: 100%;
}

.portrait-scanline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 240, 255, 0.15) 51%);
  background-size: 100% 4px;
  pointer-events: none;
}

.portrait-holo-corner {
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: var(--neon-cyan);
  border-style: solid;
}
.portrait-holo-corner.tl { top: 2px; left: 2px; border-width: 2px 0 0 2px; }
.portrait-holo-corner.tr { top: 2px; right: 2px; border-width: 2px 2px 0 0; }
.portrait-holo-corner.bl { bottom: 2px; left: 2px; border-width: 0 0 2px 2px; }
.portrait-holo-corner.br { bottom: 2px; right: 2px; border-width: 0 2px 2px 0; }

.entity-title-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.entity-name {
  font-family: var(--font-display);
  font-size: var(--font-md);
  font-weight: 700;
  color: #ffffff;
  white-space: normal;
  line-height: 1.2;
  word-break: break-word;
}

.entity-type-badge {
  font-size: var(--font-xs);
  color: #8b9bb4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.entity-status-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  color: var(--neon-green);
  background: rgba(0, 255, 136, 0.12);
  border: 1px solid rgba(0, 255, 136, 0.3);
  padding: 1px 6px;
  border-radius: 2px;
  width: fit-content;
  margin-top: 2px;
  line-height: 1.2;
}

/* Center: Stats Panel */
.console-stats-panel {
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.single-stats-view,
.building-stats-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  justify-content: center;
  box-sizing: border-box;
}

.health-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.health-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.2;
}

.health-label {
  font-size: var(--font-xs);
  color: #8b9bb4;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.health-numbers {
  font-family: var(--font-mono);
  font-size: var(--font-sm);
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
}

.health-track {
  width: 100%;
  height: 8px;
  background: rgba(14, 22, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.health-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ff88, #00f0ff);
  transition: width 0.25s ease, background 0.25s ease;
}

.health-fill.medium {
  background: linear-gradient(90deg, #ffaa00, #ffd000);
}

.health-fill.low {
  background: linear-gradient(90deg, #ff3344, #ff6677);
}

/* Core Combat Stats 3-column row for Unit Selection */
.unit-core-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-width: 0;
  box-sizing: border-box;
}

/* Building Metrics Grid */
.bldg-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  min-width: 0;
  box-sizing: border-box;
}

.bldg-metrics-grid .full-width-pill {
  grid-column: span 2;
}

/* Common Stat Pill styles */
.stat-pill {
  background: rgba(14, 22, 38, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.2);
  padding: 6px 10px;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.stat-pill:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.45);
}

.stat-pill.full-width-pill {
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
}

.stat-pill.full-width-pill .stat-pill-val {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-pill.resource-yield-pill,
.stat-pill.stat-yield-pill,
.stat-pill.bldg-yield-pill {
  border-color: rgba(0, 240, 255, 0.3);
  background: rgba(0, 240, 255, 0.06);
}

.stat-pill.resource-yield-pill .stat-pill-val,
.stat-pill.stat-yield-pill .stat-pill-val,
.stat-pill.bldg-yield-pill .stat-pill-val {
  color: #00ffaa;
  letter-spacing: 0.5px;
}

.stat-pill.bldg-power-pill {
  border-color: rgba(255, 187, 0, 0.3);
  background: rgba(255, 187, 0, 0.06);
}

.stat-pill.bldg-power-pill .stat-pill-val {
  color: var(--neon-amber);
}

.stat-pill.bldg-status-pill {
  border-color: rgba(0, 255, 136, 0.25);
  background: rgba(0, 255, 136, 0.05);
}

.stat-pill.bldg-status-pill .stat-pill-val {
  color: var(--neon-cyan);
  font-size: var(--font-sm);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-pill-label {
  font-size: var(--font-xs);
  color: #8b9bb4;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.stat-pill-val {
  font-family: var(--font-mono);
  font-size: var(--font-base);
  font-weight: 800;
  color: var(--neon-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Multi-select Grid */
.multi-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  max-height: 125px;
  overflow-y: auto;
}

.multi-unit-chip {
  position: relative;
  width: 44px;
  height: 44px;
  background: rgba(14, 22, 38, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.multi-unit-chip:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--neon-cyan);
}

.chip-hp-bar {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  height: 3px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 1px;
}

.chip-hp-fill {
  height: 100%;
  background: var(--neon-cyan);
}

/* Right: Action Buttons */
.console-actions-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  align-content: center;
  min-width: 0;
  width: 260px;
  max-width: 260px;
  overflow: hidden;
  box-sizing: border-box;
}

.cmd-btn {
  background: rgba(14, 22, 38, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #e2e8f0;
  padding: 4px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 2px;
  transition: all 0.2s ease;
  min-height: 52px;
  box-sizing: border-box;
}

.cmd-btn:hover {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--neon-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px var(--neon-cyan-glow);
}

.cmd-btn:active {
  transform: translateY(1px);
}

.cmd-btn-attack {
  border-color: rgba(255, 51, 68, 0.4);
}

.cmd-btn-attack:hover {
  background: rgba(255, 51, 68, 0.2);
  border-color: var(--neon-red);
  box-shadow: 0 0 10px var(--neon-red-glow);
}

.cmd-btn-emp {
  border-color: rgba(176, 68, 255, 0.4);
}

.cmd-btn-emp:hover {
  background: rgba(176, 68, 255, 0.2);
  border-color: var(--neon-purple);
  box-shadow: 0 0 10px rgba(176, 68, 255, 0.45);
}

.cmd-key {
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  color: var(--neon-cyan);
  line-height: 1;
}

.cmd-icon {
  font-size: var(--font-base);
  line-height: 1.1;
}

.cmd-name {
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.1;
  white-space: nowrap;
}

/* ==========================================================================
   Radar Minimap Panel
   ========================================================================== */

#minimapPanel {
  position: absolute;
  bottom: 0;
  right: var(--sidebar-width);
  width: var(--minimap-size);
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-cyan);
  border-left: 1px solid var(--border-cyan);
  display: flex;
  flex-direction: column;
  z-index: 50;
  box-shadow: -4px -4px 20px rgba(0, 0, 0, 0.6);
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-collapsed #minimapPanel {
  right: 0;
}

.minimap-header {
  height: 26px;
  background: rgba(14, 22, 38, 0.95);
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.minimap-title {
  font-family: var(--font-display);
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 0.5px;
}

.minimap-ping-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  animation: pulse-ping 2s infinite ease-in-out;
}

@keyframes pulse-ping {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.minimap-canvas-wrapper {
  position: relative;
  width: var(--minimap-size);
  height: var(--minimap-size);
  background: #04070f;
  overflow: hidden;
  cursor: pointer;
}

#minimapCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.minimap-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.3;
}

.minimap-crosshair::before, .minimap-crosshair::after {
  content: '';
  position: absolute;
  background: var(--neon-cyan);
}
.minimap-crosshair::before { top: 0; left: 7px; width: 2px; height: 16px; }
.minimap-crosshair::after { top: 7px; left: 0; width: 16px; height: 2px; }

/* Domination Bar */
.domination-wrapper {
  padding: 6px 10px 4px 10px;
  background: rgba(10, 16, 28, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.domination-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-xs);
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.dom-player { color: var(--neon-cyan); }
.dom-neutral { color: #94a3b8; }
.dom-enemy { color: var(--neon-red); }

.domination-bar-track {
  width: 100%;
  height: 6px;
  background: #0f172a;
  display: flex;
  border-radius: 1px;
  overflow: hidden;
}

.dom-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.dom-seg-player { background: var(--neon-cyan); }
.dom-seg-neutral { background: #475569; }
.dom-seg-enemy { background: var(--neon-red); }

/* Quick Actions */
.minimap-quick-actions {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.minimap-btn {
  flex: 1;
  background: rgba(14, 22, 38, 0.9);
  border: none;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  font-weight: 700;
  padding: 7px 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.minimap-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan);
}

.minimap-btn:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Classic Red Alert Style Right Sidebar Command Deck
   ========================================================================== */

#rightSidebar {
  position: absolute;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-panel-solid);
  border-left: 1px solid var(--border-cyan);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-collapsed #rightSidebar {
  transform: translateX(100%);
}

.sidebar-header {
  height: 42px;
  background: rgba(14, 22, 38, 0.95);
  border-bottom: 1px solid var(--border-cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  position: relative;
}

.sidebar-title-row {
  display: flex;
  flex-direction: column;
}

.sidebar-badge {
  font-family: var(--font-display);
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 1px;
}

.sidebar-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.sidebar-toggle-btn {
  position: absolute;
  top: 8px;
  left: -36px;
  width: 36px;
  height: 42px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--border-cyan);
  border-right: none;
  border-radius: 6px 0 0 6px;
  color: var(--neon-cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-md);
  font-weight: bold;
  box-shadow: -4px 2px 14px rgba(0, 0, 0, 0.7);
  z-index: 65;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--neon-cyan);
  box-shadow: -4px 0 16px rgba(0, 240, 255, 0.6);
  color: #ffffff;
}

body.sidebar-collapsed .sidebar-toggle-btn {
  background: rgba(14, 22, 38, 0.95);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

/* 5 Tabs */
.sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(8, 14, 26, 0.95);
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #7e8b9b;
  padding: 10px 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #ffffff;
  background: rgba(0, 240, 255, 0.08);
}

.tab-btn.active {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.12);
}

.tab-btn-superweapon.active {
  color: var(--neon-purple);
  border-bottom-color: var(--neon-purple);
  background: rgba(176, 68, 255, 0.15);
}

.tab-icon {
  font-size: 16px;
  line-height: 1.1;
}

.tab-label {
  font-size: var(--font-sm);
  font-weight: 700;
  line-height: 1.1;
}

/* Superweapon Banner in Sidebar */
.superweapon-banner {
  background: rgba(26, 12, 38, 0.9);
  border-bottom: 1px solid rgba(176, 68, 255, 0.4);
  padding: 10px 14px;
}

.sw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.sw-title {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--neon-purple);
}

.sw-timer {
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  font-weight: 700;
  color: #f1f5f9;
}

.sw-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 1px;
  overflow: hidden;
}

.sw-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-purple), #ff33bb);
  transition: width 0.3s ease;
}

.sw-launch-btn {
  width: 100%;
  margin-top: 8px;
  background: var(--neon-purple);
  border: 1px solid #ff33bb;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: var(--font-xs);
  font-weight: 700;
  padding: 6px 0;
  cursor: pointer;
  border-radius: 2px;
  animation: pulse-launch 1s infinite alternate;
}

@keyframes pulse-launch {
  0% { box-shadow: 0 0 5px var(--neon-purple); }
  100% { box-shadow: 0 0 16px #ff33bb; }
}

/* Build Cards Grid */
.build-cards-container {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.build-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Individual Build Card */
.build-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  transition: all 0.2s ease;
  overflow: hidden;
}

.build-card:hover:not(.locked):not(.disabled) {
  background: var(--bg-card-hover);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 14px var(--neon-cyan-glow);
  transform: translateX(-2px);
}

.build-card.ready-to-place {
  border-color: var(--neon-green);
  background: rgba(0, 255, 136, 0.15);
  animation: pulse-green-border 1.5s infinite alternate;
}

@keyframes pulse-green-border {
  0% { box-shadow: 0 0 4px var(--neon-green); }
  100% { box-shadow: 0 0 16px var(--neon-green); }
}

.build-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

.build-card.disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.card-icon-box {
  width: 48px;
  height: 48px;
  background: rgba(6, 10, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xl);
  flex-shrink: 0;
  border-radius: 2px;
}

.card-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 2px;
}

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

.card-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-hotkey {
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.15);
  padding: 2px 6px;
  border-radius: 2px;
  font-weight: 700;
}

.card-desc {
  font-size: var(--font-sm);
  color: #8b9bb4;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-costs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.cost-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  font-weight: 700;
}

.cost-chip.silicon { color: #f59e0b; }
.cost-chip.energy { color: var(--neon-amber); }
.cost-chip.compute { color: var(--neon-cyan); }

/* Card Build Progress Overlay */
.card-progress-overlay {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: rgba(0, 240, 255, 0.25);
  pointer-events: none;
  transition: width 0.1s linear;
}

.card-progress-timer {
  position: absolute;
  top: 4px;
  right: 6px;
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--neon-green);
}

.card-lock-badge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 15, 28, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xs);
  font-weight: 700;
  color: #94a3b8;
  gap: 6px;
}

/* Sidebar Footer */
.sidebar-footer {
  background: rgba(14, 22, 38, 0.95);
  border-top: 1px solid rgba(0, 240, 255, 0.2);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.active-queue-label {
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  color: var(--neon-cyan);
}

.hotkey-hint {
  font-size: var(--font-xs);
  color: #64748b;
}

/* Blueprint Cursor Hint */
.blueprint-hint {
  position: absolute;
  bottom: calc(var(--console-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--neon-cyan);
  color: #ffffff;
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: var(--font-xs);
  border-radius: 2px;
  pointer-events: none;
  z-index: 70;
  box-shadow: 0 0 15px var(--neon-cyan-glow);
}

/* ==========================================================================
   Modals & Overlays (Start, Tutorial, GameOver)
   ========================================================================== */

.cyber-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 6, 14, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cyber-modal {
  position: relative;
  background: var(--bg-panel-solid);
  border: 1px solid var(--border-cyan);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.25), 0 10px 50px rgba(0, 0, 0, 0.8);
  border-radius: 2px;
  padding: 32px;
  max-width: 640px;
  width: 90%;
}

.modal-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--neon-cyan);
  border-style: solid;
}
.modal-corner.tl { top: -2px; left: -2px; border-width: 3px 0 0 3px; }
.modal-corner.tr { top: -2px; right: -2px; border-width: 3px 3px 0 0; }
.modal-corner.bl { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; }
.modal-corner.br { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; }

/* Main Menu Modal & Pause Menu */
.main-menu-modal, .pause-modal {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 680px;
  background: rgba(8, 14, 26, 0.96);
  border: 1px solid var(--border-cyan);
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.25), 0 16px 60px rgba(0, 0, 0, 0.85);
}

.menu-brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.main-menu-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ffffff;
  text-shadow: 0 0 24px var(--neon-cyan-glow);
  margin-top: 4px;
}

.main-menu-title .title-accent {
  color: var(--neon-cyan);
}

.main-menu-en {
  font-family: var(--font-display);
  font-size: var(--font-sm);
  letter-spacing: 2.5px;
  color: #94a3b8;
  font-weight: 700;
}

.menu-tagline {
  font-size: var(--font-base);
  color: var(--neon-green);
  font-style: italic;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.start-brand-badge {
  font-family: var(--font-display);
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 2px;
}

.start-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  background: rgba(14, 22, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
  border-radius: 2px;
  width: 100%;
}

.summary-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.summary-item .sum-icon {
  font-size: 20px;
  margin-top: 2px;
}

.summary-item b {
  font-size: 15px;
  color: var(--neon-cyan);
  display: block;
  margin-bottom: 2px;
}

.summary-item p {
  font-size: var(--font-sm);
  color: #cbd5e1;
  line-height: 1.45;
}

.menu-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.menu-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(14, 24, 44, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #f1f5f9;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s ease;
  text-align: left;
}

.menu-btn:hover {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px var(--neon-cyan-glow);
  transform: translateX(4px);
}

.menu-btn-primary {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 14px var(--neon-cyan-glow);
}

.menu-btn-primary:hover {
  background: var(--neon-cyan);
  color: #030712;
  box-shadow: 0 0 28px var(--neon-cyan);
}

.menu-btn-primary:hover .menu-btn-main {
  color: #030712;
}

.menu-btn-primary:hover .menu-btn-sub {
  color: #1e293b;
}

.menu-btn-tutorial {
  background: rgba(16, 185, 129, 0.16);
  border-color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}

.menu-btn-tutorial:hover {
  background: #10b981;
  color: #030712;
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.6);
  transform: translateX(4px);
}

.menu-btn-tutorial:hover .menu-btn-main {
  color: #030712;
}

.menu-btn-tutorial:hover .menu-btn-sub {
  color: #064e3b;
}

.tutorial-victory-modal {
  max-width: 650px;
  text-align: center;
}

.badge-green {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid #10b981;
}

.victory-icon-glow {
  font-size: 54px;
  margin: 10px 0;
  filter: drop-shadow(0 0 16px rgba(250, 204, 21, 0.6));
  animation: pulse-glow 2s infinite ease-in-out;
}

.vic-desc {
  font-size: 15px;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 18px;
}

.vic-milestones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
  text-align: left;
}

.milestone-item {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 8px 12px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: #34d399;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.menu-btn-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
}

.menu-btn-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.menu-btn-main {
  font-family: var(--font-display);
  font-size: var(--font-md);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.menu-btn-main .diff-val {
  color: var(--neon-amber);
}

.menu-btn-sub {
  font-size: var(--font-xs);
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.menu-btn-arrow {
  font-size: var(--font-md);
  color: var(--neon-cyan);
  font-weight: bold;
}

.menu-dual-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.menu-btn-mini {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(14, 24, 44, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  cursor: pointer;
  border-radius: 2px;
  font-size: var(--font-sm);
  font-weight: 600;
  transition: all 0.2s ease;
}

.menu-btn-mini:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  color: #ffffff;
}

.menu-footer-info {
  font-size: var(--font-xs);
  color: #64748b;
  letter-spacing: 0.5px;
}

.cyber-start-btn {
  position: relative;
  background: var(--neon-cyan);
  border: none;
  color: #030712;
  font-family: var(--font-display);
  font-size: var(--font-base);
  font-weight: 900;
  letter-spacing: 2px;
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 20px var(--neon-cyan-glow);
  transition: all 0.2s ease;
  width: 100%;
}

.cyber-start-btn:hover {
  background: #ffffff;
  box-shadow: 0 0 30px var(--neon-cyan);
  transform: scale(1.02);
}

.start-hint {
  font-size: var(--font-xs);
  color: #64748b;
}

/* Tutorial Modal */
.tutorial-modal {
  max-width: 780px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.modal-title-row {
  display: flex;
  flex-direction: column;
}

.modal-badge {
  font-family: var(--font-display);
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 1px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--font-xl);
  font-weight: 700;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  border-color: var(--neon-red);
  color: var(--neon-red);
}

.tutorial-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.tut-step-card {
  position: relative;
  background: rgba(14, 22, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 3px solid var(--neon-cyan);
  padding: 14px;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tut-step-card:nth-child(2) { border-top-color: var(--neon-amber); }
.tut-step-card:nth-child(3) { border-top-color: var(--neon-purple); }

.tut-num {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.15);
  position: absolute;
  top: 6px;
  right: 10px;
}

.tut-step-icon {
  font-size: 20px;
}

.tut-step-title {
  font-family: var(--font-display);
  font-size: var(--font-sm);
  font-weight: 700;
  color: #ffffff;
}

.tut-step-desc {
  font-size: var(--font-xs);
  color: #cbd5e1;
  line-height: 1.45;
}

.tut-step-desc b {
  color: var(--neon-cyan);
}

.hotkeys-box {
  background: rgba(14, 22, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  border-radius: 2px;
  margin-bottom: 18px;
}

.hotkeys-title {
  font-family: var(--font-display);
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--neon-cyan);
  margin-bottom: 8px;
}

.hotkeys-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
}

.hotkey-item {
  font-size: var(--font-xs);
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
}

kbd {
  background: #1e293b;
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  padding: 2px 6px;
  border-radius: 2px;
  font-weight: 700;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
}

.cyber-action-btn {
  background: var(--neon-cyan);
  border: none;
  color: #030712;
  font-family: var(--font-display);
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 1px;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.cyber-action-btn:hover {
  background: #ffffff;
  box-shadow: 0 0 16px var(--neon-cyan);
}

/* GameOver Modal */
.gameover-modal {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.go-badge {
  font-family: var(--font-display);
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--neon-cyan);
}

.go-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
}

.gameover-modal.victory .go-title {
  color: var(--neon-cyan);
  text-shadow: 0 0 20px var(--neon-cyan-glow);
}

.gameover-modal.defeat .go-title {
  color: var(--neon-red);
  text-shadow: 0 0 20px var(--neon-red-glow);
}

.go-subtitle {
  font-size: var(--font-base);
  color: #cbd5e1;
}

.go-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.go-stat-card {
  background: rgba(14, 22, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
}

.go-stat-val {
  font-family: var(--font-mono);
  font-size: var(--font-lg);
  font-weight: 700;
  color: #ffffff;
}

.go-stat-lbl {
  font-size: var(--font-xs);
  color: #64748b;
}

/* ==========================================================================
   Responsive & Resolution Adjustments (1280x720, 1600x900, 1920x1080)
   ========================================================================== */

@media (max-width: 1440px) {
  #bottomConsole {
    grid-template-columns: 260px 1fr 250px;
  }
}

@media (max-width: 1280px) {
  :root {
    --sidebar-width: 320px;
    --console-height: 168px;
    --minimap-size: 220px;
  }
  #bottomConsole {
    grid-template-columns: 240px 1fr 240px;
  }
  .console-portrait-panel {
    width: 240px;
    max-width: 240px;
    padding: 6px 10px;
  }
  .console-actions-panel {
    width: 240px;
    max-width: 240px;
    padding: 6px 10px;
  }
  .portrait-frame {
    width: 68px;
    height: 68px;
  }
  .cmd-btn {
    min-height: 52px;
    padding: 4px 4px;
  }
  .cmd-icon {
    font-size: var(--font-base);
  }
  .cmd-name {
    font-size: var(--font-xs);
  }
}

@media (max-width: 1024px) {
  .resources-group {
    gap: 6px;
  }
  .resource-pill {
    min-width: 120px;
    padding: 4px 8px;
  }
  .tutorial-steps-grid {
    grid-template-columns: 1fr;
  }
}

/* Tutorial Guidance Indicators */
.tut-guide-highlight {
  position: relative;
  animation: tut-pulse-glow 1.5s infinite ease-in-out !important;
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 15px var(--neon-cyan-glow), inset 0 0 10px rgba(0, 240, 255, 0.3) !important;
}

@keyframes tut-pulse-glow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.4), inset 0 0 6px rgba(0, 240, 255, 0.2);
    border-color: rgba(0, 240, 255, 0.6);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.9), inset 0 0 14px rgba(0, 240, 255, 0.5);
    border-color: #00f0ff;
  }
}

.tut-guide-badge {
  position: absolute;
  top: -8px;
  right: -4px;
  background: var(--neon-cyan);
  color: #040812;
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 3px;
  box-shadow: 0 0 8px var(--neon-cyan-glow);
  pointer-events: none;
  z-index: 10;
  animation: tut-badge-bounce 1s infinite alternate ease-in-out;
}

@keyframes tut-badge-bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

/* ==========================================
   FLOATING CYBER DECK CARD TOOLTIP (Issue 10)
   ========================================== */
.cyber-spec-tooltip {
  position: fixed;
  z-index: 99999;
  width: 260px;
  background: rgba(10, 16, 24, 0.96);
  border: 1px solid var(--neon-cyan, #00f0ff);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85), 0 0 14px rgba(0, 240, 255, 0.35);
  border-radius: 6px;
  padding: 10px 12px;
  pointer-events: none;
  font-family: 'Segoe UI', -apple-system, sans-serif;
  color: #e2e8f0;
  backdrop-filter: blur(10px);
  animation: tooltipFadeIn 0.15s ease-out;
}

@keyframes tooltipFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.cst-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
  padding-bottom: 5px;
  margin-bottom: 8px;
}

.cst-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-cyan, #00f0ff);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.cst-role-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(0, 240, 255, 0.15);
  color: #8be9fd;
  border: 1px solid rgba(0, 240, 255, 0.3);
  font-weight: 600;
}

.cst-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  font-size: 11px;
  margin-bottom: 8px;
}

.cst-stat-item {
  display: flex;
  justify-content: space-between;
}

.cst-stat-label {
  color: #94a3b8;
}

.cst-stat-value {
  font-weight: 600;
  color: #ffffff;
}

.cst-stat-value.highlight {
  color: var(--neon-cyan, #00f0ff);
}

.cst-stat-value.energy {
  color: #ffb86c;
}

.cst-stat-value.heal {
  color: #50fa7b;
}

.cst-cost-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 10px;
}

.cst-cost-badge {
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.cst-cost-badge.compute {
  background: rgba(189, 147, 249, 0.2);
  color: #bd93f9;
  border: 1px solid rgba(189, 147, 249, 0.4);
}

.cst-cost-badge.silicon {
  background: rgba(0, 240, 255, 0.2);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.cst-cost-badge.power {
  background: rgba(255, 184, 108, 0.2);
  color: #ffb86c;
  border: 1px solid rgba(255, 184, 108, 0.4);
}

.cst-desc {
  font-size: 10.5px;
  line-height: 1.4;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 8px;
  border-radius: 4px;
  border-left: 2px solid var(--neon-cyan, #00f0ff);
}
