/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111118;
  font-family: 'Cabinet Grotesk', 'Poppins', -apple-system, sans-serif;
  color: #ffffff;
  -webkit-font-smoothing: antialiased;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ===== THREE.JS CANVAS ===== */
#game-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0;
  cursor: default;
  touch-action: none;
}

body.is-rotating, body.is-rotating * {
  cursor: grabbing !important;
}

/* ===== START SCREEN OVERLAY ===== */
#start-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Moved to the right side */
  justify-content: flex-end;
  padding-bottom: 7vh;
  padding-right: 6vw;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#start-overlay.visible {
  opacity: 1;
  pointer-events: none; /* Let drag pass through to 3D scene */
}

/* Subtle corner vignette for readability */
#start-overlay::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 65%;
  height: 55%;
  background: radial-gradient(ellipse at bottom right, rgba(10, 10, 16, 0.85) 0%, rgba(10, 10, 16, 0.35) 45%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.start-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Right align elements */
  gap: 6px;
  pointer-events: auto;
}

.game-subtitle {
  font-family: 'Cabinet Grotesk', 'Poppins', sans-serif;
  font-size: clamp(0.65rem, 1.4vw, 0.85rem);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  text-align: right;
}

.game-title {
  font-family: 'Cabinet Grotesk', 'Poppins', sans-serif;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: right;
  line-height: 0.95;
  color: #ffffff;
}

.start-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.start-btn {
  margin-top: 0;
  padding: 14px 48px;
  font-size: 1rem;
  font-weight: 800;
  font-family: 'Cabinet Grotesk', 'Poppins', sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #111118;
  background: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.start-btn:hover {
  background: #f1f5f9;
}

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

.view-runs-btn {
  padding: 14px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Cabinet Grotesk', 'Poppins', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #f8fafc;
  background: rgba(22, 27, 34, 0.95);
  border: 1px solid #30363d;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.view-runs-btn:hover {
  background: #21262d;
  border-color: #485466;
}

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

.icon-inline {
  font-size: 1.15em;
  vertical-align: -0.18em;
  line-height: 1;
  display: inline-block;
  margin-right: 6px;
  user-select: none;
}

/* Home Screen Top-Right Settings Button */
.start-top-bar {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 50;
  pointer-events: auto;
}

.home-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  outline: none;
  padding: 6px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  border-radius: 50%;
  box-shadow: none !important;
  backdrop-filter: none !important;
  transition: color 0.22s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.home-settings-btn:hover {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #ffffff;
  transform: rotate(60deg) scale(1.15);
  opacity: 1;
}

.home-settings-btn:active {
  background: transparent !important;
  border: none !important;
  transform: rotate(60deg) scale(0.95);
}

.home-settings-btn .material-symbols-outlined {
  font-size: 32px;
  line-height: 1;
  display: block;
  user-select: none;
}

/* Settings Modal Controls */
.settings-card {
  width: min(500px, 94vw);
  max-height: min(85vh, 660px);
  display: flex !important;
  flex-direction: column !important;
  background: #0f0f12 !important;
  border: 1px solid #27272a !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.settings-card .modal-header-row {
  flex-shrink: 0;
  margin-bottom: 8px;
}

.settings-card .modal-actions {
  flex-shrink: 0;
  margin-top: 10px;
  display: flex;
}

.settings-card .modal-actions button {
  width: 100%;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  flex: 1 1 auto;
  min-height: 0;
  /* Clean minimalist dark scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 #18181b;
}

.settings-content::-webkit-scrollbar {
  width: 6px;
}

.settings-content::-webkit-scrollbar-track {
  background: #18181b;
  border-radius: 3px;
}

.settings-content::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 3px;
}

.settings-content::-webkit-scrollbar-thumb:hover {
  background: #71717a;
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #18181b;
  padding: 12px 16px;
  border: 1px solid #27272a;
  border-radius: 4px;
  box-shadow: none;
}

.setting-toggle-row {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.setting-label-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-name {
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 700;
  color: #d4d4d8;
  letter-spacing: 0.05em;
}

.setting-val {
  font-family: var(--font-mono, monospace);
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
}

.cyber-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #27272a;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  box-shadow: none;
}

.cyber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #71717a;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.12s ease;
}

.cyber-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.cyber-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #71717a;
  cursor: pointer;
  box-shadow: none;
}

.cyber-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.cyber-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cyber-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #27272a;
  transition: .2s;
  border-radius: 24px;
  border: 1px solid #3f3f46;
  box-shadow: none;
}

.cyber-switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  transition: .2s;
  border-radius: 50%;
  box-shadow: none;
}

.cyber-switch input:checked + .cyber-switch-slider {
  background-color: #52525b;
  border-color: #71717a;
}

.cyber-switch input:checked + .cyber-switch-slider:before {
  transform: translateX(22px);
}

/* Recent Runs Modal Styles */
.recent-runs-card {
  width: min(520px, 94vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #0f0f12 !important;
  border: 1px solid #27272a !important;
  box-shadow: none !important;
}

.modal-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-title-compact {
  margin-bottom: 0;
  font-size: 20px;
}

.close-icon-btn {
  background: transparent;
  border: 1px solid #27272a;
  color: #a1a1aa;
  font-family: var(--font-mono);
  font-size: 14px;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 80ms ease, color 80ms ease;
  box-shadow: none;
}

.close-icon-btn:hover {
  background: #18181b;
  color: #ffffff;
}

.recent-runs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  overflow-y: auto;
  max-height: 55vh;
  padding-right: 4px;
}

.no-runs-msg {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #71717a;
  text-align: center;
  padding: 30px 10px;
  border: 1px dashed #27272a;
  border-radius: 3px;
}

.run-log-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 3px;
  box-shadow: none;
}

.run-log-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.run-log-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.05em;
}

