* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: none;
  touch-action: none;
}

body {
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

body.pointer-locked {
  cursor: none;
}

#gameCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  touch-action: none;
}

/* Loading Screen */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-content {
  text-align: center;
}

.game-title {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: #ff4444;
  text-shadow: 0 0 40px rgba(255, 68, 68, 0.5);
  margin-bottom: 40px;
  animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.loading-bar-container {
  width: 400px;
  height: 4px;
  background: #222;
  border-radius: 2px;
  margin: 0 auto 20px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff4444, #ff8800);
  border-radius: 2px;
  transition: width 0.3s;
}

.loading-text {
  color: #888;
  font-size: 0.9rem;
}

/* Main Menu */
#main-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.menu-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0a0a 50%, #0a0a0a 100%);
}

.menu-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect fill="none" stroke="%23ffffff08" stroke-width="0.5" x="0" y="0" width="100" height="100"/></svg>') repeat;
  background-size: 30px;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(30px, 30px); }
}

.menu-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.menu-title {
  font-size: 5rem;
  font-weight: 900;
  letter-spacing: 0.4em;
  color: #ff4444;
  text-shadow: 0 0 60px rgba(255, 68, 68, 0.4), 0 4px 0 #880000;
  margin-bottom: 5px;
}

.menu-subtitle {
  font-size: 1.2rem;
  color: #666;
  letter-spacing: 1em;
  margin-bottom: 60px;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 280px;
}

.menu-btn {
  padding: 14px 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ccc;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.1em;
  font-family: inherit;
}

.menu-btn:hover {
  background: rgba(255, 68, 68, 0.2);
  border-color: #ff4444;
  color: #fff;
  transform: translateX(5px);
}

.menu-footer {
  position: absolute;
  bottom: 20px;
  color: #333;
  font-size: 0.75rem;
}

/* Settings Panel */
.panel-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.panel-content {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin: 0 auto;
  padding: 40px;
  height: 100vh;
  overflow-y: auto;
}

.settings-scroll {
  max-width: 600px;
}

.panel-content h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #ff4444;
  text-align: center;
}

.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 4px;
}

.stab {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border: none;
  color: #666;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  font-family: inherit;
}

.stab:hover {
  color: #aaa;
}

.stab.active {
  background: rgba(255, 68, 68, 0.2);
  color: #ff4444;
}

.settings-tab-content {
  display: none;
}

.settings-tab-content.active {
  display: block;
}

.settings-group {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.settings-group h3 {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: #ccc;
  font-size: 0.85rem;
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-control input[type="range"] {
  width: 120px;
  -webkit-appearance: none;
  height: 4px;
  background: #333;
  border-radius: 2px;
  border: none;
  outline: none;
}

.setting-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #ff4444;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(255, 68, 68, 0.4);
}

.setting-control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #ff4444;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.range-val {
  min-width: 24px;
  text-align: center;
  color: #ff4444;
  font-size: 0.8rem;
  font-weight: bold;
}

.panel-content select {
  background: #111;
  border: 1px solid #333;
  color: #ccc;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
}

.panel-content select:focus {
  border-color: #ff4444;
  outline: none;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle .slider {
  position: absolute;
  inset: 0;
  background: #333;
  border-radius: 11px;
  transition: 0.3s;
}

.toggle .slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: #888;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .slider {
  background: rgba(255, 68, 68, 0.3);
}

.toggle input:checked + .slider::before {
  transform: translateX(18px);
  background: #ff4444;
  box-shadow: 0 0 6px rgba(255, 68, 68, 0.5);
}

.keybind-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: #999;
  font-size: 0.8rem;
}

.keybind-row:last-child {
  border-bottom: none;
}

.keybind-row .key {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  color: #aaa;
  font-family: monospace;
}

/* Armory */
.armory-content {
  max-width: 800px;
}

