/* Premium button custom styles */
#premium-btn {
  display: flex;
  align-items: center;
  color: #ffd700 !important; /* Classic gold */
  font-weight: bold;
  font-family: inherit;
  font-size: 14px;
  /* Prevent iOS/Android tap highlighting and selection */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#premium-btn .premium-emoji {
  font-size: 18px;
  margin-right: 6px;
  vertical-align: middle;
  line-height: 1;
}
#premium-btn .premium-text {
  color: #ffd700;
  font-weight: bold;
  font-family: inherit;
  font-size: 14px;
}
/* Controls menu color distinction */
.controls-list .control-action {
  color: #ffb347;
  font-weight: bold;
}
.controls-list .control-key {
  color: #4fc3f7;
  font-weight: bold;
}
html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  margin: 0;
  padding: 0;
}

/* Prevent zoom on all elements */
* {
  touch-action: manipulation;
}

body {
  margin: 0;
  padding: 0;
  background-color: #000;
  color: #fff;
  font-family: 'Orbitron', 'Arial', sans-serif;
  font-weight: 400;
  /* overflow is handled on html/body to avoid mobile bounce/scroll */
  /* keep overscroll-behavior none at root to stop pull-to-refresh and bounce */
  /* Disable touch callouts on mobile */
  -webkit-touch-callout: none;
  /* Disable tap highlight on mobile */
  -webkit-tap-highlight-color: transparent;
  /* Prevent mobile zoom issues */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

.game-container {
  position: relative;
  width: 100%;
  height: 100%;
  /* Use 100% instead of 100vw/100vh for better mobile compatibility */
}

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

#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  box-sizing: border-box;
}

#stats {
  display: flex;
  gap: 20px;
  font-size: 18px;
  text-shadow:
    0 0 5px #00f,
    0 0 10px #00f;
}

#minimap-container {
  width: 150px;
  height: 150px;
  align-self: flex-end;
}

#minimap {
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0); /* Transparent background */
  /* border: 2px solid #33f; */
  border-radius: 100%;
}

#menu {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.8);
}

.hidden {
  display: none !important;
}

button {
  background-color: #33f;
  color: white;
  border: none;
  padding: 15px 30px;
  margin: 10px;
  font-size: 18px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 15px;
}

button:hover {
  background-color: #55f;
  transform: scale(1.05);
}

button:focus,
a:focus {
  outline: 2px solid #4af;
}

h1.superspace-title {
  color: #33f;
  font-size: 80px;
  margin-bottom: 18px;
  text-shadow:
    0 0 18px #33f,
    0 0 40px #33f;
  font-family: 'Orbitron', 'Arial', sans-serif;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
}
.launch-subtext {
  color: #8cf;
  font-size: 1.5em;
  font-family: 'Orbitron', 'Arial', sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 36px;
  text-shadow:
    0 0 8px #33f,
    0 0 16px #fff;
  text-align: center;
  text-transform: uppercase;
}

/* Unified Options/Instructions Overlay - Space Theme Improvements */
#options-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 12, 32, 0.25);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}
#options-overlay.hidden {
  display: none !important;
}
.options-panel {
  background: linear-gradient(135deg, #111a3a 80%, #223 100%);
  color: #eaf2ff;
  border: 2px solid #33f;
  border-radius: 18px;
  box-shadow:
    0 0 32px #33f8,
    0 0 8px #fff2;
  padding: 15px 20px 15px 20px;
  min-width: 340px;
  max-width: 95vw;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  font-family: 'Orbitron', 'Courier New', monospace;
  font-weight: 500;
  font-size: 1em;
  position: relative;
}

/* Custom futuristic scrollbar */
.options-panel::-webkit-scrollbar {
  width: 8px;
}

.options-panel::-webkit-scrollbar-track {
  background: #0a1428;
  border-radius: 4px;
  border: 1px solid #1a2a4a;
}

.options-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #33f 0%, #1155ff 50%, #0033cc 100%);
  border-radius: 4px;
  border: 1px solid #55f;
  box-shadow: 0 0 6px #33f6;
}

