:root {
  --bg: #000308;
  --bg-deep: #00060f;
  --panel: rgba(6, 12, 24, 0.72);
  --panel-solid: #06101e;
  --border: rgba(94, 225, 255, 0.18);
  --border-strong: rgba(94, 225, 255, 0.35);
  --accent: #5ee1ff;
  --accent-soft: rgba(94, 225, 255, 0.12);
  --accent-glow: rgba(94, 225, 255, 0.55);
  --text: #e6f3ff;
  --text-dim: #7d96b0;
  --text-faint: #4a5e76;
  --success: #4eff8c;
  --warning: #ffbb3d;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --sans: 'Space Grotesk', -apple-system, system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ----- MAP ----- */
#map {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #000;
}
.leaflet-container { background: #000 !important; outline: none; }
.leaflet-tile { filter: saturate(1.05) contrast(1.05); }

/* ----- WINDOW FRAME ----- */
.window-frame {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  box-shadow:
    inset 0 0 200px rgba(0, 6, 20, 0.85),
    inset 0 0 40px rgba(94, 225, 255, 0.06);
}
.window-frame::before,
.window-frame::after {
  content: '';
  position: absolute;
  background: var(--accent);
  opacity: 0.25;
}
.window-frame::before { top: 0; left: 0; right: 0; height: 1px; }
.window-frame::after { bottom: 0; left: 0; right: 0; height: 1px; }

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 21;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(94, 225, 255, 0.015) 3px
  );
  mix-blend-mode: overlay;
}

/* ----- WINDOW OVERLAY (PNG) ----- */
.window-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 30;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s ease;
  image-rendering: -webkit-optimize-contrast;
}
.window-overlay.hidden {
  opacity: 0;
}
/* If the PNG file is missing, hide the broken image icon */
.window-overlay[src=""], .window-overlay:not([src]) { display: none; }

.overlay-toggle {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 101;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--panel);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  pointer-events: auto;
}
.overlay-toggle:hover {
  color: var(--accent);
  border-color: var(--border-strong);
}
.overlay-toggle.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(94, 225, 255, 0.25);
}

/* ----- TOP HUD ----- */
.hud-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 3, 8, 0.75), transparent);
}

.logo {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  color: var(--accent);
  font-size: 16px;
  filter: drop-shadow(0 0 6px var(--accent-glow));
  animation: pulse 2.5s ease-in-out infinite;
}
.logo-dim { color: var(--text-dim); font-weight: 300; }

.status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
}
.status-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
  animation: pulse 1.5s ease-in-out infinite;
}
.status-pill.acquiring .status-dot {
  background: var(--warning);
  box-shadow: 0 0 10px var(--warning);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ----- INFO PANEL ----- */
.info-panel {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 100;
  width: 280px;
  background: var(--panel);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: panel-in 0.8s 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  overflow: hidden;
}

.info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s;
}
.info-header:hover { background: rgba(94, 225, 255, 0.05); }

.info-panel.collapsed .info-header { border-bottom-color: transparent; }
.info-chevron {
  color: var(--text-dim);
  transition: transform 0.3s;
  flex-shrink: 0;
}
.info-panel.collapsed .info-chevron { transform: rotate(180deg); }

.info-body {
  padding: 16px 20px 18px;
  max-height: 60vh;
  overflow-y: auto;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
}
.info-panel.collapsed .info-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.panel-section:first-child { margin-top: 0; }
.panel-section + .panel-section { margin-top: 16px; }

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--accent);
  text-transform: uppercase;
}
.panel-header-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-strong), transparent);
}
.panel-header-count {
  color: var(--text-faint);
  font-size: 9.5px;
}

/* ----- NEXT PASS ----- */
.pass-btn {
  width: 100%;
  padding: 10px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
}
.pass-btn:hover { border-color: var(--accent); background: rgba(94, 225, 255, 0.18); }

.pass-info { font-family: var(--mono); padding: 2px 0; }
.pass-time {
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}
.pass-countdown {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 1.5px;
  margin-top: 2px;
}
.pass-details {
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 1.5px;
  margin-top: 6px;
}
.pass-muted { color: var(--text-faint); font-size: 11px; font-family: var(--mono); letter-spacing: 1px; }

/* ----- CREW ----- */
.crew-list, .docked-list { display: flex; flex-direction: column; gap: 6px; }
.crew-loading { color: var(--text-faint); font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; }

.crew-item, .docked-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-family: var(--mono);
  font-size: 11px;
  border-bottom: 1px dashed rgba(94, 225, 255, 0.06);
}
.crew-item:last-child, .docked-item:last-child { border-bottom: none; }