.run-log-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #71717a;
}

.run-log-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 6px 8px;
  background: #121214;
  border: 1px solid #27272a;
  border-radius: 2px;
  box-shadow: none;
}

.run-metric-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.run-metric-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #71717a;
}

.run-metric-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.run-metric-val.score {
  color: #ffffff;
}

.run-log-parts {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #a1a1aa;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.controls-hint {
  font-family: 'Cabinet Grotesk', 'Poppins', sans-serif;
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: right;
}

/* ===== DEBUG (hidden unless ?debug=1) ===== */
#debug-box {
  display: none;
  position: fixed;
  top: 40px;
  left: 10px;
  z-index: 999;
  background: rgba(0, 0, 0, 0.75);
  color: #0f0;
  font-family: monospace;
  font-size: 11px;
  padding: 10px;
  border-radius: 6px;
  max-width: 90vw;
  max-height: 40vh;
  overflow-y: auto;
  white-space: pre-wrap;
}

#debug-toggle {
  display: none;
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 10px;
  cursor: pointer;
  font-family: monospace;
}

/* ===== RESPONSIVE: PORTRAIT ===== */
@media (max-aspect-ratio: 1/1) {
  #start-overlay {
    align-items: center;
    justify-content: flex-end;
    padding-right: 0;
    padding-bottom: 4vh;
  }

  #start-overlay::after {
    width: 100%;
    height: 45%;
    background: linear-gradient(to top, rgba(10, 10, 16, 0.9) 0%, rgba(10, 10, 16, 0.4) 60%, transparent 100%);
  }

  .start-content {
    align-items: center;
    width: 100%;
    padding: 0 16px;
  }

  .game-title, .game-subtitle {
    text-align: center;
  }

  .game-title {
    font-size: clamp(2.0rem, 8.5vw, 3.2rem);
    letter-spacing: 2px;
  }

  .game-subtitle {
    letter-spacing: 3px;
  }

  .start-btn {
    width: min(280px, 80vw);
    padding: 13px 0;
    font-size: 0.95rem;
    margin-top: 10px;
  }
}

/* ============================================================
   RUNNER HUD, PANELS, OVERLAYS & UI STYLES (BRUTALIST HARDWARE ARCADE)
   ============================================================ */
:root {
  --hud-bg: #0d1117;
  --hud-surface: #161b22;
  --hud-surface-hover: #21262d;
  --hud-border: #2b323b;
  --hud-border-active: #384250;
  --hud-border-highlight: #485466;

  --text-pure: #f8fafc;
  --text-muted: #8b949e;
  --text-dim: #6e7681;

  --accent-amber: #f59e0b;
  --accent-amber-bright: #fbbf24;
  --accent-green: #10b981;
  --accent-cyan: #38bdf8;
  --accent-red: #ef4444;

  --cyan: #38bdf8;
  --emerald: #10b981;
  --gold: #e5b84b;
  --gold-bright: #fbbf24;
  --amber: #f97316;
  --danger: #ef4444;

  --font-ui: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

/* Runner Wrapper */
#runner-container {
  font-family: var(--font-ui);
  color: var(--text-pure);
}

/* Universal hidden attribute enforcement */
[hidden] {
  display: none !important;
}

