/*
World State Machine - Refactored Stylesheet v22
Aesthetic Enhancement & Full Restoration by Gemini, 2025
Theme: "Kojima" - Utilitarian Sci-Fi, Command Center UI
---
Structure:
1.  :root Variables
2.  Base & Typography
3.  Main Layout & Dashboard Structure
4.  Header & Status
5.  Left Panel: Locations
6.  Center Panel: Map, User Panel, Markers & Popups
7.  Right Panel: Info, NPCs, Logs
8.  Agent Details Panel (Bottom)
9.  Modals (Interaction, Loading, NFT Import)
10. Animations
11. Responsive Design
*/
@import url('https://fonts.googleapis.com/css2?family=Oxanium:wght@700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');


/* 1. :root Variables */
:root {
  /* Thematic Palette: Dark, Utilitarian, High-Tech */
  --color-accent: #00e5ff; /* Sharp Cyan */
  --color-accent-dark: #00b8cc;
  --color-accent-glow: rgba(0, 229, 255, 0.3);
  --color-warning: #ffc107; /* Amber */
  --color-danger: #f44336;  /* Crimson */
  --color-success: #4caf50; /* Tactical Green */
  --color-info: #2196f3;
  --color-special: #e91e63; /* Magenta for special states */
  --color-twitter: #1DA1F2;
  --color-discord: #5865F2;

  /* Backgrounds */
  --bg-body: #11161d;
  --bg-panel: #1a222c;
  --bg-content: #202b38;
  --bg-content-light: #2c3a4a;
  --bg-overlay: rgba(26, 34, 44, 0.7);
  --bg-glass: rgba(32, 43, 56, 0.8);
  --bg-glass-border: rgba(0, 229, 255, 0.2);

  /* Text */
  --text-primary: #e0e6f0;
  --text-secondary: #90a4b7;
  --text-muted: #607d8b;
  --text-accent: var(--color-accent);
  --text-heading: #ffffff;
  --text-light: #ffffff; /* For consistency with original */

  /* Borders & Shadows */
  --border-color: #37474f;
  --border-color-light: #455a64;
  --border-accent: rgba(0, 229, 255, 0.4);
  --shadow-glow: 0 0 15px var(--color-accent-glow);
  --shadow-glow-lg: 0 0 25px var(--color-accent-glow);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.3);

  /* Typography */
  --font-heading: 'Oxanium', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Roboto Mono', monospace;

  /* Sizing & Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-full: 50%;

  /* Transitions */
  --transition-fast: all 0.2s ease-in-out;
  --transition-std: all 0.3s ease;
}

/* 2. Base & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* in Block 2: Base & Typography */
body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  position: relative; /* Added for the pseudo-element */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
 
body::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
  pointer-events: none; /* This ensures it's not clickable */
  z-index: -1; /* This places it behind all content */
}
 

/* Common Utilities */
.flex-center { display: flex; align-items: center; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-xxs { font-size: 10px; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 1.2px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--border-color-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

/* 3. Main Layout & Dashboard Structure */
.dashboard-container {
  display: flex;
  height: calc(100vh - 182px - 30px); /* Header (182px) + Footer (30px) height */
  background: transparent;
  padding-bottom: 0;
}

.location-panel {
  width: 320px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  height: 100%;
}

.map-section {
  flex: 2;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.info-panel {
  flex: 1.5;
  min-width: 400px;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-color);
  height: 100%;
}

.log-transition {
  margin: 10px;
  font-size: 12px;
  color: #12d212;
  font-weight: bold;
  border-bottom: 1px solid #4CAF50;
  padding: 5px 0px;
}

.dashboard-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--spacing-sm) var(--spacing-xl);
  border-top: 1px solid var(--border-accent);
  text-align: center;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  z-index: 1000;
  height: 30px;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3);
}
.dashboard-footer a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color 0.3s ease;
}
.dashboard-footer a:hover {
  color: var(--text-heading);
  text-shadow: 0 0 8px var(--color-accent-glow);
}
/* 4. Header & Status - Themed Redesign */
.dashboard-header {
  background: var(--bg-panel);
  padding: 0 var(--spacing-xl) 0 var(--spacing-sm);
  border-bottom: 2px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1000;
  overflow: hidden;  
}

/* Top accent line */
.dashboard-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
  box-shadow: var(--shadow-glow);
  z-index: 2;
  
}
 
.dashboard-header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.1), transparent); 
  pointer-events: none;
  z-index: 1;
}
 

/* Brand Section */
.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 15px 16px 8px 8px;
  border-radius: 12px;
  position: relative;
  /* The background image is preserved from your original code */
  background: url(img/robots.png) bottom left no-repeat;
  background-size: 250px;
  min-height:180px;
}

.header-brand:hover {
  transform: translateY(-1px);
}

.header-brand:active {
  transform: translateY(0);
}

.brand-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 12px var(--color-accent-glow);
  overflow: hidden;
  /* Preserving your display:none rule */
  display: none;

}

.brand-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.2));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.header-brand:hover .brand-icon::after {
  opacity: 1;
}

.brand-icon i {
  font-size: 24px;
  color: var(--bg-body);
  z-index: 1;
  position: relative;
}

.brand-text {
  display: flex;
  flex-direction: column;
  margin: 0 0 0 210px;
}

.brand-title {
  font-family: "Oxanium", sans-serif;
  font-size: 35px;
  font-weight: 700;
  margin: 0;
  line-height: 1;
  color: var(--text-heading);
  text-shadow: 0 0 5px var(--color-accent-glow);
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
}

/* Status Grid */
.status-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 14px;
  flex: 1;
  max-width: 1000px; 
}

/* Status Cards */
.status-card {
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  
}

.wallet-address-copy {
    margin-left: 8px;
    cursor: pointer;
    color: #94a3b8; /* --text-muted */
    transition: color 0.2s ease, transform 0.2s ease;
}

.wallet-address-copy:hover {
    color: #6366f1; /* --primary */
    transform: scale(1.2);
}

.status-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  border-color: var(--border-accent);
}

/* Top border accent - like a status strip */
.status-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  opacity: 1;
  background: var(--border-color-light); /* Default strip color */
  z-index: 2;
}
 
.status-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.03) 25%,
    transparent 25%,
    transparent 50%,
    rgba(0, 0, 0, 0.03) 50%,
    rgba(0, 0, 0, 0.03) 75%,
    transparent 75%,
    transparent
  );
  background-size: 6px 6px;
  opacity: 0.5;
  pointer-events: none;
}