.crew-flag, .docked-flag { font-size: 14px; line-height: 1; flex-shrink: 0; }
.crew-name, .docked-name { flex: 1; color: var(--text); font-family: var(--sans); font-size: 12px; }
.crew-craft, .docked-agency {
  color: var(--text-faint);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.data-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  font-family: var(--mono);
  font-size: 12px;
  border-bottom: 1px dashed rgba(94, 225, 255, 0.06);
}
.data-row:last-child { border-bottom: none; }

.data-row .label {
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 1.5px;
}
.data-row .value {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}
.data-row .value.updating {
  color: var(--accent);
}

/* ----- RETICLE ----- */
.reticle {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: 120px;
  height: 120px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0.45;
}
.reticle-svg {
  width: 100%;
  height: 100%;
  stroke: var(--accent);
  fill: none;
  filter: drop-shadow(0 0 3px var(--accent-glow));
}
.reticle-ring-outer {
  stroke-width: 1;
  opacity: 0.5;
  animation: reticle-pulse 3s ease-in-out infinite;
}
.reticle-ring-inner {
  stroke-width: 1.25;
  opacity: 0.75;
  stroke-dasharray: 4 3;
  animation: reticle-rotate 20s linear infinite;
  transform-origin: 50% 50%;
}
.reticle-tick {
  stroke-width: 1.25;
  opacity: 0.6;
}
.reticle-dot {
  fill: var(--accent);
  stroke: none;
  opacity: 0.7;
}
.reticle-label {
  position: absolute;
  top: calc(100% + 4px);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--accent);
  opacity: 0.7;
  white-space: nowrap;
}

@keyframes reticle-pulse {
  0%, 100% { opacity: 0.4; transform-origin: 50% 50%; }
  50%      { opacity: 0.15; }
}
@keyframes reticle-rotate {
  from { transform: rotate(0deg); transform-origin: 50px 50px; }
  to   { transform: rotate(360deg); transform-origin: 50px 50px; }
}

/* ----- MINI GLOBE (bottom-left) ----- */
.mini-globe {
  position: fixed;
  bottom: 36px;
  left: 22px;
  z-index: 100;
  width: 125px;
  height: 125px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #000;
  /* Outer glow + spherical inner shadow gives a 3D illusion over the flat tiles. */
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.75),
    inset 0 0 18px rgba(0, 0, 0, 0.85),
    inset 8px -10px 28px rgba(0, 0, 0, 0.55),
    inset -8px 10px 28px rgba(94, 225, 255, 0.06);
  cursor: pointer;
  overflow: hidden;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              bottom 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.25s;
  animation: panel-in-left 0.8s 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.mini-globe:hover {
  border-color: var(--border-strong);
}

/* Radial highlight + shadow on top of tiles for a curved-sphere feel */
.mini-globe::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(180, 220, 255, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 65% 75%, rgba(0, 0, 0, 0.55) 0%, transparent 60%),
    radial-gradient(circle at center, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
  mix-blend-mode: soft-light;
}
/* A second overlay for edge darkening — reinforces the spherical rim */
.mini-globe::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle at center, transparent 60%, rgba(0, 0, 0, 0.8) 100%);
}

.mini-globe-map {
  width: 100%;
  height: 100%;
}

.mini-globe-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
  animation: blink-plus 1.2s steps(2, end) infinite;
  filter: drop-shadow(0 0 4px var(--accent));
}
.mini-globe-dot::before,
.mini-globe-dot::after {
  content: '';
  position: absolute;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.mini-globe-dot::before {
  top: 50%; left: 0; right: 0; height: 2px;
  transform: translateY(-50%);
}
.mini-globe-dot::after {
  left: 50%; top: 0; bottom: 0; width: 2px;
  transform: translateX(-50%);
}
.mini-globe.expanded .mini-globe-dot { width: 24px; height: 24px; }
.mini-globe.expanded .mini-globe-dot::before { height: 3px; }
.mini-globe.expanded .mini-globe-dot::after  { width: 3px; }

@keyframes blink-plus {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0.15; }
}

.mini-globe-label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--accent);
  pointer-events: none;
  opacity: 0.85;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.mini-globe-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  transition: all 0.2s;
}
.mini-globe-close:hover { color: var(--accent); border-color: var(--accent); }

