/* ── 상단 검색바 */
#topbar {
  position: fixed;
  top: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: 780px;
  max-width: calc(100vw - 32px);
}

/* 검색 + 버튼 전체 래퍼 */
.topbar-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* 검색 래퍼 */
.search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--bg-search);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 18px 28px;
  box-shadow: var(--shadow-search);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.search-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-search), var(--glow-accent);
}

.search-logo {
  font-size: 13px;
  font-weight: var(--weight-bold);
  letter-spacing: 3.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex-shrink: 0;
}

#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 20px;
  color: var(--text-primary);
  min-width: 0;
}

#search-input::placeholder { color: var(--text-muted); font-size: 17px; }

#planet-count {
  font-size: var(--text-base);
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

/* 검색 결과 드롭다운 */
#search-results {
  position: absolute;
  top: calc(100% + var(--sp-2));
  left: 0;
  right: 72px;
  background: var(--bg-search);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-modal);
  backdrop-filter: blur(20px);
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(100,140,255,0.25) transparent;
  display: none;
}

#search-results::-webkit-scrollbar { width: 4px; }
#search-results::-webkit-scrollbar-track { background: transparent; }
#search-results::-webkit-scrollbar-thumb { background: rgba(100,140,255,0.25); border-radius: 2px; }

#search-results.open { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px var(--sp-5);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item.active {
  background: rgba(100, 140, 255, 0.12);
}
.search-result-item.active {
  border-left: 2px solid rgba(120, 160, 255, 0.7);
  padding-left: calc(var(--sp-5) - 2px);
}

.search-result-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.search-result-name {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.search-result-dis {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

/* 일시정지 버튼 */
#pause-btn {
  position: fixed;
  bottom: var(--sp-6);
  left: var(--sp-6);
  z-index: 100;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(8,8,32,0.8);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
  transition: all var(--t-fast);
}
#pause-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
#pause-btn.paused { color: var(--accent-blue); border-color: var(--accent-blue); }

.ctrl-btn {
  position: fixed;
  bottom: var(--sp-6);
  z-index: 100;
  height: 40px;
  padding: 0 12px;
  border-radius: 20px;
  background: rgba(8,8,32,0.8);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  display: flex; align-items: center; gap: 5px;
  backdrop-filter: blur(10px);
  transition: all var(--t-fast);
  cursor: pointer;
  white-space: nowrap;
}
.ctrl-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.ctrl-btn.active { color: var(--accent-blue); border-color: var(--accent-blue); }
.ctrl-btn [class*="ph-"] { font-size: 14px; }

#quality-btn  { right: 70px; }
#nebula-btn   { right: 122px; }
#autocam-btn  { right: 20px; }

/* 행성 추가 버튼 — 검색창 옆 */
#add-btn {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg-search);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-search);
  transition: all var(--t-fast);
  position: relative;
}

#add-btn:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-search), var(--glow-blue);
}

/* 행성 아이콘 — CSS로 */
.add-planet-icon {
  position: relative;
  width: 40px;
  height: 40px;
}

.add-planet-core {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-gradient);
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(74,158,255,0.7);
}

.add-planet-ring {
  width: 40px; height: 14px;
  border: 2px solid rgba(139,92,246,0.75);
  border-radius: 50%;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotateX(60deg);
}

.add-planet-plus {
  position: absolute;
  top: -1px; right: -1px;
  width: 18px; height: 18px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: var(--weight-bold);
  color: #fff;
  line-height: 1;
  box-shadow: 0 0 8px rgba(74,158,255,0.9);
}

/* ── 발진 버튼 ── 행성 추가 버튼과 같은 크기·형태로 나란히.
   구석에 두면 만든 뒤 무엇을 해야 하는지 안 보인다. */
#launch-btn {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(150deg, rgba(255,140,50,.20), rgba(255,90,40,.10));
  border: 1px solid rgba(255,150,60,.5);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  color: #ffc27a;
  box-shadow: var(--shadow-search), 0 0 18px rgba(255,130,40,.18);
  transition: all var(--t-fast);
}
#launch-btn.on { display: flex; }
#launch-btn:hover {
  border-color: rgba(255,185,110,.9);
  color: #fff;
  box-shadow: var(--shadow-search), 0 0 30px rgba(255,140,50,.45);
}
#launch-btn:disabled { opacity: .6; cursor: default; }
#launch-btn [class*="ph-"] { font-size: 30px; line-height: 1; }

/* 대기 개수 — 추가 버튼의 + 배지와 같은 자리 */
.launch-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 22px; height: 22px;
  padding: 0 5px;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff9a3c, #ff6a2a);
  color: #1a0a00;
  font-size: 12px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  box-shadow: 0 0 10px rgba(255,140,50,.85);
}
