/* ============================================================================
   TOP HEADER BAR (DISCRETE SHADCN/UI & VERCEL NAVBAR)
   ============================================================================ */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  background: rgba(9, 9, 11, 0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #27272a;
  padding: max(6px, env(safe-area-inset-top)) 12px 7px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.brand-info-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.brand-sep {
  color: #52525b;
  font-size: 11px;
  flex-shrink: 0;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.65);
  flex-shrink: 0;
}

.brand-title {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #fafafa;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-sub {
  font-size: 11px;
  color: #a1a1aa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.top-actions-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  justify-content: flex-start;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
  cursor: grab;
  min-width: 0;
  padding: 2px 0;
}

.top-actions::-webkit-scrollbar {
  display: none;
}

.top-actions.dragging,
.top-actions.dragging .pill-btn,
.top-actions.dragging .icon-btn {
  cursor: grabbing !important;
}

.top-action-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(24, 24, 27, 0.7);
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 2px;
  flex-shrink: 0;
}

.top-group-divider {
  width: 1px;
  height: 20px;
  background: #27272a;
  flex-shrink: 0;
  margin: 0 2px;
}

.top-scroll-btn {
  background: #18181b;
  color: #a1a1aa;
  border: 1px solid #27272a;
  border-radius: 8px;
  width: 26px;
  height: 30px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.top-scroll-btn:hover {
  background: #27272a;
  color: #fafafa;
}

.top-scroll-btn.hidden {
  display: none;
}

.pill-btn, .icon-btn {
  background: transparent;
  color: #a1a1aa;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pill-btn:hover, .icon-btn:hover {
  background: #27272a;
  color: #fafafa;
}

.pill-btn.active {
  background: #27272a;
  border-color: #3f3f46;
  color: #fafafa;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.pill-btn.accent-btn {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.pill-btn.accent-btn:hover,
.pill-btn.accent-btn.active {
  background: #10b981;
  border-color: #10b981;
  color: #09090b;
  font-weight: 600;
}

/* Navbar Right Controls: Context Menu & Rounded Avatar Dropdown */
.nav-right-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 6px;
  border-left: 1px solid #27272a;
  flex-shrink: 0;
}

.dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-icon-trigger {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid #27272a;
  color: #a1a1aa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-icon-trigger:hover,
.nav-icon-trigger[aria-expanded="true"] {
  background: #27272a;
  color: #fafafa;
}

.unified-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 9999px;
  padding: 3px 4px 3px 10px;
  color: #e4e4e7;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.unified-menu-trigger:hover,
.unified-menu-trigger[aria-expanded="true"] {
  background: #27272a;
  border-color: #3f3f46;
  color: #fafafa;
}

.unified-menu-lbl {
  line-height: 1;
}

.avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #10b981, #047857);
  color: #09090b;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}

@keyframes shadcnDropdownIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shadcnModalIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes shadcnBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.shadcn-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 268px;
  max-width: calc(100vw - 20px);
  max-height: calc(100dvh - 82px);
  overflow-y: auto;
  background: rgba(9, 9, 11, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform-origin: top right;
  animation: shadcnDropdownIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-user-header {
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-user-title,
.dropdown-user-header strong {
  font-size: 13px;
  font-weight: 700;
  color: #fafafa;
}

.dropdown-user-sub,
.dropdown-user-header span {
  font-size: 11.5px;
  color: #a1a1aa;
}

.dropdown-section-label {
  padding: 5px 10px 3px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #71717a;
}

.dropdown-divider {
  height: 1px;
  background: #27272a;
  margin: 4px 4px;
}

.dropdown-item.dropdown-item-danger {
  color: #fca5a5;
}

.dropdown-item.dropdown-item-danger:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.dropdown-item {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: #e4e4e7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.dropdown-item:hover {
  background: #27272a;
  color: #fafafa;
}

.dropdown-kbd {
  font-size: 10.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #71717a;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 4px;
  padding: 1px 5px;
}

/* Mode Banner */
#mode-banner {
  position: fixed;
  top: calc(max(6px, env(safe-area-inset-top)) + 70px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid #27272a;
  border-radius: 99px;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  max-width: 94vw;
}

.mode-banner-text {
  font-size: 12.5px;
  font-weight: 500;
  color: #fafafa;
}

.mode-banner-actions {
  display: flex;
  gap: 6px;
}

.small-btn {
  background: #18181b;
  color: #fafafa;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.small-btn:hover {
  background: #27272a;
}

.small-btn.danger-btn {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

/* ============================================================================
   BOTTOM CAMERA MODE BAR
   ============================================================================ */
#bottom-nav {
  position: fixed;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  max-width: 96vw;
}

.nav-mode-btn {
  background: transparent;
  color: #a1a1aa;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  min-width: 68px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-mode-btn:hover {
  color: #fafafa;
  background: #27272a;
}

.nav-mode-btn.active {
  background: #27272a;
  border-color: #3f3f46;
  color: #fafafa;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.nav-icon {
  font-size: 16px;
  line-height: 1;
}

.nav-label {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}


/* ============================================================================
   FLOATING 3D LABELS (STANDS, FOREST COMPARTMENTS / SKOGSDATA, PERSONS, DOG)
   ============================================================================ */
.map-label {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  padding: 0;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.map-label img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid var(--accent-orange);
  background: rgba(16, 24, 19, 0.94);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65);
  display: block;
}

.map-label .stand-dist {
  background: rgba(14, 21, 17, 0.92);
  border: 1px solid rgba(255, 125, 25, 0.65);
  border-radius: 6px;
  padding: 1px 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Forest Compartment Badge (Skogsdata: Kompakt visning av dominerande trädslag & ålder, t.ex. "Gran, 73 år") */
.trakt-label {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
  cursor: pointer;
  background: rgba(14, 26, 18, 0.92);
  border: 1px solid rgba(110, 231, 135, 0.65);
  border-radius: 6px;
  padding: 2px 7px;
  color: #f0fdf4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.trakt-label .trakt-compact-text {
  font-size: 11px;
  font-weight: 700;
  color: #bbf7d0;
  letter-spacing: -0.01em;
}

.trakt-label:hover {
  background: rgba(22, 42, 28, 0.98);
  border-color: #a7f3d0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.75), 0 0 10px rgba(74, 222, 128, 0.45);
}

.trakt-label.active-trakt {
  background: rgba(16, 68, 38, 0.98);
  border: 2px solid #fef08a;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.75), 0 6px 20px rgba(0, 0, 0, 0.85);
  z-index: 9;
}

/* Simulated Walking Person Marker */
.person-marker {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  pointer-events: none;
  z-index: 5;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  background: rgba(18, 22, 20, 0.92);
  border: 1.5px solid rgba(255, 82, 82, 0.85);
  border-radius: 99px;
  padding: 3px 9px 3px 6px;
  color: #ffffff;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.72), 0 0 8px rgba(255, 50, 50, 0.32);
}

.person-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(255, 82, 82, 0.88);
}

.person-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff2e2e;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 6px rgba(255, 46, 46, 0.9);
  display: inline-block;
  flex-shrink: 0;
}

.person-name {
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.15px;
  line-height: 1.2;
}

.person-sep {
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.person-dist {
  color: #ffc8c8;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

/* Simulated Running Dog Marker */
.dog-marker {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  pointer-events: none;
  z-index: 6;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  background: rgba(16, 24, 19, 0.92);
  border: 2px solid #ffb020;
  border-radius: 99px;
  padding: 3px 9px 3px 6px;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75), 0 0 10px rgba(255, 176, 32, 0.45);
}

.dog-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #ffb020;
}

.dog-icon {
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dog-dist {
  font-size: 12px;
  font-weight: 800;
  color: #ffe7b3;
  letter-spacing: 0.2px;
}

.gps-label {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  pointer-events: none;
  background: rgba(20, 95, 220, 0.95);
  border: 2px solid #99ccff;
  border-radius: 99px;
  padding: 4px 10px;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(45, 135, 255, 0.8);
}

/* Walk / Mobile Joystick Controls */
#walk-controls {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 74px);
  z-index: 9;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}

.joystick-zone {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.joystick-base {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(16, 24, 19, 0.68);
  border: 2px solid rgba(255, 125, 25, 0.65);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.joystick-stick {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff9d4d, #e86400);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transform: translate(0px, 0px);
}

.joystick-caption {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffd7b3;
  text-shadow: 0 1px 3px #000;
}

.walk-center-info {
  background: rgba(14, 21, 17, 0.86);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 12px;
  text-align: right;
  max-width: 60vw;
}

#walk-coords {
  font-size: 12px;
  font-weight: 700;
  color: #ffe2c6;
}

.walk-subhint {
  font-size: 10.5px;
  color: var(--text-muted);
}


/* Subtle Center Crosshair & Distance Badge */
#center-crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.crosshair-svg {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
  transition: transform 0.15s ease, opacity 0.15s ease;
}

#center-crosshair.aiming-moose .crosshair-svg {
  transform: scale(1.12);
}

#center-crosshair.aiming-moose .crosshair-svg circle,
#center-crosshair.aiming-moose .crosshair-svg line {
  stroke: rgba(255, 160, 45, 0.9);
}

