/* ===== RETRO PIXEL ART STYLE ===== */

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

:root {
  --bg-dark: #1a1a2e;
  --bg-medium: #16213e;
  --bg-light: #0f3460;
  --accent: #e94560;
  --accent-glow: #ff6b6b;
  --text: #eee;
  --text-dim: #888;
  --green: #4ade80;
  --yellow: #fbbf24;
  --cyan: #22d3ee;
  --purple: #a78bfa;
  --orange: #fb923c;
  --pink: #f472b6;
  --pixel-size: 4px;
}

body {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
  image-rendering: pixelated;
  -webkit-font-smoothing: antialiased;
}

/* CRT scanlines effect */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 2px
  );
}

/* ===== TOP BAR ===== */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-medium) 100%);
  border-bottom: 4px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

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

.logo-icon {
  font-size: 24px;
  animation: bounce 1s infinite;
}

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

.logo-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 var(--accent);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 0;
  background: var(--yellow);
  box-shadow: 0 0 10px var(--yellow);
  animation: blink 1s infinite;
}

.status-dot.connected {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: none;
}

.status-dot.error {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

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

.status-text {
  font-size: 12px;
  color: var(--text-dim);
}

.clock {
  font-size: 14px;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan);
}

/* ===== GAME WORLD ===== */
.game-world {
  position: fixed;
  top: 52px;
  left: 0;
  right: 300px;
  bottom: 48px;
  background: var(--bg-dark);
  overflow: hidden;
}

/* Floor grid - checkered pattern */
.floor-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(45deg, #1e1e3f 25%, transparent 25%),
    linear-gradient(-45deg, #1e1e3f 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1e1e3f 75%),
    linear-gradient(-45deg, transparent 75%, #1e1e3f 75%);
  background-size: 40px 40px;
  background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
  background-color: #12122a;
}

/* Furniture layer */
.furniture-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.furniture {
  position: absolute;
  image-rendering: pixelated;
}

.meeting-table {
  width: 200px;
  height: 100px;
  background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%);
  border: 4px solid #1a202c;
  border-radius: 50%;
  box-shadow: 0 8px 0 #1a202c;
}

/* ===== WORKSTATION WITH COMPUTER ===== */
.workstation {
  width: 100px;
  height: 80px;
  position: relative;
  pointer-events: none;
}

.desk-surface {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100px;
  height: 35px;
  background: linear-gradient(180deg, #8b7355 0%, #6b5344 100%);
  border: 3px solid #4a3728;
  border-radius: 4px;
  box-shadow: 0 4px 0 #3d2e22;
}

.computer {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.monitor {
  width: 50px;
  height: 38px;
  background: #1a1a2e;
  border: 4px solid #2d3748;
  border-radius: 4px 4px 0 0;
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  background: #0a0a15;
  border-radius: 2px;
}

/* Screen idle state - terminal prompt */
.screen::before {
  content: '>';
  position: absolute;
  top: 4px;
  left: 4px;
  color: var(--green);
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  opacity: 0.5;
}

/* Screen active state */
.screen.active {
  background: linear-gradient(180deg, #0a1628 0%, #0d1f3c 100%);
  animation: screen-flicker 0.1s infinite;
}

.screen.active::before {
  content: '█';
  animation: cursor-blink 0.5s infinite;
  opacity: 1;
}

.screen.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 0, 0.03) 2px,
    rgba(0, 255, 0, 0.03) 4px
  );
  pointer-events: none;
}

@keyframes screen-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.98; }
}

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

.monitor-stand {
  width: 12px;
  height: 8px;
  background: #2d3748;
}

.keyboard {
  width: 40px;
  height: 10px;
  background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%);
  border: 2px solid #1a202c;
  border-radius: 2px;
  margin-top: 2px;
}

/* Keyboard typing animation */
.keyboard.typing {
  animation: keyboard-press 0.15s infinite;
}

@keyframes keyboard-press {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(1px); }
}

.desk-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  opacity: 0.7;
}

/* Coffee machine */
.coffee-machine {
  width: 30px;
  height: 45px;
  background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%);
  border: 3px solid #1a202c;
  border-radius: 4px;
  position: relative;
}

.coffee-machine::before {
  content: '☕';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
}

.coffee-machine::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--green);
}

