/**
 * Galactic Map Styling
 */

body {
  margin: 0;
  overflow: hidden;
}

.map-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #0a0e1a;
  display: flex;
  flex-direction: column;
}

/* Project Title Overlay */
.project-title-overlay {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
  text-align: right;
  pointer-events: none;
  user-select: none;
}

.project-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.8em;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, #8a4fff 0%, #4a9eff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(138, 79, 255, 0.5);
  letter-spacing: 2px;
  line-height: 1.2;
}

.project-subtitle {
  font-family: 'Orbitron', monospace;
  font-size: 0.75em;
  color: rgba(138, 79, 255, 0.8);
  margin-top: 2px;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(138, 79, 255, 0.3);
}

/* Header */
.map-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.95) 0%, rgba(10, 14, 26, 0) 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 100;
}

.map-header h1 {
  font-size: 1.5rem;
  margin: 0;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* Connection Status */
.connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.connection-status.connected {
  border-color: #10b981;
}

.connection-status.failed {
  border-color: #ef4444;
}

.status-indicator {
  font-size: 1.2rem;
}

.status-text {
  color: #d1d5db;
  font-size: 0.9rem;
  font-family: monospace;
}

/* Canvas Wrapper */
.map-canvas-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#galacticMap {
  width: 100%;
  height: 100%;
  cursor: move;
}

#galacticMap:active {
  cursor: grabbing;
}

/* ========================================
   SLIM MAP CONTROLS - FIXED MOBILE
   ======================================== */

/* Deprecate Top Header */
.map-header {
  display: none !important;
}

/* Map Controls - Desktop/Default */
.map-controls {
  position: fixed;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 100;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(10px);
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(138, 79, 255, 0.3);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Slim Control Buttons */
.control-btn {
  padding: 8px;
  background: rgba(138, 79, 255, 0.15);
  border: 1px solid rgba(138, 79, 255, 0.3);
  border-radius: 6px;
  color: #8a4fff;
  font-family: 'Orbitron', monospace;
  font-size: 1.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.control-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(138, 79, 255, 0.3), transparent);
  transition: left 0.3s;
}

.control-btn:hover::before {
  left: 100%;
}

.control-btn:hover {
  background: rgba(138, 79, 255, 0.25);
  border-color: #8a4fff;
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.5);
}

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

/* Menu Button - Extra Emphasis */
.control-btn.menu-btn {
  background: rgba(138, 79, 255, 0.2);
  border-color: rgba(138, 79, 255, 0.5);
  font-size: 1.2em;
  animation: menuPulse 3s ease-in-out infinite;
}

@keyframes menuPulse {
  0%, 100% { 
    box-shadow: 0 0 10px rgba(138, 79, 255, 0.3);
  }
  50% { 
    box-shadow: 0 0 20px rgba(138, 79, 255, 0.6);
  }
}

.control-btn.menu-btn:hover {
  animation: none;
  box-shadow: 0 0 20px rgba(138, 79, 255, 0.8);
}

.control-btn.menu-btn.active {
  background: rgba(138, 79, 255, 0.4);
  border-color: #8a4fff;
  box-shadow: 0 0 25px rgba(138, 79, 255, 1);
}

/* Zoom Controls */
.zoom-controls .control-btn {
  font-size: 1.3em;
  font-weight: bold;
}

/* Admin Controls Panel - Adjusted for no header */
.controls-panel {
  position: fixed;
  top: 10px;
  left: 70px;
  width: 320px;
  max-height: calc(100vh - 20px);
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(138, 79, 255, 0.4);
  border-radius: 8px;
  z-index: 200;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7),
              0 0 30px rgba(138, 79, 255, 0.3);
}

/* ========================================
   MOBILE RESPONSIVE - CLEAN VERSION
   ======================================== */

/* Tablet and below */
@media (max-width: 768px) {
  /* Keep controls in top-left, just make them smaller */
  .map-controls {
    top: 10px;
    left: 10px;
    gap: 5px;
  }

  .control-group {
    padding: 5px;
    gap: 3px;
  }

  .control-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    font-size: 1em;
  }

  .control-btn.menu-btn {
    font-size: 1.15em;
  }

  .zoom-controls .control-btn {
    font-size: 1.2em;
  }

  /* Admin panel full width on mobile */
  .controls-panel {
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100vh - 80px);
  }

  /* Overlay menu full width */
  .overlay-menu {
    width: 100%;
    right: -100%;
  }

  .overlay-menu.active {
    right: 0;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .control-btn {
    min-width: 42px;
    min-height: 42px;
    padding: 9px;
    font-size: 0.95em;
  }

  .control-btn.menu-btn {
    font-size: 1.1em;
  }

  .zoom-controls .control-btn {
    font-size: 1.15em;
  }
}

/* ========================================
   OVERLAY MENU SYSTEM
   ======================================== */

/* Overlay Menu Container */
.overlay-menu {
  position: fixed;
  top: 60px;
  right: -320px;
  width: 300px;
  bottom: 0;
  background: rgba(10, 10, 26, 0.98);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(138, 79, 255, 0.3);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.overlay-menu.active {
  right: 0;
}

/* Menu Header */
.overlay-menu-header {
  padding: 20px;
  border-bottom: 1px solid rgba(138, 79, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.overlay-menu-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.3em;
  margin: 0;
  background: linear-gradient(135deg, #8a4fff 0%, #4a9eff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.overlay-menu-close {
  background: rgba(138, 79, 255, 0.1);
  border: 1px solid rgba(138, 79, 255, 0.3);
  color: #8a4fff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 1.2em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.overlay-menu-close:hover {
  background: rgba(138, 79, 255, 0.2);
  border-color: #8a4fff;
  transform: scale(1.05);
}

/* Menu Navigation */
.overlay-menu-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

/* Menu Items */
.overlay-menu-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  color: #b0b0c0;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.overlay-menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(138, 79, 255, 0.2), transparent);
  transition: width 0.3s ease;
}

.overlay-menu-item:hover {
  background: rgba(138, 79, 255, 0.1);
  color: #fff;
  border-left-color: #8a4fff;
}

.overlay-menu-item:hover::before {
  width: 100%;
}

.menu-item-icon {
  font-size: 1.4em;
  width: 30px;
  text-align: center;
  flex-shrink: 0;
  z-index: 1;
}

.menu-item-label {
  flex: 1;
  font-size: 1em;
  font-weight: 500;
  z-index: 1;
}

.menu-item-arrow {
  font-size: 1.2em;
  color: #6a6a8a;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.2s ease;
  z-index: 1;
}

.overlay-menu-item:hover .menu-item-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Menu Divider */
.overlay-menu-divider {
  height: 1px;
  background: rgba(138, 79, 255, 0.2);
  margin: 15px 20px;
}

/* Section Title */
.overlay-menu-section-title {
  padding: 10px 20px;
  color: #6a6a8a;
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Admin Item Styling */
.overlay-menu-item.admin-item {
  background: rgba(239, 68, 68, 0.05);
}

.overlay-menu-item.admin-item:hover {
  background: rgba(239, 68, 68, 0.15);
  border-left-color: #ef4444;
}

/* Overlay Backdrop */
.overlay-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  /* backdrop-filter: blur(3px); - Removed blur for better visibility */
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* Menu Toggle Button */
.control-btn.menu-btn {
  background: rgba(138, 79, 255, 0.2);
  border-color: rgba(138, 79, 255, 0.4);
  color: #8a4fff;
  font-size: 1.3em;
}

.control-btn.menu-btn:hover {
  background: rgba(138, 79, 255, 0.3);
  border-color: #8a4fff;
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.4);
}

.control-btn.menu-btn.active {
  background: rgba(138, 79, 255, 0.4);
  border-color: #8a4fff;
  box-shadow: 0 0 20px rgba(138, 79, 255, 0.6);
}

/* Scrollbar for menu */
.overlay-menu-nav::-webkit-scrollbar {
  width: 6px;
}

.overlay-menu-nav::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.overlay-menu-nav::-webkit-scrollbar-thumb {
  background: rgba(138, 79, 255, 0.3);
  border-radius: 3px;
}

.overlay-menu-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(138, 79, 255, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .overlay-menu {
    width: 280px;
    right: -280px;
  }
  
  .overlay-menu-title {
    font-size: 1.1em;
  }
  
  .menu-item-label {
    font-size: 0.95em;
  }
}

/* ========================================
   PWA MODAL SYSTEM
   ======================================== */

/* PWA Modal Container */
.pwa-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 26, 0.98);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-modal.active {
  transform: translateY(0);
}

/* PWA Modal Header */
.pwa-modal-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: rgba(15, 15, 30, 0.95);
  border-bottom: 1px solid rgba(138, 79, 255, 0.3);
  min-height: 60px;
}

.pwa-modal-back {
  background: rgba(138, 79, 255, 0.1);
  border: 1px solid rgba(138, 79, 255, 0.3);
  color: #8a4fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.pwa-modal-back:hover {
  background: rgba(138, 79, 255, 0.2);
  border-color: #8a4fff;
  transform: translateX(-3px);
}

.pwa-modal-title {
  flex: 1;
  margin: 0;
  font-family: 'Orbitron', monospace;
  font-size: 1.3em;
  background: linear-gradient(135deg, #8a4fff 0%, #4a9eff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pwa-modal-close {
  background: rgba(138, 79, 255, 0.1);
  border: 1px solid rgba(138, 79, 255, 0.3);
  color: #8a4fff;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 1.3em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pwa-modal-close:hover {
  background: rgba(138, 79, 255, 0.2);
  border-color: #8a4fff;
  transform: scale(1.05);
}

/* PWA Modal Content */
.pwa-modal-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2a 100%);
}

/* Loading State */
.pwa-modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: #8a4fff;
}

.pwa-modal-loading p {
  margin-top: 20px;
  font-size: 1.1em;
  color: #b0b0c0;
}

/* Loading Spinner */
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(138, 79, 255, 0.2);
  border-top-color: #8a4fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Error State */
.pwa-modal-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  padding: 40px;
}

.pwa-modal-error .error-icon {
  font-size: 4em;
  margin-bottom: 20px;
}

.pwa-modal-error h3 {
  color: #ef4444;
  margin: 0 0 15px 0;
  font-size: 1.5em;
}

.pwa-modal-error p {
  color: #b0b0c0;
  margin: 0 0 25px 0;
  font-size: 1.05em;
}

.pwa-modal-error .btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #8a4fff 0%, #4a9eff 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.pwa-modal-error .btn:hover {
  transform: translateY(-2px);
}

/* Scrollbar for modal content */
.pwa-modal-content::-webkit-scrollbar {
  width: 8px;
}

.pwa-modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.pwa-modal-content::-webkit-scrollbar-thumb {
  background: rgba(138, 79, 255, 0.4);
  border-radius: 4px;
}

.pwa-modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(138, 79, 255, 0.6);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .pwa-modal-header {
    padding: 12px 15px;
    min-height: 56px;
  }

  .pwa-modal-title {
    font-size: 1.1em;
  }

  .pwa-modal-back {
    padding: 6px 12px;
    font-size: 0.9em;
  }

  .pwa-modal-content {
    padding: 15px;
  }
/* ========================================
   PWA MODAL SYSTEM - TERMINAL HUD STYLE
   ======================================== */

/* PWA Modal Container */
.pwa-modal {
  position: fixed;
  top: 4%;
  left: 4%;
  right: 4%;
  bottom: 4%;
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(138, 79, 255, 0);
  border-radius: 8px;
  box-shadow: 0 0 0 rgba(138, 79, 255, 0);
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  overflow: hidden;
}

/* Terminal HUD Opening Animation */
.pwa-modal.active {
  animation: hudBoot 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: all;
}