#crosshair-dist {
  margin-top: 2px;
  background: rgba(14, 21, 17, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 99px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

#center-crosshair.aiming-moose #crosshair-dist {
  background: rgba(255, 125, 25, 0.9);
  border-color: #ffd5aa;
  color: #101812;
  font-weight: 800;
}

/* Floating 3D Moose Marker */
.moose-marker {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  pointer-events: auto;
  cursor: pointer;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(24, 19, 14, 0.92);
  border: 2px solid #ff9933;
  border-radius: 99px;
  padding: 3px 10px 3px 7px;
  color: #fff3e0;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75), 0 0 12px rgba(255, 140, 30, 0.5);
}

/* ============================================================================
   BALLISTICS & WEAPON CONTROLS
   ============================================================================ */
.pref-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.pref-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pref-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
}

.pref-label {
  font-size: 11px;
  font-weight: 600;
  color: #c2d4c6;
}

.pref-sub-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.pref-select,
.pref-input {
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #fff;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
  width: 100%;
  user-select: text;
  transition: border-color 0.15s ease;
}

.pref-select:focus,
.pref-input:focus {
  outline: none;
  border-color: var(--accent-orange);
}

.pref-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pref-input-wrap .pref-input {
  padding-right: 28px;
}

.pref-unit {
  position: absolute;
  right: 7px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

.bc-quick-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.bc-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  color: #d8e6da;
  font-size: 11px;
  font-weight: 600;
  padding: 6px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.bc-chip:hover,
.bc-chip.active {
  background: rgba(255, 125, 25, 0.22);
  border-color: var(--accent-orange);
  color: #fff;
}

.tiny-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.tiny-btn:hover {
  background: rgba(255, 125, 25, 0.28);
  border-color: var(--accent-orange);
}

.tiny-btn.danger-tiny-btn {
  background: rgba(229, 83, 75, 0.22);
  border-color: rgba(229, 83, 75, 0.6);
  color: #ffc5c2;
}

.tiny-btn.danger-tiny-btn:hover {
  background: rgba(229, 83, 75, 0.38);
}

.wind-live-summary {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.wind-source-badge {
  font-size: 10.5px;
  color: #94a3b8;
}

.qr-frame {
  background: #fff;
  padding: 12px;
  border-radius: 14px;
  display: inline-block;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ============================================================================
   MAGNIFIED SCOPE OVERLAY CARD (BULLET DROP & WIND DRIFT)
   ============================================================================ */
.scope-overlay-card {
  position: fixed;
  top: calc(max(6px, env(safe-area-inset-top)) + 74px);
  right: 12px;
  z-index: 18;
  width: 356px;
  max-width: calc(100vw - 24px);
  background: var(--bg-card);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 135, 35, 0.55);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
  color: #fff;
}

.scope-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.scope-header h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
}

.scope-header-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.scope-canvas-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 10px;
  width: 306px;
  height: 306px;
  border-radius: 50%;
  background: #0c140f;
  border: 3px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.9), 0 6px 20px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