.plant {
  width: 40px;
  height: 60px;
  background: linear-gradient(180deg, #48bb78 0%, #276749 50%, #c53030 50%, #9b2c2c 100%);
  border-radius: 50% 50% 0 0;
  clip-path: polygon(20% 100%, 80% 100%, 100% 60%, 80% 0%, 20% 0%, 0% 60%);
}

.server-rack {
  width: 80px;
  height: 50px;
  background: linear-gradient(180deg, #2d3748 0%, #1a202c 100%);
  border: 3px solid #4a5568;
  position: relative;
}

.server-rack::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  height: 6px;
  background: var(--green);
  box-shadow: 
    0 12px 0 var(--cyan),
    0 24px 0 var(--yellow);
  animation: server-blink 2s infinite;
}

@keyframes server-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== AGENTS ===== */
.agents-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.agent {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s ease;
  z-index: 10;
}

.agent:hover {
  transform: scale(1.1);
}

.agent.selected {
  z-index: 20;
}

.agent.at-desk {
  z-index: 25;
}

.agent.at-desk .agent-avatar {
  animation: working-bob 1s ease-in-out infinite;
}

@keyframes working-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.agent-avatar {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  position: relative;
}

/* Pixel art robot avatar */
.agent-avatar .robot {
  width: 100%;
  height: 100%;
  position: relative;
}

.agent-avatar .robot .head {
  position: absolute;
  top: 0;
  left: 8px;
  width: 32px;
  height: 24px;
  border-radius: 4px 4px 0 0;
}

.agent-avatar .robot .eyes {
  position: absolute;
  top: 8px;
  left: 12px;
  width: 24px;
  height: 8px;
  background: #fff;
  display: flex;
  justify-content: space-between;
}

.agent-avatar .robot .eye {
  width: 8px;
  height: 8px;
  background: #1a1a2e;
  animation: eye-blink 3s infinite;
}

@keyframes eye-blink {
  0%, 90%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

.agent-avatar .robot .body {
  position: absolute;
  top: 24px;
  left: 4px;
  width: 40px;
  height: 24px;
  border-radius: 0 0 8px 8px;
}

.agent-avatar .robot .antenna {
  position: absolute;
  top: -8px;
  left: 20px;
  width: 8px;
  height: 12px;
  background: inherit;
}

.agent-avatar .robot .antenna::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: antenna-glow 1s infinite;
}

@keyframes antenna-glow {
  0%, 100% { box-shadow: 0 0 4px #fff; }
  50% { box-shadow: 0 0 12px #fff, 0 0 20px currentColor; }
}

/* Agent colors */
.agent[data-color="cyan"] .robot .head,
.agent[data-color="cyan"] .robot .body,
.agent[data-color="cyan"] .robot .antenna { background: var(--cyan); }

.agent[data-color="orange"] .robot .head,
.agent[data-color="orange"] .robot .body,
.agent[data-color="orange"] .robot .antenna { background: var(--orange); }

.agent[data-color="pink"] .robot .head,
.agent[data-color="pink"] .robot .body,
.agent[data-color="pink"] .robot .antenna { background: var(--pink); }

.agent[data-color="purple"] .robot .head,
.agent[data-color="purple"] .robot .body,
.agent[data-color="purple"] .robot .antenna { background: var(--purple); }

.agent[data-color="green"] .robot .head,
.agent[data-color="green"] .robot .body,
.agent[data-color="green"] .robot .antenna { background: var(--green); }

.agent[data-color="yellow"] .robot .head,
.agent[data-color="yellow"] .robot .body,
.agent[data-color="yellow"] .robot .antenna { background: var(--yellow); }

.agent[data-color="red"] .robot .head,
.agent[data-color="red"] .robot .body,
.agent[data-color="red"] .robot .antenna { background: var(--accent); }

.agent[data-color="blue"] .robot .head,
.agent[data-color="blue"] .robot .body,
.agent[data-color="blue"] .robot .antenna { background: #3b82f6; }

/* Agent status indicator */
.agent-status {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 0;
  border: 2px solid var(--bg-dark);
}

.agent-status.active {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1s infinite;
}

.agent-status.idle {
  background: var(--yellow);
}

.agent-status.offline {
  background: var(--text-dim);
}

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

/* Agent name label */
.agent-name {
  margin-top: 6px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid var(--cyan);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 4px;
}

/* Thinking animation */
.agent.thinking .agent-avatar::after {
  content: '...';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-medium);
  border: 2px solid var(--cyan);
  padding: 4px 8px;
  font-size: 10px;
  animation: thinking-dots 1s infinite;
}

@keyframes thinking-dots {
  0%, 100% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
}

/* Speech bubble */
.agent .speech-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-medium);
  border: 2px solid var(--text);
  padding: 10px 14px;
  font-size: 12px;
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 10px;
  border-radius: 8px;
  animation: fadeInUp 0.3s ease;
}

.agent .speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--text);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ===== SIDE PANELS ===== */
.activity-panel,
.agent-panel {
  position: fixed;
  right: 0;
  width: 300px;
  background: var(--bg-medium);
  border-left: 4px solid var(--accent);
  z-index: 50;
}