/* Card Variants (color gradient strips) */
.status-system::before { background: linear-gradient(90deg, var(--color-success), #388e3c); }
.status-time::before { background: linear-gradient(90deg, var(--color-accent), var(--color-accent-dark)); }
.status-weather::before { background: linear-gradient(90deg, var(--color-info), #1976d2); }
.status-treasury::before { background: linear-gradient(90deg, var(--color-warning), #f57f17); }
.status-skinet::before { background: linear-gradient(90deg, var(--color-special), #c2185b); }
.status-citizens::before { background: linear-gradient(90deg, #81d4fa, var(--color-info)); }

/* Card Icon */
.card-icon {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
  background: var(--bg-panel);
  color: var(--text-secondary);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color-light);
  position: relative;
  z-index: 2;
}

/* Per-Type Background Hues */
.status-system .card-icon { background: rgba(76, 175, 80, 0.15); color: var(--color-success); }
.status-time .card-icon { background: rgba(0, 229, 255, 0.15); color: var(--color-accent); }
.status-weather .card-icon { background: rgba(33, 150, 243, 0.15); color: var(--color-info); }
.status-treasury .card-icon { background: rgba(255, 193, 7, 0.15); color: var(--color-warning); }
.status-skinet .card-icon { background: rgba(233, 30, 99, 0.15); color: var(--color-special); }
.status-citizens .card-icon { background: rgba(129, 212, 250, 0.15); color: #81d4fa; }

/* Card Content */
.card-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.card-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-secondary);
}

.card-value {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-detail {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex; 
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pulse Dot */
.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-success);
  position: relative;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.7);
}

.pulse-dot::before,
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--color-success);
  opacity: 0;
}

.pulse-dot::before {
  animation: pulse-ring 2s ease-in-out infinite;
}

.pulse-dot::after {
  animation: pulse-ring 2s ease-in-out infinite 0.5s;
}

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

/* Minor tweaks */
.separator {
  font-size: 10px;
  color: var(--text-muted);
}

.time-period {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.period-icon {
  font-size: 12px;
  color: var(--text-secondary);
}

.period-text {
  text-transform: uppercase;
  font-weight: 600;
  font-size: 10px;
  color: var(--text-secondary);
}


/* Weather Icons */
#weatherIcon {
  transition: color 0.3s ease;
}

/* Status Card Hover Effects */
.status-card:hover .card-icon {
  transform: scale(1.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-card:hover .card-value {
  color: var(--color-accent);
  text-shadow: 0 0 5px var(--color-accent-glow);
}

/* Special hover effects for specific cards */
.status-system:hover .pulse-dot {
  animation-duration: 1s;
}

.status-time:hover .period-icon {
  animation: rotate 2s linear infinite;
}

.status-weather:hover #weatherIcon {
  animation: weatherFloat 2s ease-in-out infinite;
}

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

@keyframes weatherFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
/* 5. Left Panel & User Status Panel */
.location-panel::-webkit-scrollbar {
  width: 5px;
}
.location-panel::-webkit-scrollbar-thumb {
  background: var(--border-color-light);
  border-radius: 2px;
}
.location-panel::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}


/* === Header ============ */
.location-header {
  padding: 14px 18px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-accent);
  position: sticky;
  top: 0;
  z-index: 10;
  font-family: "Oxanium", sans-serif;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* === Grid Layout ======= */
.location-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
}

/* === Cards ============ */
.location-card {
  background: var(--bg-content);
  border-radius: var(--border-radius-sm);
  padding: 10px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.location-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  border-color: var(--border-accent);
}

/* === Card Top Area ====== */
.location-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* === Icon Box ========= */
.location-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  background: var(--bg-panel);
  color: var(--text-accent);
  border: 1px solid var(--border-color-light);
}

/* === Info Texts ======= */
.location-header-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.location-name {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.location-atmosphere {
  font-size: 9px;
  color: var(--text-secondary);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Occupants ========= */
.location-occupants-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 0;
  min-height: 28px;
  max-height: 60px;
  overflow-y: auto;
  align-content: flex-start;
}
.location-occupants-list::-webkit-scrollbar-thumb {
  background: var(--border-color-light);
  border-radius: 2px;
}
.location-occupants-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}


/* === Footer ============ */
.location-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
  font-size: 10px;
}

/* === Energy Indicator === */
.energy-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
}
.energy-positive {
  color: var(--color-success);
  background-color: rgba(76, 175, 80, 0.15);
}
.energy-negative {
  color: var(--color-danger);
  background-color: rgba(244, 67, 54, 0.15);
}
.energy-neutral {
  color: var(--text-muted);
  background-color: rgba(96, 125, 139, 0.15);
}

/* === Occupant Count ===== */
.location-occupants-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-accent);
}
.location-occupants-count.empty {
  color: var(--text-muted);
}
.location-occupants-count i {
  font-size: 12px;
}

/* === CLOSED PANEL ======= */
.location-card.is-closed {
  opacity: 0.5;
  background: repeating-linear-gradient(
    45deg,
    var(--bg-content),
    var(--bg-content) 10px,
    var(--bg-panel) 10px,
    var(--bg-panel) 11px
  );
}
.closed-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(244, 67, 54, 0.8);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  pointer-events: none;
}

/* === Weather Pulse ====== */
.weather-indicator {
  margin-left: auto;
  font-size: 14px;
  color: var(--color-info);
  animation: weatherPulse 2s ease-in-out infinite;
}

@keyframes weatherPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}


/* === Separator ========= */
.location-separator {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  text-align: center;
  margin: 12px 0 4px 0;
}
.location-separator span {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 10px;
}
.location-separator::before,
.location-separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

/* === Special Residence Variant === */
.location-card.is-residence {
  background: linear-gradient(135deg, var(--bg-content), #2a2a45);
  border: 1px solid var(--color-special);
}
.location-card.is-residence:hover {
  border-color: #ff4081;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}
.location-card.is-residence .location-icon {
  background: rgba(233, 30, 99, 0.2);
  color: var(--color-special);
}
.location-card.is-residence .location-name {
  color: #ff80ab;
}
.location-card.is-residence .location-atmosphere {
  color: #f50057;
  opacity: 0.9;
}
.location-card.is-residence .location-card-footer {
  border-top: 1px solid rgba(233, 30, 99, 0.3);
  justify-content: center;
}
.location-card.is-residence .location-occupants-count {
  color: #ff80ab;
  background-color: rgba(233, 30, 99, 0.2);
  padding: 3px 8px;
  border-radius: 12px;
}
.location-card.is-residence .location-occupants-count.empty {
  color: var(--color-special);
  opacity: 0.7;
}

/* === User Status Panel (Center Panel Top) === */
.user-status-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(5px);
  border-bottom: 1px solid var(--bg-glass-border);
  box-shadow: var(--shadow-lg);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  z-index: 2;
  position: absolute;
  width: 100%;
  overflow: hidden;
}

/* Decorative brushed lines overlay */
.user-status-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.04),
    rgba(0, 0, 0, 0.04) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}
 

