:root {
  --bg: #10131a;
  --panel: rgba(15, 17, 25, 0.6);
  --text: #fff;
  --gold: #ffb300;
  --gold-light: #ffe082;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #18202e 0%, #0b0d11 60%, #020203 100%);
  color: var(--text);
  overflow: hidden;
}

/* ========================================
   Landing Screen
   ======================================== */
#landingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
#landingScreen.hidden {
  display: none;
}
.landing-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.7);
}
.landing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.1) 30%,
    rgba(0, 0, 0, 0.1) 70%,
    rgba(0, 0, 0, 0.7) 100%
  );
}
.landing-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding: 40px 20px 60px;
  text-align: center;
}
.landing-header {
  margin-bottom: auto;
  padding-top: 30px;
}
.landing-title {
  font-size: clamp(48px, 10vw, 80px);
  font-weight: 900;
  margin: 0;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, #ffe082 0%, #ffb300 40%, #e6a200 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 4px 20px rgba(255, 179, 0, 0.5));
  animation: titlePulse 3s ease-in-out infinite;
}
@keyframes titlePulse {
  0%, 100% { filter: drop-shadow(0 4px 20px rgba(255, 179, 0, 0.5)); }
  50% { filter: drop-shadow(0 4px 30px rgba(255, 179, 0, 0.8)); }
}
.landing-subtitle {
  font-size: clamp(14px, 3vw, 20px);
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
.landing-stats {
  margin-bottom: 30px;
}
.high-score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 179, 0, 0.3);
  border-radius: 12px;
  padding: 12px 30px;
  backdrop-filter: blur(10px);
}
.high-score-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
}
.high-score-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(255, 224, 130, 0.5);
}
.landing-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 280px;
  margin-bottom: 30px;
}
.landing-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.landing-btn .btn-icon {
  font-size: 20px;
}
.landing-btn.primary {
  background: linear-gradient(135deg, #ffb300 0%, #ff9800 100%);
  color: #000;
  box-shadow: 
    0 4px 20px rgba(255, 179, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.landing-btn.primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 8px 30px rgba(255, 179, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.landing-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}
.landing-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}
.landing-btn.tertiary {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 20px;
  font-size: 14px;
}
.landing-btn.tertiary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.landing-audio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.landing-music-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}
.landing-music-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}
.landing-music-btn.playing {
  background: rgba(255, 179, 0, 0.3);
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 179, 0, 0.4);
}
.audio-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.landing-footer {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
}

/* How to Play Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  backdrop-filter: blur(5px);
}
.modal.hidden {
  display: none;
}

/* Show/hide controls based on device type */
.touch-controls-info {
  display: none;
}

/* Touch icon styling */
.touch-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Touch devices: show touch controls, hide keyboard controls */
@media (hover: none) and (pointer: coarse) {
  .touch-controls-info {
    display: block;
  }
  .desktop-controls {
    display: none;
  }
  
  /* Adjust bottom sections for mobile - single column */
  #startScreen .bottom-sections {
    grid-template-columns: 1fr;
  }
}
.modal-content {
  background: linear-gradient(145deg, rgba(25, 28, 38, 0.95) 0%, rgba(15, 17, 25, 0.98) 100%);
  border: 1px solid rgba(255, 200, 100, 0.2);
  border-radius: 20px;
  padding: 30px 35px;
  max-width: 550px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}
