:root {
  --bg-outer: #05070b;
  --slate-900: rgba(15, 23, 42, 0.88);
  --slate-800: rgba(30, 41, 59, 0.92);
  --border-subtle: rgba(148, 163, 184, 0.25);
  --cyan-glow: #38bdf8;
  --amber-gold: #fbbf24;
  --orange-fire: #f97316;
  --red-hp: #ef4444;
  --green-deploy: #22c55e;
  --purple-mystery: #c084fc;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at center, #111827 0%, #030508 100%);
  font-family: 'Rajdhani', system-ui, -apple-system, sans-serif;
  color: #f8fafc;
}

#game-shell {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fully responsive viewport across mobile, tablet, and desktop screens */
#viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #0a0d12;
  overflow: hidden;
  touch-action: none;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hidden {
  display: none !important;
}

/* HUD LAYERS */
.hud-layer {
  position: absolute;
  z-index: 10;
  pointer-events: none;
}

.hud-layer button {
  pointer-events: auto;
}

/* TOP-LEFT HUD */
#hud-top-left {
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  zoom: clamp(0.82, calc(100vw / 540), 1.24);
}

.player-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 15, 24, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 5px 8px 5px 5px;
  backdrop-filter: blur(6px);
}

.avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: visible;
  border: 2px solid var(--cyan-glow);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
  background: #0f172a;
}

.avatar-wrap img, .avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
}

.level-badge {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid #7dd3fc;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.bars-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 118px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.medic-cross {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--red-hp);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  line-height: 14px;
  text-align: center;
  flex-shrink: 0;
}

.xp-star {
  width: 14px;
  font-size: 9px;
  font-weight: 700;
  color: var(--amber-gold);
  text-align: center;
  flex-shrink: 0;
}

.bar-track {
  position: relative;
  flex: 1;
  height: 14px;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.12);
  overflow: hidden;
}

.xp-track {
  height: 11px;
}

.bar-fill {
  height: 100%;
  transition: width 0.15s ease-out;
}

.hp-fill {
  background: linear-gradient(90deg, #dc2626, #ef4444, #f87171);
}

.xp-fill {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

.bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  text-shadow: 0 1px 2px #000;
}

.buff-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.buff-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--amber-gold);
  color: var(--amber-gold);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.25);
}

.buff-pill.dmg {
  border-color: #f97316;
  color: #fb923c;
}

/* TOP-RIGHT HUD */
#hud-top-right {
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  zoom: clamp(0.82, calc(100vw / 540), 1.24);
  align-items: flex-end;
  gap: 8px;
}

.top-right-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.coin-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(10, 15, 24, 0.82);
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 20px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 14px;
  color: #fde68a;
}

.coin-icon {
  color: var(--amber-gold);
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.8);
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:active {
  transform: scale(0.92);
}

.combo-box {
  text-align: right;
  padding: 4px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.28), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(249, 115, 22, 0.55);
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.3);
}

.combo-main {
  font-family: 'Teko', sans-serif;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  color: #fb923c;
  text-shadow: 0 0 10px rgba(249, 115, 22, 0.7);
}

.combo-pts {
  font-size: 11px;
  font-weight: 700;
  color: #fde68a;
}

/* KILL FEED & CENTER BANNERS */
.kill-feed {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.feed-item {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fef08a;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
  animation: feedFade 1.5s ease-out forwards;
}

@keyframes feedFade {
  0% { opacity: 0; transform: translateY(6px) scale(0.92); }
  15% { opacity: 1; transform: translateY(0) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}

.center-banner {
  position: absolute;
  top: 26%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  pointer-events: none;
  text-align: center;
  padding: 10px 26px;
  background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.9), transparent);
  border-top: 2px solid rgba(251, 191, 36, 0.7);
  border-bottom: 2px solid rgba(251, 191, 36, 0.7);
  width: 90%;
}

.center-banner-text {
  font-family: 'Black Ops One', sans-serif;
  font-size: 26px;
  letter-spacing: 2px;
  color: var(--amber-gold);
  text-shadow: 0 0 16px rgba(251, 191, 36, 0.75), 0 2px 4px #000;
}

.center-banner-sub {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #e2e8f0;
  margin-top: 2px;
}

/* RIGHT-SIDE TACTICAL BAR */
.tactical-bar {
  position: absolute;
  right: 8px;
  top: 13%;
  z-index: 11;
  display: flex;
  flex-direction: column;
  gap: 4px;
  zoom: clamp(0.82, calc(100vw / 540), 1.24);
}

.tac-btn {
  width: 54px;
  padding: 5px 2px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
  color: #f1f5f9;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  transition: transform 0.1s, border-color 0.15s;
}

.tac-btn:hover {
  border-color: var(--amber-gold);
}

.tac-btn:active {
  transform: scale(0.93);
}

.tac-btn.disabled {
  opacity: 0.48;
}

.tac-icon {
  font-size: 16px;
  line-height: 1.1;
}

.tac-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #cbd5e1;
}

.tac-cost {
  font-size: 10px;
  font-weight: 700;
  color: var(--amber-gold);
}

