/* Pantheon MUD - Modern UI Complete Redesign */

/* CSS Variables for Modern Theme */
:root {
  /* Modern Dark Theme Colors */
  --bg-primary: #0a0a0b;
  --bg-secondary: #13131a;
  --bg-tertiary: #1a1a24;
  --bg-elevated: #22222e;
  --bg-hover: #2a2a38;

  /* Accent Colors */
  --accent-gold: #f4c430;
  --accent-gold-dark: #d4a520;
  --accent-gold-light: #ffd700;
  --accent-red: #e74c3c;
  --accent-green: #2ecc71;
  --accent-blue: #3498db;
  --accent-purple: #9b59b6;

  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #b4b4c8;
  --text-muted: #6b6b80;
  --text-disabled: #4a4a5e;

  /* UI Elements */
  --border-color: #2a2a38;
  --border-focus: #f4c430;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(244, 196, 48, 0.3);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Animations */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
    "Helvetica Neue", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

/* Modern Layout Structure */
#pantheon-client {
  display: grid;
  grid-template-columns: 280px 1fr var(--right-panel-width, 320px);
  grid-template-rows: 60px 1fr 45px;
  grid-template-areas:
    "header header header"
    "sidebar main rightpanel"
    "sidebar footer rightpanel";
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Header Bar */
.client-header {
  grid-area: header;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.header-logo img {
  height: 36px;
  width: auto;
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.header-status {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-md);
  background: var(--bg-elevated);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s infinite;
}

.connection-dot.disconnected {
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
  animation: none;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.header-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.header-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent-gold);
}

/* Sidebar */
.client-sidebar {
  grid-area: sidebar;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.sidebar-tab {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.sidebar-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sidebar-tab.active {
  color: var(--accent-gold);
  background: var(--bg-secondary);
}

.sidebar-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gold);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
}

/* Character Stats Panel */
.character-panel {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.character-equipment {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
  margin-bottom: var(--spacing-md);
}

.character-equipment h3 {
  margin: 0 0 var(--spacing-sm) 0;
  color: var(--accent-purple);
  font-size: 14px;
  font-weight: 600;
}

.character-inventory {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
}

.character-inventory h3 {
  margin: 0 0 var(--spacing-sm) 0;
  color: var(--accent-gold);
  font-size: 14px;
  font-weight: 600;
}

.character-info {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
}

.character-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: var(--spacing-xs);
}

.character-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.stat-bars {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.stat-bar {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: var(--spacing-sm);
  border: 1px solid var(--border-color);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-xs);
  font-size: 12px;
}

.stat-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-value {
  color: var(--text-primary);
  font-weight: 600;
}

.stat-progress {
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-normal);
}