@keyframes hudBoot {
  0% {
    opacity: 0;
    transform: scale(0.8);
    border-color: rgba(138, 79, 255, 0);
    box-shadow: 0 0 0 rgba(138, 79, 255, 0);
  }
  20% {
    opacity: 0.3;
    border-color: rgba(138, 79, 255, 0.3);
  }
  40% {
    opacity: 0.6;
    transform: scale(0.95);
    border-color: rgba(138, 79, 255, 0.6);
    box-shadow: 0 0 20px rgba(138, 79, 255, 0.3),
                inset 0 0 30px rgba(138, 79, 255, 0.1);
  }
  60% {
    transform: scale(1.02);
    border-color: rgba(138, 79, 255, 0.9);
  }
  80% {
    transform: scale(0.99);
    box-shadow: 0 0 40px rgba(138, 79, 255, 0.5),
                inset 0 0 50px rgba(138, 79, 255, 0.15);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    border-color: rgba(138, 79, 255, 0.6);
    box-shadow: 0 0 30px rgba(138, 79, 255, 0.4),
                inset 0 0 40px rgba(138, 79, 255, 0.1);
  }
}

/* Terminal HUD Closing Animation */
.pwa-modal.closing {
  animation: hudShutdown 0.4s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes hudShutdown {
  0% {
    opacity: 1;
    transform: scale(1);
    border-color: rgba(138, 79, 255, 0.6);
    box-shadow: 0 0 30px rgba(138, 79, 255, 0.4),
                inset 0 0 40px rgba(138, 79, 255, 0.1);
  }
  30% {
    transform: scale(1.02);
    border-color: rgba(138, 79, 255, 0.8);
  }
  60% {
    opacity: 0.4;
    transform: scale(0.95);
    border-color: rgba(138, 79, 255, 0.3);
    box-shadow: 0 0 10px rgba(138, 79, 255, 0.2),
                inset 0 0 20px rgba(138, 79, 255, 0.05);
  }
  100% {
    opacity: 0;
    transform: scale(0.85);
    border-color: rgba(138, 79, 255, 0);
    box-shadow: 0 0 0 rgba(138, 79, 255, 0);
  }
}

/* Scanline Effect */
.pwa-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(138, 79, 255, 0.03) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: scanlineFlicker 0.1s infinite;
}

.pwa-modal.active::before {
  opacity: 1;
}

@keyframes scanlineFlicker {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.7; }
}

/* Corner Brackets - Terminal HUD Style */
.pwa-modal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(to right, #8a4fff 2px, transparent 2px) 0 0,
    linear-gradient(to right, #8a4fff 2px, transparent 2px) 0 100%,
    linear-gradient(to left, #8a4fff 2px, transparent 2px) 100% 0,
    linear-gradient(to left, #8a4fff 2px, transparent 2px) 100% 100%,
    linear-gradient(to bottom, #8a4fff 2px, transparent 2px) 0 0,
    linear-gradient(to bottom, #8a4fff 2px, transparent 2px) 100% 0,
    linear-gradient(to top, #8a4fff 2px, transparent 2px) 0 100%,
    linear-gradient(to top, #8a4fff 2px, transparent 2px) 100% 100%;
  background-repeat: no-repeat;
  background-size: 30px 30px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}

.pwa-modal.active::after {
  animation: cornerBracketsBoot 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

@keyframes cornerBracketsBoot {
  0% {
    opacity: 0;
    background-size: 10px 10px;
  }
  100% {
    opacity: 0.8;
    background-size: 30px 30px;
  }
}

/* PWA Modal Header */
.pwa-modal-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: rgba(15, 15, 30, 0.8);
  border-bottom: 2px solid rgba(138, 79, 255, 0.4);
  min-height: 60px;
  position: relative;
  z-index: 3;
}

.pwa-modal-header::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent,
    #8a4fff 20%,
    #4a9eff 50%,
    #8a4fff 80%,
    transparent
  );
  animation: headerGlow 2s ease-in-out infinite;
}

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

.pwa-modal-back {
  background: rgba(138, 79, 255, 0.15);
  border: 1px solid rgba(138, 79, 255, 0.5);
  color: #8a4fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.95em;
  font-family: 'Orbitron', monospace;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.pwa-modal-back::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(138, 79, 255, 0.3), transparent);
  transition: left 0.5s;
}

.pwa-modal-back:hover::before {
  left: 100%;
}

.pwa-modal-back:hover {
  background: rgba(138, 79, 255, 0.25);
  border-color: #8a4fff;
  transform: translateX(-3px);
  box-shadow: 0 0 10px rgba(138, 79, 255, 0.5);
}

.pwa-modal-title {
  flex: 1;
  margin: 0;
  font-family: 'Orbitron', monospace;
  font-size: 1.3em;
  color: #8a4fff;
  text-shadow: 0 0 10px rgba(138, 79, 255, 0.8);
  letter-spacing: 1px;
  animation: titleFlicker 3s ease-in-out infinite;
}

@keyframes titleFlicker {
  0%, 100% { 
    text-shadow: 0 0 10px rgba(138, 79, 255, 0.8);
  }
  50% { 
    text-shadow: 0 0 20px rgba(138, 79, 255, 1),
                 0 0 30px rgba(74, 158, 255, 0.5);
  }
}

.pwa-modal-close {
  background: rgba(138, 79, 255, 0.15);
  border: 1px solid rgba(138, 79, 255, 0.5);
  color: #8a4fff;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  font-size: 1.3em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.5);
}

.pwa-modal-close:hover {
  background: rgba(138, 79, 255, 0.25);
  border-color: #8a4fff;
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.6);
}

/* PWA Modal Content */
.pwa-modal-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2a 100%);
  position: relative;
  z-index: 3;
}

/* Loading State */
.pwa-modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: #8a4fff;
}

.pwa-modal-loading p {
  margin-top: 20px;
  font-size: 1.1em;
  font-family: 'Orbitron', monospace;
  color: #8a4fff;
  text-shadow: 0 0 10px rgba(138, 79, 255, 0.8);
  animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Loading Spinner - Terminal Style */
.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(138, 79, 255, 0.2);
  border-top-color: #8a4fff;
  border-right-color: #4a9eff;
  border-radius: 50%;
  animation: spinnerRotate 1s linear infinite, spinnerGlow 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(138, 79, 255, 0.5),
              inset 0 0 20px rgba(138, 79, 255, 0.2);
}

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

@keyframes spinnerGlow {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(138, 79, 255, 0.5),
                inset 0 0 20px rgba(138, 79, 255, 0.2);
  }
  50% { 
    box-shadow: 0 0 40px rgba(138, 79, 255, 0.8),
                inset 0 0 30px rgba(138, 79, 255, 0.4);
  }
}

/* Error State */
.pwa-modal-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  padding: 40px;
}

.pwa-modal-error .error-icon {
  font-size: 4em;
  margin-bottom: 20px;
  animation: errorPulse 1s ease-in-out infinite;
}

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

.pwa-modal-error h3 {
  color: #ef4444;
  margin: 0 0 15px 0;
  font-size: 1.5em;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.pwa-modal-error p {
  color: #b0b0c0;
  margin: 0 0 25px 0;
  font-size: 1.05em;
}

.pwa-modal-error .btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #8a4fff 0%, #4a9eff 100%);
  color: white;
  border: 1px solid rgba(138, 79, 255, 0.6);
  border-radius: 4px;
  font-size: 1em;
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(138, 79, 255, 0.4);
}

.pwa-modal-error .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(138, 79, 255, 0.6);
}

/* Scrollbar for modal content */
.pwa-modal-content::-webkit-scrollbar {
  width: 10px;
}

.pwa-modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-left: 1px solid rgba(138, 79, 255, 0.2);
}

.pwa-modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8a4fff, #4a9eff);
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(138, 79, 255, 0.5);
}

.pwa-modal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #9a5fff, #5aaeFF);
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.8);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .pwa-modal {
    top: 2%;
    left: 2%;
    right: 2%;
    bottom: 2%;
  }

  .pwa-modal-header {
    padding: 12px 15px;
    min-height: 56px;
  }

  .pwa-modal-title {
    font-size: 1.1em;
  }

  .pwa-modal-back {
    padding: 6px 12px;
    font-size: 0.9em;
  }

  .pwa-modal-content {
    padding: 15px;
  }
}

/* ========================================
   ADJUSTMENTS FOR NO HEADER
   ======================================== */

/* Overlay Menu - No header offset */
.overlay-menu {
  top: 0 !important;
}

/* PWA Modal - Full screen with margins */
.pwa-modal {
  top: 2% !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .overlay-menu {
    top: 0 !important;
  }
  
  .pwa-modal {
    top: 1% !important;
    left: 1% !important;
    right: 1% !important;
    bottom: 1% !important;
/* ========================================
   OVERLAY MENU SYSTEM - TERMINAL HUD STYLED
   ======================================== */

/* Overlay Menu Container */
.overlay-menu {
  position: fixed;
  top: 0;
  right: -360px;
  width: 340px;
  bottom: 0;
  background: rgba(10, 10, 26, 0.98);
  backdrop-filter: blur(20px);
  border-left: 2px solid rgba(138, 79, 255, 0);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0);
  z-index: 1000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.4s ease,
              box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Terminal boot animation on open */
.overlay-menu.active {
  right: 0;
  border-left-color: rgba(138, 79, 255, 0.6);
  box-shadow: -5px 0 40px rgba(0, 0, 0, 0.7),
              0 0 30px rgba(138, 79, 255, 0.3);
  animation: menuBorderGlow 2s ease-in-out infinite;
}

@keyframes menuBorderGlow {
  0%, 100% {
    border-left-color: rgba(138, 79, 255, 0.6);
  }
  50% {
    border-left-color: rgba(138, 79, 255, 0.9);
  }
}

/* Scanline effect */
.overlay-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(138, 79, 255, 0.03) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s;
}

.overlay-menu.active::before {
  opacity: 1;
}

/* Corner brackets */
.overlay-menu::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 30px;
  background: 
    linear-gradient(to bottom, #8a4fff 2px, transparent 2px) 0 0,
    linear-gradient(to bottom, #8a4fff 2px, transparent 2px) 0 100%;
  background-repeat: no-repeat;
  background-size: 30px 30px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s 0.2s;
}

.overlay-menu.active::after {
  opacity: 0.8;
}

/* Menu Header */
.overlay-menu-header {
  padding: 25px 20px;
  border-bottom: 2px solid rgba(138, 79, 255, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 3;
  background: rgba(15, 15, 30, 0.8);
}

.overlay-menu-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent,
    #8a4fff 20%,
    #4a9eff 50%,
    #8a4fff 80%,
    transparent
  );
  animation: headerScan 3s ease-in-out infinite;
}

@keyframes headerScan {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.overlay-menu-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.4em;
  margin: 0;
  color: #8a4fff;
  text-shadow: 0 0 10px rgba(138, 79, 255, 0.8),
               0 0 20px rgba(138, 79, 255, 0.4);
  letter-spacing: 2px;
  animation: titleFlicker 4s ease-in-out infinite;
}

@keyframes titleFlicker {
  0%, 100% { 
    text-shadow: 0 0 10px rgba(138, 79, 255, 0.8);
  }
  50% { 
    text-shadow: 0 0 20px rgba(138, 79, 255, 1),
                 0 0 30px rgba(74, 158, 255, 0.6);
  }
}

.overlay-menu-subtitle {
  font-size: 0.7em;
  color: #6a6a8a;
  font-family: 'Orbitron', monospace;
  letter-spacing: 1px;
  margin-top: 5px;
  text-transform: uppercase;
}

.overlay-menu-close {
  background: rgba(138, 79, 255, 0.15);
  border: 1px solid rgba(138, 79, 255, 0.5);
  color: #8a4fff;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  font-size: 1.3em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.overlay-menu-close::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(138, 79, 255, 0.3), transparent);
  transition: left 0.3s;
}

.overlay-menu-close:hover::before {
  left: 100%;
}

.overlay-menu-close:hover {
  background: rgba(138, 79, 255, 0.25);
  border-color: #8a4fff;
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.6);
}

/* Menu Navigation */
.overlay-menu-nav {
  flex: 1;
  overflow-y: auto;
  padding: 15px 0;
  position: relative;
  z-index: 3;
}

/* Menu Items - Terminal Style */
.overlay-menu-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 20px;
  color: #b0b0c0;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  font-family: 'Orbitron', monospace;
  font-size: 0.95em;
  letter-spacing: 0.5px;
}

.overlay-menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, 
    rgba(138, 79, 255, 0.2), 
    rgba(138, 79, 255, 0.05),
    transparent
  );
  transition: width 0.3s ease;
  z-index: -1;
}

