/* AGENT_TARGET: exoplanet-system-browser — system switcher pill row */
.exoplanet-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.exoplanet-btn {
  /* PLAYTEST-FIX tap-target (2026-06-16): 36px -> 44px finger minimum. */
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(180, 200, 255, 0.25);
  background: rgba(20, 24, 48, 0.55);
  color: rgba(200, 220, 255, 0.75);
  font-size: 12px;
  font-weight: 800;
  font-family: "Inter", system-ui, sans-serif;
  cursor: pointer;
  transition:
    background 120ms,
    color 120ms;
}
.exoplanet-btn:hover {
  background: rgba(40, 60, 120, 0.7);
  color: #e8f0ff;
}
.exoplanet-btn.on {
  background: rgba(60, 100, 200, 0.5);
  color: #c8e0ff;
  border-color: rgba(100, 160, 255, 0.5);
}

/* AGENT_TARGET: star-spectrum — spectrum card in star detail panel */
.star-spectrum-card {
  margin: 14px 0;
  border-radius: 12px;
  border: 1px solid rgba(180, 200, 255, 0.2);
  background: rgba(10, 12, 30, 0.6);
  overflow: hidden;
}
.star-spectrum-toggle {
  display: block;
  width: 100%;
  padding: 11px 16px;
  text-align: left;
  background: none;
  border: none;
  color: rgba(200, 220, 255, 0.9);
  font-size: 14px;
  font-weight: 600;
  font-family: "Inter", system-ui, sans-serif;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.star-spectrum-toggle::-webkit-details-marker {
  display: none;
}
.star-spectrum-card[open] .star-spectrum-toggle::after {
  content: " ▲";
}
.star-spectrum-card:not([open]) .star-spectrum-toggle::after {
  content: " ▼";
}
.star-spectrum-toggle:hover { background: rgba(40, 60, 120, 0.35); }
.star-spectrum-body { padding: 0 14px 14px; }
.star-spectrum-class-label {
  font-size: 12px;
  color: rgba(180, 200, 255, 0.7);
  margin-bottom: 10px;
}
.star-spectrum-class-label strong { color: #c8e0ff; }
.star-spectrum-goal {
  margin: 0 0 12px;
  border: 1px solid rgba(255, 214, 107, 0.22);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 214, 107, 0.08);
  color: #fff3c7;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
}
.star-spectrum-target {
  width: 100%;
  min-height: 60px;
  margin: 0 0 12px;
  border: 1px solid rgba(126, 218, 255, 0.5);
  border-radius: 8px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  background: rgba(18, 40, 82, 0.78);
  color: #eef8ff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.star-spectrum-target strong {
  font-size: 1rem;
  line-height: 1.1;
}
.star-spectrum-target span:last-child {
  color: rgba(225, 240, 255, 0.74);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}
.star-spectrum-target-chip {
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 214, 107, 0.2);
  color: #fff3c7;
  font-size: 0.74rem;
  font-weight: 900;
}
.star-spectrum-target.found {
  border-color: rgba(120, 255, 191, 0.72);
  background: rgba(18, 86, 66, 0.82);
}
.star-temperature-ladder {
  margin: 0 0 12px;
}
.star-temperature-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.star-temperature-chip {
  min-height: 58px;
  border: 1px solid rgba(180, 200, 255, 0.18);
  border-radius: 8px;
  padding: 7px 6px;
  background: rgba(12, 16, 38, 0.72);
  color: rgba(210, 224, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.star-temperature-chip:nth-child(1) {
  border-color: rgba(255, 115, 95, 0.28);
}
.star-temperature-chip:nth-child(2) {
  border-color: rgba(255, 160, 75, 0.28);
}
.star-temperature-chip:nth-child(3) {
  border-color: rgba(255, 232, 140, 0.3);
}
.star-temperature-chip:nth-child(4) {
  border-color: rgba(170, 215, 255, 0.32);
}
.star-temperature-chip.active {
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow:
    0 7px 18px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.star-temperature-m .star-temperature-chip.active {
  background: linear-gradient(135deg, rgba(165, 45, 48, 0.92), rgba(70, 16, 34, 0.92));
}
.star-temperature-k .star-temperature-chip.active {
  background: linear-gradient(135deg, rgba(215, 112, 42, 0.94), rgba(86, 40, 16, 0.94));
}
.star-temperature-g .star-temperature-chip.active {
  background: linear-gradient(135deg, rgba(224, 187, 74, 0.95), rgba(92, 70, 20, 0.95));
}
.star-temperature-f .star-temperature-chip.active {
  background: linear-gradient(135deg, rgba(175, 220, 255, 0.96), rgba(48, 84, 145, 0.96));
}
.star-temperature-key,
.star-temperature-label,
.star-temperature-temp {
  display: block;
}
.star-temperature-key {
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}
.star-temperature-label {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
}
.star-temperature-temp {
  margin-top: 4px;
  font-size: 9px;
  color: rgba(220, 234, 255, 0.62);
  line-height: 1.15;
}
.star-temperature-chip.active .star-temperature-temp {
  color: rgba(255, 255, 255, 0.78);
}
.star-temperature-clue {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(200, 216, 255, 0.68);
}

/* Bar layout: UV | visible | IR side by side */
.star-spectrum-bar-wrap {
  display: flex;
  align-items: stretch;
  height: 80px;
  border-radius: 8px;
  overflow: visible;
  margin-bottom: 22px;
}
.spectrum-region { flex-shrink: 0; border-radius: 4px; }
.spectrum-uv {
  width: 28px;
  background: linear-gradient(to right, rgba(60,0,120,0.15), rgba(100,0,220,0.45));
  border-radius: 6px 0 0 6px;
  position: relative;
}
.spectrum-uv::after {
  content: "UV";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) rotate(-90deg);
  font-size: 9px;
  font-weight: 700;
  color: rgba(180,130,255,0.8);
  letter-spacing: 0.05em;
}
.spectrum-ir {
  width: 28px;
  background: linear-gradient(to right, rgba(200,0,0,0.45), rgba(80,0,0,0.15));
  border-radius: 0 6px 6px 0;
  position: relative;
}
.spectrum-ir::after {
  content: "IR";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) rotate(-90deg);
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,120,80,0.8);
  letter-spacing: 0.05em;
}
.spectrum-visible {
  flex: 1;
  position: relative;
  overflow: visible;
}
.spectrum-rainbow {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
    #6600cc 0%,
    #4400ff 5%,
    #0044ff 15%,
    #00aaff 28%,
    #00dd88 40%,
    #88ee00 52%,
    #ffee00 62%,
    #ff8800 75%,
    #ff2200 88%,
    #cc0000 100%
  );
  border-radius: 2px;
}