#hud[hidden],
#specs-panel[hidden],
.specs-inventory-strip[hidden],
.mobile-touch-controls[hidden],
.runner-controls-hint[hidden],
.pickup-toast[hidden],
body.arena-mode #hud,
body.arena-mode #specs-panel,
body.arena-mode .specs-inventory-strip {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ─────────────────────────────────────────────────────────────
   1. TOP-LEFT MINIMAL TELEMETRY STRIP & TOP-RIGHT ACTION KEYS
   ───────────────────────────────────────────────────────────── */
#hud {
  position: fixed;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: none;
  z-index: 20;
  pointer-events: none;
}

/* Top-Left Telemetry Bar */
.hud-telemetry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 3px;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.hud-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.hud-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.hud-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-pure);
}.arena-mobile-btn.btn-slide

.hud-val-amber {
  color: var(--accent-amber-bright);
}

.hud-divider {
  font-family: var(--font-mono);
  color: var(--hud-border);
  font-size: 12px;
  user-select: none;
}

/* Top-Right Tactile Action Buttons (Mechanical Keycap Style) */
.hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.hud-keycap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 12px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-bottom: 3px solid #1a202c;
  border-radius: 3px;
  color: var(--text-pure);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background-color 70ms ease, border-color 70ms ease, transform 70ms ease;
}

.hud-keycap:hover {
  background: var(--hud-surface);
  border-color: var(--hud-border-highlight);
}

.hud-keycap:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

.keycap-label {
  font-weight: 700;
}

.keycap-sub {
  color: var(--text-dim);
  font-size: 10px;
}

.keycap-indicator {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.keycap-indicator.on {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber-bright);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.hud-keycap-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ─────────────────────────────────────────────────────────────
   2. COMPACT BOTTOM-LEFT HARDWARE INVENTORY STRIP
   ───────────────────────────────────────────────────────────── */
.specs-inventory-strip {
  position: fixed;
  bottom: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 20;
  pointer-events: none;
}

.hardware-slot {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  width: 96px;
  height: 44px;
  padding: 4px 8px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: border-color 140ms ease, background-color 140ms ease;
}

.hardware-slot.equipped {
  border-color: var(--hud-border-highlight);
  background: #11161f;
}

.hardware-slot.locked {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.08);
}

.hardware-slot.goat {
  border-color: rgba(245, 158, 11, 0.7);
  background: rgba(245, 158, 11, 0.08);
}

.slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slot-type {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.slot-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--text-dim);
  opacity: 0.4;
  transition: background-color 140ms ease, opacity 140ms ease;
}

.slot-status-dot.active {
  opacity: 1;
  background: var(--accent-green);
}

.slot-status-dot.tier-worse { background: var(--accent-red); }
.slot-status-dot.tier-bad { background: #f97316; }
.slot-status-dot.tier-average { background: var(--accent-green); }
.slot-status-dot.tier-above_average { background: var(--accent-cyan); }
.slot-status-dot.tier-goat { background: var(--accent-amber-bright); }

.slot-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-pure);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
}

/* ─────────────────────────────────────────────────────────────
   3. RUNNER CONTROL HINT (Fades out cleanly)
   ───────────────────────────────────────────────────────────── */
.runner-controls-hint {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  transition: opacity 300ms ease, visibility 300ms;
}

.runner-controls-hint.faded {
  opacity: 0;
  visibility: hidden;
}

.hint-sep {
  color: var(--hud-border);
}

/* ─────────────────────────────────────────────────────────────
   4. MOBILE TOUCH CONTROLS (Rendered on touch devices)
   ───────────────────────────────────────────────────────────── */
.mobile-touch-controls {
  display: none;
  position: fixed;
  bottom: 64px;
  left: 0;
  right: 0;
  padding: 0 16px;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 25;
}

@media (pointer: coarse) {
  .mobile-touch-controls {
    display: flex;
  }
}

.touch-cluster {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.touch-btn {
  width: 58px;
  height: 52px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-bottom: 3px solid #1a202c;
  border-radius: 3px;
  color: var(--text-pure);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
}

.touch-cluster-right .touch-btn {
  width: 78px;
  font-size: 11px;
}

.touch-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
  background: var(--hud-surface);
}

/* ─────────────────────────────────────────────────────────────
   5. ALL-GOAT STOP BAR
   ───────────────────────────────────────────────────────────── */
.goat-stop-bar {
  position: fixed;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: var(--hud-bg);
  border: 1px solid var(--accent-amber-bright);
  border-radius: 3px;
  z-index: 22;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.goat-stop-bar[hidden] {
  display: none;
}

.goat-stop-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-amber-bright);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.goat-stop-btn {
  padding: 5px 12px;
  border: none;
  border-radius: 2px;
  background: var(--accent-amber-bright);
  color: #0d1117;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 80ms ease;
}

