/* ============================================
   WARZONE - Military RTS Game Stylesheet
   ============================================ */

/* --- Reset & Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #e0e0e0;
}

#gameCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hidden {
  display: none !important;
}

/* ============================================
   MAIN MENU
   ============================================ */
#main-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a15 70%, #000 100%);
}

.menu-content {
  text-align: center;
  padding: 60px 80px;
  background: rgba(15, 52, 96, 0.3);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 4px;
  backdrop-filter: blur(5px);
}

.menu-title {
  font-size: 72px;
  font-weight: 900;
  letter-spacing: 16px;
  color: #00ff41;
  text-shadow: 0 0 20px rgba(0, 255, 65, 0.5), 0 0 60px rgba(0, 255, 65, 0.2);
  margin-bottom: 8px;
}

.menu-subtitle {
  font-size: 16px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #6a8a7a;
  margin-bottom: 50px;
}

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

.menu-btn {
  width: 240px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #e0e0e0;
  background: linear-gradient(180deg, #1a4a2e 0%, #0d2818 100%);
  border: 1px solid #2a6a3e;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.menu-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #2a6a3e 0%, #1a4a2e 100%);
  border-color: #00ff41;
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.menu-btn:active:not(:disabled) {
  transform: scale(0.97);
}

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

.menu-btn-secondary {
  background: linear-gradient(180deg, #2a2a3e 0%, #16213e 100%);
  border-color: #4a4a6e;
}

.menu-btn-secondary:hover {
  background: linear-gradient(180deg, #3a3a5e 0%, #2a2a4e 100%) !important;
  border-color: #7a7aae !important;
  box-shadow: 0 0 15px rgba(120, 120, 180, 0.3) !important;
}

.menu-btn-featured {
  background: linear-gradient(180deg, #2a5a3e 0%, #1a3a28 100%);
  border: 2px solid #00ff41;
  color: #00ff41;
  font-size: 18px;
  padding: 16px 32px;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.menu-btn-featured:hover:not(:disabled) {
  background: linear-gradient(180deg, #3a7a4e 0%, #2a5a3e 100%);
  border-color: #33ff66;
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}

.menu-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 4px 0;
}

/* ============================================
   NATION SELECT
   ============================================ */
#nation-select {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a15 70%, #000 100%);
}

.nation-select-content {
  text-align: center;
  padding: 40px 50px;
  background: rgba(15, 52, 96, 0.2);
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: 4px;
  backdrop-filter: blur(5px);
  max-width: 800px;
  width: 90%;
}

.nation-select-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 8px;
  color: #00ff41;
  text-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
  margin-bottom: 30px;
}

.nation-panels {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin-bottom: 30px;
}

.nation-panel {
  flex: 1;
  padding: 20px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
}

.allied-panel {
  border: 1px solid rgba(51, 85, 255, 0.3);
}

.enemy-panel {
  border: 1px solid rgba(255, 51, 51, 0.3);
}

.panel-header {
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: #8a9aaa;
}

.allied-panel .panel-header {
  color: #6688cc;
}

.enemy-panel .panel-header {
  color: #cc6666;
}

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

.nation-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 12px 16px;
  background: rgba(22, 33, 62, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nation-card:hover {
  background: rgba(22, 33, 62, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.nation-card.selected {
  border-color: #00ff41;
  background: rgba(0, 255, 65, 0.1);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.nation-card.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.nation-flag {
  width: 32px;
  height: 20px;
  border-radius: 2px;
  flex-shrink: 0;
}

.nation-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
}

.nation-passive {
  width: 100%;
  font-size: 11px;
  color: #88cc88;
  padding-left: 44px;
  line-height: 1.3;
}

.nation-ability {
  width: 100%;
  font-size: 11px;
  color: #88bbff;
  padding-left: 44px;
  line-height: 1.3;
}

.nation-select-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* ============================================
   MULTIPLAYER SCREEN
   ============================================ */
#multiplayer-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a15 70%, #000 100%);
}

.mp-content {
  text-align: center;
  padding: 30px 40px;
  background: rgba(15, 52, 96, 0.2);
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: 4px;
  backdrop-filter: blur(5px);
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.mp-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 8px;
  color: #00ff41;
  text-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
  margin-bottom: 24px;
}

.mp-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.mp-join-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.mp-input {
  padding: 10px 14px;
  background: rgba(22, 33, 62, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #ccc;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 1px;
  outline: none;
  transition: border-color 0.2s;
}

.mp-input:focus {
  border-color: #00ff41;
}

.mp-input::placeholder {
  color: #556;
}

.mp-status {
  color: #6a8a7a;
  font-size: 12px;
  min-height: 18px;
  margin-top: 8px;
}

/* Room list */
.mp-room-list {
  margin: 12px 0;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(22, 33, 62, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.mp-room-item:hover {
  border-color: #00ff41;
  background: rgba(0, 255, 65, 0.06);
}

.mp-room-item-name {
  color: #ccc;
  font-weight: 600;
  font-size: 13px;
}

.mp-room-item-info {
  color: #6a8a7a;
  font-size: 11px;
}

/* Lobby view */
.mp-room-header {
  margin-bottom: 20px;
}

.mp-room-label {
  display: block;
  font-size: 11px;
  letter-spacing: 3px;
  color: #6a8a7a;
  margin-bottom: 4px;
}

.mp-room-code {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 8px;
  color: #ffcc00;
  text-shadow: 0 0 12px rgba(255, 204, 0, 0.3);
  cursor: pointer;
  user-select: all;
  transition: color 0.2s;
}

.mp-room-code:hover {
  color: #ffdd44;
}

/* Player slots */
.mp-players {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.mp-player-slot {
  flex: 1;
  padding: 14px 16px;
  background: rgba(22, 33, 62, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  min-width: 180px;
}

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

.mp-slot-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: #8a9aaa;
  text-transform: uppercase;
}

.mp-slot-ready {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ff4444;
}

.mp-slot-ready.is-ready {
  color: #00ff41;
}

.mp-slot-nation {
  font-size: 14px;
  font-weight: 600;
  color: #556;
}

.mp-slot-nation.has-nation {
  color: #ccc;
}

.mp-vs {
  font-size: 20px;
  font-weight: 900;
  color: #ffcc00;
  letter-spacing: 2px;
}

/* Nation selector in lobby */
.mp-nation-select {
  margin-bottom: 16px;
}

.mp-section-title {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #8a9aaa;
  margin-bottom: 10px;
}

.mp-nation-grid {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.mp-nation-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(22, 33, 62, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: #ccc;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}

.mp-nation-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(22, 33, 62, 0.9);
}

.mp-nation-btn.selected {
  border-color: #00ff41;
  background: rgba(0, 255, 65, 0.1);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.mp-flag {
  display: inline-block;
  width: 20px;
  height: 12px;
  border-radius: 2px;
}

/* Ready section */
.mp-ready-section {
  margin-bottom: 16px;
}

.mp-countdown {
  font-size: 48px;
  font-weight: 900;
  color: #ffcc00;
  text-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
  letter-spacing: 4px;
  margin-top: 10px;
  animation: mp-pulse 1s ease-in-out infinite;
}

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

/* Chat */
.mp-chat {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.mp-chat-messages {
  height: 100px;
  overflow-y: auto;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 12px;
  text-align: left;
}

.mp-chat-msg {
  margin-bottom: 3px;
  line-height: 1.4;
}

.mp-chat-msg-name {
  font-weight: 700;
  color: #88aaff;
}

.mp-chat-msg-text {
  color: #bbb;
}

.mp-chat-msg-system {
  color: #6a8a7a;
  font-style: italic;
}

.mp-chat-input-row {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mp-chat-input-row .mp-input {
  flex: 1;
  border: none;
  border-radius: 0;
  background: rgba(22, 33, 62, 0.4);
  padding: 8px 10px;
  font-size: 12px;
}

.mp-chat-send-btn {
  padding: 8px 14px;
  background: rgba(0, 100, 40, 0.3);
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  color: #00ff41;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s;
}

.mp-chat-send-btn:hover {
  background: rgba(0, 100, 40, 0.5);
}

/* Voice Chat - Lobby Button */
.voice-btn {
  width: auto;
  min-width: 60px;
  padding: 10px 16px;
  font-size: 14px;
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  border: 2px solid #4a6a4a;
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.voice-btn.voice-active {
  border-color: #00ff41;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.4);
  color: #00ff41;
}

.voice-btn.voice-muted {
  border-color: #ff4444;
  opacity: 0.6;
  color: #ff6666;
}

/* Voice Chat - In-game Indicator */
.voice-indicator {
  position: fixed;
  top: 44px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #4a6a4a;
  border-radius: 4px;
  padding: 4px 10px;
  font-family: monospace;
  font-size: 12px;
  color: #00ff41;
  cursor: pointer;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.voice-indicator.voice-muted {
  color: #ff6666;
  border-color: #ff4444;
}

.voice-indicator.voice-muted #voice-mic-icon {
  color: #ff6666;
}

/* Speaking indicator with pulsing glow */
.voice-speaking {
  animation: voice-pulse 0.8s ease-in-out infinite;
  color: #ffcc00 !important;
  text-shadow: 0 0 6px rgba(255, 204, 0, 0.6);
}

@keyframes voice-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1.0; text-shadow: 0 0 12px rgba(255, 204, 0, 0.9); }
}

/* ============================================
   HUD
   ============================================ */
#hud {
  pointer-events: none;
}

#hud > * {
  pointer-events: auto;
}

/* --- Resource Bar (Top) --- */
#resource-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 20px;
  background: linear-gradient(180deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.85) 100%);
  border-bottom: 1px solid rgba(0, 255, 65, 0.15);
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.resource-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #6a8a7a;
}

.resource-value {
  font-size: 14px;
  font-weight: 700;
  color: #00ff41;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
  min-width: 40px;
}

/* --- Selection Panel (Bottom-Left) --- */
#selection-panel {
  position: fixed;
  bottom: 10px;
  left: 10px;
  z-index: 10;
  width: 260px;
  min-height: 80px;
  padding: 12px 16px;
  background: rgba(26, 26, 46, 0.9);
  border: 1px solid rgba(0, 255, 65, 0.12);
  border-radius: 3px;
}

#selection-info {
  font-size: 13px;
}

.selection-placeholder {
  color: #4a5a6a;
  font-style: italic;
}

.selection-name {
  font-size: 15px;
  font-weight: 700;
  color: #00ff41;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.selection-hp-bar {
  width: 100%;
  height: 6px;
  background: #1a1a2e;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.selection-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff3333, #ffaa00, #00ff41);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.selection-detail {
  font-size: 11px;
  color: #8a9aaa;
  margin-bottom: 2px;
}

.selection-detail span {
  color: #c0d0e0;
}

/* --- Command Panel (Bottom-Center) --- */
#command-panel {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(26, 26, 46, 0.9);
  border: 1px solid rgba(0, 255, 65, 0.12);
  border-radius: 3px;
}

/* GD-126: Command Card */
#command-card {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 6px;
  background: rgba(16, 20, 30, 0.95);
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: 4px;
}

#command-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 56px);
  grid-template-rows: repeat(3, 44px);
  gap: 3px;
}

.cc-btn {
  width: 56px;
  height: 44px;
  font-size: 16px;
  font-weight: 700;
  color: #c0d0e0;
  background: linear-gradient(180deg, #1a2a3e 0%, #0d1520 100%);
  border: 1px solid #2a3a4e;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: inherit;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px;
}

.cc-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #2a4a5e 0%, #1a2a3e 100%);
  border-color: #00ff41;
  color: #fff;
}

.cc-btn:active:not(:disabled) {
  transform: scale(0.93);
}

.cc-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cc-btn .cc-icon {
  font-size: 18px;
  line-height: 1;
}

.cc-btn .cc-key {
  font-size: 8px;
  color: #888;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1;
}

.cmd-btn {
  width: 60px;
  height: 40px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #c0d0e0;
  background: linear-gradient(180deg, #1a2a3e 0%, #0d1520 100%);
  border: 1px solid #2a3a4e;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

/* Build menu and production panel buttons need auto height for multi-line content */
#build-options .cmd-btn,
#production-options .cmd-btn {
  width: 100%;
  height: auto;
  min-height: 40px;
  text-align: left;
  text-transform: none;
  padding: 8px 12px;
  line-height: 1.4;
  overflow: visible;
}

.cmd-btn:hover {
  background: linear-gradient(180deg, #2a4a5e 0%, #1a2a3e 100%);
  border-color: #00ff41;
  color: #fff;
}

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

.cmd-btn.active {
  background: linear-gradient(180deg, #1a4a2e 0%, #0d2818 100%);
  border-color: #00ff41;
  color: #00ff41;
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

/* --- Minimap (Bottom-Right) --- */
#minimap-container {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 10;
  width: 200px;
  height: 200px;
  background: rgba(26, 26, 46, 0.9);
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

#minimap-canvas {
  display: block;
  width: 200px;
  height: 200px;
}

/* --- Production Panel (Right Side) --- */
#production-panel {
  position: fixed;
  top: 50px;
  right: 10px;
  z-index: 10;
  width: 220px;
  padding: 12px;
  background: rgba(26, 26, 46, 0.92);
  border: 1px solid rgba(0, 255, 65, 0.12);
  border-radius: 3px;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}


.production-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #00ff41;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0, 255, 65, 0.15);
}

#production-queue {
  margin-bottom: 10px;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  margin-bottom: 4px;
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid rgba(0, 255, 65, 0.1);
  border-radius: 2px;
  font-size: 11px;
}

.queue-item-name {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #c0d0e0;
}

.queue-progress-bar {
  width: 60px;
  height: 4px;
  background: #1a1a2e;
  border-radius: 2px;
  overflow: hidden;
}

.queue-progress-fill {
  height: 100%;
  background: #00ff41;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.prod-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #c0d0e0;
  background: linear-gradient(180deg, #1a2a3e 0%, #0d1520 100%);
  border: 1px solid #2a3a4e;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.prod-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #2a4a5e 0%, #1a2a3e 100%);
  border-color: #00ff41;
  color: #fff;
}

.prod-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.prod-btn .prod-cost {
  color: #00ff41;
  font-size: 10px;
}

/* --- Build Menu (Right Side) --- */
#build-menu {
  position: fixed;
  top: 50px;
  right: 10px;
  z-index: 12;
  width: 240px;
  padding: 12px;
  background: rgba(26, 26, 46, 0.95);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 3px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

#build-options .prod-btn {
  margin-bottom: 4px;
}

/* ============================================
   GAME OVER
   ============================================ */
#game-over {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
}

.game-over-content {
  text-align: center;
  padding: 60px 80px;
  background: rgba(15, 52, 96, 0.3);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 4px;
  backdrop-filter: blur(10px);
}

.game-over-title {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 12px;
  margin-bottom: 16px;
}

.game-over-title.victory {
  color: #00ff41;
  text-shadow: 0 0 30px rgba(0, 255, 65, 0.5);
}

.game-over-title.defeat {
  color: #ff3333;
  text-shadow: 0 0 30px rgba(255, 51, 51, 0.5);
}

.game-over-message {
  font-size: 18px;
  color: #8a9aaa;
  margin-bottom: 40px;
  letter-spacing: 2px;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(26, 26, 46, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 65, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 65, 0.4);
}

/* ============================================
   POP CAP & RESOURCE FEEDBACK ANIMATIONS
   ============================================ */
@keyframes pulse-red {
  0%, 100% { color: #ff3333; text-shadow: 0 0 8px rgba(255, 51, 51, 0.3); }
  50% { color: #ff6666; text-shadow: 0 0 16px rgba(255, 51, 51, 0.6); }
}

@keyframes flash-red {
  0% { color: #ff3333; text-shadow: 0 0 12px rgba(255, 51, 51, 0.6); }
  100% { color: #00ff41; text-shadow: 0 0 8px rgba(0, 255, 65, 0.3); }
}

.unit-count-warning {
  color: #ffcc00 !important;
  text-shadow: 0 0 8px rgba(255, 204, 0, 0.3) !important;
}

.unit-count-maxed {
  color: #ff3333 !important;
  animation: pulse-red 0.8s ease-in-out infinite !important;
}

.sp-flash-red {
  animation: flash-red 0.5s ease-out !important;
}

/* ============================================
   SELECTION BOX (drawn by InputManager)
   ============================================ */
#selection-box {
  position: fixed;
  border: 1px solid #00ff41;
  background: rgba(0, 255, 65, 0.08);
  pointer-events: none;
  z-index: 5;
}

/* ============================================
   TOOLTIP
   ============================================ */
.tooltip {
  position: fixed;
  padding: 6px 10px;
  font-size: 11px;
  color: #e0e0e0;
  background: rgba(26, 26, 46, 0.95);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 2px;
  pointer-events: none;
  z-index: 15;
  white-space: nowrap;
}

/* ============================================
   TURN INDICATOR (2P mode)
   ============================================ */
#turn-indicator {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 6px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #00ff41;
  background: rgba(26, 26, 46, 0.9);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 3px;
}

/* ============================================
   ALERT NOTIFICATION SYSTEM (GD-087)
   ============================================ */
#alert-container {
  position: fixed;
  top: 50px;
  right: 240px;
  width: 280px;
  z-index: 200;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alert-notification {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(10, 10, 20, 0.92);
  border-radius: 4px;
  font-family: sans-serif;
  font-size: 12px;
  cursor: pointer;
  pointer-events: auto;
  transform: translateX(300px);
  animation: alert-slide-in 0.3s ease-out forwards;
  border-left: 3px solid #888;
  transition: opacity 0.3s, background 0.15s;
}

.alert-notification:hover {
  background: rgba(20, 20, 40, 0.95);
}

.alert-notification.alert-dismiss {
  animation: alert-slide-out 0.3s ease-in forwards;
}

.alert-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.alert-text {
  flex: 1;
  line-height: 1.3;
}

.alert-type-attack { border-left-color: #ff3333; color: #ff6666; }
.alert-type-unit-lost { border-left-color: #ff8800; color: #ffaa44; }
.alert-type-production { border-left-color: #00ff44; color: #88ff88; }
.alert-type-research { border-left-color: #4488ff; color: #88aaff; }
.alert-type-superweapon { border-left-color: #ffcc00; color: #ffdd44; }
.alert-type-low-resources { border-left-color: #ffdd00; color: #ffee66; }

@keyframes alert-slide-in {
  from { transform: translateX(300px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes alert-slide-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(300px); opacity: 0; }
}

/* ============================================
   PRODUCTION QUEUE OVERVIEW PANEL (Cycle 15)
   ============================================ */
#prod-overview-panel {
  position: fixed;
  top: 44px;
  left: 0;
  bottom: 110px;
  width: 220px;
  background: rgba(0, 0, 0, 0.88);
  border-right: 1px solid #333;
  z-index: 15;
  overflow-y: auto;
  font-family: sans-serif;
  font-size: 12px;
  color: #ccc;
  display: none;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}

#prod-overview-panel::-webkit-scrollbar {
  width: 4px;
}
#prod-overview-panel::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 2px;
}

#prod-overview-panel .po-header {
  padding: 8px 10px;
  color: #ffcc00;
  font-weight: bold;
  font-size: 13px;
  border-bottom: 1px solid #333;
  letter-spacing: 1px;
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1;
}

#prod-overview-panel .po-entry {
  padding: 6px 10px;
  border-bottom: 1px solid #222;
  cursor: pointer;
  transition: background 0.15s;
}

#prod-overview-panel .po-entry:hover {
  background: rgba(0, 255, 65, 0.08);
}

#prod-overview-panel .po-building-name {
  font-weight: 600;
  color: #aac;
  font-size: 11px;
}

#prod-overview-panel .po-idle {
  color: #cc9900;
  font-size: 10px;
  font-style: italic;
}

#prod-overview-panel .po-progress-bar {
  height: 4px;
  background: #333;
  border-radius: 2px;
  margin-top: 3px;
  overflow: hidden;
}

#prod-overview-panel .po-progress-fill {
  height: 100%;
  background: #00ff88;
  transition: width 0.3s;
}

#prod-overview-panel .po-queue-row {
  display: flex;
  gap: 2px;
  margin-top: 3px;
  flex-wrap: wrap;
}

#prod-overview-panel .po-queue-icon {
  width: 20px;
  height: 18px;
  background: #1a2a1a;
  border: 1px solid #445544;
  border-radius: 2px;
  font-size: 8px;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#prod-overview-panel .po-queue-icon.current {
  border-color: #00ff88;
  color: #fff;
}