.options-panel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #55f 0%, #3377ff 50%, #1155ee 100%);
  box-shadow: 0 0 10px #55fa;
}
.options-panel h2 {
  color: #8cf;
  text-shadow:
    0 0 12px #33f,
    0 0 4px #fff;
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 2.1em;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: 'Orbitron', sans-serif;
}
.options-panel h3 {
  color: #8af;
  margin-bottom: 6px;
  margin-top: 12px;
  font-size: 1.2em;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-shadow: 0 0 6px #33f6;
  font-family: 'Orbitron', sans-serif;
}
.section {
  margin-bottom: 8px;
}
.controls-list,
.instructions-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 0 0;
  font-size: 0.85em;
  font-family: 'Orbitron', monospace;
  font-weight: 400;
  line-height: 1.4;
}
.controls-list li,
.instructions-list li {
  margin-bottom: 3px;
  padding-left: 0.5em;
  line-height: 1.4;
  color: #d6e8ff;
  text-shadow: 0 0 2px #33f3;
}
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  margin-left: 15px; /* Move the entire row right by 15px */
}
.slider-row label {
  min-width: 90px; /* Set a minimum width to align sliders */
  text-align: left;
  font-family: 'Orbitron', monospace;
  font-weight: 500;
  font-size: 0.9em;
  color: #d6e8ff;
  text-shadow: 0 0 2px #33f3;
}
.audio-spacer {
  height: 8px;
}
.section h3 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
}
.section label {
  font-family: 'Orbitron', monospace;
  font-weight: 500;
  font-size: 0.9em;
  color: #d6e8ff;
  text-shadow: 0 0 2px #33f3;
}
input[type='range'] {
  width: 120px;
  accent-color: #33f;
  background: #222;
  border-radius: 6px;
  height: 4px;
}
.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: #222b;
  color: #fff;
  border: none;
  font-size: 1.5em;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  box-shadow: 0 0 8px #33f8;
  transition:
    background 0.2s,
    color 0.2s;
  z-index: 2;
}
.close-btn:hover {
  background: #33f;
  color: #fff;
}

#pilot-name {
  font-family: 'Orbitron', monospace;
  font-weight: 500;
  font-size: 1.1em;
  background: #222a;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
  text-shadow: 0 0 2px #33f3;
}
#rename-btn {
  margin-left: 10px;
  padding: 4px 12px;
  background: #4af;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.2s;
}
#rename-btn:hover {
  background: #33f;
}

/* Avatar Selection Styles */
.avatar-selection {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin-top: 8px;
  max-width: 900px;
}

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
  background: rgba(34, 34, 34, 0.6);
  border: 2px solid rgba(68, 68, 68, 0.8);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 40px;
}

.avatar-option:hover:not(.disabled) {
  background: rgba(51, 51, 255, 0.15);
  border-color: #33f;
  box-shadow: 0 0 8px rgba(51, 51, 255, 0.4);
}

.avatar-option.selected {
  background: rgba(51, 51, 255, 0.25);
  border-color: #4af;
  box-shadow: 0 0 10px rgba(68, 175, 255, 0.6);
}

.avatar-option.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(20, 20, 20, 0.4);
  border-color: rgba(40, 40, 40, 0.6);
}