.weapon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.weapon-card {
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.weapon-card:hover,
.weapon-card.selected {
  border-color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
}

.weapon-card .weapon-icon {
  font-size: 2rem;
  margin-bottom: 5px;
}

.weapon-card .weapon-label {
  font-size: 0.7rem;
  color: #888;
}

.weapon-stats {
  margin: 20px 0;
}

.stat {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-size: 0.85rem;
  color: #aaa;
}

.stat span {
  width: 80px;
}

.stat-bar {
  flex: 1;
  height: 6px;
  background: #1a1a1a;
  border-radius: 3px;
  overflow: hidden;
}

.stat-bar div {
  height: 100%;
  background: linear-gradient(90deg, #ff4444, #ff8800);
  border-radius: 3px;
  transition: width 0.3s;
}

.attachments {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.attach-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #333;
  color: #888;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.attach-btn:hover,
.attach-btn.active {
  border-color: #ff4444;
  color: #fff;
  background: rgba(255, 68, 68, 0.2);
}

/* Shop */
.shop-coins {
  font-size: 1.2rem;
  color: #ffd700;
  margin-bottom: 20px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.shop-item {
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-item:hover {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.05);
}

.shop-item .item-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.shop-item .item-price {
  color: #ffd700;
  font-size: 0.9rem;
}

/* HUD */
#hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.hud-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  pointer-events: none;
}

.cross-h, .cross-v {
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
}

.cross-h {
  width: 100%;
  height: 2px;
  top: 50%;
  transform: translateY(-50%);
}

.cross-v {
  width: 2px;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
}

.cross-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #ff0000;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 4px #ff0000;
}

.hud-health {
  position: absolute;
  bottom: 30px;
  left: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.health-icon {
  font-size: 1.5rem;
  color: #ff4444;
  font-weight: bold;
}

.health-bar-outer {
  width: 200px;
  height: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.health-bar-inner {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff0000, #ff4444);
  transition: width 0.3s;
}

.hud-ammo {
  position: absolute;
  bottom: 30px;
  right: 30px;
  text-align: right;
}

.ammo-display {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.ammo-sep {
  color: #666;
  margin: 0 2px;
}

#ammoReserve {
  color: #666;
  font-size: 1.2rem;
}

.weapon-name {
  font-size: 0.75rem;
  color: #666;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hud-minimap {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

#minimapCanvas {
  width: 100%;
  height: 100%;
}

.hud-killfeed {
  position: absolute;
  top: 20px;
  right: 20px;
  text-align: right;
}

.kill-entry {
  padding: 4px 10px;
  margin: 2px 0;
  background: rgba(0, 0, 0, 0.5);
  font-size: 0.75rem;
  color: #aaa;
  animation: fadeOut 4s forwards;
}

@keyframes fadeOut {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

.hud-objective {
  position: absolute;
  top: 200px;
  left: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px;
  background: rgba(0, 0, 0, 0.5);
  border-left: 3px solid #ff4444;
  font-size: 0.85rem;
  color: #ddd;
}

.obj-icon {
  color: #ff4444;
  font-weight: bold;
}

.hud-score {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  font-size: 0.8rem;
  color: #888;
}

.hud-damage-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(255, 0, 0, 0.4) 100%);
}

.hud-hitmarker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  opacity: 0;
  transition: opacity 0.05s;
}

.hm-line {
  position: absolute;
  width: 8px;
  height: 2px;
  background: #fff;
}

.hm-tl { top: 2px; left: 2px; transform: rotate(45deg); }
.hm-tr { top: 2px; right: 2px; transform: rotate(-45deg); }
.hm-bl { bottom: 2px; left: 2px; transform: rotate(-45deg); }
.hm-br { bottom: 2px; right: 2px; transform: rotate(45deg); }

.hud-weapon-wheel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
}

.ww-slot {
  position: absolute;
  width: 80px;
  height: 40px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #ff4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.hud-compass {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  font-size: 0.7rem;
  color: #555;
}

.hud-interact {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 20px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #ff4444;
  font-size: 0.9rem;
}

.hud-reload {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 0.8rem;
  color: #ff4444;
}

.reload-circle {
  width: 40px;
  height: 40px;
  border: 3px solid #333;
  border-top-color: #ff4444;
  border-radius: 50%;
  margin: 0 auto 5px;
  animation: spin 1s linear infinite;
}

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

.hud-grenade-count {
  position: absolute;
  bottom: 70px;
  right: 30px;
  font-size: 0.8rem;
  color: #888;
}

#fps-counter {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: #444;
}

/* Pause Menu */
.pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.pause-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 15px;
}

.pause-content h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

/* Death Screen */
.death-overlay {
  position: absolute;
  inset: 0;
  background: rgba(80, 0, 0, 0.7);
}

.death-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.death-content h2 {
  font-size: 3rem;
  color: #ff0000;
  margin-bottom: 10px;
}