.goat-stop-btn:hover {
  opacity: 0.9;
}

/* ─────────────────────────────────────────────────────────────
   6. VISUAL PICKUP TOAST & FLASH
   ───────────────────────────────────────────────────────────── */
.pickup-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-amber-bright);
  opacity: 0;
  pointer-events: none;
  z-index: 25;
  white-space: nowrap;
  background: var(--hud-bg);
  padding: 4px 10px;
  border: 1px solid var(--hud-border);
  border-radius: 2px;
}

.pickup-toast.show {
  animation: toast-rise 680ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast-rise {
  0% { opacity: 0; transform: translateX(-50%) translateY(4px); }
  18% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

.impact-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 28;
  opacity: 0;
  box-shadow: inset 0 0 80px rgba(239, 68, 68, 0.65);
  transition: opacity 180ms ease-out;
}

.impact-flash.active {
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────────
   7. PAUSE & GAME OVER OVERLAYS (BRUTALIST HARDWARE CARD)
   ───────────────────────────────────────────────────────────── */
.gameover-overlay,
.webgl-fallback {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 8, 11, 0.88);
  z-index: 40;
}

.gameover-overlay[hidden],
.webgl-fallback[hidden] {
  display: none;
}

.gameover-card {
  width: min(420px, 100%);
  padding: 24px 22px;
  background: #0f0f12;
  border: 1px solid #27272a;
  border-radius: 4px;
  text-align: left;
  box-shadow: none !important;
}

.gameover-reason {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #a1a1aa;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.gameover-title {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 16px;
}

.gameover-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 3px;
  box-shadow: none;
  margin-bottom: 12px;
}

.go-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.go-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #71717a;
}

.go-number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.go-gold {
  color: #ffffff;
}

.go-detail {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #a1a1aa;
  margin-bottom: 16px;
  line-height: 1.4;
}

.gameover-parts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
}

.go-part {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 9px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 3px;
  box-shadow: none;
}

.go-part-name {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #71717a;
}

.go-part-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Detailed 3D Hardware Build Summary Overlay ── */
.detailed-summary-card {
  width: min(1080px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  background: #0e0e11;
  border: 1px solid #27272a;
  border-radius: 6px;
  box-shadow: none !important;
  color: #ffffff;
}

.summary-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #27272a;
  padding-bottom: 16px;
  margin-bottom: 12px;
}

.summary-badge-reason {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #a1a1aa;
  text-transform: uppercase;
}

.summary-main-title {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 4px 0 0 0;
}

.summary-top-metrics {
  display: flex;
  gap: 12px;
}

.summary-metric-box {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 4px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
  box-shadow: none;
}

.metric-box-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #71717a;
  letter-spacing: 0.05em;
}

.metric-box-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.summary-bottleneck-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #a1a1aa;
  margin-bottom: 18px;
  line-height: 1.4;
}

.summary-body-grid {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

.summary-left-hardware {
  flex: 1.85;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #71717a;
}

.summary-hardware-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.part-3d-card {
  background: #141418;
  border: 1px solid #27272a;
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease;
  box-shadow: none;
}

.part-3d-card:hover {
  border-color: #52525b;
}

.part-3d-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
}

.part-3d-type {
  font-weight: 700;
  color: #71717a;
  letter-spacing: 0.05em;
}

.part-3d-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.part-3d-price-badge {
  font-weight: 700;
  color: #e4e4e7;
  font-size: 11px;
  background: #27272a;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid #3f3f46;
  box-shadow: none;
}

.part-3d-score-badge {
  font-weight: 700;
  color: #a1a1aa;
}

.part-3d-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.part-3d-viewport {
  position: relative;
  width: 100%;
  height: 145px;
  background: #09090b;
  border-radius: 3px;
  border: 1px solid #27272a;
  overflow: hidden;
}

.part-3d-canvas {
  width: 100% !important;
  height: 145px !important;
  display: block;
  cursor: grab;
}

.part-3d-canvas:active {
  cursor: grabbing;
}

.part-3d-drag-hint {
  position: absolute;
  bottom: 5px;
  right: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: #71717a;
  pointer-events: none;
  background: #141418;
  border: 1px solid #27272a;
  padding: 1px 5px;
  border-radius: 2px;
}

.summary-right-column {
  flex: 1.15;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-reserved-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.review-verdict-card {
  flex: 1;
  min-height: 280px;
  background: #141418;
  border: 1px solid #27272a;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: none !important;
}

.review-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #09090b;
  padding: 8px;
  min-height: 240px;
}

.review-verdict-img {
  max-width: 100%;
  max-height: 280px;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 2px;
}