.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s;
}
.modal-close:hover {
  color: #fff;
}
.modal-content h2 {
  margin: 0 0 20px;
  font-size: 28px;
  background: linear-gradient(135deg, #ffe082 0%, #ffb300 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.how-to-grid {
  display: grid;
  gap: 20px;
}
.how-to-section {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 16px;
}
.how-to-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--gold-light);
}
.how-to-section p,
.how-to-section ul {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}
.how-to-section ul {
  padding-left: 20px;
}
.how-to-section li {
  margin-bottom: 6px;
}
.how-to-remap-note {
  margin-top: 12px !important;
  margin-bottom: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.45;
}
.control-list,
.weapon-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}
.control-list kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  background: linear-gradient(180deg, rgba(60, 65, 80, 0.9) 0%, rgba(40, 45, 55, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  color: #fff;
  margin-right: 4px;
}

/* Back button on settings screen */
.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Game Over enhancements */
.final-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 25px;
}
.final-score-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 5px;
}
.final-score-value {
  font-size: 48px;
  font-weight: 700;
  color: var(--gold-light);
  text-shadow: 0 0 30px rgba(255, 224, 130, 0.5);
}
#mainMenuBtn {
  padding: 12px 24px;
  font-size: 16px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s;
}
#mainMenuBtn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
#ui {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  padding: 12px 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
#ui h1 {
  font-size: 18px;
  margin: 0;
  letter-spacing: 0.05em;
  font-weight: 700;
  background: linear-gradient(135deg, #ffe082 0%, #ffb300 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}
.stat-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  font-weight: 600;
  white-space: nowrap;
}
.score-display {
  font-size: 22px;
  font-weight: 700;
  color: #ffe082;
  text-shadow: 0 0 10px rgba(255, 224, 130, 0.5);
  white-space: nowrap;
}
.health-shield-container {
  display: flex;
  flex-direction: row;
  gap: 16px;
}
.bar-container {
  position: relative;
  min-width: 120px;
}
.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  margin-bottom: 4px;
  font-weight: 600;
  white-space: nowrap;
}
.bar-label .value {
  color: #fff;
}
.bar-bg {
  width: 100%;
  height: 16px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}
.bar-fill {
  height: 100%;
  width: 100%; /* Full width, scaled via transform */
  border-radius: 10px;
  position: relative;
  /* Use transform for GPU acceleration instead of width */
  transform-origin: left center;
  will-change: transform;
}
.bar-fill.shield {
  background: linear-gradient(90deg, #64c8ff 0%, #4da6ff 100%);
}
.bar-fill.shield.low {
  background: linear-gradient(90deg, #ffc864 0%, #ffb84d 100%);
}
.bar-fill.health {
  background: linear-gradient(90deg, #4caf50 0%, #45a049 100%);
}
.bar-fill.health.medium {
  background: linear-gradient(90deg, #ff9800 0%, #f57c00 100%);
}
.bar-fill.health.low {
  background: linear-gradient(90deg, #f44336 0%, #d32f2f 100%);
}
/* Music Controls */
.music-section {
  margin-left: auto;
}
.music-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.music-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.music-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}
.music-toggle.playing {
  background: rgba(255, 179, 0, 0.2);
  border-color: #ffb300;
  box-shadow: 0 0 12px rgba(255, 179, 0, 0.4);
}
.music-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 70px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.music-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #ffe082 0%, #ffb300 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(255, 179, 0, 0.4);
  transition: transform 0.15s ease;
}
.music-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.music-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #ffe082 0%, #ffb300 100%);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(255, 179, 0, 0.4);
}

.weapons-section {
  border-left: 1px solid rgba(255,255,255,0.1);
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.weapons-title {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  font-weight: 600;
  white-space: nowrap;
}
.weapons-grid {
  display: flex;
  flex-direction: row;
  gap: 8px;
}
.weapon-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  min-width: 50px;
}
.weapon-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.weapon-card.selected {
  background: rgba(255, 179, 0, 0.2);
  border-color: #ffb300;
  box-shadow: 0 0 12px rgba(255, 179, 0, 0.4);
}
.weapon-card.empty {
  opacity: 0.3;
  cursor: not-allowed;
}
.weapon-icon {
  font-size: 16px;
  margin-bottom: 2px;
}
.weapon-name {
  font-size: 8px;
  font-weight: 600;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.weapon-count {
  font-size: 16px;
  font-weight: 700;
  color: #ffe082;
}
.weapon-card.empty .weapon-count {
  color: rgba(255, 255, 255, 0.3);
}
.selected-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #ffb300;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px rgba(255, 179, 0, 0.8);
}

/* Heavy Weapons Section */
.heavy-weapons-section {
  margin-top: 8px;
  border-top: 1px solid rgba(150, 100, 200, 0.3);
  padding-top: 8px;
}
.heavy-weapons-section .weapons-title {
  color: rgba(200, 150, 255, 0.9);
}
.heavy-weapon-slot {
  background: rgba(150, 100, 200, 0.15);
  border: 2px solid rgba(150, 100, 200, 0.4);
  border-radius: 10px;
  padding: 10px 15px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
}
.heavy-weapon-slot:not(.empty) {
  background: rgba(150, 100, 200, 0.25);
  border-color: rgba(180, 130, 230, 0.6);
  box-shadow: 0 0 15px rgba(150, 100, 200, 0.3);
  animation: heavyWeaponPulse 2s ease-in-out infinite;
}
@keyframes heavyWeaponPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(150, 100, 200, 0.3); }
  50% { box-shadow: 0 0 25px rgba(180, 130, 255, 0.5); }
}
.heavy-weapon-slot.empty {
  opacity: 0.6;
}
.heavy-weapon-icon {
  font-size: 28px;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 8px rgba(200, 150, 255, 0.5));
}
.heavy-weapon-slot.empty .heavy-weapon-icon {
  filter: none;
  opacity: 0.4;
}
.heavy-weapon-name {
  font-size: 10px;
  font-weight: 600;
  color: #d0b0ff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.heavy-weapon-slot.empty .heavy-weapon-name {
  color: rgba(200, 150, 255, 0.5);
}
.heavy-weapon-empty {
  font-size: 8px;
  color: rgba(200, 150, 255, 0.6);
  margin-top: 4px;
  font-style: italic;
}
.key-hint {
  font-size: 9px;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 5px;
  border-radius: 3px;
  margin-left: 5px;
  font-weight: normal;
  vertical-align: middle;
}