.death-content p {
  color: #aaa;
  margin-bottom: 30px;
}

/* Mission Complete */
.mission-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 40, 0, 0.7);
}

.mission-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.mission-content h2 {
  font-size: 2.5rem;
  color: #44ff44;
  margin-bottom: 20px;
}

.mission-rewards {
  display: flex;
  gap: 30px;
  font-size: 1.2rem;
  color: #ffd700;
  margin-bottom: 30px;
}

/* Notification */
.notification {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 25px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #ff4444;
  font-size: 0.9rem;
  z-index: 20;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .game-title, .menu-title {
    font-size: 2rem;
    letter-spacing: 0.2em;
  }
  .menu-subtitle {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
  }
  .menu-buttons {
    min-width: 220px;
    gap: 8px;
  }
  .menu-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
  .loading-bar-container {
    width: 220px;
  }
  .hud-minimap {
    width: 90px;
    height: 90px;
  }
  #minimapCanvas {
    width: 90px;
    height: 90px;
  }
  .ammo-display {
    font-size: 1.3rem;
  }
  .health-bar-outer {
    width: 100px;
    height: 6px;
  }
  .hud-health {
    bottom: 170px;
    left: 15px;
  }
  .hud-ammo {
    bottom: 170px;
    right: 15px;
  }
  .hud-score {
    bottom: 155px;
    gap: 12px;
    font-size: 0.65rem;
  }
  .hud-grenade-count {
    bottom: 170px;
    right: 100px;
    font-size: 0.65rem;
  }
  .hud-objective {
    top: 60px;
    left: 10px;
    font-size: 0.75rem;
    padding: 6px 10px;
  }
  .hud-compass {
    display: none;
  }
  .hud-crosshair {
    width: 24px;
    height: 24px;
  }
  .notification {
    top: 60px;
    font-size: 0.8rem;
    padding: 8px 18px;
  }
  .hud-mission-objectives {
    top: 100px;
    left: 10px;
    max-width: 200px;
  }
  .mission-obj-item {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .panel-content {
    padding: 20px;
    max-width: 100%;
  }
  .settings-scroll {
    max-width: 100%;
  }
  .panel-content h2 {
    font-size: 1.4rem;
  }
  .settings-tabs {
    flex-wrap: wrap;
  }
  .stab {
    padding: 8px 6px;
    font-size: 0.7rem;
  }
  .setting-row {
    font-size: 0.78rem;
    padding: 8px 0;
  }
  .setting-control input[type="range"] {
    width: 90px;
  }
  .tutorial-content {
    flex-direction: column;
    padding: 20px;
    gap: 15px;
  }
  .portrait-frame {
    width: 70px;
    height: 70px;
  }
  .tutorial-text h2 {
    font-size: 1.2rem;
  }
  .dialogue-box {
    flex-direction: column;
    gap: 10px;
    padding: 15px;
  }
  .dialogue-portrait {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
    border: none;
    padding: 0;
  }
  .dialogue-portrait .portrait-icon {
    width: 35px;
    height: 35px;
    margin: 0;
  }
  .dialogue-line {
    font-size: 0.85rem;
  }
  .story-briefing {
    padding: 20px;
    margin: 10px;
  }
  .briefing-header h2 {
    font-size: 1.3rem;
  }
  .hint-content {
    padding: 8px 16px;
    max-width: 260px;
  }
  .hint-text-main {
    font-size: 0.85rem;
  }
  .hint-text-sub {
    font-size: 0.65rem;
  }
  #boss-health {
    width: 250px;
    bottom: 180px;
  }
  .weapon-card {
    padding: 10px;
  }
  .weapon-card .weapon-icon {
    font-size: 1.5rem;
  }
  .shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
  }
  .armory-content {
    max-width: 100%;
  }
  .weapon-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .game-title, .menu-title {
    font-size: 1.5rem;
  }
  .menu-buttons {
    min-width: 180px;
  }
  .menu-btn {
    padding: 10px 15px;
    font-size: 0.8rem;
  }
  .hud-minimap {
    width: 70px;
    height: 70px;
  }
  .ammo-display {
    font-size: 1.1rem;
  }
  .mobile-weapon-slot {
    width: 36px;
    height: 36px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .hud-crosshair {
    display: none;
  }
  .desktop-controls-hint {
    display: none !important;
  }
  .mobile-controls-hint {
    display: block !important;
  }
}