.user-panel-content {
  width: 100%;
  max-width: 1200px;
  z-index: 1;

}

/* =============== Logged Out =============== */
.login-prompt-section {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 0;
}

.login-message {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px 32px;
  box-shadow: var(--shadow-md);
}

.login-icon-container {
  width: 48px;
  height: 48px;
  background: radial-gradient(circle at 30% 30%, var(--color-accent), var(--color-accent-dark));
  color: var(--bg-body);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px var(--color-accent-glow);
}

.login-text-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.login-message h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.login-message p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.sign-in-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--color-accent);
  color: var(--bg-body);
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px var(--color-accent-glow);
}
.sign-in-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--color-accent-glow);
  background: var(--color-accent-dark);
}
.sign-in-button i {
  font-size: 12px;
}

/* ============== Logged In =============== */
.user-info-section {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  gap: 16px;
}

.user-profile-card,
.nft-card,
.user-actions-card {
  background: var(--bg-content-light);
  border-radius: 12px;
  padding: 5px 16px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  display: flex; 
  align-items: center; 
}

.user-profile-card:hover,
.nft-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  border-color: var(--border-accent);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
}

.og-badge {
  color: var(--color-special);
  font-size: 10px;
  font-weight: bold;
  margin-left: 6px;
  background: rgba(233, 30, 99, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(233, 30, 99, 0.2);
}

.user-discord-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.user-stats {
  flex: 1;
  display: flex;
  justify-content: center;
}

.user-actions-card {
  justify-content: center;
}

/* ========== Disconnect Button ========== */
.disconnect-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(244, 67, 54, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(244, 67, 54, 0.2);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.disconnect-button:hover {
  background: var(--color-danger);
  color: white;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}
/* 6.2 NFT Section & 6.3 Map & Markers */

/* === NFT Section Container === */
.nft-section {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 12px;
}

/* === Info Stack === */
.nft-info-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

/* === Status Text with Icons === */
.nft-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.nft-status i {
  font-size: 14px;
}
.nft-status i.fa-check-circle {
  color: var(--color-success);
}
.nft-status i.fa-info-circle {
  color: var(--color-warning);
}

/* === Import Button === */
.nft-import-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-accent);
  color: var(--bg-body);
  border: none;
  padding: 9px 20px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 3px 10px var(--color-accent-glow);
  transition: all 0.2s ease;
}
.nft-import-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px var(--color-accent-glow);
  background: var(--color-accent-dark);
}
.nft-import-button i {
  font-size: 13px;
}

/* === NFT Display Row === */
.nft-display {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-left: 20px;
  margin-left: 20px;
  border-left: 2px solid var(--border-color);
  flex: 1;
  position: relative;
}

/* === NFT Item === */
.nft-thumbnail {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-panel);
  border: 2px solid var(--border-color-light);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}
.nft-thumbnail:hover {
  border-color: var(--color-accent);
  transform: scale(1.08);
  z-index: 10;
  box-shadow: var(--shadow-glow);
}

/* === NFT Image === */
.nft-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === Placeholder (when empty) === */
.nft-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-panel);
}

/* === NFT ID Badge === */
.nft-id {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(17, 22, 29, 0.8);
  backdrop-filter: blur(3px);
  color: var(--color-accent);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--border-radius-sm) 0 0 0;
  font-weight: 600;
  font-family: var(--font-mono);
}


/* 6.3 Map & Markers */
#map {
  width: 100%;
  flex: 1;
  z-index: 1;
  position: relative;
  background-color: #0d1117; /* Dark base for map tiles */
}
.leaflet-tile-pane {
  filter: grayscale(80%) contrast(1.2) brightness(0.8);
}


.marker-container { position: relative; }

.citizen-marker,
.default-marker {
  width: 60px;
  height: 60px;
  border-radius: var(--border-radius-sm);
  border: 2px solid var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent-glow), 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.citizen-marker:hover,
.default-marker:hover {
  transform: scale(1.08);
  box-shadow: 0 0 12px var(--color-accent-glow), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.citizen-marker {
  object-fit: cover;
  background-color: var(--bg-panel);
}

.default-marker {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-body);
  font-weight: 700;
  font-size: 14px;
}

.marker-badge-status {
  font-size: 9px !important;
  font-weight: 700 !important;
  padding: 1px 5px !important;
  height: 18px;
  min-width: 18px;
  line-height: 16px;
  border-radius: 10px;
  background: rgba(255, 193, 7, 0.15);
  color: var(--color-warning);
  border: 1px solid rgba(255, 193, 7, 0.4);
}

.marker-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--color-danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 12px;
  border: 2px solid var(--bg-content);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  min-width: 20px;
  text-align: center;
    z-index: 1000 !important;
}

 
 
 
 

.leaflet-popup-content-wrapper {
  background: var(--bg-glass) !important;
  color: var(--text-primary) !important;
  border-radius: var(--border-radius-sm) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--bg-glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.leaflet-popup-content {
  font-size: 11px !important;
  line-height: 1.5 !important;
  margin: 12px !important;
  min-width: 160px;
}
.leaflet-popup-tip {
  background: var(--bg-glass) !important;
  box-shadow: none !important;
}
.leaflet-popup-close-button {
  color: var(--text-secondary) !important;
  padding: 6px 6px 0 0 !important;
  font-size: 16px !important;
}
.leaflet-popup-close-button:hover {
  color: var(--text-primary) !important;
  background: none !important;
}

.map-popup {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.popup-location-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-accent);
  border-bottom: 1px solid var(--border-accent);
  padding-bottom: 4px;
  margin-bottom: 4px;
}
.popup-location-atmosphere, .popup-location-energy {
  font-size: 10px;
  color: var(--text-secondary);
}
.popup-location-energy {
  font-weight: 500;
}
.popup-npcs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.popup-npc-container {
  border-left: 2px solid var(--color-accent);
  padding-left: 8px;
}
.popup-npc-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
}
.popup-npc-activity {
  font-size: 11px;
  color: var(--text-secondary);
}
.popup-npc-mood {
  font-size: 10px;
  font-style: italic;
  color: var(--text-accent);
}