/* Defensive Weapons Section */
.defensive-weapons-section {
  margin-top: 8px;
  border-top: 1px solid rgba(100, 200, 180, 0.3);
  padding-top: 8px;
}
.defensive-weapons-section .weapons-title {
  color: rgba(150, 220, 200, 0.9);
}
.defensive-weapon-slot {
  background: rgba(100, 200, 180, 0.15);
  border: 2px solid rgba(100, 200, 180, 0.4);
  border-radius: 10px;
  padding: 10px 15px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
}
.defensive-weapon-slot:not(.empty) {
  background: rgba(100, 200, 180, 0.25);
  border-color: rgba(130, 220, 200, 0.6);
  box-shadow: 0 0 15px rgba(100, 200, 180, 0.3);
  animation: defensiveWeaponPulse 2s ease-in-out infinite;
}
@keyframes defensiveWeaponPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(100, 200, 180, 0.3); }
  50% { box-shadow: 0 0 25px rgba(130, 230, 210, 0.5); }
}
.defensive-weapon-slot.empty {
  opacity: 0.6;
}
.defensive-weapon-icon {
  font-size: 28px;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 8px rgba(150, 220, 200, 0.5));
}
.defensive-weapon-slot.empty .defensive-weapon-icon {
  filter: none;
  opacity: 0.4;
}
.defensive-weapon-name {
  font-size: 10px;
  font-weight: 600;
  color: #a0e0d0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.defensive-weapon-slot.empty .defensive-weapon-name {
  color: rgba(150, 220, 200, 0.5);
}
.defensive-weapon-empty {
  font-size: 8px;
  color: rgba(150, 220, 200, 0.6);
  margin-top: 4px;
  font-style: italic;
}

#legend {
  font-size: 10px;
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.03);
  padding: 2px 6px;
  border-radius: 99px;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot.hex { background: rgba(255, 236, 179, 0.8); }
.dot.bee { background: #ffe082; }
.dot.honey { background: #ffb300; }
.dot.flower { background: #82b1ff; }
canvas { display: block; }
#gameOver {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(5px);
}
#gameOver.show {
  display: flex;
}
#gameOver h2 {
  font-size: 48px;
  margin: 0 0 20px;
  color: #ff4444;
  text-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}