.avatar-canvas {
  border-radius: 2px;
  margin-bottom: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.avatar-option.disabled .avatar-canvas {
  border-color: rgba(100, 100, 100, 0.3);
  background: rgba(60, 60, 60, 0.3);
}

.avatar-name {
  font-size: 9px;
  color: #eaf2ff;
  text-align: center;
  font-weight: bold;
  line-height: 1;
}

.avatar-option.selected .avatar-name {
  color: #4af;
}

.avatar-option.disabled .avatar-name {
  color: #666;
}

/* Pilot Profile Styles */
.pilot-profile {
  display: flex;
  justify-content: center;
  padding: 10px;
  background: rgba(20, 30, 50, 0.8);
  border-radius: 8px;
  border: 2px solid rgba(68, 175, 255, 0.3);
}

.pilot-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pilot-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.pilot-label {
  color: #4af;
  font-weight: bold;
  font-size: 0.9em;
}

.profile-avatar-canvas {
  border: 2px solid rgba(68, 175, 255, 0.6);
  border-radius: 8px;
  background: rgba(0, 20, 40, 0.8);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.pilot-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.rename-btn {
  padding: 4px 12px;
  background-color: #33f;
  border: 1px solid #4af;
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Orbitron', monospace;
  font-size: 0.85em;
}

.rename-btn:hover {
  background-color: #55f;
  border-color: #6cf;
  box-shadow: 0 0 10px rgba(68, 175, 255, 0.4);
}

.change-pilot-btn {
  padding: 4px 12px;
  background-color: #33f;
  border: 1px solid #4af;
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Orbitron', monospace;
  font-size: 0.85em;
}

.change-pilot-btn:hover {
  background-color: #55f;
  border-color: #6cf;
  box-shadow: 0 0 10px rgba(68, 175, 255, 0.4);
}

.profile-buttons {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 4px;
}

.profile-btn {
  padding: 2px 8px;
  background-color: #336;
  border: 1px solid #44a;
  border-radius: 3px;
  color: #fff;
  font-weight: normal;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Orbitron', monospace;
  font-size: 0.7em;
}

.profile-btn:hover {
  background-color: #44a;
  border-color: #66c;
}

/* Avatar Modal Styles */
.avatar-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.avatar-modal.hidden {
  display: none;
}

.avatar-modal-content {
  background: linear-gradient(
    135deg,
    rgba(20, 30, 50, 0.95),
    rgba(10, 20, 40, 0.95)
  );
  border: 2px solid rgba(68, 175, 255, 0.6);
  border-radius: 12px;
  padding: 20px;
  max-width: 950px;
  width: 95%;
  box-shadow: 0 0 30px rgba(68, 175, 255, 0.3);
}

.avatar-modal-content h3 {
  color: #4af;
  text-align: center;
  margin-bottom: 15px;
  font-size: 1.2em;
}

.avatar-modal-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.authenticate-btn {
  padding: 10px 20px;
  background-color: #33f;
  border: none;
  border-radius: 5px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.authenticate-btn:hover {
  background-color: #55f;
  box-shadow: 0 0 10px rgba(68, 175, 255, 0.5);
}

.cancel-btn {
  padding: 10px 20px;
  background-color: #666;
  border: none;
  border-radius: 5px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cancel-btn:hover {
  background-color: #888;
  box-shadow: 0 0 10px rgba(136, 136, 136, 0.5);
}
.avatar-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background: rgba(34, 34, 34, 0.3);
  border: 2px solid rgba(68, 68, 68, 0.4);
  border-radius: 6px;
  opacity: 0.5;
}

.avatar-canvas-placeholder {
  width: 48px;
  height: 48px;
  background: rgba(100, 100, 100, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin-bottom: 6px;
  position: relative;
}

.avatar-canvas-placeholder::before {
  content: '?';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.3);
  font-size: 20px;
  font-weight: bold;
}

.avatar-placeholder .avatar-name {
  font-size: 0.7em;
  color: rgba(234, 242, 255, 0.4);
  text-align: center;
  font-style: italic;
}

/* Branding styles for main menu */
#branding {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: #8af;
  font-size: 14px;
}

.copyright {
  margin-bottom: 8px;
  opacity: 0.9;
}

.links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
}

.links:last-child {
  margin-bottom: 0;
}

.links a {
  color: #4af;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 3px;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.links a:hover {
  color: #fff;
  background: rgba(68, 170, 255, 0.2);
  border-color: #4af;
  text-shadow: 0 0 5px #4af;
}

/* Base Status Panel Styles */
#status-panel {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 6px;
  border: 1px solid #444;
  box-shadow: 0 0 8px rgba(0, 100, 255, 0.5);
  z-index: 1001;
  pointer-events: auto;
  width: 280px !important; /* Increased fixed width for better readability */
  box-sizing: border-box;
}

#status-panel .status-item {
  background-color: rgba(0, 0, 0, 0.5);
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #555;
  color: white;
  font-family: 'Orbitron', 'Arial', sans-serif;
  font-weight: 500;
  font-size: 0.9em;
  white-space: nowrap; /* Prevent text wrapping that could cause size changes */
  min-width: 160px; /* Fixed width to accommodate longest weapon name "Quantum Disruptor" */
  box-sizing: border-box; /* Include padding and border in width calculation */
}

#status-panel .status-label {
  font-weight: bold;
  margin-right: 4px;
}

#status-panel .status-value {
  font-weight: bold;
}

/* Branding styles for options overlay */
.branding-section {
  border-top: 1px solid #334;
  padding-top: 12px;
  margin-top: 8px;
}

.game-branding {
  text-align: center;
  font-size: 0.9em;
}

.copyright-text {
  color: #8af;
  margin-bottom: 8px;
  opacity: 0.8;
}

.brand-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}

.brand-links:last-child {
  margin-bottom: 0;
}

.brand-link {
  color: #4af;
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 3px;
  transition: all 0.2s;
  border: 1px solid transparent;
  font-size: 0.9em;
}

.brand-link:hover {
  color: #fff;
  background: rgba(68, 170, 255, 0.2);
  border-color: #4af;
  text-shadow: 0 0 5px #4af;
}

/* Game UI buttons - Shop and Admin */
#shop-btn {
  position: absolute;
  top: 76px;
  right: 0px;
  z-index: 1002;
  background: rgba(0, 0, 50, 0.7);
  color: white;
  border: 1px solid #33f;
  border-radius: 5px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#shop-btn:hover {
  background: rgba(0, 0, 70, 0.9);
}

#admin-btn {
  position: absolute;
  top: 114px;
  right: 0px;
  z-index: 1002;
  background: rgba(50, 0, 0, 0.7);
  color: white;
  border: 1px solid #f33;
  border-radius: 5px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#admin-btn:hover {
  background: rgba(70, 0, 0, 0.9);
}

/* Collapsible Player List Styles (Desktop and Mobile) */
#player-list {
  transition: transform 0.3s ease-in-out;
  position: relative;
}