.review-verdict-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #141418;
  border-top: 1px solid #27272a;
}

.review-verdict-tier {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.review-verdict-score {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #a1a1aa;
}

.reserved-cyber-slot {
  flex: 1;
  min-height: 280px;
  background: #141418;
  border: 1px dashed #3f3f46;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  text-align: center;
  gap: 8px;
  box-shadow: none;
}

.reserved-slot-icon {
  font-size: 32px;
  color: #71717a;
  filter: none;
}

.reserved-slot-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #e4e4e7;
}

.reserved-slot-desc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #71717a;
  max-width: 240px;
  line-height: 1.45;
}

.summary-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 820px) {
  .summary-body-grid {
    flex-direction: column;
  }
  .summary-hardware-grid {
    grid-template-columns: 1fr;
  }
  .summary-top-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

.play-again-btn {
  width: 100%;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid #ffffff;
  border-radius: 3px;
  background: #ffffff;
  color: #09090b;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 70ms ease, opacity 70ms ease;
  box-shadow: none !important;
}

.play-again-btn:hover {
  background: #e4e4e7;
}

.play-again-btn:active {
  transform: translateY(1px);
}

.modal-compact {
  width: min(380px, 100%);
}

.modal-actions-3 {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.continue-btn {
  width: 100%;
  min-height: 42px;
  padding: 10px 16px;
  background: #ffffff;
  color: #09090b;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid #ffffff;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: none !important;
  transition: background-color 0.12s ease;
}

.continue-btn:hover {
  background: #e4e4e7;
}

.continue-btn:active {
  transform: translateY(1px);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.secondary-btn {
  width: 100%;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #27272a;
  border-radius: 3px;
  background: #18181b;
  color: #d4d4d8;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: none !important;
  transition: background-color 70ms ease, border-color 70ms ease;
}

.secondary-btn:hover {
  background: #27272a;
  border-color: #3f3f46;
  color: #ffffff;
}

.secondary-btn:active {
  transform: translateY(1px);
}

/* Guide Modal Styling */
.guide-card {
  max-width: 580px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #0f0f12 !important;
  border: 1px solid #27272a !important;
  box-shadow: none !important;
}

.guide-content-scroll {
  overflow-y: auto;
  max-height: 55vh;
  margin: 14px 0 20px;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guide-content-scroll::-webkit-scrollbar {
  width: 6px;
}
.guide-content-scroll::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 3px;
}

.guide-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-section-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
}

.guide-text {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: #a1a1aa;
  margin: 0;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 4px;
  padding: 10px 12px;
  box-shadow: none;
}

.guide-key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.guide-key {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  color: #ffffff;
  background: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 4px;
  padding: 2px 7px;
  min-width: 82px;
  text-align: center;
  box-shadow: none;
}

.guide-key-desc {
  font-family: var(--font-body);
  color: #a1a1aa;
  font-size: 12px;
}

/* Mobile responsive adjustments */
@media (max-width: 640px), (pointer: coarse) {
  .start-actions {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 240px !important;
    gap: 10px !important;
  }

  .start-actions .start-btn,
  .start-actions .view-runs-btn {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .modal-actions-3 {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .modal-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .modal-actions button {
    width: 100% !important;
  }

  .touch-cluster-right,
  .touch-cluster-left {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .touch-cluster-right .touch-btn,
  .touch-cluster-left .touch-btn {
    width: 64px !important;
  }

  #hud {
    top: 8px;
    left: 8px;
    right: 8px;
  }

  .hud-telemetry {
    padding: 5px 8px;
    gap: 8px;
  }

  .hud-val {
    font-size: 12px;
  }

  .hud-tag {
    font-size: 9px;
  }

  .specs-inventory-strip {
    bottom: 8px;
    left: 8px;
    gap: 4px;
  }

  .hardware-slot {
    width: 72px;
    height: 38px;
    padding: 3px 6px;
  }

  .slot-name {
    font-size: 10px;
  }

  .runner-controls-hint {
    display: none;
  }
}

/* ===== LOADING SCREEN OVERLAY ===== */
#loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #09090b;
  z-index: 100;
  user-select: none;
}

.loading-text {
  font-family: 'Cabinet Grotesk', 'Chakra Petch', sans-serif;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  animation: pulse-loading 1.2s ease-in-out infinite alternate;
}

@keyframes pulse-loading {
  0% { opacity: 0.45; transform: scale(0.98); }
  100% { opacity: 1.0; transform: scale(1.0); }
}

/* Step 1 Brutalist FPS Arena HUD & Mobile Joystick */
.arena-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 14;
}

.arena-hud[hidden] {
  display: none;
}

/* Top-Left Action Buttons: Standalone Translucent Glass (No bulky container) */
.arena-top-left-actions {
  position: fixed;
  top: 10px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 25;
  pointer-events: auto;
}

.arena-top-btn,
.arena-btn {
  padding: 4px 9px;
  background: rgba(14, 14, 18, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  box-shadow: none !important;
  transition: background-color 80ms ease, border-color 80ms ease, transform 60ms ease;
  user-select: none;
  -webkit-user-select: none;
}

.arena-top-btn:active,
.arena-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.2);
}

.arena-top-btn.active,
.arena-btn.active {
  border-color: #38bdf8;
  color: #38bdf8;
}

.arena-top-bar {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px;
  background: rgba(14, 14, 18, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  pointer-events: none;
  z-index: 20;
  backdrop-filter: blur(4px);
  box-shadow: none !important;
}

.arena-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  white-space: nowrap;
}

.arena-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: #f4f4f5;
}