.overlay-menu-item:hover {
  background: rgba(138, 79, 255, 0.1);
  color: #fff;
  border-left-color: #8a4fff;
  text-shadow: 0 0 8px rgba(138, 79, 255, 0.6);
}

.overlay-menu-item:hover::before {
  width: 100%;
}

.overlay-menu-item:active {
  transform: translateX(5px);
}

.menu-item-icon {
  font-size: 1.5em;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
  z-index: 1;
  filter: drop-shadow(0 0 4px rgba(138, 79, 255, 0.4));
}

.menu-item-label {
  flex: 1;
  font-weight: 500;
  z-index: 1;
}

.menu-item-arrow {
  font-size: 1.3em;
  color: #6a6a8a;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  z-index: 1;
}

.overlay-menu-item:hover .menu-item-arrow {
  opacity: 1;
  transform: translateX(0);
  color: #8a4fff;
  text-shadow: 0 0 8px rgba(138, 79, 255, 0.8);
}

/* Menu Divider */
.overlay-menu-divider {
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    rgba(138, 79, 255, 0.3) 20%,
    rgba(138, 79, 255, 0.3) 80%,
    transparent
  );
  margin: 15px 20px;
  position: relative;
}

.overlay-menu-divider::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    #8a4fff,
    transparent
  );
  animation: dividerScan 3s ease-in-out infinite;
  opacity: 0.5;
}

@keyframes dividerScan {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

/* Section Title */
.overlay-menu-section-title {
  padding: 12px 20px 8px 20px;
  color: #6a6a8a;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.3);
}

/* Admin Item Styling */
.overlay-menu-item.admin-item {
  background: rgba(239, 68, 68, 0.05);
  border-left-color: rgba(239, 68, 68, 0.3);
}

.overlay-menu-item.admin-item:hover {
  background: rgba(239, 68, 68, 0.15);
  border-left-color: #ef4444;
  color: #ff8888;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* Overlay Backdrop */
.overlay-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.overlay-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* Scrollbar for menu */
.overlay-menu-nav::-webkit-scrollbar {
  width: 8px;
}

.overlay-menu-nav::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-left: 1px solid rgba(138, 79, 255, 0.2);
}

.overlay-menu-nav::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8a4fff, #4a9eff);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(138, 79, 255, 0.5);
}

.overlay-menu-nav::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #9a5fff, #5aaeFF);
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.8);
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

/* Tablets and large phones */
@media (max-width: 768px) {
  .overlay-menu {
    width: 100%;
    right: -100%;
    max-width: 400px;
  }

  .overlay-menu.active {
    right: 0;
  }

  .overlay-menu-header {
    padding: 20px 18px;
  }

  .overlay-menu-title {
    font-size: 1.3em;
  }

  .menu-item-label {
    font-size: 0.9em;
  }

  .overlay-menu-item {
    padding: 14px 18px;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .overlay-menu {
    width: 100%;
    right: -100%;
    max-width: none;
  }

  .overlay-menu-header {
    padding: 18px 15px;
  }

  .overlay-menu-title {
    font-size: 1.2em;
    letter-spacing: 1px;
  }

  .overlay-menu-close {
    width: 34px;
    height: 34px;
    font-size: 1.2em;
  }

  .overlay-menu-item {
    padding: 15px 15px;
  }

  .menu-item-icon {
    font-size: 1.4em;
    width: 28px;
  }

  .menu-item-label {
    font-size: 0.95em;
  }

  .overlay-menu-section-title {
    padding: 10px 15px 6px 15px;
    font-size: 0.7em;
  }

  .overlay-menu-divider {
    margin: 12px 15px;
  }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .overlay-menu {
    width: 50%;
    min-width: 320px;
    max-width: 400px;
  }
}

/* Extra wide screens */
@media (min-width: 1920px) {
  .overlay-menu {
    width: 380px;
    right: -380px;
  }

  .overlay-menu-title {
    font-size: 1.5em;
  }

  .menu-item-label {
    font-size: 1em;
  }
}
}

/* ========================================
   SLIM MAP CONTROLS - FIXED MOBILE
   ======================================== */

/* Deprecate Top Header */
.map-header {
  display: none !important;
}

/* Map Controls - Desktop/Default */
.map-controls {
  position: fixed;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 100;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(10px);
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(138, 79, 255, 0.3);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Slim Control Buttons */
.control-btn {
  padding: 8px;
  background: rgba(138, 79, 255, 0.15);
  border: 1px solid rgba(138, 79, 255, 0.3);
  border-radius: 6px;
  color: #8a4fff;
  font-family: 'Orbitron', monospace;
  font-size: 1.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.control-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(138, 79, 255, 0.3), transparent);
  transition: left 0.3s;
}

.control-btn:hover::before {
  left: 100%;
}

.control-btn:hover {
  background: rgba(138, 79, 255, 0.25);
  border-color: #8a4fff;
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.5);
}

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

/* Menu Button - Extra Emphasis */
.control-btn.menu-btn {
  background: rgba(138, 79, 255, 0.2);
  border-color: rgba(138, 79, 255, 0.5);
  font-size: 1.2em;
  animation: menuPulse 3s ease-in-out infinite;
}

@keyframes menuPulse {
  0%, 100% { 
    box-shadow: 0 0 10px rgba(138, 79, 255, 0.3);
  }
  50% { 
    box-shadow: 0 0 20px rgba(138, 79, 255, 0.6);
  }
}

.control-btn.menu-btn:hover {
  animation: none;
  box-shadow: 0 0 20px rgba(138, 79, 255, 0.8);
}

.control-btn.menu-btn.active {
  background: rgba(138, 79, 255, 0.4);
  border-color: #8a4fff;
  box-shadow: 0 0 25px rgba(138, 79, 255, 1);
}

/* Zoom Controls */
.zoom-controls .control-btn {
  font-size: 1.3em;
  font-weight: bold;
}

/* Admin Controls Panel - Adjusted for no header */
.controls-panel {
  position: fixed;
  top: 10px;
  left: 70px;
  width: 320px;
  max-height: calc(100vh - 20px);
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(138, 79, 255, 0.4);
  border-radius: 8px;
  z-index: 200;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7),
              0 0 30px rgba(138, 79, 255, 0.3);
}

/* ========================================
   MOBILE RESPONSIVE - CLEAN VERSION
   ======================================== */

/* Tablet and below */
@media (max-width: 768px) {
  /* Keep controls in top-left, just make them smaller */
  .map-controls {
    top: 10px;
    left: 10px;
    gap: 5px;
  }

  .control-group {
    padding: 5px;
    gap: 3px;
  }

  .control-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    font-size: 1em;
  }

  .control-btn.menu-btn {
    font-size: 1.15em;
  }

  .zoom-controls .control-btn {
    font-size: 1.2em;
  }

  /* Admin panel full width on mobile */
  .controls-panel {
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100vh - 80px);
  }

  /* Overlay menu full width */
  .overlay-menu {
    width: 100%;
    right: -100%;
  }

  .overlay-menu.active {
    right: 0;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .control-btn {
    min-width: 42px;
    min-height: 42px;
    padding: 9px;
    font-size: 0.95em;
  }

  .control-btn.menu-btn {
    font-size: 1.1em;
  }

  .zoom-controls .control-btn {
    font-size: 1.15em;
  }
}

/* ========================================
   OVERLAY MENU SYSTEM
   ======================================== */

/* Overlay Menu Container */
.overlay-menu {
  position: fixed;
  top: 60px;
  right: -320px;
  width: 300px;
  bottom: 0;
  background: rgba(10, 10, 26, 0.98);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(138, 79, 255, 0.3);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.overlay-menu.active {
  right: 0;
}

/* Menu Header */
.overlay-menu-header {
  padding: 20px;
  border-bottom: 1px solid rgba(138, 79, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.overlay-menu-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.3em;
  margin: 0;
  background: linear-gradient(135deg, #8a4fff 0%, #4a9eff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.overlay-menu-close {
  background: rgba(138, 79, 255, 0.1);
  border: 1px solid rgba(138, 79, 255, 0.3);
  color: #8a4fff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 1.2em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.overlay-menu-close:hover {
  background: rgba(138, 79, 255, 0.2);
  border-color: #8a4fff;
  transform: scale(1.05);
}

/* Menu Navigation */
.overlay-menu-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

/* Menu Items */
.overlay-menu-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  color: #b0b0c0;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.overlay-menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(138, 79, 255, 0.2), transparent);
  transition: width 0.3s ease;
}

.overlay-menu-item:hover {
  background: rgba(138, 79, 255, 0.1);
  color: #fff;
  border-left-color: #8a4fff;
}

.overlay-menu-item:hover::before {
  width: 100%;
}

.menu-item-icon {
  font-size: 1.4em;
  width: 30px;
  text-align: center;
  flex-shrink: 0;
  z-index: 1;
}

.menu-item-label {
  flex: 1;
  font-size: 1em;
  font-weight: 500;
  z-index: 1;
}

.menu-item-arrow {
  font-size: 1.2em;
  color: #6a6a8a;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.2s ease;
  z-index: 1;
}

.overlay-menu-item:hover .menu-item-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Menu Divider */
.overlay-menu-divider {
  height: 1px;
  background: rgba(138, 79, 255, 0.2);
  margin: 15px 20px;
}

/* Section Title */
.overlay-menu-section-title {
  padding: 10px 20px;
  color: #6a6a8a;
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Admin Item Styling */
.overlay-menu-item.admin-item {
  background: rgba(239, 68, 68, 0.05);
}

.overlay-menu-item.admin-item:hover {
  background: rgba(239, 68, 68, 0.15);
  border-left-color: #ef4444;
}

/* Overlay Backdrop */
.overlay-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  /* backdrop-filter: blur(3px); - Removed blur for better visibility */
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* Menu Toggle Button */
.control-btn.menu-btn {
  background: rgba(138, 79, 255, 0.2);
  border-color: rgba(138, 79, 255, 0.4);
  color: #8a4fff;
  font-size: 1.3em;
}

.control-btn.menu-btn:hover {
  background: rgba(138, 79, 255, 0.3);
  border-color: #8a4fff;
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.4);
}

.control-btn.menu-btn.active {
  background: rgba(138, 79, 255, 0.4);
  border-color: #8a4fff;
  box-shadow: 0 0 20px rgba(138, 79, 255, 0.6);
}

/* Scrollbar for menu */
.overlay-menu-nav::-webkit-scrollbar {
  width: 6px;
}

.overlay-menu-nav::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.overlay-menu-nav::-webkit-scrollbar-thumb {
  background: rgba(138, 79, 255, 0.3);
  border-radius: 3px;
}

.overlay-menu-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(138, 79, 255, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .overlay-menu {
    width: 280px;
    right: -280px;
  }
  
  .overlay-menu-title {
    font-size: 1.1em;
  }
  
  .menu-item-label {
    font-size: 0.95em;
  }
}

/* ========================================
   PWA MODAL SYSTEM
   ======================================== */

/* PWA Modal Container */
.pwa-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 26, 0.98);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-modal.active {
  transform: translateY(0);
}

/* PWA Modal Header */
.pwa-modal-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: rgba(15, 15, 30, 0.95);
  border-bottom: 1px solid rgba(138, 79, 255, 0.3);
  min-height: 60px;
}

.pwa-modal-back {
  background: rgba(138, 79, 255, 0.1);
  border: 1px solid rgba(138, 79, 255, 0.3);
  color: #8a4fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.pwa-modal-back:hover {
  background: rgba(138, 79, 255, 0.2);
  border-color: #8a4fff;
  transform: translateX(-3px);
}

.pwa-modal-title {
  flex: 1;
  margin: 0;
  font-family: 'Orbitron', monospace;
  font-size: 1.3em;
  background: linear-gradient(135deg, #8a4fff 0%, #4a9eff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pwa-modal-close {
  background: rgba(138, 79, 255, 0.1);
  border: 1px solid rgba(138, 79, 255, 0.3);
  color: #8a4fff;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 1.3em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pwa-modal-close:hover {
  background: rgba(138, 79, 255, 0.2);
  border-color: #8a4fff;
  transform: scale(1.05);
}

/* PWA Modal Content */
.pwa-modal-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2a 100%);
}