/* Collapsed state for player list */
#player-list.collapsed {
  transform: translateX(calc(-98% - 15px));
}

/* Player list toggle tab */
#player-list-toggle {
  position: absolute;
  top: 50%;
  right: -30px;
  transform: translateY(-50%);
  width: 30px;
  height: 60px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #555;
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  z-index: 1002;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-weight: 500;
  font-family: 'Orbitron', 'Arial', sans-serif;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.3);
}

#player-list-toggle:hover {
  background: rgba(0, 0, 50, 0.9);
  border-color: #33f;
  color: #8cf;
  text-shadow: 0 0 4px #33f;
  box-shadow: 2px 0 8px rgba(51, 51, 255, 0.3);
}

#player-list-toggle:active {
  background: rgba(0, 0, 70, 0.9);
  transform: translateY(-50%) scale(0.95);
}

/* Futuristic style for menu buttons - unified for desktop and mobile */
#menu button {
  font-family: 'Orbitron', 'Courier New', monospace !important;
  font-weight: 600 !important;
  font-size: 1.1rem !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: #8cf !important;
  background: linear-gradient(90deg, #111a40 0%, #2233aa 100%) !important;
  border: 2px solid #33f !important;
  border-radius: 8px !important;
  box-shadow:
    0 0 12px #33f4,
    0 0 3px #fff2 !important;
  text-shadow:
    0 0 6px #33f,
    0 0 1px #fff !important;
  transition: all 0.2s cubic-bezier(0.4, 2, 0.6, 1) !important;
  min-height: 48px !important;
  min-width: 120px !important;
  padding: 12px 24px !important;
  margin: 8px !important;
  touch-action: manipulation !important;
}

#menu button:hover {
  background: linear-gradient(90deg, #2233aa 0%, #111a40 100%) !important;
  color: #fff !important;
  border-color: #8cf !important;
  box-shadow:
    0 0 18px #8cf8,
    0 0 6px #fff4 !important;
  transform: scale(1.04) !important;
}