.mobile-joystick-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.3);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: background 0.1s;
}

.mobile-joystick.active .mobile-joystick-inner {
  background: rgba(255, 255, 255, 0.4);
}

.mobile-btn {
  position: fixed;
  border-radius: 50%;
  z-index: 50;
  pointer-events: auto;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: transform 0.1s, background 0.1s;
}

.mobile-btn:active {
  transform: scale(0.9);
}

.mobile-fire-btn {
  right: 25px;
  bottom: 70px;
  width: 90px;
  height: 90px;
  background: rgba(255, 30, 30, 0.35);
  border: 3px solid rgba(255, 30, 30, 0.6);
  font-size: 0.8rem;
  font-weight: bold;
  color: #fff;
  letter-spacing: 0.1em;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.2);
}

.mobile-fire-btn:active {
  background: rgba(255, 30, 30, 0.6);
}

.mobile-jump-btn {
  right: 130px;
  bottom: 110px;
  width: 65px;
  height: 65px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.25);
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
}

.mobile-jump-btn:active {
  background: rgba(255, 255, 255, 0.3);
}

.mobile-crouch-btn {
  right: 130px;
  bottom: 40px;
  width: 55px;
  height: 55px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  font-size: 0.6rem;
  color: #aaa;
}

.mobile-reload-btn {
  right: 205px;
  bottom: 110px;
  width: 55px;
  height: 55px;
  background: rgba(255, 170, 0, 0.15);
  border: 2px solid rgba(255, 170, 0, 0.3);
  font-size: 0.6rem;
  font-weight: bold;
  color: #ffaa00;
}

.mobile-sprint-btn {
  left: 170px;
  bottom: 80px;
  width: 55px;
  height: 55px;
  background: rgba(0, 200, 255, 0.12);
  border: 2px solid rgba(0, 200, 255, 0.25);
  font-size: 0.55rem;
  font-weight: 600;
  color: #00ccff;
}

.mobile-sprint-btn.active {
  background: rgba(0, 200, 255, 0.35);
  border-color: rgba(0, 200, 255, 0.6);
}

.mobile-grenade-btn {
  right: 205px;
  bottom: 45px;
  width: 50px;
  height: 50px;
  background: rgba(0, 200, 80, 0.12);
  border: 2px solid rgba(0, 200, 80, 0.25);
  font-size: 0.55rem;
  font-weight: 600;
  color: #00cc55;
}

.mobile-interact-btn {
  right: 270px;
  bottom: 80px;
  width: 50px;
  height: 50px;
  background: rgba(200, 200, 0, 0.12);
  border: 2px solid rgba(200, 200, 0, 0.25);
  font-size: 0.55rem;
  font-weight: 600;
  color: #cccc00;
  display: none;
}

.mobile-interact-btn.visible {
  display: flex;
}

.mobile-weapon-bar {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 50;
  pointer-events: auto;
  touch-action: none;
}

.mobile-weapon-slot {
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  color: #888;
  transition: all 0.15s;
}

.mobile-weapon-slot.active {
  border-color: #ff4444;
  background: rgba(255, 68, 68, 0.2);
  color: #fff;
}

.mobile-weapon-slot .slot-num {
  font-size: 0.45rem;
  color: #555;
  margin-bottom: 1px;
}

.mobile-weapon-slot .slot-icon {
  font-size: 0.9rem;
}

.mobile-pause-btn {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  z-index: 50;
  pointer-events: auto;
  font-size: 1.2rem;
  color: #aaa;
}
  .menu-subtitle {
    font-size: 0.8rem;
    letter-spacing: 0.5em;
  }
  .loading-bar-container {
    width: 250px;
  }
  .hud-minimap {
    width: 100px;
    height: 100px;
  }
  .ammo-display {
    font-size: 1.5rem;
  }
  .health-bar-outer {
    width: 120px;
  }
}

/* Mobile joystick */
.mobile-joystick {
  position: fixed;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  z-index: 50;
  pointer-events: auto;
}