.stat-fill.health {
  background: linear-gradient(90deg, #c0392b, #e74c3c);
}

.stat-fill.stamina {
  background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.stat-fill.mana {
  background: linear-gradient(90deg, #2980b9, #3498db);
}

/* Vitals Color Coding for GMCP Updates */
.stat-fill.low {
  filter: brightness(0.7) hue-rotate(30deg);
}

.stat-fill.critical {
  background: linear-gradient(90deg, #a93226, #c0392b) !important;
  animation: pulse-critical 2s infinite;
}

@keyframes pulse-critical {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Main Content Area */
.client-main {
  grid-area: main;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 var(--spacing-md);
  gap: var(--spacing-sm);
}

.main-tab {
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: var(--spacing-sm);
}

.main-tab:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.main-tab.active {
  background: var(--bg-primary);
  color: var(--accent-gold);
  border-color: var(--border-color);
}

.message-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.message-window {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
  background: var(--bg-primary);
}

/* Individual message timestamp styling */
.message-individual-timestamp {
  display: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  margin-right: 8px;
  min-width: 90px;
  font-family: "Fira Code", monospace;
  user-select: none;
}

.message-content {
  flex: 1;
}

/* Show timestamps when enabled */
.message-window.show-timestamps .message-individual-timestamp {
  display: inline-block;
}

.message-window.show-timestamps .message {
  display: flex;
  align-items: flex-start;
}

.message-window.show-timestamps .message-content {
  flex: 1;
}

/* Modern Message Styling */
.message-group {
  margin-bottom: var(--spacing-md);
  opacity: 0;
  animation: fadeInUp 0.3s ease forwards;
}

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

.message-timestamp {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
}

.message {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-xs);
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
  white-space: pre-wrap;
  font-family: "Fira Code", "Consolas", "Monaco", monospace;
  line-height: 1.4;
  word-wrap: break-word;
}

.message:hover {
  background: var(--bg-tertiary);
  transform: translateX(2px);
}

.message.system {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-elevated));
  border-left-color: var(--accent-gold);
  color: var(--text-secondary);
}

.message.echo {
  background: var(--bg-elevated);
  border-left-color: var(--accent-blue);
  color: var(--accent-blue);
  font-style: italic;
  opacity: 0.8;
}

.message.combat {
  border-left-color: var(--accent-red);
}

.message.reward {
  border-left-color: var(--accent-green);
}

.message.chat {
  border-left-color: var(--accent-blue);
}

.message.whisper {
  background: var(--bg-elevated);
  border-left-color: var(--accent-purple);
  font-style: italic;
}

/* Scroll to Bottom Button */
.scroll-to-bottom-btn {
  position: absolute;
  bottom: 90px;
  right: 20px;
  background: var(--accent-gold);
  color: var(--bg-primary);
  border: none;
  border-radius: 25px;
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
  z-index: 1000;
  animation: slideInUp 0.3s ease;
}

.scroll-to-bottom-btn:hover {
  background: var(--accent-gold-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.scroll-to-bottom-btn span:first-child {
  font-size: 18px;
  line-height: 1;
}

.scroll-btn-text {
  font-size: 12px;
  white-space: nowrap;
}

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

/* Vitals Area (above input) */
.vitals-area {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: calc(var(--spacing-md) / 2) var(--spacing-md);
}

.vitals-area .stat-bars {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-lg);
  justify-content: space-between;
}

.vitals-area .stat-bar {
  flex: 1;
  position: relative;
  background: var(--bg-primary);
  border-radius: 12px;
  height: 24px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  min-width: 150px; /* Make bars wider */
}

.vitals-area .stat-header {
  display: none; /* Hide the old header since text will be on the bar */
}

.vitals-area .stat-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.vitals-area .stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.vitals-area .stat-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: var(--bg-primary);
  border-radius: 12px;
  overflow: hidden;
}

.vitals-area .stat-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  z-index: 10;
  pointer-events: none;
}

.vitals-area .stat-label {
  color: white;
  font-weight: 600;
  font-size: 10px;
}

.vitals-area .stat-value {
  color: white;
  font-weight: 600;
  font-size: 10px;
}

/* Input Area */
.input-area {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-md);
}

.input-wrapper {
  display: flex;
  gap: var(--spacing-sm);
  align-items: flex-end;
}

.input-field {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-primary);
  font-size: 14px;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  transition: all var(--transition-fast);
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.1);
}

.input-actions {
  display: flex;
  gap: var(--spacing-xs);
}

.input-btn {
  width: 40px;
  height: 40px;
  background: var(--accent-gold);
  border: none;
  border-radius: 8px;
  color: var(--bg-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-btn:hover {
  background: var(--accent-gold-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.input-btn.secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.input-btn.secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Right Panel */
.client-rightpanel {
  grid-area: rightpanel;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-width: 200px;
  max-width: 600px;
}

/* Resize handle for right panel */
.panel-resize-handle {
  position: absolute;
  left: -5px;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: ew-resize;
  background: transparent;
  z-index: 1000;
  user-select: none;
}

.panel-resize-handle:hover {
  background: rgba(244, 196, 48, 0.3);
}

.panel-resize-handle.resizing {
  background: rgba(244, 196, 48, 0.5);
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.panel-tab {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.panel-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.panel-tab.active {
  color: var(--accent-gold);
  background: var(--bg-secondary);
}

.panel-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gold);
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
}

.inventory-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-md);
  overflow-y: auto;
}

.inventory-grid {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding: 0;
  min-height: auto;
}

.inventory-slot {
  aspect-ratio: 1;
  background: var(--bg-elevated);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.inventory-slot:hover {
  border-color: var(--accent-gold);
  transform: scale(1.05);
}

.inventory-slot.occupied {
  background: var(--bg-tertiary);
}

.item-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.item-count {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--bg-primary);
  color: var(--accent-gold);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 4px;
}

/* Inventory Display Styles */
.inventory-section-header {
  font-weight: 600;
  color: var(--accent-gold);
  margin: var(--spacing-md) 0 var(--spacing-sm) 0;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--bg-elevated);
  border-radius: 4px;
  font-size: 13px;
  border-left: 3px solid var(--accent-gold);
}

.inventory-item {
  padding: var(--spacing-sm) var(--spacing-md);
  margin: 2px 0;
  background: var(--bg-secondary);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
  display: block;
  width: 100%;
}

.inventory-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent-gold);
  transform: translateX(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.inventory-weight {
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm);
  background: var(--bg-tertiary);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
}