/* Map controls to not be hidden under user panel */
.leaflet-control-zoom {
  position: fixed;
  margin-left: -50px;
  top: 30%;
  border-color: var(--border-color) !important;
}
.leaflet-control-zoom-in, .leaflet-control-zoom-out {
    background-color: var(--bg-content) !important;
    color: var(--text-accent) !important;
    border-bottom: 1px solid var(--border-color) !important;
}
.leaflet-control-zoom-in:hover, .leaflet-control-zoom-out:hover {
    background-color: var(--bg-content-light) !important;
}
/* 7. Right Panel: Info, NPCs, Logs */

/* Conversation Bubble on Map */
.conversation-bubble-container {
  z-index: 1000000 !important;
}

.conversation-bubble {
  background: radial-gradient(circle, var(--color-accent) 20%, var(--color-accent-dark) 100%);
  border-radius: 50%;
  padding: 8px;
  box-shadow: 0 0 12px var(--color-accent-glow);
  cursor: pointer;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
}

.conversation-bubble:hover {
  transform: scale(1.12);
}

.conversation-bubble i {
  font-size: 16px;
  color: var(--bg-body);
}


.city-tabs {
  display: flex;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  height: 36px;
}
.city-tab {
  flex: 1;
  padding: 8px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  transition: color 0.2s ease, background 0.2s ease;
  position: relative;
}
.city-tab:hover {
  color: var(--text-accent);
}
.city-tab.active {
  color: var(--text-accent);
  background: var(--bg-content);
}
.city-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  box-shadow: var(--shadow-glow);
}

/* Filter Controls */
.filter-controls {
  padding: 8px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
}
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}
.filter-checkbox:hover { color: var(--text-accent); }
.filter-checkbox input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--color-accent);
}

/* NPC Section */
.npc-section {
  flex: 1 1 auto; /* This makes it flexible */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  background: var(--bg-body);
  border-bottom: 1px solid var(--border-color);
  min-height: 0; /* A key flexbox fix for overflow */
}

/* NPC Grid */
.npc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
}

/* NPC Card */
.npc-card {
  background: var(--bg-content);
  border-radius: var(--border-radius-sm);
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.25,0.8,0.25,1);
  position: relative;
  display: flex;
  flex-direction: column;
}
.npc-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}
.npc-card::before,
.npc-card::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0.4;
  transition: opacity 0.3s ease, transform 0.3s ease;
  filter: drop-shadow(0 0 2px var(--color-accent-glow));
}
.npc-card::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid var(--color-accent);
  border-left: 1px solid var(--color-accent);
}
.npc-card::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 1px solid var(--color-accent);
  border-right: 1px solid var(--color-accent);
}
.npc-card:hover::before,
.npc-card:hover::after {
  opacity: 1;
  transform: scale(1.2);
}

/* Interacting State */
.npc-card.interacting {
  outline: 2px solid var(--color-special);
  box-shadow: 0 0 15px rgba(233, 30, 99, 0.5);
}

/* NPC Content */
.npc-content-wrapper {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* NPC Header */
.npc-header {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

/* Avatar */
.npc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border-color-light);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4), 0 1px 3px rgba(0,0,0,0.2);
}
.npc-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
}

/* NPC Info */
.npc-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.npc-name { font-weight: 600; font-size: 14px; color: var(--text-heading); }
.npc-role {
  font-size: 9px;
  color: var(--text-accent);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* State Badges */
.npc-state-indicators {
  display: flex;
  gap: 6px;
  margin-top: 3px;
}
.state-badge {
  font-family: var(--font-mono);
  font-size: 8px;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #fff;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.state-badge:hover { opacity: 1; }

.state-my-agent {
  background: linear-gradient(135deg, var(--color-warning), #d89a00);
}
.npc-card.my-agent {
  border-color: var(--color-warning);
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
}
.npc-card.my-agent:hover {
  border-color: #f57f17;
  box-shadow: 0 0 25px rgba(255, 193, 7, 0.6);
}

.state-sleeping { background: var(--text-muted); }
.state-working { background: var(--color-info); }
.state-resting { background: var(--color-success); }
.state-agent {
  background: linear-gradient(135deg, var(--color-special), #c2185b);
}
.state-interacting { background: var(--color-danger); }

/* NPC Data Grid */
.npc-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "vitals details"
    "dossier dossier"
    "actions actions";
  gap: 8px;
}
.npc-vitals {
  grid-area: vitals;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.npc-details {
  grid-area: details;
  font-size: 9px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 82%;
}
.npc-dossier { grid-area: dossier; }
.agent-actions { grid-area: actions; }

/* Status Stat Bars */
.status-stat {
  display: flex;
  flex-direction: column;
}
.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
  color: var(--text-secondary);
}
.stat-header span { font-weight: 600; font-size: 10px; }
.stat-bar {
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.3);
  border-radius: 1px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.stat-fill {
  height: 100%;
  transition: width 0.5s ease-out;
  background-size: 8px 8px;
  background-image: linear-gradient(-45deg, rgba(255,255,255,0.05) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.05) 75%, transparent 75%, transparent);
}
.energy-fill { background-color: var(--color-accent); }
.stress-fill { background-color: var(--color-danger); }

/* Detail Row */
.detail-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.detail-icon {
  color: var(--text-muted);
  min-width: 12px;
  text-align: center;
  font-size: 12px;
}
.detail-value { flex: 1; }

/* Dossier Toggle */
.dossier-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid var(--border-accent);
  border-radius: 50%;
  color: var(--color-accent);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  transition: all 0.2s ease;
  z-index: 5;
}
.dossier-toggle:hover { 
}

/* Expandable Dossier */
.npc-dossier { 
  font-size: 11px;
  line-height: 1.1;
  color: var(--text-secondary);
  border-top: 2px double #00BCD4;
  max-height: 0;
  overflow: hidden;
  margin:0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  opacity: 0;
  transition: max-height 0.4s ease-out, padding 0.4s ease-out, opacity 0.4s ease-out, margin-top 0.4s ease-out;
}
.npc-dossier.dossier-visible {
  max-height: 500px;
  opacity: 1;
  padding: 8px 10px;
  margin-top: 8px;
  width: 100%;
}

/* Dossier Sections */
.dossier-section {
  position: relative;
  padding: 6px 0;
}
.dossier-section + .dossier-section {
  border-top: 1px dashed var(--border-color);
  margin-top: 6px;
}
.dossier-section-title {
  font-weight: 700;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-accent);
  margin-bottom: 4px;
  opacity: 0.85;
  border-left: 2px solid var(--color-accent);
  padding-left: 4px;
  transition: color 0.2s;
}
.dossier-section-title:hover { color: var(--color-accent-dark); }

/* Backstory & Personality */
.npc-dossier .npc-backstory {
  padding: 10px;
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.2;
  background: var(--bg-panel);
  border-radius: 3px;
}
.npc-dossier .npc-personality {
   padding: 10px;
  font-size: 10px;
  color: var(--text-primary);
  line-height: 1.2;
  font-style: italic;
  font-weight: 500;
}