/* Absorption line ticks */
.spectrum-line {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 2;
  transform: translateX(-50%);
}
.spectrum-line-tick {
  width: 2px;
  flex: 1;
  background: rgba(0,0,0,0.85);
}
.spectrum-line.strength-3 .spectrum-line-tick { background: rgba(0,0,0,0.95); width: 2px; }
.spectrum-line.strength-2 .spectrum-line-tick { background: rgba(0,0,0,0.7); width: 2px; }
.spectrum-line.strength-1 .spectrum-line-tick { background: rgba(0,0,0,0.45); width: 1px; }
.spectrum-line.target,
.spectrum-line.found,
.spectrum-line:focus-visible {
  z-index: 5;
}
.spectrum-line-label {
  position: absolute;
  bottom: calc(100% + 4px);
  white-space: nowrap;
  font-size: 9px;
  font-weight: 700;
  color: rgba(220,235,255,0.95);
  background: rgba(5,8,25,0.82);
  border-radius: 3px;
  padding: 1px 3px;
  letter-spacing: 0.03em;
  pointer-events: none;
}
.spectrum-line-nm {
  position: absolute;
  top: calc(100% + 3px);
  white-space: nowrap;
  font-size: 8px;
  color: rgba(180,200,255,0.7);
  pointer-events: none;
}
.spectrum-line.target .spectrum-line-tick {
  box-shadow:
    0 0 0 3px rgba(255, 247, 174, 0.32),
    0 0 18px rgba(255, 247, 174, 0.55);
}
.spectrum-line.found .spectrum-line-tick {
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 0 0 4px rgba(120, 255, 191, 0.32),
    0 0 20px rgba(120, 255, 191, 0.58);
}
.spectrum-line.found .spectrum-line-label {
  background: rgba(18, 88, 64, 0.94);
  color: #ffffff;
}

/* Wavelength axis */
.spectrum-axis {
  position: absolute;
  bottom: -18px;
  left: 0;
  right: 0;
  height: 16px;
}
.spectrum-axis-mark {
  position: absolute;
  transform: translateX(-50%);
  font-size: 8px;
  color: rgba(180,200,255,0.5);
  white-space: nowrap;
}

/* Legend */
.spectrum-legend {
  font-size: 11px;
  color: rgba(180,200,255,0.7);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: rgba(0,0,0,0.9);
  margin-right: 2px;
}
.legend-dot.strength-3 { opacity: 1; }
.legend-dot.strength-2 { opacity: 0.7; }
.legend-dot.strength-1 { opacity: 0.45; }

.spectrum-note {
  font-size: 11px;
  color: rgba(180,200,255,0.6);
  line-height: 1.5;
  margin-top: 4px;
}

.spectrum-found-badge {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  border: 1px solid rgba(124, 255, 191, 0.38);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(124, 255, 191, 0.12);
  color: #d8fff0;
  font-size: 0.84rem;
  font-weight: 900;
  animation: spectrum-found-pop 0.28s ease-out both;
}

@keyframes spectrum-found-pop {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 560px) {
  .star-temperature-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .star-spectrum-target {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .star-spectrum-bar-wrap {
    height: 92px;
    margin-bottom: 28px;
  }
  .spectrum-line {
    min-width: 34px;
  }
  .spectrum-axis,
  .spectrum-line-label,
  .spectrum-line-nm {
    display: none;
  }
  .spectrum-line.target .spectrum-line-label,
  .spectrum-line.found .spectrum-line-label {
    display: block;
    bottom: calc(100% + 6px);
    font-size: 10px;
  }
  .star-spectrum-body {
    padding-bottom: 86px;
  }
  .spectrum-found-badge {
    margin-left: 92px;
    max-width: calc(100% - 92px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spectrum-found-badge {
    animation: none;
  }
}

/* Design audit 2026-07-06: on phones the 4 system tabs wrapped to two rows
   and pushed the sky map below the fold — one scrollable row instead. */
@media (max-width: 480px) {
  .exoplanet-picker {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: calc(100vw - 24px);
    padding-bottom: 4px;
  }
  .exoplanet-picker::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 480px) {
  .exoplanet-btn {
    white-space: nowrap;
    flex: 0 0 auto;
  }
}