.inventory-empty {
  padding: var(--spacing-lg);
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
}

/* Footer Quick Actions */
.client-footer {
  grid-area: footer;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-xs) var(--spacing-md);
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  justify-content: center;
  height: 45px;
}

.quick-action {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: var(--spacing-xs) var(--spacing-sm);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  height: 32px;
}

.quick-action:hover {
  background: var(--bg-hover);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.quick-action-icon {
  width: 14px;
  height: 14px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

/* Modern Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold-dark);
}

/* Tooltips */
.tooltip {
  position: absolute;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-primary);
  font-size: 13px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  box-shadow: var(--shadow-lg);
}

.tooltip.show {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 1400px) {
  #pantheon-client {
    grid-template-columns: 240px 1fr 280px;
  }

  .inventory-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1200px) {
  #pantheon-client {
    grid-template-columns: 200px 1fr 0;
    grid-template-areas:
      "header header"
      "sidebar main"
      "sidebar footer";
  }

  .client-rightpanel {
    display: none;
  }
}

@media (max-width: 768px) {
  #pantheon-client {
    grid-template-columns: 1fr;
    grid-template-rows: 50px 1fr;
    grid-template-areas:
      "header"
      "main";
  }

  .client-sidebar {
    border-right: none;
    border-top: 1px solid var(--border-color);
    flex-direction: row;
  }

  .connection-status {
    display: none !important;
  }

  .vitals-area .stat-label {
    display: none !important;
  }

  .vitals-area .stat-bar {
    min-width: 0 !important;
  }

  .vitals-area .stat-bars {
    gap: calc(var(--spacing-lg) / 2) !important;
  }

  /* Show map on mobile as overlay */
  .client-rightpanel {
    display: block !important;
    position: fixed !important;
    top: 91px;
    left: 0;
    width: 100vw !important;
    height: 30vh !important;
    z-index: 200 !important;
    background: rgba(10, 10, 11, 0.85) !important;
    backdrop-filter: blur(4px) !important;
    border: none !important;
    opacity: 0.75;
    padding: 0 !important;
  }

  .panel-tabs {
    display: none !important;
  }

  .panel-content {
    height: 100% !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .map-section {
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .map-container,
  #map-container-right {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
  }

  .map-viewport,
  #map-viewport-right {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    transform: none !important;
  }

  .current-location-display {
    display: none !important;
  }

  .navigation-container {
    position: fixed !important;
    bottom: 60px !important;
    right: 8px !important;
    z-index: 210 !important;
    margin: 0 !important;
  }

  #wind-rose.wind-rose {
    position: fixed !important;
    top: auto !important;
    bottom: 250px !important;
    right: 8px !important;
    z-index: 210 !important;
    width: 200px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  #wind-rose .compass-grid {
    width: 150px !important;
    height: 150px !important;
  }

  #wind-rose .direction-btn {
    font-size: 12px !important;
    min-height: 40px !important;
  }

  #wind-rose .vertical-btn {
    width: 60px !important;
    height: 35px !important;
    font-size: 10px !important;
  }

  .map-controls {
    display: none !important;
  }

  .sidebar-content {
    display: none;
  }

  .header-title {
    font-size: 16px;
  }
}