/* Mini Citizen */
.mini-citizen {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  border: 1px solid var(--border-color-light);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.mini-citizen:hover {
  transform: scale(1.15);
  z-index: 10;
  box-shadow: 0 2px 6px var(--color-accent-glow);
  border-color: var(--color-accent);
}
.mini-citizen img {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
}

/* Online Indicator */
.online-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--bg-content);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  z-index: 10;
}
.npc-avatar .online-indicator {
  top: -3px; right: -3px; width: 8px; height: 8px;
}
.indicator-online {
  background: var(--color-success);
  box-shadow: 0 0 4px var(--color-success);
}
.indicator-offline {
  background: var(--text-muted);
}

/* Agent Indicator */
.agent-citizen::after {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  content: '\f2db'; /* fa-microchip */
  font-size: 9px;
  position: absolute;
  top: -5px;
  right: -5px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-info));
  color: white;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-content);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Agent Log Indicator */
.agent-log-indicator {
  color: var(--color-accent);
  font-size: 0.9em;
  opacity: 0.8;
  position: relative;
  top: -1px;
}

/* Agent Indicator in Marker */
.marker-container .agent-indicator {
  position: absolute;
  top: -6px;
  left: -6px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-info));
  color: white;
  font-size: 9px;
  padding: 2px 4px;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid var(--bg-content);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Agent Actions */
.agent-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}
.agent-btn {
  flex: 1;
  padding: 3px 2px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: var(--bg-body);
  border: none;
  border-radius: 4px;
  font-size: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-transform: uppercase;
}
.agent-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--color-accent-glow);
}

/* Log Section */
.log-section {
  flex-shrink: 0; /* Prevent the log section from shrinking */
  height: 210px; /* You can keep a desired height */
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
}

/* Log Tabs */
.log-tabs {
  display: flex;
  padding: 0 8px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.log-tab {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.log-tab:hover {
  color: var(--text-accent);
  background: var(--bg-content-light);
}
.log-tab.active {
  color: var(--text-accent);
  font-weight: 600;
  border-bottom-color: var(--color-accent);
  background: var(--bg-content);
}

/* Log Content */
.log-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  font-size: 10px;
  line-height: 1.2;
  background: var(--bg-content);
  font-family: var(--font-mono);
}
.log-entry {
  margin-bottom: 2px;
  padding: 4px 5px;
  animation: fadeIn 0.5s ease forwards;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  border-radius: 4px;
  border-left: 3px solid transparent;
  background: transparent;
  transition: background-color 0.3s ease;
  border-bottom: 1px dotted #4a4a4a;
}
.log-entry:hover {
  background-color: var(--bg-content-light);
}
.log-time {
  color: var(--text-muted);
  font-size: 10px;
  font-family: monospace;
  min-width: 40px;
  padding-top: 1px;
}
.log-main-content { flex: 1; }

/* Thought, Movement, Event Entries */
.log-entry.log-thought {
  border-left-color: var(--color-accent);
}
.log-entry.log-thought::before {
  content: '\f5dc'; /* brain */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: var(--color-accent);
  font-size: 11px;
}
.log-entry.log-movement {
  border-left-color: var(--color-warning);
}
.log-entry.log-movement::before {
  content: '\f554'; /* walking */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: var(--color-warning);
  font-size: 11px;
}
.log-entry.log-event {
  border-left-color: var(--color-danger);
}
.log-entry.log-event::before {
  content: '\f562'; /* globe-americas */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: var(--color-danger);
  font-size: 11px;
}

/* Live Entry */
.live-entry {
  background: rgba(76, 175, 80, 0.1);
  animation: slideInLeft 0.4s ease-out, fadeIn 0.5s ease-out;
}
.live-entry:hover {
  background: rgba(76, 175, 80, 0.2);
}

/* Agent Card Highlight */
.npc-card:has(.state-agent) {
  background: var(--bg-content-light);
}
.npc-card:has(.state-agent):hover {
  border-color: var(--color-special);
  box-shadow: 0 0 20px rgba(233, 30, 99, 0.4);
}
.npc-card:has(.state-agent)::before,
.npc-card:has(.state-agent)::after {
  border-color: var(--color-special);
  opacity: 0.6;
}
.npc-card:has(.state-agent):hover::before,
.npc-card:has(.state-agent):hover::after {
  opacity: 1;
}

/* Clickable Actor */
.log-actor.clickable {
  cursor: pointer;
  color: var(--text-accent);
  text-decoration: underline;
}
.log-actor.clickable:hover {
    color: var(--color-accent-dark);
}


/* Additional Controls */
.npc-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.locate-btn {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--color-info);
}
.locate-btn:hover {
    background-color: var(--color-info);
    color: white;
}


.twitter-link, .discord-link {
  font-size: 16px;
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 5px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.twitter-link { color: var(--color-twitter); }
.twitter-link:hover {
  color: #ffffff;
  background-color: var(--color-twitter);
  transform: scale(1.1);
}
.twitter-link.disconnected, .discord-link.disconnected {
  color: var(--text-muted);
  opacity: 0.6;
  cursor: help;
}
.twitter-link.disconnected:hover {
  color: var(--color-twitter);
  opacity: 1;
  background-color: transparent;
  transform: scale(1.1);
}

.submission-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
  background-color: var(--bg-panel);
}

.twitter-link.inactive,
.discord-link.inactive {
  color: var(--color-danger);
  opacity: 0.7;
  cursor: default;
}

.discord-link {
  color: var(--color-discord);
}
.discord-link.active:hover {
  color: #ffffff;
  background-color: var(--color-discord);
  transform: scale(1.1);
}
.discord-link.disconnected:hover {
  color: var(--color-discord);
  opacity: 1;
  background-color: transparent;
  transform: scale(1.1);
}
/* 8. Agent Details Panel (Bottom) */
.agent-detail-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-panel);
  border-top: 2px solid var(--border-accent);
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 500;
  max-height: 40vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.agent-detail-panel.collapsed {
  transform: translateY(calc(100% - 40px));
}
.agent-detail-panel.expanded {
  transform: translateY(0);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg-content-light);
  color: var(--text-heading);
  cursor: pointer;
  flex-shrink: 0;
  height: 40px;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}