.mobile-joystick-inner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.mobile-fire-btn {
  position: fixed;
  right: 30px;
  bottom: 80px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 0, 0, 0.3);
  border: 2px solid rgba(255, 0, 0, 0.5);
  z-index: 50;
  pointer-events: auto;
  font-size: 0.7rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-jump-btn {
  position: fixed;
  right: 130px;
  bottom: 100px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.2);
  z-index: 50;
  pointer-events: auto;
  font-size: 0.6rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-reload-btn {
  position: fixed;
  right: 130px;
  bottom: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 50;
  pointer-events: auto;
  font-size: 0.55rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tutorial Overlay */
#tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  pointer-events: auto;
}

.tutorial-content {
  display: flex;
  gap: 30px;
  max-width: 700px;
  padding: 40px;
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 8px;
}

.tutorial-portrait {
  flex-shrink: 0;
  text-align: center;
}

.portrait-frame {
  width: 100px;
  height: 100px;
  border: 3px solid #ff4444;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.portrait-soldier {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2a3a2a 0%, #1a2a1a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.portrait-soldier::after {
  content: '🎖️';
}

.portrait-name {
  font-size: 0.75rem;
  color: #888;
}

.tutorial-text {
  flex: 1;
}

.tutorial-text h2 {
  font-size: 1.5rem;
  color: #ff4444;
  margin-bottom: 12px;
}

.tutorial-text p {
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 20px;
}

.tutorial-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
  transition: background 0.3s;
}

.progress-dot.active {
  background: #ff4444;
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
}

.tutorial-btn {
  padding: 12px 30px;
  background: #ff4444;
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  pointer-events: auto;
}

.tutorial-btn:hover {
  background: #ff6666;
}

.tutorial-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.action-hint {
  text-align: center;
  padding: 30px 50px;
  background: rgba(20, 20, 30, 0.9);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 8px;
}

.action-hint h3 {
  font-size: 1.3rem;
  color: #ff4444;
  margin-bottom: 10px;
}

.action-hint p {
  color: #ccc;
  margin-bottom: 15px;
}

.action-objective {
  padding: 10px 20px;
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 4px;
  margin-bottom: 15px;
}

.obj-arrow {
  color: #ff4444;
  margin-right: 8px;
}

.tutorial-complete-step {
  text-align: center;
  padding: 30px 50px;
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(68, 255, 68, 0.3);
  border-radius: 8px;
}