/* Loading Animation */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid var(--bg-elevated);
  border-top: 3px solid var(--accent-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Notifications */
.notification {
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: var(--spacing-md);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideInRight 0.3s ease forwards;
  max-width: 320px;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-title {
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--accent-gold);
}

.notification-body {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Map View */
.map-container {
  width: 100%;
  height: 400px;
  min-height: 400px;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.map-viewport {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.room-node {
  position: absolute;
  width: 30px;
  height: 30px;
  background: var(--bg-elevated);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-node.current {
  background: var(--accent-gold);
  color: var(--bg-primary);
  border-color: var(--accent-gold-light);
  box-shadow: var(--shadow-glow);
}

.room-node:hover {
  transform: scale(1.1);
  border-color: var(--accent-gold);
}

.room-connection {
  position: absolute;
  background: var(--border-color);
  transform-origin: center left;
}

/* Room Type Colors */
.room-node.room-type-miasto {
  background: #2d3340;
  border-color: #4a5568;
}

.room-node.room-type-miasto.current {
  background: var(--accent-gold);
  border-color: var(--accent-gold-light);
}

.room-node.room-type-jaskinia {
  background: #2d3748;
  border-color: #4a5568;
}

.room-node.room-type-jaskinia.current {
  background: var(--accent-gold);
  border-color: var(--accent-gold-light);
}

.room-node.room-type-trakt {
  background: #805ad5;
  border-color: #9f7aea;
}

.room-node.room-type-trakt.current {
  background: var(--accent-gold);
  border-color: var(--accent-gold-light);
}

.room-node.room-type-pvp_teren {
  background: #e53e3e;
  border-color: #fc8181;
}

.room-node.room-type-pvp_teren.current {
  background: var(--accent-gold);
  border-color: var(--accent-gold-light);
}

.room-node.room-type-las {
  background: #38a169;
  border-color: #68d391;
}

.room-node.room-type-las.current {
  background: var(--accent-gold);
  border-color: var(--accent-gold-light);
}

.room-node.room-type-bagna {
  background: #2b6cb0;
  border-color: #4299e1;
}

.room-node.room-type-bagna.current {
  background: var(--accent-gold);
  border-color: var(--accent-gold-light);
}

.room-node.room-type-unknown {
  background: #718096;
  border-color: #a0aec0;
}

.room-node.room-type-unknown.current {
  background: var(--accent-gold);
  border-color: var(--accent-gold-light);
}

/* Map Legend */
.map-legend {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--bg-elevated);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.legend-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.legend-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--spacing-xs);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-secondary);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border-color);
}

.legend-color.room-type-miasto {
  background: #2d3340;
  border-color: #4a5568;
}

.legend-color.room-type-jaskinia {
  background: #2d3748;
  border-color: #4a5568;
}

.legend-color.room-type-trakt {
  background: #805ad5;
  border-color: #9f7aea;
}

.legend-color.room-type-pvp_teren {
  background: #e53e3e;
  border-color: #fc8181;
}

.legend-color.room-type-las {
  background: #38a169;
  border-color: #68d391;
}

.legend-color.room-type-bagna {
  background: #2b6cb0;
  border-color: #4299e1;
}

/* Current Location Display */
.current-location-display {
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--bg-elevated);
  border-radius: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-gold);
  border: 1px solid var(--border-color);
}

/* Navigation Container */
.navigation-container {
  margin-top: var(--spacing-sm);
}

/* Settings Modal */
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.settings-modal.show {
  opacity: 1;
  pointer-events: all;
}

.settings-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.settings-modal.show .settings-content {
  transform: scale(1);
}

.settings-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-gold);
}

.settings-close {
  width: 32px;
  height: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-close:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

.settings-body {
  padding: var(--spacing-lg);
}

.settings-section {
  margin-bottom: var(--spacing-xl);
}

.settings-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border-color);
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) 0;
}