/* Mobile and Tablet Responsive Design */
@media screen and (max-width: 768px), (hover: none) and (pointer: coarse) {
  /* Shop button for Mobile Only - position within fixed viewport */
  #shop-btn {
    top: 10px !important;
    right: 10px !important;
    position: absolute !important;
    z-index: 1003 !important;
  }
  #mobile-menu-button {
    top: 60px !important;
    right: 10px !important;
    position: absolute !important;
    z-index: 1003 !important;
  }

  /* Connection indicator mobile positioning */
  #connection-indicator {
    top: 10px !important;
    left: 10px !important;
    z-index: 1003 !important;
    font-size: 12px !important;
  }
  /* Hide mute and music buttons on mobile/tablet only */
  #mute-btn,
  #music-btn {
    display: none !important;
  }

  /* Connection indicator mobile adjustments - keep under player list */
  #connection-indicator {
    z-index: 50 !important; /* Lower than player list (z-index: 1001) */
  }

  /* Ensure mobile viewport fills correctly and prevents scroll */
  html,
  body {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .game-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  #gameCanvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  #hud {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  /* Menu adjustments for mobile */
  #menu {
    padding: 10px;
  }

  #menu h1 {
    font-size: 2.5rem;
    margin: 20px 0;
  }

  /* Options overlay mobile adjustments */
  .options-panel {
    width: 95%;
    max-width: 400px;
    margin: 10px;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .options-panel h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
  }

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

  .section h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }

  /* Compact controls list for mobile */
  .controls-list,
  .instructions-list {
    font-size: 0.85rem;
    line-height: 1.4;
    padding-left: 15px;
  }

  .controls-list li,
  .instructions-list li {
    margin-bottom: 4px;
  }

  /* Audio controls mobile adjustments */
  .slider-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 10px;
  }

  .slider-row label {
    min-width: unset;
    font-size: 0.85rem;
  }

  input[type='range'] {
    width: 100%;
    max-width: 200px;
  }

  input[type='checkbox'] {
    transform: scale(1.2);
    margin-right: 8px;
  }

  /* Profile section mobile adjustments */
  .pilot-info {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .pilot-name-row {
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }

  .profile-avatar-canvas {
    margin: 10px auto;
  }

  .pilot-buttons {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .pilot-buttons button {
    width: 100%;
    min-height: 44px;
  }

  .profile-buttons {
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 15px;
  }

  .profile-buttons button {
    width: 100%;
    min-height: 44px;
  }

  /* Avatar selection mobile adjustments */
  .avatar-selection {
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .avatar-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .avatar-option {
    padding: 6px;
  }

  .avatar-canvas {
    width: 40px;
    height: 40px;
  }

  .avatar-name {
    font-size: 0.65rem;
  }

  /* Close button mobile adjustments */
  .close-btn {
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.3em;
  }

  /* HUD adjustments for mobile - avoid touch control overlap */
  #hud-container {
    padding: 80px 10px 140px 10px; /* More padding at top for menu button, bottom for touch controls */
  }

  /* Move top info panel down to avoid mobile menu button - MOBILE ONLY */
  #top-info-panel {
    top: 70px;
  }

  /* Player list mobile adjustments - position within fixed viewport */
  #player-list {
    max-width: 220px !important;
    max-height: 250px !important;
    font-size: 12px !important;
    padding: 8px !important;
    top: 10px !important;
    left: 10px !important;
    position: absolute !important;
    transform: scale(0.9) !important;
    transform-origin: top left !important;
    z-index: 1001 !important;
    transition: transform 0.3s ease-in-out !important;
  }

  /* Collapsed state for player list */
  #player-list.collapsed {
    transform: translateX(calc(-75% - 20px)) scale(0.9) !important;
    transform-origin: top left !important;
  }

  /* Player list toggle tab */
  #player-list-toggle {
    position: absolute !important;
    top: 50% !important;
    right: -30px !important;
    transform: translateY(-50%) !important;
    width: 30px !important;
    height: 60px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    border: 1px solid #555 !important;
    border-left: none !important;
    border-radius: 0 8px 8px 0 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    color: #fff !important;
    z-index: 1002 !important;
    writing-mode: vertical-rl !important;
    text-orientation: mixed !important;
    font-weight: 500 !important;
  }

  #player-list-toggle:hover {
    background: rgba(0, 0, 50, 0.9) !important;
    border-color: #33f !important;
  }

  #player-list-container {
    font-size: 11px !important;
    color: #fff !important;
  }

  #player-list .player-item,
  #player-list-container > div {
    font-size: 11px !important;
    line-height: 1.3 !important;
    margin-bottom: 2px !important;
    padding: 2px 4px !important;
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-radius: 3px !important;
  }

  #player-list span {
    color: inherit !important;
    font-size: inherit !important;
  }

  /* Adjust game UI elements to avoid touch control overlap */
  #score-container,
  #energy-container,
  #credits-container {
    font-size: 14px;
    padding: 4px 6px;
  }

  /* Minimap adjustments for mobile */
  #minimap-container {
    width: 90px;
    height: 90px;
    bottom: 150px; /* Move up to avoid touch controls */
    right: 10px;
    border: 2px solid #555;
  }

  /* Status panel adjustments for mobile */
  #status-panel {
    position: fixed !important;
    bottom: 10px !important; /* True bottom center, with a small gap from the edge */
    left: 50% !important;
    transform: translateX(-50%) scale(0.9) !important; /* Centered and larger */
    transform-origin: bottom center !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    border: 2px solid #444 !important;
    border-radius: 8px !important;
    box-shadow: 0 0 10px rgba(0, 100, 255, 0.6) !important;
    z-index: 1001 !important;
    max-width: 240px !important;
    padding: 8px !important;
  }

  /* Make status panel items larger and more readable on mobile */
  #status-panel .status-item {
    font-size: 12px !important;
    margin-bottom: 3px !important;
    min-width: 140px !important; /* Slightly smaller for mobile but still fixed */
    box-sizing: border-box !important;
  }

  #status-panel .status-label {
    font-size: 11px !important;
  }

  #status-panel .status-value {
    font-size: 12px !important;
  }

  /* Touch controls styling */
  .touch-ui {
    --touch-gap: 30px; /* distance from edges */
    --touch-gap-large: 100px; /* secondary offset used between buttons */
    display: block !important;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 140px; /* Fixed height for touch control area */
    pointer-events: none;
    z-index: 1001;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    /* Add safe area padding for devices with bottom indicators */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .touch-joystick {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 100px;
    height: 100px;
    background-color: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: auto;
    touch-action: none;
  }

  .joystick-knob {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .touch-button {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    transition: all 0.1s ease;
  }

  .touch-button:active {
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(0.95);
  }

  /* Fire button - larger and prominent */
  #fire-button {
    bottom: var(--touch-gap);
    right: var(--touch-gap);
    width: 80px;
    height: 80px;
    background-color: rgba(255, 100, 100, 0.3);
    border-color: rgba(255, 100, 100, 0.6);
  }

  #fire-button:active {
    background-color: rgba(255, 100, 100, 0.6);
  }

  /* Weapon switch button */
  #weapon-button {
    bottom: var(--touch-gap);
    right: calc(var(--touch-gap) + var(--touch-gap-large));
    width: 60px;
    height: 60px;
    background-color: rgba(100, 150, 255, 0.3);
    border-color: rgba(100, 150, 255, 0.6);
  }

  #weapon-button:active {
    background-color: rgba(100, 150, 255, 0.6);
  }

  /* Afterburner button */
  #afterburner-button {
    /* place above the fire button with the same spacing as the weapon's horizontal offset */
    bottom: calc(var(--touch-gap) + var(--touch-gap-large));
    right: var(--touch-gap);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 200, 100, 0.3);
    border-color: rgba(255, 200, 100, 0.6);
  }

  #afterburner-button:active,
  #afterburner-button.active {
    background-color: rgba(255, 200, 100, 0.6);
    box-shadow: 0 0 15px rgba(255, 200, 100, 0.8);
  }

  /* Mobile brake/stop button - positioned above joystick */
  #brake-button {
    bottom: 140px;
    left: 20px;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 80, 80, 0.3);
    border-color: rgba(255, 80, 80, 0.6);
    font-size: 18px;
  }

  #brake-button:active,
  #brake-button.active {
    background-color: rgba(255, 80, 80, 0.6);
    box-shadow: 0 0 15px rgba(255, 80, 80, 0.8);
  }

  /* Mobile menu/settings button - styled like shop button and positioned below it */
  #mobile-menu-button {
    top: 114px; /* Below shop button - matches admin button positioning */
    right: 0px; /* Align with shop button */
    width: auto; /* Auto width like shop button */
    height: auto; /* Auto height like shop button */
    background: rgba(0, 0, 50, 0.7); /* Same as shop button */
    border: 1px solid #33f; /* Same as shop button */
    border-radius: 5px; /* Same as shop button */
    color: white;
    padding: 6px 12px; /* Same as shop button */
    font-size: 14px; /* Readable font size */
    position: fixed;
    z-index: 1002; /* Same as shop button */
    display: none; /* Hidden on desktop */
    cursor: pointer;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: inherit;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* Show mobile menu button only on touch devices */
  @media (hover: none) and (pointer: coarse) {
    #mobile-menu-button {
      display: flex !important;
    }
  }

  #mobile-menu-button:active {
    background: rgba(
      0,
      0,
      70,
      0.9
    ); /* Darker on press, similar to shop button */
    transform: scale(0.98); /* Subtle press effect */
  }

  /* Mobile brake/stop button - positioned above joystick */
  #brake-button {
    bottom: 130px;
    left: 20px;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 50, 50, 0.3);
    border-color: rgba(255, 50, 50, 0.6);
    font-size: 18px;
    position: fixed;
    z-index: 1001;
    display: none; /* Hidden on desktop */
  }

  #brake-button:active,
  #brake-button.active {
    background-color: rgba(255, 50, 50, 0.6);
    box-shadow: 0 0 15px rgba(255, 50, 50, 0.8);
  }

  /* Show brake button only on touch devices */
  @media (hover: none) and (pointer: coarse) {
    #brake-button {
      display: flex !important;
    }
  }

  /* Prevent double-tap zoom on all interactive elements */
  button,
  .touch-button,
  .touch-joystick,
  input,
  select,
  textarea {
    touch-action: manipulation;
  }

  /* Shop container mobile adjustments */
  #shop-container {
    width: 95% !important;
    max-width: 500px !important;
    height: 85vh !important;
    max-height: 600px !important;
    padding: 15px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Shop content area mobile adjustments */
  #shop-content {
    height: calc(100% - 120px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Shop header mobile adjustments */
  #shop-container h2 {
    font-size: 1.5rem !important;
    margin-bottom: 10px !important;
  }

  /* Shop tabs container mobile adjustments */
  #shop-container > div:nth-child(2) {
    flex-wrap: wrap !important;
    gap: 5px !important;
    margin-bottom: 15px !important;
  }

  /* Shop tab buttons mobile adjustments */
  #shop-container > div:nth-child(2) > div {
    font-size: 0.8rem !important;
    padding: 8px 12px !important;
    min-width: 80px !important;
    flex: 1 !important;
    text-align: center !important;
  }

  /* Shop item cards mobile adjustments */
  .shop-item {
    flex-direction: column !important;
    padding: 10px !important;
    margin: 8px 0 !important;
  }

  .shop-item > div:first-child {
    width: 80px !important;
    height: 80px !important;
    margin: 0 auto 10px auto !important;
  }

  /* Shop item text content mobile adjustments */
  .shop-item h3 {
    font-size: 1rem !important;
    margin-bottom: 5px !important;
  }

  .shop-item p {
    font-size: 0.8rem !important;
    margin-bottom: 5px !important;
  }

  .shop-item button {
    min-height: 40px !important;
    padding: 8px 16px !important;
    font-size: 0.9rem !important;
    margin-top: 5px !important;
  }
}