#gameOver p {
  font-size: 18px;
  margin: 0 0 30px;
  opacity: 0.9;
}
#gameOver .button-container {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
#restartBtn, #settingsBtn {
  padding: 12px 24px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
#restartBtn:hover, #settingsBtn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}
#startScreen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(20, 15, 5, 0.95) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(10px);
  overflow-y: auto;
  padding: 30px 20px;
}
#startScreen.hidden {
  display: none;
}
#startScreenContent {
  position: relative;
  max-width: 680px;
  width: 100%;
  background: linear-gradient(145deg, rgba(25, 28, 38, 0.9) 0%, rgba(15, 17, 25, 0.95) 100%);
  border: 1px solid rgba(255, 200, 100, 0.15);
  border-radius: 24px;
  padding: 32px 40px;
  backdrop-filter: blur(20px);
  box-shadow: 
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(255, 179, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
#startScreen h1 {
  font-size: 48px;
  margin: 0 0 8px;
  text-align: center;
  letter-spacing: 0.08em;
  font-weight: 800;
  background: linear-gradient(135deg, #ffe082 0%, #ffb300 50%, #ff9800 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 10px rgba(255, 179, 0, 0.4));
}
#startScreen .subtitle {
  text-align: center;
  font-size: 14px;
  opacity: 0.6;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}
#startScreen .section {
  margin-bottom: 24px;
}
#startScreen .section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 200, 100, 0.12);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85);
}
#startScreen .section-icon {
  font-size: 16px;
}

/* Settings Grid - 2 column layout */
#startScreen .settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
}
@media (max-width: 560px) {
  #startScreen .settings-grid {
    grid-template-columns: 1fr;
  }
}

#startScreen .control {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}
#startScreen .control:hover {
  background: rgba(255, 200, 100, 0.05);
  border-color: rgba(255, 200, 100, 0.15);
}
#startScreen .control label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
#startScreen .control-icon {
  font-size: 14px;
  opacity: 0.9;
}
#startScreen .control-text {
  flex: 1;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}
#startScreen .control-value {
  font-size: 14px;
  font-weight: 700;
  color: #ffe082;
  background: rgba(255, 224, 130, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  min-width: 40px;
  text-align: center;
}

/* Custom Range Slider */
#startScreen input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
#startScreen input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #ffe082 0%, #ffb300 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 179, 0, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#startScreen input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(255, 179, 0, 0.6);
}
#startScreen input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #ffe082 0%, #ffb300 100%);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(255, 179, 0, 0.4);
}
#startScreen .range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 4px;
  padding: 0 2px;
}

/* Bottom sections - Controls & Legend side by side */
#startScreen .bottom-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 8px;
}
@media (max-width: 560px) {
  #startScreen .bottom-sections {
    grid-template-columns: 1fr;
  }
}
#startScreen .controls-section,
#startScreen .legend-section-container {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px 16px;
}
#startScreen .controls-section .section-title,
#startScreen .legend-section-container .section-title {
  margin-bottom: 12px;
  padding-bottom: 8px;
  font-size: 12px;
}

/* Controls Grid */
#startScreen .controls-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
#startScreen .control-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
#startScreen .key-group {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
}
#startScreen kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  background: linear-gradient(180deg, rgba(60, 65, 80, 0.9) 0%, rgba(40, 45, 55, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  box-shadow: 
    0 2px 0 rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
#startScreen kbd.wide {
  min-width: 60px;
}
#startScreen .control-desc {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#startScreen .keybind-intro {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.55);
}
#startScreen .keybind-intro .key-hint-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(60, 65, 80, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  color: #fff;
}
#startScreen .keybind-toolbar {
  margin-bottom: 10px;
}
#startScreen .keybind-reset-btn {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
}
#startScreen .keybind-reset-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
#startScreen .keybind-table-wrap {
  max-height: 220px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
#startScreen .keybind-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
#startScreen .keybind-table tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.12);
}
#startScreen .keybind-table td {
  padding: 6px 8px;
  vertical-align: middle;
  color: rgba(255, 255, 255, 0.85);
}
#startScreen .keybind-label {
  width: 42%;
  color: rgba(255, 255, 255, 0.7);
}
#startScreen .keybind-keys {
  font-weight: 600;
  letter-spacing: 0.02em;
}
#startScreen .keybind-change-btn {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 179, 0, 0.2);
  border: 1px solid rgba(255, 179, 0, 0.35);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
