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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  color: #e8ecf5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

#app { position: relative; width: 100%; height: 100%; }

#scene { display: block; width: 100%; height: 100%; }

/* ---------- 상단 HUD ---------- */
#hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  pointer-events: none;
}
#hud-top > * { pointer-events: auto; }
#back-link {
  color: #9aa5c4; text-decoration: none; font-size: 13px;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  transition: background .15s;
}
#back-link:hover { background: rgba(255,255,255,0.14); }
#hud-top h1 { font-size: 17px; font-weight: 700; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
#sim-clock {
  margin-left: auto; font-size: 12px; color: #9aa5c4;
  background: rgba(0,0,0,0.45); padding: 6px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  font-variant-numeric: tabular-nums;
}

/* ---------- 행성 라벨 ---------- */
.planet-label {
  color: #cfd8ee; font-size: 12px; font-weight: 600;
  text-shadow: 0 0 6px #000, 0 0 3px #000;
  cursor: pointer; user-select: none;
  transition: color .15s;
}
.planet-label:hover { color: #ffd76a; }

/* ---------- 정보 패널 ---------- */
#info-panel {
  position: absolute; top: 64px; right: 16px;
  width: 290px; max-width: calc(100vw - 32px);
  background: rgba(12, 16, 32, 0.88);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 18px 20px;
  backdrop-filter: blur(8px);
  transition: opacity .2s, transform .2s;
}
#info-panel.hidden { opacity: 0; transform: translateX(12px); pointer-events: none; }
#info-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; color: #9aa5c4;
  font-size: 20px; cursor: pointer; line-height: 1;
}
#info-close:hover { color: #fff; }
#info-panel h2 { font-size: 19px; margin-bottom: 8px; }
#info-panel p { font-size: 12.5px; line-height: 1.6; color: #aeb8d6; margin-bottom: 12px; }
#info-stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; margin-bottom: 14px; }
#info-stats dt { color: #7d88aa; }
#info-stats dd { color: #e8ecf5; text-align: right; font-variant-numeric: tabular-nums; }
#btn-unfollow {
  width: 100%; padding: 8px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,0.08); color: #cfd8ee;
  border: 1px solid rgba(255,255,255,0.14); font-size: 12.5px;
}
#btn-unfollow:hover { background: rgba(255,255,255,0.16); }

/* ---------- 하단 컨트롤 ---------- */
#hud-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
}
.ctrl-group { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #aeb8d6; }
.ctrl-group label { display: flex; align-items: center; gap: 5px; cursor: pointer; }

#hud-bottom button {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #e8ecf5; border-radius: 8px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
  transition: background .15s;
}
#hud-bottom button:hover { background: rgba(255,255,255,0.18); }

.speed-group input[type="range"] { width: 140px; accent-color: #ffd76a; }
#speed-label { min-width: 84px; font-variant-numeric: tabular-nums; color: #ffd76a; }

#planet-buttons { flex-wrap: wrap; gap: 5px; }
#planet-buttons button { padding: 5px 9px; font-size: 12px; }
#planet-buttons button.active { background: rgba(255,215,106,0.25); border-color: #ffd76a; }

/* ---------- 힌트 ---------- */
#hint {
  position: absolute; bottom: 72px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: #7d88aa;
  background: rgba(0,0,0,0.4); padding: 6px 14px; border-radius: 99px;
  pointer-events: none;
  animation: hint-fade 1s ease 6s forwards;
  white-space: nowrap;
}
@keyframes hint-fade { to { opacity: 0; } }

@media (max-width: 640px) {
  #hud-top h1 { font-size: 14px; }
  #sim-clock { display: none; }
  .speed-group input[type="range"] { width: 90px; }
  #hint { display: none; }
}