.tac-cost.kit-ready {
  color: #4ade80;
}

/* BOTTOM-CENTER WAVE BAR */
.hud-bottom-center {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  width: 136px;
  zoom: clamp(0.82, calc(100vw / 540), 1.24);
}

@media (max-width: 520px) {
  .hud-bottom-center {
    width: 124px;
    bottom: 10px;
  }
  .action-cluster {
    right: 8px;
    bottom: 14px;
  }
  .joystick-zone {
    left: 8px;
    bottom: 12px;
  }
}

@media (min-width: 900px) {
  #hud-top-left,
  #hud-top-right,
  #tactical-bar,
  #hud-bottom-center,
  .joystick-zone,
  .action-cluster {
    zoom: 1.24;
  }
}

.wave-progress-wrap {
  background: rgba(10, 15, 24, 0.82);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 5px 8px;
}

.wave-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

#wave-label {
  color: #f8fafc;
  letter-spacing: 0.5px;
}

.kill-counter {
  color: #fca5a5;
}

.wave-bar-track {
  height: 6px;
  background: rgba(30, 41, 59, 0.9);
  border-radius: 4px;
  overflow: hidden;
}

.wave-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #fbbf24);
  transition: width 0.2s ease;
}

/* CONTROLS LAYER */
.controls-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.joystick-zone {
  position: absolute;
  bottom: 16px;
  left: 14px;
  width: 120px;
  height: 120px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  zoom: clamp(0.82, calc(100vw / 540), 1.24);
}

.joystick-base {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.45);
  border: 2px solid rgba(56, 189, 248, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}

.joystick-knob {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #7dd3fc, #0284c7);
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.55);
  transform: translate(0px, 0px);
}

.action-cluster {
  position: absolute;
  bottom: 18px;
  right: 14px;
  width: 136px;
  height: 136px;
  pointer-events: none;
  zoom: clamp(0.82, calc(100vw / 540), 1.24);
}

.fire-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 30%, #f97316, #b91c1c);
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.6), inset 0 2px 6px rgba(255,255,255,0.35);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fire-btn:active, .fire-btn.firing {
  transform: scale(0.94);
  box-shadow: 0 0 30px rgba(249, 115, 22, 0.9);
}

.reload-ring {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  transform: rotate(-90deg);
  pointer-events: none;
}

.reload-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 5;
}

.reload-ring-fg {
  fill: none;
  stroke: #fbbf24;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
}

.fire-btn-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.ammo-count {
  font-family: 'Teko', sans-serif;
  font-size: 30px;
  font-weight: 700;
}

.ammo-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  opacity: 0.9;
}

.sub-action-btn {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.sub-action-btn:active {
  transform: scale(0.92);
}

.dash-btn {
  bottom: 8px;
  right: 92px;
  border-color: rgba(56, 189, 248, 0.6);
}

.grenade-btn {
  bottom: 92px;
  right: 12px;
  border-color: rgba(251, 191, 36, 0.65);
  overflow: visible;
}

.weapon-pill {
  position: absolute;
  bottom: 112px;
  right: 76px;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid var(--cyan-glow);
  color: #e0f2fe;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
  white-space: nowrap;
}

.crouch-btn {
  bottom: 62px;
  right: 96px;
  width: 40px;
  height: 40px;
  border-color: rgba(74, 222, 128, 0.55);
}

.crouch-btn.active {
  background: rgba(22, 101, 52, 0.92);
  border-color: #4ade80;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.65);
}

.reload-btn {
  bottom: 144px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-color: rgba(148, 163, 184, 0.6);
}

.difficulty-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 12px;
}

.diff-btn {
  padding: 7px 2px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.85);
  color: #94a3b8;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.diff-btn.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #7dd3fc;
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.stages-btn {
  width: 100%;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.6);
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #e0f2fe;
  font-family: 'Black Ops One', sans-serif;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
}

.stages-card {
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  background: linear-gradient(180deg, rgba(20, 28, 45, 0.98), rgba(10, 14, 23, 0.99));
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.stages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding: 4px;
  margin: 10px 0 12px;
  max-height: 58vh;
}

.stage-tile {
  padding: 8px 6px;
  border-radius: 9px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stage-tile:hover:not(.locked) {
  border-color: var(--amber-gold);
  transform: translateY(-1px);
}

.stage-tile.locked {
  opacity: 0.48;
  border-color: rgba(148, 163, 184, 0.25);
  cursor: not-allowed;
}

.stage-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan-glow);
}

.stage-tile.locked .stage-num {
  color: #94a3b8;
}

.stage-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: #e2e8f0;
}

.stage-lock {
  font-size: 10px;
  color: #fca5a5;
  margin-top: 2px;
}

.mode-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.endless-btn {
  width: 100%;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid rgba(192, 132, 252, 0.65);
  background: linear-gradient(135deg, #6b21a8, #4c1d95);
  color: #f3e8ff;
  font-family: 'Black Ops One', sans-serif;
  font-size: 15px;
  letter-spacing: 1.2px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(126, 34, 206, 0.4);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 20px;
}

.opt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.opt-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--amber-gold);
}