.arena-timer {
  color: #fbbf24;
}

.arena-crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.arena-crosshair::before,
.arena-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(244, 246, 249, 0.9);
}

.arena-crosshair::before {
  left: 6px;
  top: 0;
  width: 2px;
  height: 14px;
}

.arena-crosshair::after {
  top: 6px;
  left: 0;
  width: 14px;
  height: 2px;
}

.arena-lock-banner {
  display: none !important;
}

.arena-lock-banner[hidden] {
  display: none !important;
}

/* Door Interaction Hover Prompt */
.arena-interact-prompt {
  position: fixed;
  top: 58%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f0f12;
  border: 1px solid #3f3f46;
  box-shadow: none !important;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: 4px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 25;
}

.arena-interact-prompt[hidden] {
  display: none !important;
}

.arena-interact-prompt .interact-key {
  color: #ffffff;
  background: #27272a;
  border: 1px solid #3f3f46;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 800;
}

.arena-mobile-controls {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.arena-mobile-controls[hidden] {
  display: none !important;
}

.arena-joy-base {
  position: fixed;
  left: 45px;
  bottom: 40px;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: rgba(14, 14, 18, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.28);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  touch-action: none;
  backdrop-filter: blur(2px);
}

.arena-joy-thumb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
  transition: transform 0.04s ease-out;
}

/* Step 2: Realistic High-Precision Sniper Scope Overlay, Hit-Marker & Weapon HUD */
.arena-sniper-scope {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, transparent 33vmin, rgba(5, 8, 14, 0.72) 36vmin, rgba(2, 4, 8, 0.98) 42vmin);
  pointer-events: none;
  z-index: 13;
  overflow: hidden;
}

.arena-sniper-scope[hidden] {
  display: none !important;
}