/* Loading State */
.pwa-modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: #8a4fff;
}

.pwa-modal-loading p {
  margin-top: 20px;
  font-size: 1.1em;
  color: #b0b0c0;
}

/* Loading Spinner */
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(138, 79, 255, 0.2);
  border-top-color: #8a4fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Error State */
.pwa-modal-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  padding: 40px;
}

.pwa-modal-error .error-icon {
  font-size: 4em;
  margin-bottom: 20px;
}

.pwa-modal-error h3 {
  color: #ef4444;
  margin: 0 0 15px 0;
  font-size: 1.5em;
}

.pwa-modal-error p {
  color: #b0b0c0;
  margin: 0 0 25px 0;
  font-size: 1.05em;
}

.pwa-modal-error .btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #8a4fff 0%, #4a9eff 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.pwa-modal-error .btn:hover {
  transform: translateY(-2px);
}

/* Scrollbar for modal content */
.pwa-modal-content::-webkit-scrollbar {
  width: 8px;
}

.pwa-modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.pwa-modal-content::-webkit-scrollbar-thumb {
  background: rgba(138, 79, 255, 0.4);
  border-radius: 4px;
}

.pwa-modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(138, 79, 255, 0.6);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .pwa-modal-header {
    padding: 12px 15px;
    min-height: 56px;
  }

  .pwa-modal-title {
    font-size: 1.1em;
  }

  .pwa-modal-back {
    padding: 6px 12px;
    font-size: 0.9em;
  }

  .pwa-modal-content {
    padding: 15px;
  }
/* ========================================
   PWA MODAL SYSTEM - TERMINAL HUD STYLE
   ======================================== */

/* PWA Modal Container */
.pwa-modal {
  position: fixed;
  top: 4%;
  left: 4%;
  right: 4%;
  bottom: 4%;
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(138, 79, 255, 0);
  border-radius: 8px;
  box-shadow: 0 0 0 rgba(138, 79, 255, 0);
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  overflow: hidden;
}

/* Terminal HUD Opening Animation */
.pwa-modal.active {
  animation: hudBoot 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: all;
}

@keyframes hudBoot {
  0% {
    opacity: 0;
    transform: scale(0.8);
    border-color: rgba(138, 79, 255, 0);
    box-shadow: 0 0 0 rgba(138, 79, 255, 0);
  }
  20% {
    opacity: 0.3;
    border-color: rgba(138, 79, 255, 0.3);
  }
  40% {
    opacity: 0.6;
    transform: scale(0.95);
    border-color: rgba(138, 79, 255, 0.6);
    box-shadow: 0 0 20px rgba(138, 79, 255, 0.3),
                inset 0 0 30px rgba(138, 79, 255, 0.1);
  }
  60% {
    transform: scale(1.02);
    border-color: rgba(138, 79, 255, 0.9);
  }
  80% {
    transform: scale(0.99);
    box-shadow: 0 0 40px rgba(138, 79, 255, 0.5),
                inset 0 0 50px rgba(138, 79, 255, 0.15);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    border-color: rgba(138, 79, 255, 0.6);
    box-shadow: 0 0 30px rgba(138, 79, 255, 0.4),
                inset 0 0 40px rgba(138, 79, 255, 0.1);
  }
}

/* Terminal HUD Closing Animation */
.pwa-modal.closing {
  animation: hudShutdown 0.4s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes hudShutdown {
  0% {
    opacity: 1;
    transform: scale(1);
    border-color: rgba(138, 79, 255, 0.6);
    box-shadow: 0 0 30px rgba(138, 79, 255, 0.4),
                inset 0 0 40px rgba(138, 79, 255, 0.1);
  }
  30% {
    transform: scale(1.02);
    border-color: rgba(138, 79, 255, 0.8);
  }
  60% {
    opacity: 0.4;
    transform: scale(0.95);
    border-color: rgba(138, 79, 255, 0.3);
    box-shadow: 0 0 10px rgba(138, 79, 255, 0.2),
                inset 0 0 20px rgba(138, 79, 255, 0.05);
  }
  100% {
    opacity: 0;
    transform: scale(0.85);
    border-color: rgba(138, 79, 255, 0);
    box-shadow: 0 0 0 rgba(138, 79, 255, 0);
  }
}

/* Scanline Effect */
.pwa-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(138, 79, 255, 0.03) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: scanlineFlicker 0.1s infinite;
}

.pwa-modal.active::before {
  opacity: 1;
}

@keyframes scanlineFlicker {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.7; }
}

/* Corner Brackets - Terminal HUD Style */
.pwa-modal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(to right, #8a4fff 2px, transparent 2px) 0 0,
    linear-gradient(to right, #8a4fff 2px, transparent 2px) 0 100%,
    linear-gradient(to left, #8a4fff 2px, transparent 2px) 100% 0,
    linear-gradient(to left, #8a4fff 2px, transparent 2px) 100% 100%,
    linear-gradient(to bottom, #8a4fff 2px, transparent 2px) 0 0,
    linear-gradient(to bottom, #8a4fff 2px, transparent 2px) 100% 0,
    linear-gradient(to top, #8a4fff 2px, transparent 2px) 0 100%,
    linear-gradient(to top, #8a4fff 2px, transparent 2px) 100% 100%;
  background-repeat: no-repeat;
  background-size: 30px 30px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}

.pwa-modal.active::after {
  animation: cornerBracketsBoot 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

@keyframes cornerBracketsBoot {
  0% {
    opacity: 0;
    background-size: 10px 10px;
  }
  100% {
    opacity: 0.8;
    background-size: 30px 30px;
  }
}

/* PWA Modal Header */
.pwa-modal-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: rgba(15, 15, 30, 0.8);
  border-bottom: 2px solid rgba(138, 79, 255, 0.4);
  min-height: 60px;
  position: relative;
  z-index: 3;
}

.pwa-modal-header::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent,
    #8a4fff 20%,
    #4a9eff 50%,
    #8a4fff 80%,
    transparent
  );
  animation: headerGlow 2s ease-in-out infinite;
}

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

.pwa-modal-back {
  background: rgba(138, 79, 255, 0.15);
  border: 1px solid rgba(138, 79, 255, 0.5);
  color: #8a4fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.95em;
  font-family: 'Orbitron', monospace;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.pwa-modal-back::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(138, 79, 255, 0.3), transparent);
  transition: left 0.5s;
}

.pwa-modal-back:hover::before {
  left: 100%;
}

.pwa-modal-back:hover {
  background: rgba(138, 79, 255, 0.25);
  border-color: #8a4fff;
  transform: translateX(-3px);
  box-shadow: 0 0 10px rgba(138, 79, 255, 0.5);
}

.pwa-modal-title {
  flex: 1;
  margin: 0;
  font-family: 'Orbitron', monospace;
  font-size: 1.3em;
  color: #8a4fff;
  text-shadow: 0 0 10px rgba(138, 79, 255, 0.8);
  letter-spacing: 1px;
  animation: titleFlicker 3s ease-in-out infinite;
}

@keyframes titleFlicker {
  0%, 100% { 
    text-shadow: 0 0 10px rgba(138, 79, 255, 0.8);
  }
  50% { 
    text-shadow: 0 0 20px rgba(138, 79, 255, 1),
                 0 0 30px rgba(74, 158, 255, 0.5);
  }
}

.pwa-modal-close {
  background: rgba(138, 79, 255, 0.15);
  border: 1px solid rgba(138, 79, 255, 0.5);
  color: #8a4fff;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  font-size: 1.3em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.5);
}

.pwa-modal-close:hover {
  background: rgba(138, 79, 255, 0.25);
  border-color: #8a4fff;
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.6);
}

/* PWA Modal Content */
.pwa-modal-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2a 100%);
  position: relative;
  z-index: 3;
}

/* Loading State */
.pwa-modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: #8a4fff;
}

.pwa-modal-loading p {
  margin-top: 20px;
  font-size: 1.1em;
  font-family: 'Orbitron', monospace;
  color: #8a4fff;
  text-shadow: 0 0 10px rgba(138, 79, 255, 0.8);
  animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Loading Spinner - Terminal Style */
.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(138, 79, 255, 0.2);
  border-top-color: #8a4fff;
  border-right-color: #4a9eff;
  border-radius: 50%;
  animation: spinnerRotate 1s linear infinite, spinnerGlow 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(138, 79, 255, 0.5),
              inset 0 0 20px rgba(138, 79, 255, 0.2);
}

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

@keyframes spinnerGlow {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(138, 79, 255, 0.5),
                inset 0 0 20px rgba(138, 79, 255, 0.2);
  }
  50% { 
    box-shadow: 0 0 40px rgba(138, 79, 255, 0.8),
                inset 0 0 30px rgba(138, 79, 255, 0.4);
  }
}

/* Error State */
.pwa-modal-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  padding: 40px;
}

.pwa-modal-error .error-icon {
  font-size: 4em;
  margin-bottom: 20px;
  animation: errorPulse 1s ease-in-out infinite;
}

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

.pwa-modal-error h3 {
  color: #ef4444;
  margin: 0 0 15px 0;
  font-size: 1.5em;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.pwa-modal-error p {
  color: #b0b0c0;
  margin: 0 0 25px 0;
  font-size: 1.05em;
}

.pwa-modal-error .btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #8a4fff 0%, #4a9eff 100%);
  color: white;
  border: 1px solid rgba(138, 79, 255, 0.6);
  border-radius: 4px;
  font-size: 1em;
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(138, 79, 255, 0.4);
}

.pwa-modal-error .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(138, 79, 255, 0.6);
}

/* Scrollbar for modal content */
.pwa-modal-content::-webkit-scrollbar {
  width: 10px;
}

.pwa-modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-left: 1px solid rgba(138, 79, 255, 0.2);
}

.pwa-modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8a4fff, #4a9eff);
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(138, 79, 255, 0.5);
}

.pwa-modal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #9a5fff, #5aaeFF);
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.8);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .pwa-modal {
    top: 2%;
    left: 2%;
    right: 2%;
    bottom: 2%;
  }

  .pwa-modal-header {
    padding: 12px 15px;
    min-height: 56px;
  }

  .pwa-modal-title {
    font-size: 1.1em;
  }

  .pwa-modal-back {
    padding: 6px 12px;
    font-size: 0.9em;
  }

  .pwa-modal-content {
    padding: 15px;
  }
}

/* ========================================
   ADJUSTMENTS FOR NO HEADER
   ======================================== */

/* Overlay Menu - No header offset */
.overlay-menu {
  top: 0 !important;
}

/* PWA Modal - Full screen with margins */
.pwa-modal {
  top: 2% !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .overlay-menu {
    top: 0 !important;
  }
  
  .pwa-modal {
    top: 1% !important;
    left: 1% !important;
    right: 1% !important;
    bottom: 1% !important;
  }
}

/* ========================================
   ASSET INFO PANELS - TERMINAL HUD STYLE
   ======================================== */

/* Asset Selection Menu (Multi-asset picker) */
.asset-selection-menu {
  position: fixed;
  background: rgba(10, 10, 26, 0.98);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(138, 79, 255, 0.6);
  border-radius: 8px;
  padding: 0;
  min-width: 280px;
  max-width: 400px;
  z-index: 2500;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8),
              0 0 30px rgba(138, 79, 255, 0.4);
  animation: menuPop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes menuPop {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Scanline effect */
.asset-selection-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(138, 79, 255, 0.03) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  border-radius: 8px;
}

.selection-menu-header {
  padding: 15px 18px;
  border-bottom: 2px solid rgba(138, 79, 255, 0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 15, 30, 0.8);
  border-radius: 6px 6px 0 0;
}

.selection-menu-header h3 {
  margin: 0;
  font-family: 'Orbitron', monospace;
  font-size: 1.1em;
  color: #8a4fff;
  text-shadow: 0 0 10px rgba(138, 79, 255, 0.8);
  letter-spacing: 1px;
}

.close-menu-btn {
  background: rgba(138, 79, 255, 0.15);
  border: 1px solid rgba(138, 79, 255, 0.5);
  color: #8a4fff;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  font-size: 1.2em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.5);
}

.close-menu-btn:hover {
  background: rgba(138, 79, 255, 0.25);
  border-color: #8a4fff;
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.6);
}