.setting-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Toggle Switch */
.toggle-switch {
  width: 44px;
  height: 24px;
  background: var(--bg-elevated);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.toggle-switch.active {
  background: var(--accent-gold);
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.toggle-switch.active .toggle-slider {
  transform: translateX(20px);
}

/* Character Selection Interface */
.character-selection {
  padding: var(--spacing-xl);
  max-width: 800px;
  margin: 0 auto;
}

.character-selection-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.character-selection-header h2 {
  color: var(--accent-gold);
  font-size: 24px;
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.character-selection-header p {
  color: var(--text-secondary);
  font-size: 16px;
  margin: 0;
}

.character-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.character-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.character-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.character-avatar {
  flex-shrink: 0;
}

.avatar-icon {
  font-size: 32px;
  display: block;
  width: 48px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  background: var(--bg-secondary);
  border-radius: 50%;
  border: 2px solid var(--border-color);
}

.character-info {
  flex: 1;
}

.character-name {
  color: var(--accent-gold);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 var(--spacing-xs) 0;
}

.character-details {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
}

.character-details span {
  background: var(--bg-secondary);
  padding: 2px var(--spacing-xs);
  border-radius: 4px;
}

.character-status {
  margin-top: var(--spacing-xs);
  color: var(--accent-blue);
  font-size: 12px;
  font-style: italic;
}

.character-actions-mini {
  flex-shrink: 0;
}

.character-btn-small {
  background: var(--accent-gold);
  color: var(--bg-primary);
  border: none;
  border-radius: 6px;
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.character-btn-small:hover {
  background: var(--accent-gold-light);
  transform: translateY(-1px);
}

.character-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  align-items: center;
}

.character-btn {
  background: var(--bg-elevated);
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
  border-radius: 12px;
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.character-btn:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.character-btn.logout-btn {
  background: var(--bg-elevated);
  border: 2px solid var(--accent-red);
  color: var(--accent-red);
}

.character-btn.logout-btn:hover {
  background: var(--accent-red);
  color: var(--text-primary);
}

.btn-icon {
  font-size: 18px;
}

.no-characters {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.no-characters p {
  margin: var(--spacing-sm) 0;
}

/* Login Interface */
.login-interface {
  padding: var(--spacing-xl);
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.login-header h2 {
  color: var(--accent-gold);
  font-size: 24px;
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

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

.login-form {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: var(--spacing-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.login-field {
  margin-bottom: var(--spacing-lg);
}

.login-field label {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  font-size: 14px;
}

.login-input {
  width: 100%;
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 16px;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.login-input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.1);
  background: var(--bg-primary);
}

.login-input::placeholder {
  color: var(--text-muted);
}

.login-actions {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.login-btn {
  background: var(--accent-gold);
  color: var(--bg-primary);
  border: none;
  border-radius: 12px;
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  min-width: 160px;
  justify-content: center;
}

.login-btn:hover {
  background: var(--accent-gold-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.login-help {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: var(--spacing-md);
  border-left: 3px solid var(--accent-blue);
}

.login-help p {
  margin: var(--spacing-xs) 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.4;
}

.login-help strong {
  color: var(--text-primary);
}

/* ANSI/Xterm Color Classes for Text Coloring */
.xterm-color-0 {
  color: #000000 !important;
} /* Black */
.xterm-color-1 {
  color: #ef4444 !important;
} /* Red */
.xterm-color-2 {
  color: #10b981 !important;
} /* Green */
.xterm-color-3 {
  color: #f59e0b !important;
} /* Yellow */
.xterm-color-4 {
  color: #3b82f6 !important;
} /* Blue */
.xterm-color-5 {
  color: #8b5cf6 !important;
} /* Magenta */
.xterm-color-6 {
  color: #06b6d4 !important;
} /* Cyan */
.xterm-color-7 {
  color: #e5e7eb !important;
} /* White */
.xterm-color-8 {
  color: #6b7280 !important;
} /* Bright Black */
.xterm-color-9 {
  color: #f87171 !important;
} /* Bright Red */
.xterm-color-10 {
  color: #34d399 !important;
} /* Bright Green */
.xterm-color-11 {
  color: #fbbf24 !important;
} /* Bright Yellow */
.xterm-color-12 {
  color: #60a5fa !important;
} /* Bright Blue */
.xterm-color-13 {
  color: #a78bfa !important;
} /* Bright Magenta */
.xterm-color-14 {
  color: #22d3ee !important;
} /* Bright Cyan */
.xterm-color-15 {
  color: #f9fafb !important;
} /* Bright White */

/* Additional commonly used MUD colors */
.xterm-color-16 {
  color: #000000 !important;
}
.xterm-color-17 {
  color: #00005f !important;
}
.xterm-color-18 {
  color: #000087 !important;
}
.xterm-color-19 {
  color: #0000af !important;
}
.xterm-color-20 {
  color: #0000d7 !important;
}
.xterm-color-21 {
  color: #0000ff !important;
}
.xterm-color-22 {
  color: #005f00 !important;
}
.xterm-color-23 {
  color: #005f5f !important;
}
.xterm-color-24 {
  color: #005f87 !important;
}
.xterm-color-25 {
  color: #005faf !important;
}
.xterm-color-26 {
  color: #005fd7 !important;
}
.xterm-color-27 {
  color: #005fff !important;
}
.xterm-color-28 {
  color: #008700 !important;
}
.xterm-color-29 {
  color: #00875f !important;
}
.xterm-color-30 {
  color: #008787 !important;
}
.xterm-color-31 {
  color: #0087af !important;
}
.xterm-color-32 {
  color: #0087d7 !important;
}
.xterm-color-33 {
  color: #0087ff !important;
}
.xterm-color-34 {
  color: #00af00 !important;
}
.xterm-color-35 {
  color: #00af5f !important;
}
.xterm-color-36 {
  color: #00af87 !important;
}
.xterm-color-37 {
  color: #00afaf !important;
}
.xterm-color-38 {
  color: #00afd7 !important;
}
.xterm-color-39 {
  color: #00afff !important;
}
.xterm-color-40 {
  color: #00d700 !important;
}
.xterm-color-41 {
  color: #00d75f !important;
}
.xterm-color-42 {
  color: #00d787 !important;
}
.xterm-color-43 {
  color: #00d7af !important;
}
.xterm-color-44 {
  color: #00d7d7 !important;
}
.xterm-color-45 {
  color: #00d7ff !important;
}
.xterm-color-46 {
  color: #00ff00 !important;
}
.xterm-color-47 {
  color: #00ff5f !important;
}
.xterm-color-48 {
  color: #00ff87 !important;
}
.xterm-color-49 {
  color: #00ffaf !important;
}
.xterm-color-50 {
  color: #00ffd7 !important;
}
.xterm-color-51 {
  color: #00ffff !important;
}

/* Evennia standard color-XXX classes (256 color palette) */
.color-000 {
  color: #000000 !important;
} /* Black */
.color-001 {
  color: #800000 !important;
} /* Dark Red */
.color-002 {
  color: #008000 !important;
} /* Dark Green */
.color-003 {
  color: #808000 !important;
} /* Dark Yellow */
.color-004 {
  color: #000080 !important;
} /* Dark Blue */
.color-005 {
  color: #800080 !important;
} /* Dark Magenta */
.color-006 {
  color: #008080 !important;
} /* Dark Cyan */
.color-007 {
  color: #c0c0c0 !important;
} /* Light Gray */
.color-008 {
  color: #808080 !important;
} /* Dark Gray */
.color-009 {
  color: #ff0000 !important;
} /* Red */
.color-010 {
  color: #00ff00 !important;
} /* Green */
.color-011 {
  color: #ffff00 !important;
} /* Yellow */
.color-012 {
  color: #0000ff !important;
} /* Blue */
.color-013 {
  color: #ff00ff !important;
} /* Magenta */
.color-014 {
  color: #00ffff !important;
} /* Cyan */
.color-015 {
  color: #ffffff !important;
} /* White */

/* Extended colors for common MUD usage */
.color-016 {
  color: #000000 !important;
}
.color-017 {
  color: #00005f !important;
}
.color-018 {
  color: #000087 !important;
}
.color-019 {
  color: #0000af !important;
}
.color-020 {
  color: #0000d7 !important;
}
.color-021 {
  color: #0000ff !important;
}
.color-022 {
  color: #005f00 !important;
}
.color-023 {
  color: #005f5f !important;
}
.color-024 {
  color: #005f87 !important;
}
.color-025 {
  color: #005faf !important;
}
.color-026 {
  color: #005fd7 !important;
}
.color-027 {
  color: #005fff !important;
}
.color-028 {
  color: #008700 !important;
}
.color-029 {
  color: #00875f !important;
}
.color-030 {
  color: #008787 !important;
}
.color-031 {
  color: #0087af !important;
}
.color-032 {
  color: #0087d7 !important;
}
.color-033 {
  color: #0087ff !important;
}
.color-034 {
  color: #00af00 !important;
}
.color-035 {
  color: #00af5f !important;
}
.color-036 {
  color: #00af87 !important;
}
.color-037 {
  color: #00afaf !important;
}
.color-038 {
  color: #00afd7 !important;
}
.color-039 {
  color: #00afff !important;
}
.color-040 {
  color: #00d700 !important;
}
.color-041 {
  color: #00d75f !important;
}
.color-042 {
  color: #00d787 !important;
}
.color-043 {
  color: #00d7af !important;
}
.color-044 {
  color: #00d7d7 !important;
}
.color-045 {
  color: #00d7ff !important;
}
.color-046 {
  color: #00ff00 !important;
}
.color-047 {
  color: #00ff5f !important;
}
.color-048 {
  color: #00ff87 !important;
}
.color-049 {
  color: #00ffaf !important;
}
.color-050 {
  color: #00ffd7 !important;
}
.color-051 {
  color: #00ffff !important;
}

/* Common Evennia color shortcuts */
.color-red {
  color: #ff0000 !important;
}
.color-green {
  color: #00ff00 !important;
}
.color-yellow {
  color: #ffff00 !important;
}
.color-blue {
  color: #0000ff !important;
}
.color-magenta {
  color: #ff00ff !important;
}
.color-cyan {
  color: #00ffff !important;
}
.color-white {
  color: #ffffff !important;
}
.color-black {
  color: #000000 !important;
}

/* Custom MUD-specific colors for common game elements */
.color-gold {
  color: var(--accent-gold) !important;
}
.color-silver {
  color: #c0c0c0 !important;
}
.color-copper {
  color: #b87333 !important;
}
.color-health {
  color: #ef4444 !important;
}
.color-mana {
  color: #3b82f6 !important;
}
.color-stamina {
  color: #f59e0b !important;
}
.color-experience {
  color: #8b5cf6 !important;
}
.color-speech {
  color: #fbbf24 !important;
}
.color-emote {
  color: #06b6d4 !important;
}
.color-system {
  color: #10b981 !important;
}
.color-error {
  color: #ef4444 !important;
}
.color-warning {
  color: #f59e0b !important;
}
.color-success {
  color: #10b981 !important;
}

/* Wind Rose / Compass Navigation */
.wind-rose {
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm);
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.wind-rose-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
}

.compass-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  width: 120px;
  height: 120px;
}

.direction-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  min-height: 32px;
  text-align: center;
}

.direction-btn:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.direction-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.direction-btn.available {
  background: var(--bg-elevated);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.direction-btn.available:hover {
  background: var(--accent-green);
  color: var(--bg-primary);
  border-color: var(--accent-green);
}

.direction-btn.unavailable {
  background: var(--bg-tertiary);
  border-color: var(--text-disabled);
  color: var(--text-disabled);
  cursor: not-allowed;
  opacity: 0.5;
}

.direction-btn.unavailable:hover {
  background: var(--bg-tertiary);
  color: var(--text-disabled);
  border-color: var(--text-disabled);
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

.compass-center {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-size: 16px;
  font-weight: bold;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-gold);
  border-radius: 50%;
}

.vertical-btn {
  width: 60px;
  height: 40px;
  font-size: 10px;
  line-height: 1.2;
}

.vertical-btn small {
  font-size: 8px;
  font-weight: 500;
  opacity: 0.8;
}

.up-btn {
  margin-bottom: var(--spacing-xs);
}

.down-btn {
  margin-top: var(--spacing-xs);
}

/* Map controls */
.map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
  background: var(--bg-elevated);
  border-radius: 6px;
  padding: 6px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.map-control-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  transition: all var(--transition-fast);
  user-select: none;
  border: 1px solid var(--border-color);
}

.map-control-btn:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.map-control-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.zoom-level {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 2px;
  font-weight: 600;
  line-height: 1;
}

/* Map container positioning */
#map-container-right {
  position: relative;
  height: 400px;
  min-height: 300px;
}

/* Map viewport styling */
#map-viewport-right {
  cursor: grab;
  overflow: hidden;
  position: relative;
  user-select: none;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  min-height: 200px;
  height: 100%;
  width: 100%;
}

#map-viewport-right:active {
  cursor: grabbing;
}

/* Region selector */
.region-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
}

.region-selector label {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
}

.region-select {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.region-select:hover {
  border-color: var(--accent-gold);
  background: var(--bg-hover);
}

.region-select:focus {
  outline: none;
  border-color: var(--accent-gold);
  background: var(--bg-hover);
  box-shadow: 0 0 0 2px rgba(244, 196, 48, 0.2);
}

.region-select option {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Current location display */
.current-location-display {
  text-align: center;
  font-weight: 600;
  color: var(--accent-gold);
  font-size: 14px;
  margin-top: var(--spacing-sm);
  padding: var(--spacing-xs);
  background: var(--bg-secondary);
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  /* Hide entire left sidebar on mobile */
  .client-sidebar {
    display: none !important;
  }

  /* Hide bottom quick actions bar on mobile */
  .quick-actions {
    display: none !important;
  }

  /* Hide footer with quick action buttons */
  .client-footer {
    display: none !important;
  }

  /* Remove any footer spacing */
  body {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Ensure full height usage */
  #pantheon-client {
    min-height: 100vh !important;
    padding-bottom: 0 !important;
  }

  /* Hide sidebar tabs (Postac section) */
  .sidebar-tabs {
    display: none !important;
  }

  /* Hide character panel */
  #character-panel {
    display: none !important;
  }

  /* Make main content area full width */
  .main-content {
    width: 100% !important;
    margin-left: 0 !important;
    max-width: none !important;
  }

  /* Ensure full width layout */
  #pantheon-client {
    width: 100% !important;
    max-width: none !important;
  }

  /* Hide right panel and make game area full width */
  .right-panel {
    display: none !important;
  }

  .game-area {
    width: 100% !important;
    position: relative;
  }

  /* Floating compact map in top-right corner */
  #map-container-right {
    position: fixed !important;
    top: 130px;
    right: 10px;
    width: 120px !important;
    height: 120px !important;
    background: rgba(19, 19, 26, 0.9) !important;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 100;
    backdrop-filter: blur(10px);
    padding: 4px;
  }

  #map-viewport-right {
    width: 100% !important;
    height: 100% !important;
    overflow: hidden;
  }

  /* Floating wind rose overlay */
  .wind-rose {
    position: fixed !important;
    top: 310px;
    right: 10px;
    width: 140px;
    background: rgba(19, 19, 26, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent-gold);
    z-index: 150;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    touch-action: manipulation; /* Optimize for touch */
  }

  .compass-grid {
    width: 90px !important;
  }

  /* Hide legend on mobile to save space */
  .map-legend {
    display: none !important;
  }

  .compass-grid {
    height: 90px !important;
  }

  .direction-btn {
    font-size: 9px !important;
    min-height: 24px !important;
    touch-action: manipulation; /* Optimize for touch */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
  }

  .vertical-btn {
    width: 45px !important;
    height: 30px !important;
    font-size: 8px !important;
  }

  /* Location display floating above wind rose */
  .current-location-display {
    position: fixed !important;
    top: 260px;
    right: 10px;
    width: 140px;
    margin-top: 0 !important;
    background: rgba(19, 19, 26, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent-gold);
    z-index: 140;
    font-size: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  /* Mobile input area adjustments */
  .input-section {
    padding: var(--spacing-sm) !important;
    background: var(--bg-secondary);
  }

  .input-area {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  #input-field {
    font-size: 14px !important;
    height: 38px !important;
    min-height: 38px !important; /* Touch-friendly */
  }

  #send-btn {
    min-width: 50px !important;
    padding: 12px !important;
  }

  /* Header adjustments for mobile */
  .client-header {
    padding: var(--spacing-sm) !important;
    height: 60px !important;
  }

  .header-title {
    font-size: 18px !important;
  }

  /* Message window mobile optimizations */
  .message-window {
    padding: var(--spacing-sm) !important;
    /* Full width on mobile - no right padding */
    padding-right: var(--spacing-sm) !important;
    /* Make messages appear at bottom and push up */
    display: flex !important;
    flex-direction: column-reverse !important;
  }

  .message {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  /* Tab navigation mobile adjustments */
  .main-tabs {
    padding: var(--spacing-xs) var(--spacing-sm) !important;
  }

  .main-tab {
    font-size: 12px !important;
    padding: var(--spacing-xs) var(--spacing-sm) !important;
  }

  /* Hide scroll to bottom button on mobile or make it smaller */
  #scroll-to-bottom-btn {
    width: 40px !important;
    height: 40px !important;
    bottom: 20px !important;
    left: 20px !important;
  }

  /* Character selection mobile optimizations */
  .character-selection {
    padding: var(--spacing-md) !important;
  }

  .character-card {
    margin-bottom: var(--spacing-sm) !important;
  }

  /* Login interface mobile optimizations */
  .login-interface {
    padding: var(--spacing-md) !important;
  }

  .login-form {
    max-width: none !important;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  /* Make floating elements even more compact */
  #map-container-right {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
  }

  #map-viewport-right {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
  }

  .wind-rose {
    width: 120px;
    bottom: 100px;
    right: 5px;
  }

  .current-location-display {
    width: 120px;
    bottom: 240px;
    right: 5px;
    font-size: 11px !important;
  }

  .compass-grid {
    width: 75px !important;
    height: 75px !important;
  }

  .direction-btn {
    font-size: 8px !important;
    min-height: 20px !important;
  }

  .vertical-btn {
    width: 40px !important;
    height: 25px !important;
    font-size: 7px !important;
  }

  /* Keep message window full width on extra small screens */
  .message-window {
    padding-right: var(--spacing-sm) !important;
  }
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 75px;
  right: 15px;
  width: 44px;
  height: 44px;
  background: rgba(244, 196, 48, 0.9);
  border: 2px solid var(--accent-gold);
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 200;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-fast);
  user-select: none;
}