.panel-header h3 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-accent);
}
.panel-toggle {
  background: none;
  border: none;
  color: var(--text-heading);
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.agent-detail-panel.expanded .panel-toggle {
  transform: rotate(180deg);
}

.panel-tabs {
  display: flex;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.panel-tab {
  flex: 1;
  padding: 8px 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}
.panel-tab:hover {
    color: var(--text-accent);
}
.panel-tab.active {
  color: var(--text-accent);
  border-bottom-color: var(--color-accent);
  background: var(--bg-content);
}

.panel-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-content);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.panel-content .loading,
.panel-content .error {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* Memories Timeline */
.memories-timeline {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid var(--border-color);
}
.memory-item {
  position: relative;
  margin-bottom: 12px;
  padding: 10px;
  background: var(--bg-panel);
  border-radius: 6px;
  border-left: 3px solid var(--color-accent);
}
.memory-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 12px;
  width: 10px;
  height: 10px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 2px solid var(--bg-content);
}

.memory-time {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}
.memory-content {
  font-size: 12px;
  color: var(--text-primary);
}
.memory-content i {
  margin-right: 5px;
  color: var(--color-accent);
}

/* Emotion Indicator */
.emotion-indicator {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: opacity 0.3s;
}

/* Diary Entries */
.diary-entry {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-panel);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}
.diary-date {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-accent);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}
.diary-mood {
  font-size: 10px;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 8px;
}
.diary-narrative {
  line-height: 1.5;
  font-size: 12px;
  color: var(--text-primary);
}

/* Relationships Grid */
.relationships-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.relationship-card {
  padding: 12px;
  background: var(--bg-panel);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}
.relationship-card h4 {
  margin: 0 0 8px 0;
  color: var(--text-heading);
  font-size: 13px;
}

/* Meters */
.meter {
  display: flex;
  align-items: center;
  margin: 4px 0;
  font-size: 9px;
  font-family: var(--font-mono);
}
.meter-label {
  width: 55px;
  color: var(--text-secondary);
}
.meter-bar {
  flex: 1;
  height: 5px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  margin: 0 6px;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  transition: width 0.5s ease;
  background: linear-gradient(135deg, var(--color-accent-dark), var(--color-accent));
  border-radius: 3px;
}
.meter-value {
  width: 30px;
  text-align: right;
  font-weight: 600;
  color: var(--text-primary);
}

/* 9. Modals (Interaction, Loading, NFT Import) */
#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17, 22, 29, 0.9);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 2px;
}
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  margin: 20px auto;
  animation: spin 1.5s linear infinite;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.nft-import-modal {
  background: var(--bg-content);
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}
.modal-overlay.visible .nft-import-modal {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.modal-close-btn:hover {
  color: var(--bg-body);
  background: var(--color-accent);
  transform: rotate(90deg);
}

.modal-title {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-heading);
  font-family: var(--font-heading);
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.import-status {
  margin-bottom: 16px;
  font-size: 13px;
  text-align: center;
  padding: 8px;
  background: var(--bg-panel);
  border-left: 3px solid var(--color-accent);
  border-radius: 6px;
  color: var(--text-primary);
}

.connect-wallet-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-accent);
  color: var(--bg-body);
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-transform: uppercase;
}
.connect-wallet-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--color-accent-glow);
  background: var(--color-accent-dark);
}

.import-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 16px;
}
.import-progress .loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--color-accent);
}

.interaction-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 95000000; /* Increased from 1500 to be on top */ 
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.interaction-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.interaction-modal {
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  overflow: hidden;
}
.interaction-modal.visible {
  transform: scale(1);
}

.interaction-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.interaction-close-btn:hover {
  color: var(--color-accent);
  transform: rotate(90deg);
}

.interaction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.interaction-header .npc-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-color);
}
.interaction-header .npc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vs-icon {
  font-size: 24px;
  color: var(--text-accent);
  opacity: 0.8;
}

.interaction-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
  text-align: center;
  margin-bottom: 16px;
}

.interaction-content {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  padding: 12px;
  background: var(--bg-panel);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.dialogue-line {
  padding: 10px 14px;
  border-radius: 20px;
  max-width: 80%;
  position: relative;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.2);
}
.dialogue-line.left {
  background: var(--bg-content-light);
  align-self: flex-start;
  color: var(--text-primary);
}
.dialogue-line.right {
  background: linear-gradient(145deg, var(--color-accent), var(--color-accent-dark));
  align-self: flex-end;
  color: var(--bg-body);
}
.dialogue-line .speaker {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: 0.8;
}
.dialogue-line.left .speaker {
  color: var(--text-secondary);
}
.dialogue-line.right .speaker {
  color: rgba(17, 22, 29, 0.9);
}
.dialogue-line p {
  margin: 0;
}

.interaction-summary {
  background: rgba(76, 175, 80, 0.1);
  border-left: 4px solid var(--color-success);
  padding: 12px;
  margin-top: 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
}
.interaction-summary strong {
  display: block;
  margin-bottom: 6px;
  color: var(--color-success);
  font-weight: 600;
}

.interaction-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  background: var(--bg-panel);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-secondary);
  gap: 8px;
}
.interaction-footer i {
  color: var(--text-accent);
  font-size: 14px;
}

.loading {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 20px 0;
}

/* locate */
.locate-btn {
  width: 22px;
  padding: 2px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  background: var(--bg-content);
  color: var(--text-accent);
  margin: 6px 0 0 0;
  cursor: pointer;
  transition: all 0.2s ease;
}
.locate-btn:hover {
  background: var(--bg-content-light);
  border-color: var(--color-accent);
}

/* 10. Animations */
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}

@keyframes pulse-dot-anim {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.5; transform: scale(1.2); }
}