.selection-menu-list {
  padding: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.selection-menu-item {
  padding: 12px 15px;
  margin-bottom: 6px;
  background: rgba(138, 79, 255, 0.08);
  border: 1px solid rgba(138, 79, 255, 0.25);
  border-left: 3px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Orbitron', monospace;
}

.selection-menu-item:last-child {
  margin-bottom: 0;
}

.selection-menu-item:hover {
  background: rgba(138, 79, 255, 0.15);
  border-color: rgba(138, 79, 255, 0.5);
  border-left-color: #8a4fff;
  transform: translateX(5px);
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.3);
}

.selection-menu-item-title {
  font-size: 1em;
  font-weight: 600;
  color: #e0e0ff;
  margin-bottom: 4px;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.4);
}

.selection-menu-item-type {
  font-size: 0.75em;
  color: #8a4fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Info Pane Backdrop Overlay */
#infoPaneBackdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#infoPaneBackdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Side Panel (Asset Details) - Enhanced Modal Style */
.side-panel,
#infoPane {
  position: fixed;
  top: 60px;
  right: -340px;
  width: 320px;
  max-height: calc(100vh - 70px);
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(5px);
  border: 2px solid rgba(138, 79, 255, 0);
  border-radius: 8px;
  box-shadow: -5px 0 40px rgba(0, 0, 0, 0);
  z-index: 9999;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.4s ease,
              box-shadow 0.4s ease,
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9);
}

.side-panel.active,
.side-panel.visible,
#infoPane.active,
#infoPane.visible {
  right: 10px;
  border-color: rgba(138, 79, 255, 0.6);
  box-shadow: -5px 0 40px rgba(0, 0, 0, 0.7),
              0 0 30px rgba(138, 79, 255, 0.3),
              0 0 60px rgba(138, 79, 255, 0.5);
  transform: scale(1);
}

/* Scanline for side panel */
.side-panel::before,
#infoPane::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(138, 79, 255, 0.03) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s;
  border-radius: 8px;
}

.side-panel.active::before,
.side-panel.visible::before,
#infoPane.active::before,
#infoPane.visible::before {
  opacity: 1;
}

/* Corner brackets for side panel */
.side-panel::after,
#infoPane::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 30px;
  background: 
    linear-gradient(to bottom, #8a4fff 2px, transparent 2px) 0 0,
    linear-gradient(to bottom, #8a4fff 2px, transparent 2px) 0 100%;
  background-repeat: no-repeat;
  background-size: 30px 30px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s 0.2s;
}

.side-panel.active::after,
.side-panel.visible::after,
#infoPane.active::after,
#infoPane.visible::after {
  opacity: 0.8;
}

.panel-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(138, 79, 255, 0.2);
  border: 1px solid rgba(138, 79, 255, 0.4);
  border-radius: 50%;
  color: #8a4fff;
  font-size: 1.2em;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
  font-family: 'Orbitron', monospace;
}

.panel-close-btn:hover {
  background: rgba(138, 79, 255, 0.3);
  border-color: #8a4fff;
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.5);
  transform: scale(1.1);
}

.panel-section {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  padding-top: 40px;
  position: relative;
  z-index: 3;
}

#assetInfo {
  font-family: 'Orbitron', monospace;
  color: #e0e0ff;
}

.zone-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.asset-info-header {
  padding-bottom: 15px;
  margin-bottom: 20px;
  border-bottom: 2px solid rgba(138, 79, 255, 0.4);
}

.asset-info-title {
  font-size: 1.6em;
  color: #8a4fff;
  margin: 0 0 10px 0;
  text-shadow: 0 0 15px rgba(138, 79, 255, 0.8);
  letter-spacing: 2px;
  animation: titleFlicker 4s ease-in-out infinite;
}

.asset-info-type {
  font-size: 0.85em;
  color: #6a6a8a;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.asset-info-section {
  margin-bottom: 20px;
}

.asset-info-section h4 {
  font-size: 1em;
  color: #8a4fff;
  margin: 0 0 10px 0;
  text-shadow: 0 0 8px rgba(138, 79, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.asset-info-section p {
  color: #b0b0c0;
  line-height: 1.6;
  margin: 0;
}

.asset-info-data {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 15px;
  padding: 15px;
  background: rgba(138, 79, 255, 0.05);
  border: 1px solid rgba(138, 79, 255, 0.2);
  border-radius: 4px;
}

.asset-info-label {
  color: #8a8aaa;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.asset-info-value {
  color: #e0e0ff;
  font-weight: 600;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.3);
}

/* Info section styles (for displayAssetInfo function) */
.info-section {
  margin-bottom: 16px;
  background: rgba(138, 79, 255, 0.03);
  border: 1px solid rgba(138, 79, 255, 0.15);
  border-radius: 6px;
  padding: 10px;
}

.info-section h4 {
  font-size: 0.75em;
  color: #8a4fff;
  margin: 0 0 8px 0;
  text-shadow: 0 0 8px rgba(138, 79, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  font-size: 0.7em;
}

.info-item.full-width {
  grid-column: 1 / -1;
}

.info-label {
  color: #8a8aaa;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 400;
}

.info-value {
  color: #e0e0ff;
  font-weight: 600;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.3);
}

.asset-info-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.asset-action-btn {
  flex: 1;
  padding: 12px;
  background: linear-gradient(135deg, rgba(138, 79, 255, 0.2), rgba(74, 158, 255, 0.2));
  border: 1px solid rgba(138, 79, 255, 0.5);
  color: #8a4fff;
  border-radius: 6px;
  font-family: 'Orbitron', monospace;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s ease;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.5);
}

.asset-action-btn:hover {
  background: linear-gradient(135deg, rgba(138, 79, 255, 0.3), rgba(74, 158, 255, 0.3));
  border-color: #8a4fff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(138, 79, 255, 0.4);
}

/* Travel action styles */
.travel-action-bar {
  margin: 12px 0;
  padding: 10px;
  background: rgba(138, 79, 255, 0.05);
  border: 1px solid rgba(138, 79, 255, 0.2);
  border-radius: 6px;
}

.travel-action-bar.disabled {
  opacity: 0.6;
}

.travel-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(138, 79, 255, 0.2), rgba(74, 158, 255, 0.2));
  border: 1px solid rgba(138, 79, 255, 0.4);
  border-radius: 6px;
  color: #8a4fff;
  font-family: 'Orbitron', monospace;
  font-size: 0.75em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.travel-btn:hover {
  background: linear-gradient(135deg, rgba(138, 79, 255, 0.3), rgba(74, 158, 255, 0.3));
  border-color: #8a4fff;
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.4);
  transform: translateY(-1px);
}

.travel-btn.explore-btn {
  background: linear-gradient(135deg, rgba(0, 255, 159, 0.2), rgba(0, 200, 130, 0.2));
  border-color: rgba(0, 255, 159, 0.4);
  color: #00ff9f;
}

.travel-btn.explore-btn:hover {
  background: linear-gradient(135deg, rgba(0, 255, 159, 0.3), rgba(0, 200, 130, 0.3));
  border-color: #00ff9f;
  box-shadow: 0 0 15px rgba(0, 255, 159, 0.4);
}

.travel-icon {
  font-size: 1.2em;
}

.travel-text {
  flex: 1;
  text-align: center;
}

.travel-distance {
  font-size: 0.85em;
  color: #b0b0c0;
  opacity: 0.8;
}

.travel-unavailable {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  color: #666;
  font-size: 0.75em;
  font-family: 'Orbitron', monospace;
}

.travel-hint {
  font-size: 0.7em;
  color: #8a8aaa;
  margin-top: 6px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  line-height: 1.4;
}

.travel-path-info {
  margin-top: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-size: 0.7em;
}

.path-label {
  color: #8a4fff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 6px;
}

.path-route {
  color: #b0b0c0;
  line-height: 1.5;
}

.exploration-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px;
  margin-top: 8px;
  background: rgba(138, 79, 255, 0.05);
  border-left: 2px solid rgba(138, 79, 255, 0.4);
  border-radius: 4px;
  font-size: 0.7em;
  color: #b0b0c0;
  line-height: 1.4;
}

.hint-icon {
  font-size: 1.2em;
  flex-shrink: 0;
}

/* Asset header in panel */
.asset-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(138, 79, 255, 0.3);
}

.asset-icon-large {
  font-size: 2.5em;
  line-height: 1;
}

.asset-title-section {
  flex: 1;
}

.asset-title {
  font-size: 1.1em;
  margin: 0 0 6px 0;
  color: #e0e0ff;
  text-shadow: 0 0 10px rgba(138, 79, 255, 0.4);
  line-height: 1.2;
}

.asset-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge {
  padding: 2px 6px;
  font-size: 0.65em;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.badge-galaxy {
  background: rgba(138, 79, 255, 0.2);
  color: #8a4fff;
  border: 1px solid rgba(138, 79, 255, 0.4);
}

.badge-orbital {
  background: rgba(74, 158, 255, 0.2);
  color: #4a9eff;
  border: 1px solid rgba(74, 158, 255, 0.4);
}

.badge-planet {
  background: rgba(0, 200, 130, 0.2);
  color: #00c882;
  border: 1px solid rgba(0, 200, 130, 0.4);
}

.badge-anomaly {
  background: rgba(255, 159, 0, 0.2);
  color: #ff9f00;
  border: 1px solid rgba(255, 159, 0, 0.4);
}

.badge-subtype {
  background: rgba(255, 255, 255, 0.05);
  color: #b0b0c0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-hub {
  background: rgba(0, 255, 159, 0.2);
  color: #00ff9f;
  border: 1px solid rgba(0, 255, 159, 0.4);
}

.badge-common {
  background: rgba(200, 200, 200, 0.1);
  color: #c8c8c8;
  border: 1px solid rgba(200, 200, 200, 0.3);
}

.badge-uncommon {
  background: rgba(0, 200, 130, 0.2);
  color: #00c882;
  border: 1px solid rgba(0, 200, 130, 0.4);
}

.badge-rare {
  background: rgba(74, 158, 255, 0.2);
  color: #4a9eff;
  border: 1px solid rgba(74, 158, 255, 0.4);
}

.badge-epic {
  background: rgba(138, 79, 255, 0.2);
  color: #8a4fff;
  border: 1px solid rgba(138, 79, 255, 0.4);
}

.badge-legendary {
  background: rgba(255, 159, 0, 0.2);
  color: #ff9f00;
  border: 1px solid rgba(255, 159, 0, 0.4);
}

.string-domain {
  color: #00ff9f !important;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0, 255, 159, 0.5);
}

/* Effects list */
.effects-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.effect-item {
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 2px solid rgba(138, 79, 255, 0.4);
  border-radius: 3px;
  font-size: 0.7em;
}

.effect-item strong {
  color: #8a4fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.95em;
  display: block;
  margin-bottom: 3px;
}

.effect-item p {
  color: #b0b0c0;
  margin: 3px 0;
  line-height: 1.4;
}

.effect-value {
  color: #e0e0ff;
  font-weight: 600;
  display: inline-block;
  margin-right: 6px;
}

.effect-tag {
  padding: 1px 4px;
  background: rgba(138, 79, 255, 0.2);
  border-radius: 2px;
  color: #8a4fff;
  font-size: 0.9em;
}

/* Lore text */
.lore-text {
  color: #b0b0c0;
  line-height: 1.6;
  margin: 0 0 8px 0;
  font-size: 0.75em;
  font-style: italic;
}

.flavor-text {
  color: #8a8aaa;
  line-height: 1.5;
  margin: 0;
  font-size: 0.7em;
  font-style: italic;
  opacity: 0.9;
}

/* Scrollbars for panels */
.selection-menu-list::-webkit-scrollbar,
.panel-section::-webkit-scrollbar {
  width: 8px;
}

.selection-menu-list::-webkit-scrollbar-track,
.panel-section::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-left: 1px solid rgba(138, 79, 255, 0.2);
}

.selection-menu-list::-webkit-scrollbar-thumb,
.panel-section::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8a4fff, #4a9eff);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(138, 79, 255, 0.5);
}

.selection-menu-list::-webkit-scrollbar-thumb:hover,
.panel-section::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #9a5fff, #5aaeFF);
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.8);
}