#startScreen .keybind-change-btn:hover {
  background: rgba(255, 179, 0, 0.3);
}
#startScreen .keybind-change-btn.listening {
  background: rgba(100, 180, 255, 0.25);
  border-color: rgba(100, 180, 255, 0.5);
  color: #fff;
}

/* Legend Grid */
#startScreen .legend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
#startScreen .legend-grid .badge {
  font-size: 10px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  justify-content: flex-start;
}

#startBtn {
  width: 100%;
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffb300 0%, #ff9800 100%);
  border: none;
  border-radius: 12px;
  color: #000;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 24px;
  box-shadow: 
    0 4px 15px rgba(255, 179, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
#startBtn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(255, 179, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
}
#startBtn:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 10px rgba(255, 179, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ========================================
   Mobile Touch Controls
   ======================================== */

/* Prevent text selection and touch callouts on mobile */
.touch-controls,
.touch-controls * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

/* Canvas touch handling */
#c {
  touch-action: none;
}

.touch-controls {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.touch-controls.hidden {
  display: none;
}

/* Joystick Zone - Left Side */
.joystick-zone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40%;
  height: 50%;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.joystick-base {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 0 30px rgba(0, 0, 0, 0.3),
    inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.joystick-thumb {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 200, 100, 0.9) 0%, rgba(255, 179, 0, 0.8) 100%);
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 
    0 4px 15px rgba(255, 179, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.05s ease-out;
  position: absolute;
}

.joystick-thumb.active {
  background: linear-gradient(145deg, rgba(255, 220, 130, 1) 0%, rgba(255, 200, 50, 0.95) 100%);
  box-shadow: 
    0 4px 20px rgba(255, 179, 0, 0.6),
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

/* Touch Buttons - Right Side */
.touch-buttons {
  position: absolute;
  right: 20px;
  bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  pointer-events: auto;
}

.touch-btn {
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

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

/* Fire Button - Large */
.fire-btn {
  width: 80px;
  height: 80px;
  background: linear-gradient(145deg, rgba(255, 80, 80, 0.9) 0%, rgba(200, 40, 40, 0.85) 100%);
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 6px 25px rgba(255, 80, 80, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.fire-btn:active {
  background: linear-gradient(145deg, rgba(255, 100, 100, 1) 0%, rgba(220, 60, 60, 0.95) 100%);
  box-shadow: 
    0 2px 15px rgba(255, 80, 80, 0.6),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.fire-btn .btn-inner {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.05em;
}

/* Secondary Buttons Row */
.secondary-buttons {
  display: flex;
  gap: 12px;
}

/* Special Weapon Button */
.special-btn {
  width: 56px;
  height: 56px;
  background: linear-gradient(145deg, rgba(100, 180, 255, 0.9) 0%, rgba(60, 130, 200, 0.85) 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 4px 20px rgba(100, 180, 255, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.special-btn:active {
  background: linear-gradient(145deg, rgba(120, 200, 255, 1) 0%, rgba(80, 150, 220, 0.95) 100%);
  box-shadow: 
    0 2px 12px rgba(100, 180, 255, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.special-btn .btn-inner {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Cycle Weapon Button */
.cycle-btn {
  width: 56px;
  height: 56px;
  background: linear-gradient(145deg, rgba(180, 130, 255, 0.9) 0%, rgba(130, 80, 200, 0.85) 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 4px 20px rgba(180, 130, 255, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.cycle-btn:active {
  background: linear-gradient(145deg, rgba(200, 150, 255, 1) 0%, rgba(150, 100, 220, 0.95) 100%);
  box-shadow: 
    0 2px 12px rgba(180, 130, 255, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.cycle-btn .btn-inner {
  font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Tertiary Buttons Row (Heavy & Defensive) */
.tertiary-buttons {
  display: flex;
  gap: 12px;
}

/* Heavy Weapon Button (B key) */
.heavy-btn {
  width: 56px;
  height: 56px;
  background: linear-gradient(145deg, rgba(255, 160, 60, 0.9) 0%, rgba(200, 100, 30, 0.85) 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 4px 20px rgba(255, 160, 60, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.heavy-btn:active {
  background: linear-gradient(145deg, rgba(255, 180, 80, 1) 0%, rgba(220, 120, 50, 0.95) 100%);
  box-shadow: 
    0 2px 12px rgba(255, 160, 60, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.heavy-btn .btn-inner {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Defensive Weapon Button (C key) */
.defensive-btn {
  width: 56px;
  height: 56px;
  background: linear-gradient(145deg, rgba(80, 220, 160, 0.9) 0%, rgba(40, 160, 110, 0.85) 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 4px 20px rgba(80, 220, 160, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.defensive-btn:active {
  background: linear-gradient(145deg, rgba(100, 240, 180, 1) 0%, rgba(60, 180, 130, 0.95) 100%);
  box-shadow: 
    0 2px 12px rgba(80, 220, 160, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.defensive-btn .btn-inner {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

 .weapons-grid .weapon-card:not(.selected) {
    display: none !important;
  }

/* Mobile-specific UI adjustments */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  /* Show touch controls on mobile/touch devices */
  .touch-controls.mobile-enabled {
    display: block;
  }
  
  /* Adjust game UI for mobile */
  #ui {
    padding: 6px 10px;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  
  #ui h1 {
    font-size: 12px;
  }
  
  .score-display {
    font-size: 14px;
  }
  
  .stat-label {
    font-size: 7px;
  }
  
  .bar-container {
    min-width: 60px;
  }
  
  .bar-bg {
    height: 10px;
  }
  
  .bar-label {
    font-size: 8px;
  }
  
  /* Simplify health/shield on very small screens */
  .health-shield-container {
    gap: 6px;
  }
  
  /* Smaller weapon cards on mobile */
  .weapons-section {
    padding-left: 8px;
  }
  
  .weapon-card {
    padding: 3px 5px;
    min-width: 36px;
  }
  
  .weapon-icon {
    font-size: 12px;
  }
  
  .weapon-name {
    font-size: 6px;
  }
  
  .weapon-count {
    font-size: 12px;
  }
  
  /* Music controls smaller */
  .music-toggle {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  .music-slider {
    width: 40px;
  }
  
  /* Smaller joystick on mobile */
  .joystick-base {
    width: 90px;
    height: 90px;
  }
  
  .joystick-thumb {
    width: 38px;
    height: 38px;
  }
  
  /* Smaller touch buttons on mobile */
  .touch-buttons {
    right: 12px;
    bottom: 20px;
    gap: 8px;
  }
  
  .fire-btn {
    width: 60px;
    height: 60px;
  }
  
  .fire-btn .btn-inner {
    font-size: 11px;
  }
  
  .secondary-buttons,
  .tertiary-buttons {
    gap: 8px;
  }
  
  .special-btn,
  .cycle-btn,
  .heavy-btn,
  .defensive-btn {
    width: 42px;
    height: 42px;
  }
  
  .special-btn .btn-inner,
  .cycle-btn .btn-inner,
  .heavy-btn .btn-inner,
  .defensive-btn .btn-inner {
    font-size: 14px;
  }
  
  /* Smaller heavy/defensive weapon slots on mobile */
  .heavy-weapons-section,
  .defensive-weapons-section {
    margin-top: 4px;
    padding-top: 4px;
  }
  
  .heavy-weapon-slot,
  .defensive-weapon-slot {
    padding: 6px 8px;
    border-radius: 6px;
  }
  
  .heavy-weapon-icon,
  .defensive-weapon-icon {
    font-size: 18px;
    margin-bottom: 2px;
  }
  
  .heavy-weapon-name,
  .defensive-weapon-name {
    font-size: 7px;
  }
  
  .heavy-weapon-empty,
  .defensive-weapon-empty {
    font-size: 6px;
    margin-top: 2px;
  }
  
  .weapons-title {
    font-size: 8px;
  }
  
  .key-hint {
    font-size: 7px;
    padding: 1px 3px;
  }
  
  /* Only show selected special weapon on mobile */

  .weapons-grid {
    justify-content: flex-start;
  }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .joystick-zone {
    height: 70%;
  }
  
  .joystick-base {
    width: 80px;
    height: 80px;
  }
  
  .joystick-thumb {
    width: 32px;
    height: 32px;
  }
  
  .touch-buttons {
    bottom: 10px;
    right: 10px;
    gap: 6px;
  }
  
  .fire-btn {
    width: 50px;
    height: 50px;
  }
  
  .fire-btn .btn-inner {
    font-size: 10px;
  }
  
  .secondary-buttons,
  .tertiary-buttons {
    gap: 6px;
  }
  
  .special-btn,
  .cycle-btn,
  .heavy-btn,
  .defensive-btn {
    width: 36px;
    height: 36px;
  }
  
  .special-btn .btn-inner,
  .cycle-btn .btn-inner,
  .heavy-btn .btn-inner,
  .defensive-btn .btn-inner {
    font-size: 12px;
  }
  
  #ui {
    padding: 4px 8px;
    gap: 6px;
  }
  
  #ui h1 {
    font-size: 10px;
  }
  
  .score-display {
    font-size: 12px;
  }
}

/* Mobile-only: show only selected weapon to save space */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  .weapons-section .weapons-grid .weapon-card:not(.selected) {
    display: none !important;
  }
}

/* ========================================
   Mobile Landing Screen & Modals
   ======================================== */
@media (max-width: 480px) {
  /* Landing screen adjustments */
  .landing-content {
    padding: 20px 15px 40px;
  }
  
  .landing-header {
    padding-top: 15px;
  }
  
  .landing-buttons {
    max-width: 240px;
    gap: 10px;
    margin-bottom: 20px;
  }
  
  .landing-btn {
    padding: 14px 20px;
    font-size: 14px;
    gap: 10px;
  }
  
  .landing-btn.tertiary {
    padding: 10px 16px;
    font-size: 12px;
  }
  
  .high-score-display {
    padding: 10px 24px;
  }
  
  .high-score-value {
    font-size: 26px;
  }
  
  /* Modal adjustments */
  .modal-content {
    padding: 20px 18px;
    width: 95%;
    max-height: 90vh;
    border-radius: 16px;
  }
  
  .modal-content h2 {
    font-size: 22px;
    margin-bottom: 15px;
  }
  
  .modal-close {
    top: 10px;
    right: 15px;
    font-size: 24px;
  }
  
  .how-to-grid {
    gap: 12px;
  }
  
  .how-to-section {
    padding: 12px;
  }
  
  .how-to-section h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .how-to-section p,
  .how-to-section ul {
    font-size: 12px;
    line-height: 1.4;
  }
  
  .how-to-section li {
    margin-bottom: 4px;
  }
  
  .control-list,
  .weapon-list {
    font-size: 11px;
    gap: 5px;
  }
  
  .control-list kbd {
    min-width: 20px;
    height: 18px;
    font-size: 9px;
    padding: 0 4px;
  }
  
  /* Game over screen */
  #gameOver h2 {
    font-size: 36px;
  }
  
  #gameOver p {
    font-size: 14px;
    margin-bottom: 20px;
  }
  
  .final-score-value {
    font-size: 36px;
  }
  
  .final-score-label {
    font-size: 12px;
  }
  
  #gameOver .button-container {
    flex-direction: column;
    gap: 10px;
    width: 80%;
    max-width: 250px;
  }
  
  #restartBtn, #settingsBtn, #mainMenuBtn {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
  }
  
  /* Settings screen */
  #startScreenContent {
    padding: 20px 18px;
    border-radius: 16px;
  }
  
  #startScreen h1 {
    font-size: 32px;
    margin-bottom: 4px;
  }
  
  #startScreen .subtitle {
    font-size: 12px;
    margin-bottom: 20px;
  }
  
  #startScreen .section {
    margin-bottom: 16px;
  }
  
  #startScreen .section-title {
    font-size: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
  }
  
  #startScreen .control {
    padding: 10px 12px;
    border-radius: 10px;
  }
  
  #startScreen .control label {
    font-size: 11px;
    margin-bottom: 8px;
  }
  
  #startScreen .control-value {
    font-size: 12px;
    padding: 2px 6px;
  }
  
  #startScreen input[type="range"] {
    height: 5px;
  }
  
  #startScreen input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
  }
  
  #startScreen .range-labels {
    font-size: 8px;
  }
  
  #startScreen kbd {
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    font-size: 10px;
  }
  
  #startScreen .control-desc {
    font-size: 9px;
  }
  
  #startBtn {
    padding: 14px 24px;
    font-size: 16px;
    margin-top: 16px;
  }
  
  .back-btn {
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Very small screens (phones in portrait) */
@media (max-width: 360px) {
  .landing-title {
    font-size: 36px;
  }
  
  .landing-subtitle {
    font-size: 12px;
  }
  
  .landing-buttons {
    max-width: 200px;
  }
  
  .landing-btn {
    padding: 12px 16px;
    font-size: 13px;
  }
  
  #gameOver h2 {
    font-size: 28px;
  }
  
  .final-score-value {
    font-size: 28px;
  }
  
  #startScreen h1 {
    font-size: 26px;
  }
  
  .modal-content h2 {
    font-size: 18px;
  }
  
  .how-to-section h3 {
    font-size: 12px;
  }
  
  .how-to-section p,
  .how-to-section ul,
  .control-list,
  .weapon-list {
    font-size: 10px;
  }
}

/* Landscape on mobile - compact UI */
@media (max-height: 500px) and (orientation: landscape) {
  .landing-content {
    padding: 10px 20px 20px;
  }
  
  .landing-header {
    padding-top: 5px;
  }
  
  .landing-title {
    font-size: 32px;
  }
  
  .landing-subtitle {
    font-size: 11px;
    margin-top: 4px;
  }
  
  .landing-stats {
    margin-bottom: 15px;
  }
  
  .high-score-display {
    padding: 8px 20px;
  }
  
  .high-score-value {
    font-size: 22px;
  }
  
  .landing-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 400px;
    gap: 8px;
    margin-bottom: 15px;
  }
  
  .landing-btn {
    padding: 10px 16px;
    font-size: 12px;
  }
  
  .landing-btn.tertiary {
    padding: 8px 12px;
    font-size: 10px;
  }
  
  .landing-audio-controls {
    margin-bottom: 10px;
  }
  
  .landing-music-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  /* Modal in landscape */
  .modal-content {
    max-height: 95vh;
    padding: 15px 20px;
  }
  
  .modal-content h2 {
    font-size: 20px;
    margin-bottom: 10px;
  }
  
  .how-to-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .how-to-section {
    padding: 10px;
  }
  
  .how-to-section h3 {
    font-size: 12px;
    margin-bottom: 6px;
  }
  
  .how-to-section p,
  .how-to-section ul,
  .control-list,
  .weapon-list {
    font-size: 10px;
  }
  
  /* Game over in landscape */
  #gameOver h2 {
    font-size: 32px;
    margin-bottom: 10px;
  }
  
  #gameOver p {
    font-size: 12px;
    margin-bottom: 15px;
  }
  
  .final-score {
    margin-bottom: 15px;
  }
  
  .final-score-value {
    font-size: 28px;
  }
  
  #gameOver .button-container {
    flex-direction: row;
  }
  
  #restartBtn, #settingsBtn, #mainMenuBtn {
    padding: 10px 16px;
    font-size: 12px;
  }
  
  /* Settings in landscape */
  #startScreen {
    padding: 15px;
  }
  
  #startScreenContent {
    padding: 20px 25px;
  }
  
  #startScreen h1 {
    font-size: 28px;
  }
  
  #startScreen .subtitle {
    margin-bottom: 15px;
  }
  
  #startBtn {
    margin-top: 15px;
    padding: 12px 20px;
  }
}