.mini-globe.expanded {
  width: min(70vw, 70vh);
  height: min(70vw, 70vh);
  bottom: calc(50vh - min(35vw, 35vh));
  left: calc(50vw - min(35vw, 35vh));
  z-index: 999;
  border-color: var(--accent);
  box-shadow: 0 0 60px rgba(94, 225, 255, 0.4), inset 0 0 40px rgba(0, 0, 0, 0.7);
  cursor: default;
}
.mini-globe.expanded .mini-globe-close { display: block; }
.mini-globe.expanded .mini-globe-label {
  font-size: 11px;
  bottom: 20px;
}
.mini-globe.expanded .mini-globe-dot { width: 14px; height: 14px; }

/* Dim background when globe is expanded */
.globe-backdrop {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(0, 2, 8, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
.globe-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* ----- ISS FEED TOGGLE (hidden audio iframe) ----- */
.iss-feed-toggle {
  position: fixed;
  bottom: 92px;
  right: 22px;
  z-index: 109;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: var(--panel);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  animation: panel-in 0.8s 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.iss-feed-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.iss-feed-toggle.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 16px rgba(94, 225, 255, 0.25);
}
.ifeed-icon {
  flex-shrink: 0;
  opacity: 0.9;
}
/* Swap icons by .active state on the button (SVG doesn't reliably honour
   the HTML [hidden] attribute in every browser, so class-based is safer). */
.iss-feed-toggle .ifeed-icon-pause,
.iss-feed-toggle.active .ifeed-icon-play { display: none; }
.iss-feed-toggle.active .ifeed-icon-pause { display: inline-block; }

.ifeed-dot {
  width: 6px;
  height: 6px;
  margin-left: 4px;
  background: var(--text-faint);
  border-radius: 50%;
  transition: all 0.3s;
}
.iss-feed-toggle.active .ifeed-dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.5s ease-in-out infinite;
}

/* Hidden container — iframe lives here off-screen when active */
#iss-feed-player {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 320px;
  height: 180px;
  pointer-events: none;
}
#iss-feed-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ----- MINI PLAYER (bottom-right) ----- */
.mini-player {
  position: fixed;
  bottom: 18px;
  right: 22px;
  z-index: 110;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 10px;
  background: var(--panel);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 100px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.7);
  animation: panel-in 0.8s 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  max-width: min(560px, calc(100vw - 44px));
}
.mini-player[hidden] { display: none !important; }

.mp-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mp-btn, .mp-play {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s;
  color: var(--text-dim);
}
.mp-btn:hover, .mp-play:hover { color: var(--text); }

.mp-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.mp-play {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
}
.mp-play svg { width: 22px; height: 22px; }
.mp-play .mp-icon-play { margin-left: 2px; }

.mp-info {
  flex: 1;
  min-width: 0;
  padding: 0 2px;
}
.mp-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.mp-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--accent);
  text-transform: uppercase;
  line-height: 1.2;
  opacity: 0.85;
}
.mp-time {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.mp-title {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
  line-height: 1.3;
  margin-top: 2px;
  cursor: pointer;
  transition: color 0.2s;
}
.mp-title:hover { color: var(--accent); }
.mp-progress {
  height: 2px;
  background: rgba(94, 225, 255, 0.12);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
  cursor: pointer;
}
.mp-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  box-shadow: 0 0 6px var(--accent-glow);
  transition: width 0.2s linear;
}

.mp-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.mp-vol-icon { opacity: 0.6; }
#mp-vol {
  -webkit-appearance: none;
  appearance: none;
  width: 70px;
  height: 3px;
  background: rgba(94, 225, 255, 0.15);
  border-radius: 100px;
  cursor: pointer;
  outline: none;
}
#mp-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.15s;
}
#mp-vol::-webkit-slider-thumb:hover { transform: scale(1.3); }
#mp-vol::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-glow);
  cursor: pointer;
}
#mp-vol::-moz-range-track {
  background: rgba(94, 225, 255, 0.15);
  height: 3px;
  border-radius: 100px;
}

.mp-spotify {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-dim);
  border-radius: 50%;
  text-decoration: none;
  transition: color 0.2s;
  flex-shrink: 0;
}
.mp-spotify:hover { color: #1DB954; }

/* ----- PLAYLIST DROPDOWN ----- */
.mp-list {
  position: fixed;
  bottom: 140px;
  right: 22px;
  z-index: 108;
  width: 360px;
  max-width: calc(100vw - 44px);
  max-height: 340px;
  background: var(--panel);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: panel-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mp-list[hidden] { display: none !important; }

.mp-list-header {
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--accent);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
}

.mp-list-items {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
}
.mp-list-items::-webkit-scrollbar { width: 5px; }
.mp-list-items::-webkit-scrollbar-thumb { background: rgba(94, 225, 255, 0.25); border-radius: 3px; }

.mp-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  transition: background 0.15s;
}
.mp-list-item:hover {
  background: rgba(94, 225, 255, 0.06);
}
.mp-list-item.current {
  color: var(--accent);
  background: rgba(94, 225, 255, 0.08);
}
.mp-list-item .mp-list-idx {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-faint);
  min-width: 22px;
}
.mp-list-item.current .mp-list-idx { color: var(--accent); }
.mp-list-item .mp-list-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-list-item .mp-list-playing {
  display: none;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}