/* Ocular Lens Housing */
.scope-housing {
  position: relative;
  width: 74vmin;
  height: 74vmin;
  border-radius: 50%;
  border: 4px solid #0b111c;
  box-shadow: 
    0 0 0 14px rgba(10, 16, 26, 0.95),
    0 0 0 18px rgba(3, 6, 12, 0.98),
    inset 0 0 45px rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scope-lens {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

/* Subtle Curved Optical Glass Glare */
.scope-glare {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 45%, transparent 70%);
  pointer-events: none;
}

.scope-reticle-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Heads-Up Scope Tactical Telemetry Elements */
.scope-telemetry-top-left,
.scope-telemetry-top-right,
.scope-telemetry-bottom-left,
.scope-telemetry-bottom-right {
  position: absolute;
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(14, 14, 18, 0.85);
  padding: 2px 7px;
  border: 1px solid #3f3f46;
  border-radius: 2px;
  pointer-events: none;
  box-shadow: none !important;
}

.scope-telemetry-top-left {
  top: 18%;
  left: 18%;
}

.scope-telemetry-top-right {
  top: 18%;
  right: 18%;
}

.scope-telemetry-bottom-left {
  bottom: 18%;
  left: 18%;
}

.scope-telemetry-bottom-right {
  bottom: 18%;
  right: 18%;
}

.scope-tag {
  font-size: 9px;
  font-weight: 700;
  color: #71717a;
  letter-spacing: 0.06em;
}

.scope-val {
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.arena-crosshair.scoped-rifle::before,
.arena-crosshair.scoped-rifle::after {
  background: #ffffff;
}

.arena-hit-marker {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  pointer-events: none;
  z-index: 15;
  transition: opacity 90ms ease-out, transform 90ms ease-out;
}

.arena-hit-marker::before,
.arena-hit-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 2px;
  background: #ffffff;
  border-radius: 1px;
}

.arena-hit-marker::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.arena-hit-marker::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.arena-hit-marker.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.arena-hit-marker.headshot::before,
.arena-hit-marker.headshot::after {
  background: #ffffff;
  box-shadow: none;
  height: 3px;
}

.arena-damage-toast {
  position: fixed;
  top: calc(50% - 34px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-shadow: none;
  opacity: 0;
  pointer-events: none;
  z-index: 15;
  transition: opacity 150ms ease-out, transform 150ms ease-out;
}

.arena-damage-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

/* Top-Right Weapon Slots (Free Fire Style) */
.arena-weapon-slots {
  position: fixed;
  top: 14px;
  right: 18px;
  display: flex;
  gap: 8px;
  z-index: 25;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

.arena-weapon-card {
  width: 122px;
  height: 56px;
  padding: 6px 10px;
  background: rgba(14, 14, 18, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  backdrop-filter: blur(4px);
  color: #ffffff;
  box-shadow: none !important;
  overflow: hidden;
}

.arena-weapon-card.active {
  opacity: 1.0;
  background: rgba(220, 38, 38, 0.28);
  border: 2px solid #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4) !important;
}

.arena-weapon-card:active {
  transform: scale(0.96);
}

.weapon-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
}

.weapon-card-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ffffff;
}

.weapon-card-ammo {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
}

.weapon-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  opacity: 0.95;
  height: 28px;
}

.weapon-card-img {
  max-width: 84px;
  max-height: 28px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.weapon-card-reload {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.arena-weapon-card.reloading .weapon-card-reload {
  color: #fbbf24;
  animation: pulseReload 0.8s infinite alternate;
}

@keyframes pulseReload {
  0% { opacity: 0.45; }
  100% { opacity: 1.0; }
}

.arena-weapon-panel {
  display: none !important;
}

.weapon-tabs,
.weapon-ammo-row,
.weapon-ammo,
.weapon-badge,
.weapon-reload-note {
  display: none !important;
}

/* Free Fire Style Mobile Controls */
.btn-sprint {
  position: fixed;
  left: 88px;
  bottom: 180px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(14, 14, 18, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease, border-color 0.12s ease;
  backdrop-filter: blur(2px);
  box-shadow: none !important;
  z-index: 22;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.btn-sprint:active,
.btn-sprint.active,
.btn-sprint.sprinting {
  background: rgba(14, 165, 233, 0.45);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.6) !important;
  transform: scale(1.05);
}

.arena-mobile-actions {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 250px;
  height: 250px;
  pointer-events: none;
  z-index: 22;
}

.arena-mobile-btn {
  position: absolute;
  pointer-events: auto;
  background: rgba(14, 14, 18, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none !important;
  touch-action: none;
  backdrop-filter: blur(2px);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s ease, border-color 0.1s ease, transform 0.08s ease;
}

.arena-mobile-btn:active,
.arena-mobile-btn.active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.85);
  transform: scale(0.92);
}

/* Fire button: prominent on the right with draggable joystick outline */
.arena-mobile-btn.fire {
  right: 98px;
  bottom: 64px;
  width: 90px;
  height: 90px;
  background: rgba(20, 20, 26, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.65);
  outline: 2.5px dashed rgba(56, 189, 248, 0.6);
  outline-offset: 5px;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
  position: absolute;
}

.arena-mobile-btn.fire::before {
  content: '';
  position: absolute;
  inset: -11px;
  border-radius: 50%;
  border: 1px dotted rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.arena-mobile-btn.fire:active,
.arena-mobile-btn.fire.active {
  outline-color: rgba(56, 189, 248, 0.95);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
  border-color: rgba(255, 255, 255, 0.9);
}

.arena-mobile-btn.fire .arena-btn-img {
  width: 76%;
  height: 76%;
  transition: transform 0.05s ease-out;
}

/* Jump button: to the right of fire */
.arena-mobile-btn.btn-jump {
  right: 28px;
  bottom: 95px;
  width: 54px;
  height: 54px;
}

/* Slide button: below fire */
.arena-mobile-btn.btn-slide {
  right: 40px;
  bottom: 20px;
  width: 52px;
  height: 52px;
}

/* Scope button: upper-right of fire */
.arena-mobile-btn.btn-scope {
  right: 42px;
  bottom: 170px;
  width: 52px;
  height: 52px;
}

.arena-mobile-btn.btn-scope.scoped {
  background: rgba(56, 189, 248, 0.35);
  border-color: #38bdf8;
}

.arena-mobile-btn.btn-scope .arena-btn-img {
  width: 84%;
  height: 84%;
}

.btn-sprint .arena-btn-img {
  width: 86%;
  height: 86%;
}

/* Mobile Interact Button: Above and a bit to left of fire */
.arena-mobile-btn.btn-interact {
  right: 200px;
  bottom: 160px;
  width: 58px;
  height: 58px;
  background: rgba(14, 14, 18, 0.55);
  border: 2px solid #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5) !important;
  animation: pulseInteract 1.2s infinite ease-in-out alternate;
  z-index: 25;
}

.arena-mobile-btn.btn-interact .arena-btn-img {
  width: 68%;
  height: 68%;
}

.arena-mobile-btn.btn-interact[hidden] {
  display: none !important;
}

@keyframes pulseInteract {
  0% { transform: scale(1); border-color: rgba(56, 189, 248, 0.6); }
  100% { transform: scale(1.08); border-color: #38bdf8; box-shadow: 0 0 20px rgba(56, 189, 248, 0.75) !important; }
}

.arena-btn-img {
  width: 60%;
  height: 60%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}



@media (hover: none) and (pointer: coarse), (max-width: 900px) {
  .arena-interact-prompt {
    display: none !important;
  }
}

/* Arena Mobile Rotate Screen (Phones only, not tablets) */
.arena-rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 10, 12, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(8px);
  user-select: none;
  -webkit-user-select: none;
}

.arena-rotate-overlay[hidden] {
  display: none !important;
}

.arena-rotate-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 320px;
  background: #18181b;
  border: 1px solid #27272a;
  padding: 32px 24px;
  border-radius: 8px;
}

.arena-rotate-icon {
  font-size: 54px;
  color: #ffffff;
  margin-bottom: 16px;
  animation: phoneRotateAnim 2.2s infinite ease-in-out;
}

@keyframes phoneRotateAnim {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-90deg); }
  75% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

.arena-rotate-title {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ffffff;
  margin: 0 0 8px 0;
}

.arena-rotate-text {
  font-family: var(--font-sans);
  font-size: 13px;
  color: #a1a1aa;
  line-height: 1.45;
  margin: 0;
}

/* Step 3: Boss HP Bar, 120s Timer, Player HP Bar & BSOD */
.arena-timer {
  font-size: 14px;
  color: #ffffff;
  padding-right: 4px;
}

.arena-timer.urgent {
  color: #ef4444;
}

.arena-boss-panel {
  position: fixed;
  top: 35px;
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, calc(100vw - 220px));
  padding: 4px 10px 5px;
  background: rgba(14, 14, 18, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  pointer-events: none;
  z-index: 18;
  backdrop-filter: blur(4px);
  box-shadow: none !important;
}

.arena-boss-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 3px;
}

.arena-boss-name {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffffff;
}

.arena-boss-hp-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

.arena-boss-track {
  width: 100%;
  height: 5px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.arena-boss-fill {
  width: 100%;
  height: 100%;
  background: #ffffff;
  transition: width 120ms ease-out;
}

.arena-boss-alert {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fbbf24;
  text-align: center;
}

.arena-boss-alert[hidden] {
  display: none;
}

@media (max-width: 820px) {
  #arena-pos {
    display: none;
  }
  .arena-boss-panel {
    top: 34px;
    width: min(270px, 42vw);
  }
}

.arena-player-panel {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(280px, 48vw);
  padding: 6px 14px 8px;
  background: rgba(14, 14, 18, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  pointer-events: none;
  z-index: 20;
  backdrop-filter: blur(4px);
  box-shadow: none !important;
  text-align: center;
}

.arena-player-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}

.arena-player-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
}

.arena-player-hp-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
}

.arena-player-track {
  width: 100%;
  height: 7px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.arena-player-fill {
  width: 100%;
  height: 100%;
  background: #ffffff;
  transition: width 120ms ease-out, background-color 140ms ease-out;
}

.bsod-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: #0047ab;
  color: #ffffff;
  z-index: 35;
}

.bsod-overlay[hidden] {
  display: none;
}

.bsod-card {
  width: min(620px, 100%);
  text-align: left;
  font-family: var(--font-mono);
}

.bsod-sad {
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 20px;
}

.bsod-headline {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 14px;
}

.bsod-detail {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 14px;
}

.bsod-stopcode {
  display: inline-block;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 26px;
}

.bsod-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.bsod-retry-btn {
  min-width: 150px;
  min-height: 44px;
  padding: 10px 24px;
  background: #ffffff;
  color: #0047ab;
  border: 0;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.bsod-retry-btn:hover {
  background: #e2e8f0;
}

.bsod-secondary-btn {
  min-height: 44px;
  padding: 10px 18px;
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.bsod-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