.activity-panel {
  top: 52px;
  height: calc(50% - 26px);
}

.agent-panel {
  top: calc(50% + 26px);
  bottom: 48px;
}

.panel-header {
  padding: 14px 16px;
  background: var(--bg-light);
  border-bottom: 2px solid var(--accent);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pixel-icon {
  font-size: 14px;
}

/* Activity feed */
.activity-feed {
  height: calc(100% - 44px);
  overflow-y: auto;
  padding: 8px;
}

.activity-feed::-webkit-scrollbar {
  width: 8px;
}

.activity-feed::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

.activity-feed::-webkit-scrollbar-thumb {
  background: var(--accent);
}

.activity-item {
  padding: 10px;
  margin-bottom: 4px;
  background: var(--bg-dark);
  border-left: 3px solid var(--cyan);
  font-size: 11px;
  line-height: 1.5;
}

.activity-item.system {
  border-left-color: var(--yellow);
}

.activity-item.error {
  border-left-color: var(--accent);
}

.activity-item.agent-main {
  border-left-color: var(--orange);
}

.activity-item.agent-scout {
  border-left-color: var(--green);
}

.activity-item .time {
  color: var(--text-dim);
  margin-right: 8px;
}

.activity-item .agent-tag {
  color: var(--cyan);
  margin-right: 4px;
}

/* Agent details */
.agent-details {
  padding: 16px;
  height: calc(100% - 44px);
  overflow-y: auto;
}

.agent-details .hint {
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
  margin-top: 40px;
  font-style: italic;
}

.agent-details .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-light);
  font-size: 12px;
}

.agent-details .detail-label {
  color: var(--text-dim);
}

.agent-details .detail-value {
  color: var(--cyan);
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-details .sessions-list {
  margin-top: 16px;
}

.agent-details .session-item {
  background: var(--bg-dark);
  padding: 10px;
  margin-bottom: 6px;
  font-size: 11px;
  border-radius: 4px;
}

.agent-details .session-item .session-key {
  color: var(--cyan);
  word-break: break-all;
}

.agent-details .session-item .session-channel {
  color: var(--text-dim);
  margin-top: 4px;
}

/* ===== STATS BAR ===== */
.stats-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
  border-top: 4px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  z-index: 100;
}

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

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 16px;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan);
}

/* ===== KING AVATAR (zlaCk) ===== */
.king-container {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 15;
}

.throne {
  width: 100px;
  height: 120px;
  position: relative;
}

/* Throne back */
.throne-back {
  position: absolute;
  bottom: 40px;
  left: 10px;
  width: 80px;
  height: 80px;
  background: linear-gradient(180deg, #b8860b 0%, #8b6914 50%, #654a0e 100%);
  border: 4px solid #4a3508;
  border-radius: 8px 8px 0 0;
  box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.3);
}

/* Throne decorations */
.throne-back::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #ffd700 0%, #ffec8b 50%, #ffd700 100%);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

