:root {
  --bg: #05060d;
  --bg2: #0b0f1f;
  --panel: #0f1428;
  --line: #2a3458;
  --ink: #e8edff;
  --muted: #8c97c7;
  --accent: #ffd966;
  --pattern: #ff9f5e;
  --link: #7ab6ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: radial-gradient(ellipse at top, #0b1130 0%, var(--bg) 70%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  min-height: 100vh;
}

.topbar {
  padding: 18px 24px 0;
  text-align: center;
}
.topbar h1 {
  margin: 0; font-size: 22px; letter-spacing: 0.02em;
}
.topbar .sub {
  margin: 4px 0 12px; color: var(--muted); font-size: 13px;
}
.seasons {
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 8px;
}
.seasons button {
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; cursor: pointer;
  transition: 0.15s;
}
.seasons button:hover { border-color: var(--accent); }
.seasons button.active {
  background: var(--accent); color: #1a1300; border-color: var(--accent);
  font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px; padding: 12px 18px 24px;
  max-width: 1400px; margin: 0 auto;
}
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .panel { order: 2; }
}

.sky-wrap {
  position: relative;
  background: radial-gradient(circle at 50% 50%, #0a1233 0%, #04060f 75%);
  border: 1px solid var(--line); border-radius: 14px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
#sky { width: 100%; height: 100%; display: block; }

.compass {
  position: absolute; inset: 0; pointer-events: none;
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.compass span {
  position: absolute; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.35); padding: 2px 6px; border-radius: 4px;
}
.compass .n { left: 50%; top: 14px; }
.compass .s { left: 50%; bottom: 4px; top: auto; transform: translate(-50%, 50%); }
.compass .e { left: calc(100% - 14px); top: 50%; }
.compass .w { left: 14px; top: 50%; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  display: flex; flex-direction: column; gap: 10px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.panel h2 {
  margin: 6px 0 4px; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 600;
}

.season-info {
  background: linear-gradient(135deg, #1a2150 0%, #0d1230 100%);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; line-height: 1.5;
}
.season-info .title { font-weight: 700; font-size: 15px; }
.season-info .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }

.cons-list { list-style: none; margin: 0; padding: 0; }
.cons-list li {
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  display: flex; justify-content: space-between; gap: 8px;
  border: 1px solid transparent;
}
.cons-list li:hover { background: #161c3a; }
.cons-list li.active {
  background: #1d2756; border-color: var(--accent);
}
.cons-list .ko { font-weight: 600; }
.cons-list .lat { color: var(--muted); font-size: 12px; }

.star-info {
  background: #0a0f24; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
  min-height: 60px; line-height: 1.5;
}
.star-info .hint { color: var(--muted); margin: 0; font-size: 13px; }
.star-info h3 { margin: 0 0 4px; font-size: 15px; }
.star-info .row { display: flex; justify-content: space-between; font-size: 13px; }
.star-info .row span:first-child { color: var(--muted); }
.star-info .desc { margin-top: 6px; font-size: 13px; color: #c8d1ff; }

.toggles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px;
  font-size: 13px;
}
.toggles label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

.howto { font-size: 13px; color: var(--muted); }
.howto summary { cursor: pointer; padding: 4px 0; }
.howto ul { margin: 6px 0 0 18px; padding: 0; }
.howto li { margin-bottom: 3px; }

.foot {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 8px 12px 20px;
}

/* SVG */
.horizon { fill: none; stroke: #3a4677; stroke-width: 1.5; stroke-dasharray: 4 4; }
.altline { fill: none; stroke: #1f2748; stroke-width: 1; }
.cardinal { fill: #6f7ab0; font-size: 14px; font-weight: 600; }

.cline {
  stroke: #6485e0; stroke-width: 1.4; fill: none;
  stroke-linecap: round; opacity: 0.55;
}
.cname {
  fill: #aebbff; font-size: 13px; font-weight: 500;
  text-anchor: middle; pointer-events: none;
  opacity: 0.85;
  paint-order: stroke;
  stroke: #04060f; stroke-width: 3;
}
.constellation:hover .cline { stroke: var(--accent); opacity: 1; }
.constellation:hover .cname { fill: var(--accent); }
.constellation.active .cline { stroke: var(--accent); opacity: 1; stroke-width: 1.8; }
.constellation.active .cname { fill: var(--accent); font-weight: 700; }

.star { cursor: pointer; }
.star circle { fill: #fff; }
.star:hover circle { fill: var(--accent); }
.star.bright circle { filter: drop-shadow(0 0 4px #fff); }
.starName {
  fill: #cdd6ff; font-size: 11px;
  paint-order: stroke; stroke: #04060f; stroke-width: 2.5;
  pointer-events: none;
}

.pattern {
  fill: none; stroke: var(--pattern); stroke-width: 1.5;
  stroke-dasharray: 6 4; opacity: 0.85;
}
.pname {
  fill: var(--pattern); font-size: 12px; font-weight: 600;
  paint-order: stroke; stroke: #04060f; stroke-width: 3;
  pointer-events: none;
}

.bgstar { fill: #ffffff; opacity: 0.55; }