.mp-list-item.current .mp-list-playing {
  display: inline-block;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-glow);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ----- BOTTOM HUD ----- */
.hud-bottom {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 99;
  padding: 14px 28px 5px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  background: linear-gradient(
    to top,
    rgba(0, 2, 8, 0.95) 0%,
    rgba(0, 2, 8, 0.75) 45%,
    rgba(0, 2, 8, 0.35) 75%,
    transparent 100%
  );
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text);
  letter-spacing: 1.2px;
  pointer-events: none;
}
.mono-label {
  color: var(--text-faint);
  margin-right: 8px;
  letter-spacing: 2px;
}
.mono-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.hud-bottom-center {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 1.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.hud-stat {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 2px;
  opacity: 0.9;
  transition: opacity 0.45s ease;
  min-height: 14px;
  font-variant-numeric: tabular-nums;
}
.hud-credit { color: var(--text-dim); }

.hud-bottom-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.ambient-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(6, 12, 24, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 2px;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s;
}
.ambient-toggle:hover { color: var(--text-dim); }
.ambient-toggle.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.credit-heart {
  color: #ffffff;
  font-size: 11px;
  vertical-align: -1px;
}
.credit-link {
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.4);
  pointer-events: auto;
  transition: border-color 0.2s;
}
.credit-link:hover { border-bottom-color: #fff; }

/* ----- ISS MARKER -----
   Hidden by default — the reticle overlay at viewport center is the
   visual indicator of ISS position. Marker is kept in DOM so its lat/lng
   can still be used for event anchoring. */
.iss-marker-wrapper { display: none !important; }

/* footprint circle style */
.iss-footprint {
  stroke: var(--accent);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  fill: var(--accent);
  fill-opacity: 0.02;
  opacity: 0.5;
}

/* terminator polygon — nearly opaque so the night side looks like an actual
   nighttime ISS photo. Black Marble city-lights layer is above this with
   mix-blend-mode: screen, so bright city pixels shine through the blackness
   while ocean/wilderness stays dark. */
.night-overlay {
  fill: #000;
  fill-opacity: 0.93;
  stroke: rgba(15, 20, 30, 0.5);
  stroke-width: 1;
}

/* trail */
.iss-trail {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-opacity: 0.5;
  fill: none;
  stroke-dasharray: 2 6;
  filter: drop-shadow(0 0 3px var(--accent-glow));
}

/* ----- BOOT OVERLAY ----- */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.8s 0.3s;
}
.boot-overlay.done {
  opacity: 0;
  pointer-events: none;
}
.boot-content {
  text-align: center;
}
.boot-logo {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}
.boot-line {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--text-dim);
  margin-bottom: 20px;
  min-height: 16px;
}
.boot-bar {
  width: 240px;
  height: 2px;
  background: rgba(94, 225, 255, 0.15);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 2px;
}
.boot-bar-fill {
  height: 100%;
  width: 30%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: boot-load 2s ease-in-out infinite;
}
@keyframes boot-load {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* ----- RESPONSIVE ----- */
@media (max-width: 900px) {
  /* Hide the window-frame overlay + toggle + mini globe on mobile */
  .window-overlay,
  .overlay-toggle,
  .mini-globe,
  .globe-backdrop,
  .hud-bottom-center { display: none !important; }

  .hud-top { padding: 12px 16px; }
  .logo { font-size: 18px; }

  /* Telemetry panel at the top full width */
  .info-panel {
    top: 56px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 220px);
  }
  .info-body { max-height: 50vh; }

  /* Player at the very bottom */
  .mini-player {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
    padding: 8px 14px 8px 8px;
  }
  .mp-title { max-width: none; font-size: 13px; }

  .iss-feed-toggle {
    right: 12px;
    bottom: 80px;
  }
  .mp-list {
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    bottom: 120px;
  }

  .reticle { width: 70px; height: 70px; }
  .status-pill { font-size: 9.5px; }
}
@media (max-width: 600px) {
  .hud-bottom { display: none; } /* hide bottom HUD entirely on phones */
  .mp-title { font-size: 12px; }
  .mp-label { font-size: 8px; }
}

/* ----- LEAFLET CLEANUP ----- */
.leaflet-control-attribution { display: none; }