/* Throne armrests */
.throne-armrest {
  position: absolute;
  bottom: 40px;
  width: 20px;
  height: 50px;
  background: linear-gradient(180deg, #b8860b 0%, #8b6914 100%);
  border: 3px solid #4a3508;
  border-radius: 4px;
}

.throne-armrest.left {
  left: 0;
}

.throne-armrest.right {
  right: 0;
}

/* Throne seat */
.throne-seat {
  position: absolute;
  bottom: 20px;
  left: 5px;
  width: 90px;
  height: 25px;
  background: linear-gradient(180deg, #dc143c 0%, #8b0000 100%);
  border: 3px solid #4a0000;
  border-radius: 4px;
  box-shadow: inset 0 -5px 10px rgba(0, 0, 0, 0.3);
}

/* Throne base */
.throne-base {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100px;
  height: 25px;
  background: linear-gradient(180deg, #8b6914 0%, #654a0e 100%);
  border: 3px solid #4a3508;
  border-radius: 4px;
}

/* King character */
.king {
  position: absolute;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 60px;
}

/* King body */
.king-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 35px;
  background: linear-gradient(180deg, #4a0080 0%, #2d004d 100%);
  border: 3px solid #1a002e;
  border-radius: 8px 8px 12px 12px;
}

/* King cape */
.king-body::before {
  content: '';
  position: absolute;
  top: 5px;
  left: -8px;
  width: 56px;
  height: 30px;
  background: linear-gradient(180deg, #dc143c 0%, #8b0000 100%);
  border: 2px solid #4a0000;
  border-radius: 0 0 20px 20px;
  z-index: -1;
}

/* King head */
.king-head {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 28px;
  background: linear-gradient(180deg, #fdbf6f 0%, #e5a55d 100%);
  border: 3px solid #c4864a;
  border-radius: 8px 8px 12px 12px;
}

/* King eyes */
.king-eyes {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 6px;
  display: flex;
  justify-content: space-between;
}

.king-eye {
  width: 6px;
  height: 6px;
  background: #1a1a2e;
  border-radius: 50%;
  animation: king-blink 4s infinite;
}

@keyframes king-blink {
  0%, 90%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

/* King smile */
.king-smile {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 5px;
  border: 2px solid #c4864a;
  border-top: none;
  border-radius: 0 0 10px 10px;
}

/* Joint */
.king-joint {
  position: absolute;
  bottom: 8px;
  right: -12px;
  width: 18px;
  height: 5px;
  background: linear-gradient(90deg, #f5f5dc 0%, #e8e8c8 60%, #ff6b35 85%, #ff4500 100%);
  border-radius: 2px;
  transform: rotate(-15deg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Joint ember glow */
.king-joint::before {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: #ff4500;
  border-radius: 50%;
  box-shadow: 0 0 4px #ff4500, 0 0 8px #ff6b35;
  animation: ember-glow 0.8s ease-in-out infinite alternate;
}

@keyframes ember-glow {
  0% { box-shadow: 0 0 4px #ff4500, 0 0 8px #ff6b35; }
  100% { box-shadow: 0 0 6px #ff4500, 0 0 12px #ff6b35, 0 0 16px #ffa500; }
}

/* Smoke */
.smoke-container {
  position: absolute;
  bottom: 14px;
  right: -18px;
  width: 20px;
  height: 40px;
  overflow: visible;
}

.smoke {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  background: rgba(200, 200, 200, 0.6);
  border-radius: 50%;
  animation: smoke-rise 2s ease-out infinite;
}

.smoke:nth-child(2) {
  animation-delay: 0.5s;
  left: 40%;
}

.smoke:nth-child(3) {
  animation-delay: 1s;
  left: 60%;
}

.smoke:nth-child(4) {
  animation-delay: 1.5s;
  left: 45%;
}

@keyframes smoke-rise {
  0% {
    opacity: 0.7;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 0.4;
    transform: translateY(-15px) translateX(5px) scale(1.5);
  }
  100% {
    opacity: 0;
    transform: translateY(-35px) translateX(10px) scale(2);
  }
}

/* Crown */
.crown {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 20px;
  background: linear-gradient(180deg, #ffd700 0%, #daa520 100%);
  border: 3px solid #b8860b;
  clip-path: polygon(0% 100%, 0% 40%, 15% 70%, 30% 30%, 50% 60%, 70% 30%, 85% 70%, 100% 40%, 100% 100%);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
  animation: crown-glow 2s ease-in-out infinite;
}

@keyframes crown-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
  50% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.9), 0 0 40px rgba(255, 215, 0, 0.4); }
}

/* Crown jewels */
.crown::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: #ff0000;
  border-radius: 50%;
  box-shadow: 
    -10px 2px 0 #00ff00,
    10px 2px 0 #0066ff;
}

/* King name label */
.king-name {
  margin-top: 8px;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid #ffd700;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 4px;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* ===== HEADER ACTIONS ===== */
.header-actions {
  display: flex;
  gap: 12px;
}

.pixel-btn {
  background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-medium) 100%);
  border: 3px solid var(--accent);
  color: var(--text);
  padding: 8px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  image-rendering: pixelated;
}

.pixel-btn:hover {
  background: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
  transform: translateY(-2px);
}

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

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-medium);
  border: 4px solid var(--accent);
  border-radius: 8px;
  max-width: 90vw;
  max-height: 85vh;
  overflow: auto;
  animation: slideIn 0.3s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-light);
  border-bottom: 3px solid var(--accent);
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  letter-spacing: 1px;
}

.modal-close {
  margin-left: auto;
  background: none;
  border: 2px solid var(--text-dim);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== REPORTS ===== */
.reports-modal {
  width: 900px;
  max-width: 95vw;
  height: 600px;
  max-height: 80vh;
}

.reports-container {
  display: flex;
  height: calc(100% - 50px);
}

.reports-sidebar {
  width: 200px;
  border-right: 3px solid var(--bg-light);
  overflow-y: auto;
  background: var(--bg-dark);
}

.reports-sidebar .loading {
  padding: 20px;
  color: var(--text-dim);
  text-align: center;
  font-size: 12px;
}

.report-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg-light);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
}

.report-item:hover {
  background: var(--bg-light);
}

.report-item.active {
  background: var(--accent);
  color: white;
}

.report-item .report-date {
  font-weight: 600;
  margin-bottom: 4px;
}

.report-item .report-day {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.report-item.active .report-day {
  color: rgba(255,255,255,0.7);
}

.reports-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: var(--bg-dark);
}

.no-report-selected {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
}

.no-report-selected .big-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.no-reports {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
}

.no-reports .big-icon {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
}

/* Report content styling */
.report-view {
  font-size: 13px;
  line-height: 1.7;
}

.report-view h1 {
  font-size: 18px;
  color: var(--cyan);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}

.report-view h2 {
  font-size: 15px;
  color: var(--accent);
  margin: 24px 0 12px 0;
}

.report-view h3 {
  font-size: 13px;
  color: var(--orange);
  margin: 16px 0 8px 0;
}

.report-view p {
  margin: 8px 0;
}

.report-view ul, .report-view ol {
  margin: 8px 0 8px 20px;
}

.report-view li {
  margin: 4px 0;
}

.report-view strong {
  color: var(--cyan);
}

.report-view code {
  background: var(--bg-medium);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

.report-view hr {
  border: none;
  border-top: 1px solid var(--bg-light);
  margin: 20px 0;
}

/* ===== HIERARCHY ===== */
.hierarchy-modal {
  min-width: 600px;
}

.hierarchy-tree {
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hierarchy-level {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.hierarchy-node {
  background: var(--bg-dark);
  border: 3px solid var(--bg-light);
  border-radius: 8px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
  min-width: 180px;
}

.hierarchy-node:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* King node special styling */
.hierarchy-node.king-node {
  border-color: #ffd700;
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.1) 0%, var(--bg-dark) 100%);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.hierarchy-node.king-node:hover {
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.4), 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Lead node special styling */
.hierarchy-node.lead-node {
  border-color: var(--orange);
  background: linear-gradient(180deg, rgba(251, 146, 60, 0.1) 0%, var(--bg-dark) 100%);
}

/* Node avatar */
.node-avatar {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* King mini avatar */
.king-avatar .mini-crown {
  font-size: 24px;
  position: absolute;
  top: -4px;
  animation: crown-float 2s ease-in-out infinite;
}

@keyframes crown-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.king-avatar .mini-head {
  width: 32px;
  height: 32px;
  background: linear-gradient(180deg, #fdbf6f 0%, #e5a55d 100%);
  border: 3px solid #c4864a;
  border-radius: 8px;
  margin-top: 16px;
}

/* Mini robots */
.mini-robot {
  width: 36px;
  height: 40px;
  position: relative;
}

.mini-robot::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 4px;
  width: 28px;
  height: 18px;
  border-radius: 4px 4px 0 0;
  background: currentColor;
}

.mini-robot::after {
  content: '';
  position: absolute;
  top: 26px;
  left: 2px;
  width: 32px;
  height: 14px;
  border-radius: 0 0 6px 6px;
  background: currentColor;
}

/* Mini robot antenna */
.mini-robot .antenna {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 10px;
  background: currentColor;
}

.mini-robot.orange { color: var(--orange); }
.mini-robot.green { color: var(--green); }
.mini-robot.blue { color: #3b82f6; }
.mini-robot.purple { color: var(--purple); }
.mini-robot.cyan { color: var(--cyan); }

/* Eyes on mini robot */
.mini-robot .eyes {
  position: absolute;
  top: 12px;
  left: 8px;
  width: 20px;
  height: 6px;
  display: flex;
  justify-content: space-between;
  z-index: 1;
}

.mini-robot .eye {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 1px;
}

/* Node info */
.node-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.node-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.node-title {
  font-size: 11px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.node-desc {
  font-size: 10px;
  color: var(--text-dim);
}

/* Connectors */
.hierarchy-connector {
  width: 4px;
  height: 40px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--cyan) 100%);
  position: relative;
}

.hierarchy-connector.branching {
  height: 50px;
}

.hierarchy-connector.branching::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 4px;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--accent) 50%, var(--cyan) 100%);
}

/* Level 2 vertical connectors */
.level-2 .hierarchy-node {
  position: relative;
}

.level-2 .hierarchy-node::before {
  content: '';
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 26px;
  background: var(--cyan);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .game-world {
    right: 0;
    bottom: 200px;
  }
  
  .activity-panel,
  .agent-panel {
    top: auto;
    bottom: 48px;
    left: 0;
    width: 50%;
    height: 150px;
  }
  
  .agent-panel {
    left: 50%;
  }
}