/* ========================================
   MOBILE RESPONSIVE FOR INFO PANELS
   ======================================== */

@media (max-width: 768px) {
  /* Asset selection menu */
  .asset-selection-menu {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%);
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
  }

  .asset-selection-menu[style*="display: block"] {
    transform: translate(-50%, -50%) !important;
  }

  .selection-menu-list {
    max-height: 300px;
  }

  /* Side panel - full width bottom sheet */
  .side-panel,
  #infoPane {
    top: auto;
    right: auto;
    left: 0;
    bottom: -100%;
    width: 100vw;
    max-height: 60vh;
    height: auto;
    border-radius: 12px 12px 0 0;
    border: none;
    border-top: 2px solid rgba(138, 79, 255, 0.6);
    z-index: 9999;
    overflow: hidden;
    transform: scale(1);
  }

  .side-panel.active,
  .side-panel.visible,
  #infoPane.active,
  #infoPane.visible {
    bottom: 0;
    right: auto;
    transform: scale(1);
  }

  .panel-section {
    padding: 12px;
    padding-top: 40px;
  }

  .panel-close-btn {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    font-size: 1.3em;
  }

  .asset-info-title {
    font-size: 1.1em;
  }

  .asset-title {
    font-size: 1em;
  }

  .asset-icon-large {
    font-size: 2em;
  }

  .asset-info-actions {
    flex-direction: column;
  }

  .asset-action-btn {
    width: 100%;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .travel-btn {
    font-size: 0.7em;
    padding: 8px 10px;
  }
}

@media (max-width: 480px) {
  .asset-selection-menu {
    min-width: 260px;
    max-width: calc(100vw - 30px);
  }

  .selection-menu-header {
    padding: 12px 15px;
  }

  .selection-menu-header h3 {
    font-size: 1em;
  }

  .selection-menu-item {
    padding: 10px 12px;
  }

  .side-panel {
    max-height: 55vh;
  }

  .panel-section {
    padding: 10px;
    max-height: calc(55vh - 60px);
    overflow-y: auto;
  }

  .asset-info-title {
    font-size: 1em;
    letter-spacing: 0.5px;
  }

  .info-section {
    padding: 8px;
    margin-bottom: 10px;
  }

  .info-section h4 {
    font-size: 0.7em;
  }

  .info-item {
    font-size: 0.65em;
    padding: 3px 5px;
  }
}

/* Fix for side panel - support both 'visible' and 'active' classes */
.side-panel.visible {
  right: 10px;
  border-color: rgba(138, 79, 255, 0.6);
  box-shadow: -5px 0 40px rgba(0, 0, 0, 0.7),
              0 0 30px rgba(138, 79, 255, 0.3);
}

.side-panel.visible::before {
  opacity: 1;
}

.side-panel.visible::after {
  opacity: 0.8;
}

/* Mobile fix for visible class */
@media (max-width: 768px) {
  .side-panel.visible {
    bottom: 0;
    right: auto;
  }
}

/* ========================================
   PWA MODAL CONTENT RESPONSIVE DESIGN
   Universal styles for all loaded content
   ======================================== */

/* Override loaded page styles for mobile responsiveness */
@media (max-width: 768px) {
  /* Force responsive layout for tome sidebar */
  .pwa-modal-content .tome-layout {
    flex-direction: column !important;
    padding-top: 0 !important;
  }

  .pwa-modal-content .tome-sidebar {
    position: relative !important;
    width: 100% !important;
    top: 0 !important;
    left: 0 !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(138, 79, 255, 0.2) !important;
    max-height: 200px !important;
    overflow-y: auto !important;
  }

  .pwa-modal-content .sidebar-header {
    padding: 12px 15px !important;
  }

  .pwa-modal-content .sidebar-title {
    font-size: 1.1em !important;
  }

  .pwa-modal-content .sidebar-subtitle {
    font-size: 0.7em !important;
  }

  .pwa-modal-content .nav-item {
    padding: 10px 15px !important;
    font-size: 0.9em !important;
  }

  .pwa-modal-content .nav-icon {
    font-size: 1em !important;
    margin-right: 10px !important;
  }

  /* Main content area adjustments */
  .pwa-modal-content .tome-main {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 15px !important;
  }

  /* Content sections */
  .pwa-modal-content .content-section {
    padding: 12px !important;
  }

  .pwa-modal-content .section-header h2 {
    font-size: 1.2em !important;
  }

  /* Cards and grids - force single column */
  .pwa-modal-content .asset-grid,
  .pwa-modal-content .character-grid,
  .pwa-modal-content .card-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Card styling */
  .pwa-modal-content .card,
  .pwa-modal-content .asset-card,
  .pwa-modal-content .character-card {
    padding: 12px !important;
  }

  /* Text sizing */
  .pwa-modal-content h1 {
    font-size: 1.5em !important;
    line-height: 1.3 !important;
  }

  .pwa-modal-content h2 {
    font-size: 1.3em !important;
    line-height: 1.3 !important;
  }

  .pwa-modal-content h3 {
    font-size: 1.1em !important;
    line-height: 1.3 !important;
  }

  .pwa-modal-content h4 {
    font-size: 1em !important;
    line-height: 1.3 !important;
  }

  .pwa-modal-content p,
  .pwa-modal-content li {
    font-size: 0.9em !important;
    line-height: 1.5 !important;
  }

  /* Tables - make scrollable */
  .pwa-modal-content table {
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    font-size: 0.85em !important;
  }

  .pwa-modal-content th,
  .pwa-modal-content td {
    padding: 8px 6px !important;
    font-size: 0.9em !important;
  }

  /* Forms */
  .pwa-modal-content .form-group {
    margin-bottom: 15px !important;
  }

  .pwa-modal-content input,
  .pwa-modal-content textarea,
  .pwa-modal-content select {
    font-size: 1em !important;
    padding: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .pwa-modal-content button,
  .pwa-modal-content .btn {
    font-size: 0.9em !important;
    padding: 10px 15px !important;
    width: 100% !important;
    margin-bottom: 8px !important;
  }

  /* Buttons in flex containers should still fill width */
  .pwa-modal-content .button-group button,
  .pwa-modal-content .button-group .btn {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  /* Images - responsive */
  .pwa-modal-content img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Lists */
  .pwa-modal-content ul,
  .pwa-modal-content ol {
    padding-left: 20px !important;
  }

  /* Hide elements that don't work well on mobile */
  .pwa-modal-content .desktop-only {
    display: none !important;
  }

  /* Asset workshop specific */
  .pwa-modal-content .workshop-filters {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .pwa-modal-content .filter-group {
    width: 100% !important;
  }

  /* Character list specific */
  .pwa-modal-content .character-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  /* Profile specific */
  .pwa-modal-content .profile-layout {
    flex-direction: column !important;
  }

  .pwa-modal-content .profile-sidebar {
    width: 100% !important;
    margin-bottom: 15px !important;
  }

  /* Admin panel specific */
  .pwa-modal-content .admin-grid {
    grid-template-columns: 1fr !important;
  }

  .pwa-modal-content .stat-card {
    padding: 12px !important;
  }

  /* Inventory specific */
  .pwa-modal-content .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
  }

  .pwa-modal-content .inventory-item {
    font-size: 0.8em !important;
  }

  /* Voting specific */
  .pwa-modal-content .voting-card {
    padding: 12px !important;
  }

  .pwa-modal-content .vote-buttons {
    flex-direction: column !important;
    gap: 8px !important;
  }

  /* Badge and tag sizing */
  .pwa-modal-content .badge,
  .pwa-modal-content .tag {
    font-size: 0.75em !important;
    padding: 3px 6px !important;
  }

  /* Modals within modals (nested) */
  .pwa-modal-content .modal {
    width: 95% !important;
    max-width: none !important;
    margin: 10px auto !important;
  }

  /* Code blocks */
  .pwa-modal-content pre,
  .pwa-modal-content code {
    font-size: 0.8em !important;
    overflow-x: auto !important;
  }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
  .pwa-modal-content .tome-sidebar {
    max-height: 150px !important;
  }

  .pwa-modal-content h1 {
    font-size: 1.3em !important;
  }

  .pwa-modal-content h2 {
    font-size: 1.2em !important;
  }

  .pwa-modal-content h3 {
    font-size: 1em !important;
  }

  .pwa-modal-content p,
  .pwa-modal-content li {
    font-size: 0.85em !important;
  }

  .pwa-modal-content .nav-item {
    padding: 8px 12px !important;
    font-size: 0.85em !important;
  }

  .pwa-modal-content button,
  .pwa-modal-content .btn {
    font-size: 0.85em !important;
    padding: 8px 12px !important;
  }

  .pwa-modal-content .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)) !important;
  }
}

/* Project Title Mobile Responsive */
@media (max-width: 768px) {
  .project-title-overlay {
    top: 10px;
    right: 10px;
  }

  .project-title {
    font-size: 1.2em;
    letter-spacing: 1px;
  }

  .project-subtitle {
    font-size: 0.65em;
    letter-spacing: 2px;
  }
}

@media (max-width: 480px) {
  .project-title {
    font-size: 1em;
    letter-spacing: 0.5px;
  }

  .project-subtitle {
    font-size: 0.6em;
    letter-spacing: 1.5px;
  }
}

/* ========================================
   NESTED MODALS - TERMINAL HUD STYLE
   Modals that appear within PWA modal content
   ======================================== */

/* Second-level modals (within PWA modal content) */
.pwa-modal-content .modal {
  display: none;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 90% !important;
  max-width: 800px !important;
  max-height: 85vh !important;
  margin: 0 !important;
  z-index: 10000 !important;
  background: rgba(10, 10, 26, 0.98) !important;
  backdrop-filter: blur(20px) !important;
  border: 2px solid rgba(138, 79, 255, 0.6) !important;
  border-radius: 8px !important;
  box-shadow: 0 0 50px rgba(138, 79, 255, 0.4),
              0 0 100px rgba(0, 0, 0, 0.8) !important;
  overflow: hidden !important;
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.pwa-modal-content .modal.active,
.pwa-modal-content .modal[style*="display: block"],
.pwa-modal-content .modal[style*="display:block"] {
  display: flex !important;
  flex-direction: column !important;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Modal backdrop */
.pwa-modal-content .modal-overlay,
.pwa-modal-content .modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 0, 0, 0.7) !important;
  backdrop-filter: blur(4px) !important;
  z-index: 9999 !important;
}

/* Modal scanlines effect */
.pwa-modal-content .modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(138, 79, 255, 0.03) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

/* Modal content area */
.pwa-modal-content .modal-content {
  background: transparent !important;
  color: #e0e0ff !important;
  padding: 20px !important;
  border-radius: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  margin: 0 !important;
  box-shadow: none !important;
  position: relative !important;
  z-index: 2 !important;
  flex: 1 !important;
}

/* Modal header */
.pwa-modal-content .modal-header {
  background: rgba(138, 79, 255, 0.1) !important;
  border-bottom: 2px solid rgba(138, 79, 255, 0.4) !important;
  padding: 15px 20px !important;
  margin: -20px -20px 20px -20px !important;
  position: sticky !important;
  top: -20px !important;
  z-index: 10 !important;
}

.pwa-modal-content .modal-header h2,
.pwa-modal-content .modal-header h3 {
  color: #8a4fff !important;
  font-family: 'Orbitron', monospace !important;
  margin: 0 !important;
  font-size: 1.3em !important;
  text-shadow: 0 0 10px rgba(138, 79, 255, 0.6) !important;
}

.pwa-modal-content .modal-header p {
  color: #b0b0c0 !important;
  margin: 5px 0 0 0 !important;
  font-size: 0.9em !important;
}

/* Modal close button */
.pwa-modal-content .modal-close,
.pwa-modal-content .close-modal {
  position: absolute !important;
  top: 15px !important;
  right: 15px !important;
  width: 32px !important;
  height: 32px !important;
  background: rgba(138, 79, 255, 0.2) !important;
  border: 1px solid rgba(138, 79, 255, 0.4) !important;
  border-radius: 50% !important;
  color: #8a4fff !important;
  font-size: 1.2em !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 20 !important;
  transition: all 0.2s ease !important;
  font-family: 'Orbitron', monospace !important;
  line-height: 1 !important;
  padding: 0 !important;
  text-decoration: none !important;
}