/* ============================================
   HOVER TOOLTIP (Cycle 15)
   ============================================ */
#entity-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 300;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid #555;
  border-radius: 5px;
  padding: 8px 12px;
  font-family: sans-serif;
  font-size: 12px;
  color: #ccc;
  max-width: 240px;
  display: none;
  white-space: nowrap;
}

#entity-tooltip .tt-name {
  font-weight: bold;
  font-size: 13px;
  color: #fff;
  margin-bottom: 3px;
}

#entity-tooltip .tt-hp-bar {
  height: 5px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
  margin: 3px 0;
}

#entity-tooltip .tt-hp-fill {
  height: 100%;
  transition: width 0.2s;
}

#entity-tooltip .tt-detail {
  font-size: 10px;
  color: #999;
  margin-top: 2px;
}

#entity-tooltip .tt-strong {
  color: #88ff88;
  font-size: 10px;
}

#entity-tooltip .tt-weak {
  color: #ff8888;
  font-size: 10px;
}

/* ============================================
   MOBILE SPECTATE BUTTON (always hidden on desktop unless shown by JS)
   ============================================ */
.mobile-spectate-btn {
  width: 260px;
  font-size: 20px !important;
  padding: 18px 32px !important;
  min-height: 56px;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */
@media (max-width: 768px) {
  /* Main menu adjustments */
  .menu-content {
    padding: 30px 20px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .menu-title {
    font-size: 36px;
    letter-spacing: 8px;
  }

  .menu-subtitle {
    font-size: 12px;
    letter-spacing: 3px;
    margin-bottom: 24px;
  }

  .menu-buttons {
    gap: 10px;
  }

  .menu-btn {
    width: 220px;
    min-height: 44px;
    padding: 12px 20px;
    font-size: 14px;
  }

  .menu-btn-featured {
    font-size: 16px !important;
    padding: 14px 20px !important;
  }

  /* Make quick spectate button very prominent on mobile */
  .mobile-spectate-btn {
    width: 240px;
    font-size: 18px !important;
    padding: 16px 24px !important;
    min-height: 52px;
    order: -1;
  }

  /* Hide less useful buttons on mobile */
  body.is-mobile #btn-multiplayer,
  body.is-mobile #btn-2player,
  body.is-mobile #btn-map-editor,
  body.is-mobile #btn-replays,
  body.is-mobile #btn-history {
    display: none;
  }

  /* Nation select */
  .nation-select-content {
    padding: 20px 15px;
    max-height: 95vh;
    overflow-y: auto;
  }

  .nation-panels {
    flex-direction: column;
    gap: 15px;
  }

  /* HUD resource bar */
  #resource-bar {
    height: 28px;
    gap: 10px;
    padding: 0 8px;
    font-size: 10px;
  }

  .resource-label {
    font-size: 9px;
    letter-spacing: 1px;
  }

  .resource-value {
    font-size: 11px;
    min-width: 28px;
  }

  /* Minimap smaller */
  #minimap-container {
    width: 120px !important;
    height: 120px !important;
  }

  #minimap-canvas {
    width: 120px !important;
    height: 120px !important;
  }

  /* Selection panel */
  #selection-panel {
    width: 200px;
    min-height: 60px;
    padding: 8px 10px;
    font-size: 11px;
  }

  /* Production panel */
  #production-panel {
    max-width: 160px;
  }
}

/* ============================================
   SPECTATE MODE (mobile + desktop)
   ============================================ */
body.spectate-mode #selection-panel,
body.spectate-mode #command-card,
body.spectate-mode #build-menu,
body.spectate-mode #control-group-bar,
body.spectate-mode #prod-overview-panel,
body.spectate-mode #production-panel,
body.spectate-mode #voice-indicator {
  display: none !important;
}

/* On mobile spectate, also hide extra resource bar buttons */
@media (max-width: 768px) {
  body.spectate-mode #btn-help,
  body.spectate-mode #btn-techtree {
    display: none !important;
  }

  body.spectate-mode #resource-bar {
    gap: 8px;
  }
}