.act-icon {
  font-size: 19px;
}

.act-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--amber-gold);
  color: #0f172a;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.cd-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

/* SENTRY DEPLOY MODAL */
.sentry-modal {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  z-index: 25;
}

.sentry-modal-card {
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid var(--green-deploy);
  border-radius: 14px;
  padding: 12px 16px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85);
}

.sentry-modal-title {
  font-family: 'Black Ops One', sans-serif;
  font-size: 18px;
  color: #4ade80;
  letter-spacing: 1px;
}

.sentry-modal-desc {
  font-size: 13px;
  color: #cbd5e1;
  margin: 4px 0 12px;
}

.sentry-modal-actions {
  display: flex;
  gap: 10px;
}

.modal-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.btn-cancel {
  background: #334155;
  color: #e2e8f0;
}

.btn-deploy {
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #0f172a;
}

/* OVERLAY SCREENS */
.overlay-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(5, 8, 15, 0.86);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Title-screen artwork: use the wide composition on desktop and the
   portrait compositions on narrow screens so the scene stays readable
   behind the start menu at every aspect ratio. */
#start-overlay {
  background-image:
    linear-gradient(90deg, rgba(3, 5, 8, 0.78), rgba(3, 5, 8, 0.38) 52%, rgba(3, 5, 8, 0.78)),
    url('../assets/start-bg-wide.jfif');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

@media (max-width: 520px) {
  #start-overlay {
    background-image:
      linear-gradient(180deg, rgba(3, 5, 8, 0.48), rgba(3, 5, 8, 0.82)),
      url('../assets/start-bg-portrait-a.jfif');
    background-position: center;
  }
}

@media (min-width: 521px) and (max-aspect-ratio: 4/5) {
  #start-overlay {
    background-image:
      linear-gradient(180deg, rgba(3, 5, 8, 0.48), rgba(3, 5, 8, 0.82)),
      url('../assets/start-bg-portrait-b.jfif');
  }
}

.start-card, .menu-card {
  width: 100%;
  max-width: 390px;
  background: linear-gradient(180deg, rgba(20, 28, 45, 0.96), rgba(10, 14, 23, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.85);
}

.title-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--cyan-glow);
  margin-bottom: 6px;
}

.title-logo-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto 10px;
  display: block;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 18px rgba(251, 146, 60, 0.45));
}

.game-title {
  font-family: 'Black Ops One', sans-serif;
  font-size: 38px;
  line-height: 1.05;
  color: #f8fafc;
  text-shadow: 0 4px 18px rgba(0,0,0,0.9);
  margin-bottom: 12px;
}

.game-title span {
  color: var(--amber-gold);
  text-shadow: 0 0 22px rgba(251, 191, 36, 0.55);
}

.start-desc, .menu-desc {
  font-size: 14px;
  line-height: 1.45;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.controls-hint {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: #94a3b8;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 18px;
}

.controls-hint b {
  color: #e2e8f0;
}

.primary-btn {
  width: 100%;
  padding: 13px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  font-family: 'Black Ops One', sans-serif;
  font-size: 17px;
  letter-spacing: 1.2px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(234, 88, 12, 0.45);
}

.primary-btn:active {
  transform: scale(0.97);
}

.secondary-btn {
  width: 100%;
  margin-top: 10px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.pulse-btn {
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 18px rgba(234, 88, 12, 0.45); }
  50% { box-shadow: 0 4px 28px rgba(251, 191, 36, 0.75); }
}

.menu-title {
  font-family: 'Black Ops One', sans-serif;
  font-size: 30px;
  color: var(--amber-gold);
  margin-bottom: 8px;
}

.end-stats {
  background: rgba(15, 23, 42, 0.85);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #e2e8f0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  text-align: left;
}

/* BETWEEN-WAVE UPGRADE SCREEN */
.upgrade-panel {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.upgrade-title {
  font-family: 'Black Ops One', sans-serif;
  font-size: 28px;
  color: #facc15;
  text-shadow: 0 0 18px rgba(250, 204, 21, 0.55);
  letter-spacing: 1px;
}

.upgrade-subtitle {
  font-size: 13px;
  color: #e2e8f0;
  margin-top: 4px;
  margin-bottom: 10px;
}

.mission-tracker {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-bottom: 14px;
}

.mission-tracker .sep {
  color: #475569;
}

.upgrade-cards {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upgrade-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 2px solid #38bdf8;
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
}

.upgrade-card.firepower {
  border-color: #f97316;
}

.upgrade-card.automation {
  border-color: #38bdf8;
}

.upgrade-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.upgrade-card:active {
  transform: scale(0.98);
}

.upg-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.upg-body {
  flex: 1;
}

.upg-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #38bdf8;
}

.upgrade-card.firepower .upg-cat {
  color: #fb923c;
}

.upg-name {
  font-family: 'Teko', sans-serif;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 700;
  color: #f8fafc;
}

.upg-desc {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.3;
}

.upgrade-footer {
  margin-top: 12px;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}