/* Small mobile devices (phones in portrait) */
@media screen and (max-width: 480px) {
  #menu h1 {
    font-size: 2rem;
  }

  .options-panel {
    width: 98%;
    margin: 5px;
    font-size: 0.9rem;
  }

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

  .controls-list,
  .instructions-list {
    font-size: 0.8rem;
  }

  /* Smaller touch controls for small screens */
  .touch-joystick {
    width: 80px;
    height: 80px;
    bottom: 15px;
    left: 15px;
  }

  .joystick-knob {
    width: 30px;
    height: 30px;
  }

  #fire-button {
    width: 80px;
    height: 80px;
    bottom: var(--touch-gap);
    right: var(--touch-gap);
    font-size: 20px;
  }

  #weapon-button {
    width: 60px;
    height: 60px;
    bottom: var(--touch-gap);
    right: calc(var(--touch-gap) + var(--touch-gap-large));
    font-size: 18px;
  }

  #afterburner-button {
    width: 60px;
    height: 60px;
    bottom: calc(var(--touch-gap) + var(--touch-gap-large));
    right: var(--touch-gap);
    font-size: 18px;
  }

  #mobile-menu-button {
    padding: 5px 10px; /* Slightly smaller padding for small screens */
    font-size: 14px;
    top: 114px; /* Keep consistent positioning */
    right: 0px;
  }

  #brake-button {
    width: 40px;
    height: 40px;
    bottom: 110px;
    left: 15px;
    font-size: 16px;
  }

  /* Adjust HUD for smaller screens */
  #hud-container {
    padding: 50px 5px 120px 5px;
  }

  /* Minimap adjustments for small mobile */
  #minimap-container {
    width: 75px;
    height: 75px;
    bottom: 140px;
    right: 5px;
  }

  /* Status panel adjustments for small mobile */
  #status-panel {
    bottom: 10px !important; /* Bottom center like regular mobile */
    left: 50% !important; /* Center horizontally */
    transform: translateX(-50%) scale(0.85) !important; /* Center and scale */
    transform-origin: bottom center !important;
    max-width: 220px !important;
  }

  /* Player list even smaller on small mobile */
  #player-list {
    max-width: 160px;
    max-height: 150px;
    font-size: 8px;
    padding: 4px;
    transform: scale(0.7);
  }

  /* Small mobile collapsed state */
  #player-list.collapsed {
    transform: translateX(calc(-70% - 15px)) scale(0.7) !important;
  }

  /* Smaller toggle button for small mobile */
  #player-list-toggle {
    width: 25px !important;
    height: 50px !important;
    right: -25px !important;
    font-size: 12px !important;
  }

  #player-list-container {
    font-size: 7px;
  }

  /* Shop container adjustments for small mobile */
  #shop-container {
    width: 98% !important;
    max-width: 400px !important;
    height: 90vh !important;
    padding: 10px !important;
    font-size: 0.85rem !important;
  }

  /* Shop header for small mobile */
  #shop-container h2 {
    font-size: 1.2rem !important;
    margin-bottom: 8px !important;
  }

  /* Shop content for small mobile */
  #shop-content {
    height: calc(100% - 100px) !important;
  }

  /* Shop tabs for small mobile */
  #shop-container > div:nth-child(2) > div {
    font-size: 0.7rem !important;
    padding: 6px 8px !important;
    min-width: 60px !important;
  }

  /* Shop credits display for small mobile */
  #shop-credits {
    font-size: 1rem !important;
  }

  /* Shop items extra small mobile adjustments */
  .shop-item {
    padding: 8px !important;
    margin: 6px 0 !important;
  }

  .shop-item > div:first-child {
    width: 60px !important;
    height: 60px !important;
  }

  .shop-item h3 {
    font-size: 0.9rem !important;
  }

  .shop-item p {
    font-size: 0.75rem !important;
  }

  .shop-item button {
    min-height: 36px !important;
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
  }
}