.pwa-modal-content .modal-close:hover,
.pwa-modal-content .close-modal:hover {
  background: rgba(138, 79, 255, 0.3) !important;
  border-color: #8a4fff !important;
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.5) !important;
  transform: scale(1.1) !important;
  color: #8a4fff !important;
}

/* Modal body content styling */
.pwa-modal-content .modal-body {
  color: #e0e0ff !important;
  line-height: 1.6 !important;
}

.pwa-modal-content .modal-body h3 {
  color: #8a4fff !important;
  font-family: 'Orbitron', monospace !important;
  font-size: 1.1em !important;
  margin: 20px 0 10px 0 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
}

.pwa-modal-content .modal-body p {
  color: #b0b0c0 !important;
  margin: 10px 0 !important;
}

/* Stats, effects, and lore displays */
.pwa-modal-content .stats-display,
.pwa-modal-content .effects-display,
.pwa-modal-content .lore-display {
  background: rgba(138, 79, 255, 0.05) !important;
  border: 1px solid rgba(138, 79, 255, 0.2) !important;
  border-radius: 6px !important;
  padding: 15px !important;
  margin: 15px 0 !important;
}

.pwa-modal-content .stats-display h4,
.pwa-modal-content .effects-display h4,
.pwa-modal-content .lore-display h4 {
  color: #8a4fff !important;
  border-bottom: 2px solid rgba(138, 79, 255, 0.4) !important;
  padding-bottom: 8px !important;
  margin: 0 0 12px 0 !important;
  font-family: 'Orbitron', monospace !important;
  font-size: 1em !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
}

.pwa-modal-content .stats-display ul,
.pwa-modal-content .effects-display ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.pwa-modal-content .stats-display li,
.pwa-modal-content .effects-display li {
  background: rgba(0, 0, 0, 0.3) !important;
  border-left: 3px solid #8a4fff !important;
  color: #e0e0ff !important;
  padding: 8px 12px !important;
  margin: 6px 0 !important;
  border-radius: 4px !important;
}

.pwa-modal-content .flavor-text {
  color: #8a8aaa !important;
  font-style: italic !important;
  background: rgba(0, 0, 0, 0.2) !important;
  padding: 12px !important;
  border-radius: 4px !important;
  border-left: 2px solid rgba(138, 79, 255, 0.3) !important;
}

/* Modal images */
.pwa-modal-content .modal img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 6px !important;
  border: 2px solid rgba(138, 79, 255, 0.3) !important;
  box-shadow: 0 0 20px rgba(138, 79, 255, 0.2) !important;
}

/* Modal scrollbar */
.pwa-modal-content .modal-content::-webkit-scrollbar {
  width: 8px;
}

.pwa-modal-content .modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.pwa-modal-content .modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8a4fff, #4a9eff);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(138, 79, 255, 0.5);
}

.pwa-modal-content .modal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #9a5fff, #5aaeFF);
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.8);
}

/* Third-level modals (modals within modals) */
.pwa-modal-content .modal .modal {
  z-index: 10001 !important;
  max-width: 700px !important;
}

.pwa-modal-content .modal .modal-overlay {
  z-index: 10000 !important;
}

/* Mobile responsive for nested modals */
@media (max-width: 768px) {
  .pwa-modal-content .modal {
    width: 95% !important;
    max-height: 90vh !important;
  }

  .pwa-modal-content .modal-content {
    padding: 15px !important;
  }

  .pwa-modal-content .modal-header {
    padding: 12px 15px !important;
    margin: -15px -15px 15px -15px !important;
  }

  .pwa-modal-content .modal-header h2,
  .pwa-modal-content .modal-header h3 {
    font-size: 1.1em !important;
    padding-right: 35px !important;
  }

  .pwa-modal-content .modal-close,
  .pwa-modal-content .close-modal {
    top: 12px !important;
    right: 12px !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 1.3em !important;
  }

  .pwa-modal-content .stats-display,
  .pwa-modal-content .effects-display,
  .pwa-modal-content .lore-display {
    padding: 12px !important;
  }
}

@media (max-width: 480px) {
  .pwa-modal-content .modal {
    width: 98% !important;
    max-height: 95vh !important;
  }

  .pwa-modal-content .modal-content {
    padding: 12px !important;
  }

  .pwa-modal-content .modal-header h2,
  .pwa-modal-content .modal-header h3 {
    font-size: 1em !important;
  }
}

/* ========================================
   PWA MODAL ACTIVE STATES
   Styling for active modal states
   ======================================== */

/* Main PWA Modal Active State */
.pwa-modalActive,
.pwa-modal-active {
  z-index: 2000 !important;
  pointer-events: all !important;
}

/* Body lock when modal is active */
body.pwa-modalActive,
body.pwa-modal-active,
body.modal-open {
  overflow: hidden !important;
}

/* Active nested modal within PWA content */
.pwa-modal-content .modal.active,
.pwa-modal-content .modal.pwa-modalActive,
.pwa-modal-content .modal.pwa-modal-active {
  display: flex !important;
  flex-direction: column !important;
  pointer-events: all !important;
}

/* Active modal backdrop */
.pwa-modal-content .modal-backdrop.active,
.pwa-modal-content .modal-overlay.active {
  display: block !important;
  opacity: 1 !important;
}

/* Dim background content when modal is active */
.pwa-modal-content.has-active-modal {
  filter: brightness(0.5);
  pointer-events: none;
}

.pwa-modal-content .modal.active ~ * {
  filter: brightness(0.7);
}

/* Active modal animations */
.pwa-modal-content .modal.active {
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Modal closing animation */
.pwa-modal-content .modal.closing {
  animation: modalSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

@keyframes modalSlideOut {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
}

/* Active state indicators */
.pwa-modal-content .modal.active::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid rgba(138, 79, 255, 0.8);
  border-radius: 8px;
  pointer-events: none;
  z-index: 999;
  box-shadow: 0 0 40px rgba(138, 79, 255, 0.6);
  animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderPulse {
  0%, 100% {
    border-color: rgba(138, 79, 255, 0.6);
    box-shadow: 0 0 30px rgba(138, 79, 255, 0.4);
  }
  50% {
    border-color: rgba(138, 79, 255, 0.9);
    box-shadow: 0 0 50px rgba(138, 79, 255, 0.7);
  }
}

/* Active buttons and interactive elements */
.pwa-modal-content .modal.active button:hover,
.pwa-modal-content .modal.active .btn:hover {
  background: rgba(138, 79, 255, 0.3) !important;
  border-color: #8a4fff !important;
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.5) !important;
}

/* Active form inputs */
.pwa-modal-content .modal.active input:focus,
.pwa-modal-content .modal.active textarea:focus,
.pwa-modal-content .modal.active select:focus {
  border-color: #8a4fff !important;
  box-shadow: 0 0 0 2px rgba(138, 79, 255, 0.3) !important;
  outline: none !important;
}

/* Stacking context for multiple active modals */
.pwa-modal-content .modal.active.level-1 {
  z-index: 10000 !important;
}

.pwa-modal-content .modal.active.level-2 {
  z-index: 10001 !important;
}

.pwa-modal-content .modal.active.level-3 {
  z-index: 10002 !important;
}

/* Active state accessibility */
.pwa-modal-content .modal.active[aria-hidden="false"] {
  display: flex !important;
}

.pwa-modal-content .modal:not(.active)[aria-hidden="true"] {
  display: none !important;
}

/* Mobile active modal states */
@media (max-width: 768px) {
  .pwa-modal-content .modal.active {
    width: 95% !important;
    max-height: 90vh !important;
  }

  .pwa-modal-content .modal.active::after {
    border-width: 2px;
  }
}

@media (max-width: 480px) {
  .pwa-modal-content .modal.active {
    width: 98% !important;
    max-height: 95vh !important;
  }
}

/* ========================================
   SIDE PANEL NESTED DOM STYLING
   Comprehensive styles for all elements inside the info panel
   ======================================== */

/* General nested elements in side panel */
.side-panel .panel-section * {
  box-sizing: border-box;
}

/* Headings in side panel */
.side-panel .panel-section h1,
.side-panel #assetInfo h1 {
  font-family: 'Orbitron', monospace !important;
  font-size: 1.4em !important;
  color: #8a4fff !important;
  margin: 0 0 15px 0 !important;
  text-shadow: 0 0 10px rgba(138, 79, 255, 0.6) !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
}

.side-panel .panel-section h2,
.side-panel #assetInfo h2 {
  font-family: 'Orbitron', monospace !important;
  font-size: 1.2em !important;
  color: #8a4fff !important;
  margin: 15px 0 10px 0 !important;
  text-shadow: 0 0 8px rgba(138, 79, 255, 0.5) !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
}

.side-panel .panel-section h3,
.side-panel #assetInfo h3 {
  font-family: 'Orbitron', monospace !important;
  font-size: 1em !important;
  color: #8a4fff !important;
  margin: 12px 0 8px 0 !important;
  text-shadow: 0 0 6px rgba(138, 79, 255, 0.4) !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.side-panel .panel-section h4,
.side-panel #assetInfo h4 {
  font-family: 'Orbitron', monospace !important;
  font-size: 0.9em !important;
  color: #8a4fff !important;
  margin: 10px 0 6px 0 !important;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.3) !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* Paragraphs and text */
.side-panel .panel-section p,
.side-panel #assetInfo p {
  color: #b0b0c0 !important;
  font-size: 0.85em !important;
  line-height: 1.6 !important;
  margin: 0 0 10px 0 !important;
}

.side-panel .panel-section strong,
.side-panel #assetInfo strong {
  color: #e0e0ff !important;
  font-weight: 600 !important;
}

.side-panel .panel-section em,
.side-panel #assetInfo em {
  color: #9a9aaa !important;
  font-style: italic !important;
}

/* Links */
.side-panel .panel-section a,
.side-panel #assetInfo a {
  color: #8a4fff !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

.side-panel .panel-section a:hover,
.side-panel #assetInfo a:hover {
  color: #9a5fff !important;
  text-shadow: 0 0 8px rgba(138, 79, 255, 0.6) !important;
}

/* Lists */
.side-panel .panel-section ul,
.side-panel #assetInfo ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 12px 0 !important;
}

.side-panel .panel-section ol,
.side-panel #assetInfo ol {
  padding-left: 20px !important;
  margin: 0 0 12px 0 !important;
  color: #b0b0c0 !important;
}

.side-panel .panel-section li,
.side-panel #assetInfo li {
  padding: 6px 10px !important;
  margin: 4px 0 !important;
  background: rgba(0, 0, 0, 0.2) !important;
  border-left: 2px solid rgba(138, 79, 255, 0.4) !important;
  border-radius: 3px !important;
  color: #b0b0c0 !important;
  font-size: 0.85em !important;
  line-height: 1.5 !important;
}

/* Divs and containers */
.side-panel .panel-section div,
.side-panel #assetInfo div {
  color: #e0e0ff !important;
}

/* Spans */
.side-panel .panel-section span,
.side-panel #assetInfo span {
  color: inherit !important;
}

/* Buttons */
.side-panel .panel-section button,
.side-panel #assetInfo button {
  font-family: 'Orbitron', monospace !important;
  background: linear-gradient(135deg, rgba(138, 79, 255, 0.2), rgba(74, 158, 255, 0.2)) !important;
  border: 1px solid rgba(138, 79, 255, 0.4) !important;
  color: #8a4fff !important;
  padding: 8px 12px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-size: 0.85em !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin: 4px 2px !important;
}

.side-panel .panel-section button:hover,
.side-panel #assetInfo button:hover {
  background: linear-gradient(135deg, rgba(138, 79, 255, 0.3), rgba(74, 158, 255, 0.3)) !important;
  border-color: #8a4fff !important;
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.4) !important;
  transform: translateY(-1px) !important;
}

.side-panel .panel-section button:active,
.side-panel #assetInfo button:active {
  transform: translateY(0) !important;
}

/* Images */
.side-panel .panel-section img,
.side-panel #assetInfo img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 6px !important;
  border: 2px solid rgba(138, 79, 255, 0.3) !important;
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.2) !important;
  margin: 10px 0 !important;
}