.checkmark {
  font-size: 3rem;
  color: #44ff44;
  margin-bottom: 10px;
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.tutorial-complete-step h3 {
  color: #44ff44;
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.tutorial-complete-step p {
  color: #888;
}

.tutorial-final {
  text-align: center;
  padding: 40px 60px;
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 8px;
}

.tutorial-final h2 {
  font-size: 2rem;
  color: #ff4444;
  margin-bottom: 15px;
}

.tutorial-final p {
  color: #ccc;
  margin-bottom: 10px;
}

.story-intro {
  font-style: italic;
  color: #888;
  margin: 20px 0 30px !important;
  line-height: 1.8;
}

.start-campaign {
  background: #ff4444;
  padding: 15px 40px;
  font-size: 1.1rem;
}

.start-campaign:hover {
  background: #ff6666;
}

/* Story Overlay */
#story-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  pointer-events: auto;
}

.story-briefing {
  max-width: 600px;
  padding: 40px;
  background: rgba(15, 15, 25, 0.98);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 8px;
  text-align: center;
}

.briefing-header {
  margin-bottom: 25px;
}

.briefing-number {
  font-size: 0.75rem;
  color: #ff4444;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.briefing-header h2 {
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 5px;
}

.briefing-subtitle {
  color: #888;
  font-style: italic;
}

.briefing-body {
  text-align: right;
  margin-bottom: 20px;
}

.briefing-body p {
  color: #ccc;
  line-height: 1.8;
}

.briefing-objectives {
  text-align: right;
  margin-bottom: 25px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}

.briefing-objectives h4 {
  color: #888;
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.obj-item {
  padding: 5px 0;
  color: #aaa;
  font-size: 0.85rem;
}

.obj-item .obj-icon {
  color: #ff4444;
  margin-left: 8px;
}

.story-btn {
  padding: 12px 30px;
  background: #ff4444;
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  pointer-events: auto;
}

.story-btn:hover {
  background: #ff6666;
}

.story-complete {
  text-align: center;
  padding: 40px;
}

.complete-badge {
  font-size: 4rem;
  color: #ffd700;
  margin-bottom: 15px;
}

.story-complete h2 {
  font-size: 2rem;
  color: #44ff44;
  margin-bottom: 5px;
}

.story-complete h3 {
  color: #888;
  margin-bottom: 20px;
}

.rewards {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 25px;
}

.reward {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  color: #ffd700;
}

.reward-icon {
  font-size: 1.3rem;
}

.story-ending {
  text-align: center;
  padding: 50px;
  max-width: 600px;
}

.story-ending h1 {
  font-size: 3rem;
  color: #ff4444;
  letter-spacing: 0.3em;
  margin-bottom: 5px;
}

.story-ending h2 {
  font-size: 1.5rem;
  color: #888;
  margin-bottom: 30px;
}

.ending-text {
  color: #ccc;
  line-height: 1.8;
  margin-bottom: 15px;
}

.ending-credits {
  margin: 30px 0;
  padding: 20px;
  border-top: 1px solid #333;
  border-bottom: 1px solid #333;
}

.ending-credits p {
  color: #666;
  margin: 5px 0;
}

/* Dialogue Overlay */
#dialogue-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  padding: 20px;
  pointer-events: auto;
  cursor: pointer;
}

.dialogue-box {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 20px;
  padding: 20px;
  background: rgba(10, 10, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  backdrop-filter: blur(10px);
}

.dialogue-portrait {
  flex-shrink: 0;
  width: 80px;
  text-align: center;
  padding: 10px;
  border: 2px solid;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
}

.portrait-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 8px;
}

.portrait-info .portrait-name {
  font-size: 0.7rem;
  color: #fff;
  font-weight: bold;
  margin-bottom: 2px;
}

.portrait-info .portrait-role {
  font-size: 0.6rem;
  color: #666;
}

.dialogue-text {
  flex: 1;
}

.dialogue-line {
  color: #eee;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

.dialogue-continue {
  color: #555;
  font-size: 0.75rem;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Mission Objectives Panel */
.hud-mission-objectives {
  position: absolute;
  top: 200px;
  left: 20px;
  max-width: 280px;
  pointer-events: none;
}

.mission-obj-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 4px;
  background: rgba(0, 0, 0, 0.5);
  border-left: 2px solid #ff4444;
  font-size: 0.8rem;
  color: #ccc;
  transition: all 0.3s;
}

.mission-obj-item.done {
  border-left-color: #44ff44;
  color: #666;
  text-decoration: line-through;
}

.obj-check {
  width: 14px;
  height: 14px;
  border: 2px solid #555;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  flex-shrink: 0;
}

.mission-obj-item.done .obj-check {
  border-color: #44ff44;
  color: #44ff44;
}

.obj-check::after {
  content: '✓';
  opacity: 0;
}

.mission-obj-item.done .obj-check::after {
  opacity: 1;
}

/* Boss Health Bar */
#boss-health {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  z-index: 20;
  display: none;
  pointer-events: none;
}

#boss-name {
  text-align: center;
  color: #ff4444;
  font-size: 0.85rem;
  margin-bottom: 6px;
  letter-spacing: 0.1em;
}

.boss-health-outer {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

#boss-health-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff0000, #ff4444);
  transition: width 0.2s;
  border-radius: 4px;
}

/* Game Hint System */
#game-hint {
  position: fixed;
  z-index: 18;
  pointer-events: none;
  display: none;
}

#game-hint.hint-fade-in {
  animation: hintIn 0.4s ease-out;
}

#game-hint.hint-fade-out {
  animation: hintOut 0.3s ease-in forwards;
}

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

@keyframes hintOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.hint-content {
  text-align: center;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  backdrop-filter: blur(8px);
  max-width: 320px;
}

.hint-content.bottom-center {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
}

.hint-content.bottom-right {
  position: fixed;
  bottom: 100px;
  right: 30px;
}

.hint-content.top-center {
  position: fixed;
  top: 140px;
  left: 50%;
  transform: translateX(-50%);
}

.hint-content.top-left {
  position: fixed;
  top: 200px;
  left: 30px;
}

.hint-key {
  font-size: 1.8rem;
  font-weight: 900;
  color: #ff4444;
  text-shadow: 0 0 12px rgba(255, 68, 68, 0.4);
  margin-bottom: 4px;
}

.hint-text-main {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 600;
  margin-bottom: 4px;
}

.hint-text-sub {
  font-size: 0.75rem;
  color: #888;
}