@keyframes pulse {
0% { transform: scale(1); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
50% { transform: scale(1.02); box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3); }
100% { transform: scale(1); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
}

@keyframes glow {
from { 
filter: brightness(1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
to { 
filter: brightness(1.1);
box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2);
}
}

.economy-active {
animation: glow 2s ease-in-out infinite alternate;
}

@keyframes weatherPulse {
0%, 100% { transform: scale(1); opacity: 0.8; }
50% { transform: scale(1.1); opacity: 1; }
}

@keyframes thoughtBubbleIn {
from { opacity: 0; transform: translateX(-5px) scale(0.95); }
to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes thoughtFadeOut {
from { opacity: 1; transform: translateX(0) scale(1); }
to { opacity: 0; transform: translateX(5px) scale(0.95); }
}

@keyframes slideInLeft {
from { transform: translateX(-8px); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}

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


@media (max-width: 1540px) {
 .user-info-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 16px;
}
}
 

@media (max-width: 1000px) {
  body {
    overflow-y: auto;
    height: auto;
  }
  .dashboard-container {
    flex-direction: column;
    height: auto;
  }
  .location-panel {
    width: 100%;
    height: auto; 
    overflow-y: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    display: block;
  }
  .map-section {
    flex: none;
    height: auto;
    min-height: 90vh;
  }
  .info-panel {
    flex: none;
    min-width: 100%;
    height: auto;
  }
  .user-status-panel {
    position: relative;
    min-height: auto;
    padding: 12px;
  }
  .user-info-section {
    gap: 12px;
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }

  .nft-section {
    flex-direction: column;
    align-items: flex-start;
  }
  .nft-display {
    border-left: none;
    margin-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--bg-glass-border);
    padding-top: 12px;
    width: 100%;
  }
  .dashboard-header {
    padding: 12px;
    min-height: auto;
    height: auto;
    flex-direction: column;
    gap: 16px;
  }
  .header-brand {
    gap: 12px;
    padding: 6px 12px 6px 6px;
    align-self: flex-start; 
  }
  .brand-icon img {
    width: 40px;
    height: 40px;
  }
  .brand-title {
    font-size: 20px;
  }
  .brand-subtitle {
    font-size: 10px;
  }
  .status-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
  }
  .status-card {
    padding: 10px 12px;
    gap: 8px;
  }
  .card-icon {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
  .card-value {
    font-size: 12px;
  }
  .card-detail {
    font-size: 10px;
  }
  .location-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
  }
  .location-card {
    padding: 6px;
    gap: 4px;
  }
  .location-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  .location-name {
    font-size: 11px;
  }
  .location-atmosphere {
    font-size: 8px;
  }
  .location-occupants-list {
    max-height: 50px;
  }
  .energy-indicator {
    font-size: 9px;
  }
  .location-occupants-count {
    font-size: 10px;
  }
  .location-separator {
    margin: 8px 0 2px 0;
  }
  .location-separator span {
    font-size: 8px;
  }
  #map {
    height: 50vh;
  }
  .login-message {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    text-align: center;
  }
  .login-text-container {
    align-items: center;
  }
  .sign-in-button {
    margin-left: 0;
    margin-top: 8px;
  }
  .user-profile {
    gap: 12px;
  }
  .user-avatar {
    width: 40px;
    height: 40px;
  }
  .user-name {
    font-size: 14px;
  }
  .user-discord-id {
    font-size: 11px;
  }
  .disconnect-button {
    padding: 8px 16px;
    font-size: 11px;
  }
  .nft-thumbnail {
    width: 40px;
    height: 40px;
  }
  .nft-id {
    font-size: 9px;
  }
  .citizen-marker,
  .default-marker {
    width: 36px;
    height: 36px;
    border-width: 2px;
    border-radius: 12px;
  }
  .marker-badge {
    top: -6px;
    right: -6px;
    font-size: 10px;
    padding: 2px 6px;
    min-width: 18px;
    border-width: 1px;
  }
  .map-thought-bubble {
    width: 120px;
    padding: 4px 6px;
    gap: 4px;
  }
  .thought-timer {
    width: 20px;
    height: 20px;
  }
  .circular-timer {
    width: 16px;
    height: 16px;
  }
  .thought-text {
    font-size: 9px;
    line-height: 1.2;
  }
  .leaflet-popup-content {
    font-size: 10px !important;
    margin: 10px !important;
    min-width: 140px;
  }
  .popup-location-name {
    font-size: 12px;
  }
  .popup-location-atmosphere, .popup-location-energy {
    font-size: 9px;
  }
  .popup-npc-name {
    font-size: 11px;
  }
  .popup-npc-activity {
    font-size: 10px;
  }
  .popup-npc-mood {
    font-size: 9px;
  }
  .conversation-bubble {
    width: 28px;
    height: 28px;
    padding: 6px;
  }
  .conversation-bubble i {
    font-size: 14px;
  }
  .leaflet-control-zoom {
    margin-left: 0;
    top: auto;
    bottom: 20px;
    right: 10px;
    position: absolute;
  }
  .city-tabs {
    height: auto;
    flex-wrap: wrap;
  }
  .city-tab {
    padding: 6px 12px;
    font-size: 10px;
  }
  .filter-controls {
    gap: 12px;
    padding: 6px 12px;
  }
  .filter-checkbox {
    font-size: 10px;
    gap: 4px;
  }
  .npc-section {
    padding: 8px;
  }
  .npc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
  }
  .npc-card {
    padding: 0;
  }
  .npc-content-wrapper {
    padding: 8px;
    gap: 6px;
  }
  .npc-header {
    gap: 4px;
    padding-bottom: 4px;
  }
  .npc-avatar {
    width: 36px;
    height: 36px;
  }
  .npc-name {
    font-size: 13px;
  }
  .npc-role {
    font-size: 8px;
  }
  .state-badge {
    font-size: 7px;
    padding: 1px 4px;
  }
  .npc-data-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "vitals" "details" "dossier" "actions";
    gap: 6px;
  }
  .npc-details {
    max-width: 100%;
  }
  .stat-header {
    font-size: 8px;
  }
  .stat-bar {
    height: 5px;
  }
  .detail-row {
    font-size: 8px;
    gap: 4px;
  }
  .detail-icon {
    min-width: 10px;
    font-size: 10px;
  }
  .dossier-toggle {
    width: 20px;
    height: 20px;
    font-size: 14px;
  }
  .npc-dossier.dossier-visible {
    max-height: 300px;
    width: 100%;
    margin: 6px 0 0 0;
    padding: 0;
  }
  .dossier-section {
    padding: 4px 0;
  }
  .dossier-section-title {
    font-size: 8px;
    margin-bottom: 2px;
    padding-left: 3px;
  }
  .npc-dossier .npc-backstory {
    font-size: 9px;
    padding: 3px;
  }
  .npc-dossier .npc-personality {
    font-size: 9px;
  }
  .mini-citizen {
    width: 18px;
    height: 18px;
    font-size: 8px;
  }
  .mini-citizen:hover {
    transform: scale(1.1);
  }
  .online-indicator {
    width: 5px;
    height: 5px;
  }
  .agent-citizen::after {
    font-size: 8px;
    width: 14px;
    height: 14px;
    top: -4px;
    right: -4px;
    border-width: 1px;
  }
  .agent-actions {
    gap: 3px;
    margin-top: 6px;
    padding-top: 6px;
  }
  .agent-btn {
    padding: 2px 6px;
    font-size: 8px;
    gap: 3px;
  }
  .log-section {
    height: auto;
    min-height: 200px;
    max-height: 300px;
  }
  .log-tabs {
    padding: 0 6px;
  }
  .log-tab {
    font-size: 10px;
    padding: 8px 12px;
    gap: 6px;
  }
  .log-content {
    padding: 8px;
    font-size: 11px;
    line-height: 1.5;
  }
  .log-entry {
    margin-bottom: 1px;
    padding: 4px 6px;
    gap: 8px;
  }
  .log-time {
    font-size: 10px;
    min-width: 40px;
  }
  .log-entry::before {
    font-size: 10px;
  }
  .agent-detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    max-height: 100vh;
    z-index: 2000;
    transform: translateY(100%);
  }
  .agent-detail-panel.collapsed {
    display: none;
  }
  .agent-detail-panel.expanded {
    transform: translateY(0);
  }
  .panel-header {
    padding: 6px 12px;
    height: 36px;
  }
  .panel-header h3 {
    font-size: 13px;
  }
  .panel-toggle {
    font-size: 14px;
  }
  .panel-tabs {
    height: auto;
  }
  .panel-tab {
    padding: 6px 8px;
    font-size: 10px;
  }
  .panel-content {
    padding: 8px;
  }
  .memory-item {
    margin-bottom: 8px;
    padding: 8px;
  }
  .memory-time {
    font-size: 9px;
    margin-bottom: 4px;
  }
  .memory-content {
    font-size: 11px;
  }
  .diary-entry {
    margin-bottom: 12px;
    padding: 8px;
  }
  .diary-date {
    font-size: 11px;
    margin-bottom: 4px;
  }
  .diary-mood {
    font-size: 9px;
    margin-bottom: 6px;
  }
  .diary-narrative {
    font-size: 11px;
  }
  .relationships-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .relationship-card {
    padding: 8px;
  }
  .relationship-card h4 {
    font-size: 12px;
    margin-bottom: 6px;
  }
  .meter {
    font-size: 8px;
  }
  .meter-label {
    width: 50px;
  }
  .meter-bar {
    height: 4px;
    margin: 0 4px;
  }
  .meter-value {
    width: 25px;
  }
  #loading {
    font-size: 16px;
  }
  .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
  }
  .nft-import-modal {
    padding: 16px;
    max-width: 90%;
  }
  .modal-title {
    font-size: 16px;
  }
  .modal-content p {
    font-size: 13px;
    margin-bottom: 16px;
  }
  .import-status {
    font-size: 12px;
    padding: 6px;
  }
  .connect-wallet-button {
    padding: 8px 20px;
    font-size: 13px;
  }
  .import-progress {
    font-size: 13px;
    gap: 10px;
    margin-top: 12px;
  }
  .import-progress .loading-spinner {
    width: 20px;
    height: 20px;
    border-width: 2px;
  }
  .interaction-modal {
    padding: 16px;
    max-height: 90vh;
  }
  .interaction-close-btn {
    top: 8px;
    right: 8px;
    font-size: 20px;
  }
  .interaction-header {
    gap: 12px;
    margin-bottom: 12px;
  }
  .interaction-header .npc-avatar {
    width: 40px;
    height: 40px;
  }
  .vs-icon {
    font-size: 20px;
  }
  .interaction-title {
    font-size: 14px;
    margin-bottom: 12px;
  }
  .interaction-content {
    gap: 8px;
    max-height: 200px;
    padding: 8px;
  }
  .dialogue-line {
    padding: 8px 12px;
    font-size: 12px;
    max-width: 90%;
  }
  .dialogue-line .speaker {
    font-size: 10px;
    margin-bottom: 2px;
  }
  .interaction-summary {
    padding: 8px;
    margin-top: 8px;
    font-size: 12px;
  }
  .interaction-summary strong {
    margin-bottom: 4px;
  }
  .interaction-footer {
    padding: 8px;
    font-size: 11px;
    gap: 6px;
  }
  .interaction-footer i {
    font-size: 12px;
  }
  .locate-btn {
    margin: 4px 0 0 0;
    width: 20px;
  }
  .dashboard-footer {
    padding: 6px 16px;
    font-size: 9px;
    height: 30px;
  }
  .npc-marker-icon {
    width: 36px;
    height: 36px;
  }
}