/* Code blocks */
.side-panel .panel-section code,
.side-panel #assetInfo code {
  background: rgba(0, 0, 0, 0.4) !important;
  color: #4a9eff !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
  font-family: 'Courier New', monospace !important;
  font-size: 0.9em !important;
}

.side-panel .panel-section pre,
.side-panel #assetInfo pre {
  background: rgba(0, 0, 0, 0.4) !important;
  color: #e0e0ff !important;
  padding: 12px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(138, 79, 255, 0.2) !important;
  overflow-x: auto !important;
  font-family: 'Courier New', monospace !important;
  font-size: 0.8em !important;
  line-height: 1.5 !important;
}

/* Horizontal rules */
.side-panel .panel-section hr,
.side-panel #assetInfo hr {
  border: none !important;
  border-top: 1px solid rgba(138, 79, 255, 0.3) !important;
  margin: 15px 0 !important;
}

/* Tables */
.side-panel .panel-section table,
.side-panel #assetInfo table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 12px 0 !important;
  font-size: 0.85em !important;
}

.side-panel .panel-section th,
.side-panel #assetInfo th {
  background: rgba(138, 79, 255, 0.2) !important;
  color: #8a4fff !important;
  padding: 8px !important;
  text-align: left !important;
  font-weight: 600 !important;
  border-bottom: 2px solid rgba(138, 79, 255, 0.4) !important;
}

.side-panel .panel-section td,
.side-panel #assetInfo td {
  padding: 8px !important;
  color: #b0b0c0 !important;
  border-bottom: 1px solid rgba(138, 79, 255, 0.2) !important;
}

.side-panel .panel-section tr:hover,
.side-panel #assetInfo tr:hover {
  background: rgba(138, 79, 255, 0.05) !important;
}

/* Blockquotes */
.side-panel .panel-section blockquote,
.side-panel #assetInfo blockquote {
  border-left: 3px solid rgba(138, 79, 255, 0.5) !important;
  padding: 10px 15px !important;
  margin: 12px 0 !important;
  background: rgba(138, 79, 255, 0.05) !important;
  color: #b0b0c0 !important;
  font-style: italic !important;
  border-radius: 4px !important;
}

/* Form inputs */
.side-panel .panel-section input,
.side-panel .panel-section textarea,
.side-panel .panel-section select,
.side-panel #assetInfo input,
.side-panel #assetInfo textarea,
.side-panel #assetInfo select {
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(138, 79, 255, 0.3) !important;
  color: #e0e0ff !important;
  padding: 8px !important;
  border-radius: 4px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.9em !important;
  width: 100% !important;
  margin: 4px 0 !important;
}

.side-panel .panel-section input:focus,
.side-panel .panel-section textarea:focus,
.side-panel .panel-section select:focus,
.side-panel #assetInfo input:focus,
.side-panel #assetInfo textarea:focus,
.side-panel #assetInfo select:focus {
  outline: none !important;
  border-color: #8a4fff !important;
  box-shadow: 0 0 0 2px rgba(138, 79, 255, 0.3) !important;
}

/* Labels */
.side-panel .panel-section label,
.side-panel #assetInfo label {
  color: #8a8aaa !important;
  font-size: 0.85em !important;
  font-weight: 600 !important;
  display: block !important;
  margin: 8px 0 4px 0 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* Mobile responsive for nested elements */
@media (max-width: 768px) {
  .side-panel .panel-section h1,
  .side-panel #assetInfo h1 {
    font-size: 1.2em !important;
  }

  .side-panel .panel-section h2,
  .side-panel #assetInfo h2 {
    font-size: 1.1em !important;
  }

  .side-panel .panel-section h3,
  .side-panel #assetInfo h3 {
    font-size: 0.95em !important;
  }

  .side-panel .panel-section p,
  .side-panel #assetInfo p {
    font-size: 0.8em !important;
  }

  .side-panel .panel-section button,
  .side-panel #assetInfo button {
    font-size: 0.8em !important;
    padding: 6px 10px !important;
  }

  .side-panel .panel-section table,
  .side-panel #assetInfo table {
    font-size: 0.75em !important;
  }
}

@media (max-width: 480px) {
  .side-panel .panel-section h1,
  .side-panel #assetInfo h1 {
    font-size: 1.1em !important;
  }

  .side-panel .panel-section h2,
  .side-panel #assetInfo h2 {
    font-size: 1em !important;
  }

  .side-panel .panel-section h3,
  .side-panel #assetInfo h3 {
    font-size: 0.9em !important;
  }

  .side-panel .panel-section p,
  .side-panel #assetInfo p,
  .side-panel .panel-section li,
  .side-panel #assetInfo li {
    font-size: 0.75em !important;
  }
}

/* ========================================
   INFO PANEL - HIGHER SPECIFICITY FIXES
   Ensure info-section styles apply correctly
   ======================================== */

/* Force info-section styling to override general nested DOM styles */
.side-panel #assetInfo .info-section,
.side-panel .panel-section .info-section {
  margin-bottom: 16px !important;
  background: rgba(138, 79, 255, 0.03) !important;
  border: 1px solid rgba(138, 79, 255, 0.15) !important;
  border-radius: 6px !important;
  padding: 10px !important;
}

.side-panel #assetInfo .info-section h4,
.side-panel .panel-section .info-section h4 {
  font-size: 0.75em !important;
  color: #8a4fff !important;
  margin: 0 0 8px 0 !important;
  text-shadow: 0 0 8px rgba(138, 79, 255, 0.6) !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  font-weight: 600 !important;
  font-family: 'Orbitron', monospace !important;
}

.side-panel #assetInfo .info-grid,
.side-panel .panel-section .info-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 6px 8px !important;
}

.side-panel #assetInfo .info-item,
.side-panel .panel-section .info-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 4px 6px !important;
  background: rgba(0, 0, 0, 0.2) !important;
  border-radius: 3px !important;
  font-size: 0.7em !important;
}

.side-panel #assetInfo .info-item.full-width,
.side-panel .panel-section .info-item.full-width {
  grid-column: 1 / -1 !important;
}

.side-panel #assetInfo .info-label,
.side-panel .panel-section .info-label {
  color: #8a8aaa !important;
  font-size: 0.9em !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  font-weight: 400 !important;
}

.side-panel #assetInfo .info-value,
.side-panel .panel-section .info-value {
  color: #e0e0ff !important;
  font-weight: 600 !important;
  text-shadow: 0 0 5px rgba(138, 79, 255, 0.3) !important;
}

/* Mobile responsive for info sections */
@media (max-width: 768px) {
  .side-panel #assetInfo .info-grid,
  .side-panel .panel-section .info-grid {
    grid-template-columns: 1fr !important;
  }

  .side-panel #assetInfo .info-section,
  .side-panel .panel-section .info-section {
    padding: 8px !important;
    margin-bottom: 10px !important;
  }

  .side-panel #assetInfo .info-section h4,
  .side-panel .panel-section .info-section h4 {
    font-size: 0.7em !important;
  }

  .side-panel #assetInfo .info-item,
  .side-panel .panel-section .info-item {
    font-size: 0.65em !important;
    padding: 3px 5px !important;
  }
}

@media (max-width: 480px) {
  .side-panel #assetInfo .info-section h4,
  .side-panel .panel-section .info-section h4 {
    font-size: 0.65em !important;
  }

  .side-panel #assetInfo .info-item,
  .side-panel .panel-section .info-item {
    font-size: 0.6em !important;
    padding: 2px 4px !important;
  }
}

/* ========================================
   IMMERSIVE GAMEPLAY OVERLAY MENU
   ======================================== */

/* Quick Action Floating Toolbar */
#quickActionBar {
  animation: slideInFromRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s backwards;
}

@keyframes slideInFromRight {
  0% {
    opacity: 0;
    transform: translateX(100px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Quick Action Buttons */
.quick-btn {
  position: relative;
  overflow: hidden;
  will-change: transform, box-shadow;
}

.quick-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.quick-btn:hover::before {
  width: 120%;
  height: 120%;
}

.quick-btn:hover {
  transform: scale(1.1) translateY(-2px);
  filter: brightness(1.2);
}

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

/* Gameplay Overlay */
#gameplayOverlay {
  will-change: right;
}

#gameplayOverlay .overlay-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 79, 255, 0.5) rgba(0, 0, 0, 0.3);
}

#gameplayOverlay .overlay-content::-webkit-scrollbar {
  width: 8px;
}

#gameplayOverlay .overlay-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

#gameplayOverlay .overlay-content::-webkit-scrollbar-thumb {
  background: rgba(138, 79, 255, 0.5);
  border-radius: 4px;
  transition: background 0.3s;
}

#gameplayOverlay .overlay-content::-webkit-scrollbar-thumb:hover {
  background: rgba(138, 79, 255, 0.8);
}

/* Menu Header */
#gameplayOverlay .menu-header {
  position: relative;
  overflow: hidden;
}

#gameplayOverlay .menu-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(138, 79, 255, 0.2),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

#gameplayOverlay .menu-header button {
  position: relative;
  z-index: 1;
  transition: all 0.3s;
}

#gameplayOverlay .menu-header button:hover {
  transform: rotate(90deg);
  background: rgba(138, 79, 255, 0.2) !important;
}

/* Section Headers with Glow Effect */
.sidebar-section .section-header {
  position: relative;
  transition: all 0.3s;
}

.sidebar-section .section-header:hover {
  transform: translateX(5px);
  box-shadow: 0 0 20px rgba(138, 79, 255, 0.3);
}

.sidebar-section .section-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    currentColor,
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-section .section-header:hover::after {
  opacity: 0.5;
}

/* Control Buttons */
.control-btn,
.control-select {
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.control-btn::before,
.control-select::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.control-btn:hover::before {
  width: 150%;
  height: 150%;
}

.control-btn:hover,
.control-select:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 255, 170, 0.4);
  filter: brightness(1.1);
}

.control-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 255, 170, 0.3);
}

/* Backdrop Blur Effect */
#gameplayBackdrop {
  will-change: opacity;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #gameplayOverlay {
    width: 90vw;
    right: -90vw;
  }

  #quickActionBar {
    right: 10px;
    top: 70px;
  }

  .quick-btn {
    width: 50px !important;
    height: 50px !important;
    font-size: 20px !important;
  }
}

@media (max-width: 480px) {
  #gameplayOverlay {
    width: 95vw;
    right: -95vw;
  }

  #quickActionBar {
    right: 5px;
    top: 65px;
    gap: 8px !important;
  }

  .quick-btn {
    width: 45px !important;
    height: 45px !important;
    font-size: 18px !important;
    padding: 8px !important;
  }

  #gameplayOverlay .menu-header {
    padding: 20px 15px !important;
  }

  #gameplayOverlay .overlay-content {
    padding: 10px !important;
  }
}

/* ========================================
   ENHANCED MOBILE & TOUCH IMPROVEMENTS
   ======================================== */

/* Touch-friendly global improvements */
* {
  -webkit-tap-highlight-color: rgba(138, 79, 255, 0.3);
}

button, a, select, input[type="range"] {
  touch-action: manipulation;
}

canvas {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Additional mobile improvements for tablet */
@media (max-width: 768px) {
  #unifiedSidebar {
    top: 0 !important;
    height: 100vh !important;
    width: 280px !important;
  }

  .sidebar-content {
    -webkit-overflow-scrolling: touch;
  }

  .quick-access-toolbar {
    gap: 8px !important;
    padding: 12px !important;
  }

  .quick-btn {
    min-width: 48px !important;
    min-height: 48px !important;
    font-size: 20px !important;
  }

  #showSidebarBtn {
    padding: 20px 12px !important;
    font-size: 24px !important;
  }

  .section-header {
    padding: 14px !important;
  }

  input[type="range"] {
    height: 32px;
  }

  input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }

  .sidebar-section button {
    min-height: 44px !important;
  }
}

/* Additional mobile improvements for phones */
@media (max-width: 480px) {
  #unifiedSidebar {
    width: 100% !important;
    max-width: 320px !important;
  }

  .project-title {
    font-size: 1.4em !important;
  }

  .project-subtitle {
    font-size: 0.65em !important;
  }
}