/* Tablet landscape adjustments */
@media screen and (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
  .touch-ui {
    height: 120px;
  }

  .touch-joystick {
    width: 90px;
    height: 90px;
  }

  #fire-button {
    width: 70px;
    height: 70px;
  }

  #weapon-button,
  #afterburner-button {
    width: 55px;
    height: 55px;
  }

  #minimap-container {
    bottom: 130px;
  }

  #status-panel {
    bottom: 140px !important; /* Adjust for tablet landscape */
    left: 20px !important;
    transform: scale(0.95) !important; /* Slightly larger on tablet */
  }
}

/* Disclaimer Popup Styles */
.disclaimer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.disclaimer-content {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 2px solid #0f3460;
  border-radius: 15px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  color: #ffffff;
}

.disclaimer-content h2 {
  color: #ff6b6b;
  margin-bottom: 20px;
  font-size: 24px;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.disclaimer-content p {
  line-height: 1.6;
  margin-bottom: 15px;
  color: #e0e0e0;
}

.disclaimer-content ul {
  text-align: left;
  margin: 20px 0;
  padding-left: 20px;
  color: #ffcc02;
}

.disclaimer-content .disclaimer-list {
  text-align: center;
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.disclaimer-content .disclaimer-list li {
  margin: 8px 0;
  list-style-type: none;
  color: #ffcc02;
}

.disclaimer-content .disclaimer-list li::before {
  content: '⚠️ ';
}

.disclaimer-content li {
  margin: 8px 0;
  list-style-type: '⚠️ ';
}

.disclaimer-actions {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b0b0b0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.checkbox-label input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: #0f3460;
}

#disclaimer-agree-btn {
  background: linear-gradient(45deg, #0f3460, #16213e);
  color: white;
  border: 2px solid #0f3460;
  padding: 12px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#disclaimer-agree-btn:hover {
  background: linear-gradient(45deg, #16213e, #0f3460);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(15, 52, 96, 0.4);
}

#disclaimer-agree-btn:active {
  transform: translateY(0);
}

.disclaimer-hidden {
  display: none !important;
}

/* Flash animation for locked premium items */
@keyframes flash {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
    background-color: rgba(255, 100, 100, 0.2);
  }
  100% {
    opacity: 1;
  }
}

/* Chat UI Styles */
#chat-container {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 450px;
  height: 250px;
  background-color: rgba(0, 0, 0, 0.7);
  border: 2px solid #33f;
  border-radius: 10px;
  z-index: 1005;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    opacity 0.3s,
    transform 0.3s;
}