/* In style.css */
/* Add this to your style.css */
.npc-marker-icon {
transition: none; /* Default: no transition */
}

.npc-marker-icon.animating {
transition: transform 3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.npc-marker-icon.animating .marker-container {
transform: scale(1.1);
animation: movePulse 1s infinite alternate;
box-shadow: 0 0 20px rgba(99, 102, 241, 0.7);
}

@keyframes movePulse {
from { box-shadow: 0 0 15px rgba(99, 102, 241, 0.4); }
to { box-shadow: 0 0 25px rgba(139, 92, 246, 0.8); }
}

/* 12. Event Alert Panel */
#eventAlertPanel {
  position: absolute;
  top: 120px; /* Position below the user panel */
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  max-width: 800px;
  z-index: 999; /* Below map controls but above map tiles */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none; /* Allows clicking through the panel onto the map */
}

.alert-entry {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-accent);
  border-radius: var(--border-radius-md);
  padding: 10px 16px;
  box-shadow: var(--shadow-glow);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  width: fit-content;
  max-width: 100%;
  animation: slideInDown 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, fadeOut 0.5s 7.5s forwards;
  pointer-events: all; /* Make individual alerts clickable if needed */
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-icon {
  font-size: 16px;
  color: var(--color-accent);
}

.alert-entry.event {
  border-color: var(--color-warning);
}
.alert-entry.event .alert-icon {
  color: var(--color-warning);
}

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

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


/* In style.css */
.npc-wallet {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  margin-top: 4px;
}
.npc-wallet i {
  font-size: 12px;
}
/* Add this to your style.css */
.avatar-container {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}
.avatar-container > .citizen-marker {
    position: absolute;
    top: 0;
    left: 0; 
}

        .meter-bipolar {
            display: flex;
            align-items: center;
            margin: 6px 0;
            font-size: 10px;
            font-family: var(--font-mono);
        }
        .meter-bipolar .meter-label {
            width: 60px;
            color: var(--text-secondary);
            font-weight: 500;
        }
        .meter-bipolar .meter-track {
            flex: 1;
            height: 10px;
            background-color: var(--bg-panel);
            border: 1px solid var(--border-color);
            border-radius: 5px;
            position: relative;
            overflow: hidden;
        }
        .meter-bipolar .meter-center-line {
            position: absolute;
            left: 50%;
            top: 0;
            bottom: 0;
            width: 1px;
            background-color: var(--border-color-light);
            transform: translateX(-50%);
        }
        .meter-bipolar .meter-fill-bipolar {
            position: absolute;
            top: 0;
            bottom: 0;
            height: 100%;
            transition: all 0.4s ease-out;
            border-radius: 2px;
        }
        .meter-bipolar .meter-value {
            width: 40px;
            text-align: right;
            font-weight: 600;
            color: var(--text-primary);
        }