#scope-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.scope-Distance-pill {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 16, 12, 0.86);
  border: 1px solid rgba(255, 165, 60, 0.65);
  border-radius: 99px;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 800;
  color: #ffd8a8;
  pointer-events: none;
}

.scope-wind-pill {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 18, 22, 0.86);
  border: 1px solid rgba(110, 210, 255, 0.55);
  border-radius: 99px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #bae6fd;
  pointer-events: none;
  white-space: nowrap;
}

.scope-legend {
  background: var(--bg-section);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  padding: 8px 10px;
  margin-bottom: 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.impact-dot {
  background: #ff2e2e;
  border: 2px solid #fff;
  box-shadow: 0 0 8px #ff2e2e;
}

.legend-dot.aim-dot {
  background: #00e5ff;
  border: 2px solid #fff;
  box-shadow: 0 0 8px #00e5ff;
}

.scope-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.scope-stat {
  background: var(--bg-section);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 6px 9px;
  display: flex;
  flex-direction: column;
}

.scope-stat .s-lbl {
  font-size: 10px;
  color: var(--text-muted);
}

.scope-stat .s-val {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

/* ============================================================================
   MOBILE NAVIGATION & TOUCH OPTIMIZATION (3D HUD)
   ============================================================================ */
@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }

  #top-bar {
    padding: max(5px, env(safe-area-inset-top)) 8px 6px;
    gap: 3px;
  }

  .brand-sep,
  .brand-sub {
    display: none;
  }

  .brand-group {
    gap: 5px;
  }

  .brand-title {
    font-size: 11.5px;
    color: #d4d4d8;
  }

  .top-action-group {
    gap: 2px;
    padding: 2px;
  }

  .top-group-divider {
    display: none;
  }

  .pill-btn,
  .icon-btn {
    min-height: 35px;
    padding: 5px 8px;
    font-size: 11.5px;
    gap: 4px;
  }

  .unified-menu-lbl {
    display: none;
  }

  .unified-menu-trigger {
    height: 35px;
    padding: 3px 4px 3px 8px;
    gap: 5px;
  }

  .dropdown-item {
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }

  .dropdown-kbd {
    display: none;
  }

  #mode-banner {
    top: calc(max(5px, env(safe-area-inset-top)) + 66px);
    padding: 6px 12px;
    gap: 8px;
    border-radius: 14px;
  }

  .mode-banner-text {
    font-size: 11.5px;
  }
}

@media (max-width: 640px) {
  #bottom-nav {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    transform: none;
    width: auto;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding: 4px;
    border-radius: 14px;
  }

  .nav-mode-btn {
    min-width: 0;
    width: 100%;
    min-height: 46px;
    padding: 5px 2px;
    gap: 2px;
  }

  .nav-icon {
    font-size: 15px;
  }

  .nav-label {
    font-size: 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #walk-controls {
    left: 10px;
    right: 10px;
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 64px);
  }

  .joystick-base {
    width: 96px;
    height: 96px;
  }

  .walk-center-info {
    max-width: 56vw;
    padding: 6px 9px;
  }
}