.mobile-nav-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.mobile-nav-toggle:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: flex !important;
  }
}

/* Keyboard Shortcuts Modal */
.keyboard-help-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.keyboard-help-modal.show {
  opacity: 1;
  pointer-events: all;
}

.keyboard-help-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  margin: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.keyboard-help-modal.show .keyboard-help-content {
  transform: scale(1);
}

.keyboard-help-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.keyboard-help-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-gold);
}

.keyboard-help-close {
  width: 32px;
  height: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.keyboard-help-close:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: var(--text-primary);
}

.keyboard-help-body {
  padding: var(--spacing-lg);
  overflow-y: auto;
  max-height: calc(80vh - 100px);
}

.keyboard-section {
  margin-bottom: var(--spacing-xl);
}

.keyboard-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border-color);
}

.keyboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.keyboard-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-sm);
}

.key-help {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs);
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
}

.key-help kbd {
  display: inline-block;
  padding: 4px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-gold);
  min-width: 24px;
  text-align: center;
  box-shadow: 0 1px 0 var(--border-color);
}

.key-help span {
  flex: 1;
  color: var(--text-secondary);
  font-size: 12px;
}

/* Mobile keyboard help adjustments */
@media (max-width: 768px) {
  .keyboard-help-content {
    width: 95%;
    margin: 10px;
  }

  .keyboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .keyboard-list {
    grid-template-columns: 1fr;
  }

  .keyboard-help-body {
    max-height: calc(90vh - 80px);
  }
}