/* Mobile chat adjustments */
@media screen and (max-width: 768px), (hover: none) and (pointer: coarse) {
  #chat-container {
    width: 95vw;
    max-width: 350px;
    height: 200px;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
  }

  #chat-input {
    font-size: 16px !important; /* Prevent iOS zoom on focus */
  }
}

#chat-container.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

#chat-messages {
  flex-grow: 1;
  padding: 10px;
  overflow-y: auto;
  color: #fff;
  font-size: 14px;
  text-shadow: 0 0 3px #00f;
}

#chat-input {
  border: none;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 10px;
  font-family: 'Orbitron', 'Arial', sans-serif;
  font-size: 14px;
  border-top: 2px solid #33f;
}

#chat-input:focus {
  outline: none;
  background-color: rgba(0, 0, 20, 0.9);
}

/* Custom scrollbar for chat */
#chat-messages::-webkit-scrollbar {
  width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
  background: #0a1428;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #33f;
  border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
  background: #55f;
}

/* Chat Toast Notifications */
#chat-toast-container {
  position: absolute;
  bottom: 280px; /* Position above the chat input area */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  z-index: 1006;
  pointer-events: none;
}

.chat-toast-message {
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 8px 15px;
  border-radius: 5px;
  margin-top: 5px;
  font-size: 14px;
  text-shadow: 0 0 3px #00f;
  animation: fade-in-out 5s forwards;
}

@keyframes fade-in-out {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  10% {
    opacity: 1;
    transform: translateY(0);
  }
  90% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Mobile adjustments for chat toast */
@media screen and (max-width: 768px), (hover: none) and (pointer: coarse) {
  #chat-toast-container {
    bottom: 220px; /* Adjust for smaller mobile chat */
    width: 95vw;
    max-width: 350px;
  }

  .chat-toast-message {
    font-size: 12px;
    padding: 6px 12px;
    max-width: 90vw;
    word-wrap: break-word;
  }
}

/* iPhone Portrait Orientation - Fix button overlap issue */
@media screen and (max-width: 428px) and (orientation: portrait) {
  /* Adjust top-right button positioning for iPhone portrait mode */
  #shop-btn {
    top: 20px !important; /* Moved much higher to use empty space */
  }

  #mobile-menu-button {
    top: 80px !important; /* Options button - 50px spacing from shop */
  }

  #premium-btn {
    top: 130px !important; /* Premium button - 50px spacing from options */
  }

  #mobile-chat-btn {
    top: 190px !important; /* Chat button - 50px spacing from premium */
  }
}

/* Desktop: ensure status panel is anchored to bottom-left only on non-mobile/desktop */
@media screen and (min-width: 769px) {
  /* Force bottom-left anchoring on desktop. Use !important to override inline styles
       applied by the HUD creation JS so desktop always shows status in the lower-left. */
  #status-panel {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    transform: none !important; /* Remove JS scaling transforms that shift placement */
    transform-origin: unset !important;
    z-index: 1001 !important;
    width: auto !important; /* Allow width to size naturally on desktop */
  }
}
