* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: #0d0f1a; color: #e8eaf2;
  padding: 20px; max-width: 1100px; margin: 0 auto;
}
h1 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.sub { font-size: 13px; color: #8890a8; margin-bottom: 16px; }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.stat { flex: 1; min-width: 120px; background: #151827; border-radius: 10px; padding: 12px 16px; }
.stat .label { font-size: 12px; color: #8890a8; }
.stat .value { font-size: 20px; font-weight: 600; margin-top: 2px; }

.panel { background: #151827; border: 1px solid #2a2f45; border-radius: 12px; padding: 12px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }

button {
  background: #1e2236; color: #e8eaf2; border: 1px solid #363c58;
  border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit; min-height: 44px;
}
button:hover { background: #262b44; }
button.active { border: 2px solid #7a86ff; }
#zIn, #zOutBtn, #dClose {
  min-width: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}

input[type=text] {
  background: #1e2236; color: #e8eaf2; border: 1px solid #363c58;
  border-radius: 8px; padding: 8px 12px; font-size: 13px; font-family: inherit;
  min-width: 160px;
}

.searchWrap { position: relative; display: inline-flex; }
.searchWrap input[type=text] { padding-right: 32px; }
.searchClear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; padding: 0; border: none; background: transparent;
  color: #8890a8; font-size: 15px; cursor: pointer; border-radius: 6px;
}
.searchClear:hover { background: #262b44; color: #e8eaf2; }

#banner {
  display: none; margin-bottom: 12px; padding: 10px 14px;
  background: #1c2033; border: 1px dashed #3a4260; border-radius: 8px;
  font-size: 13px; color: #a8aec4;
}
#banner.on { display: block; }
#banner code { color: #9db4ff; background: #10131f; padding: 2px 6px; border-radius: 4px; }

canvas { width: 100%; border-radius: 8px; display: block; background: #05060f; touch-action: none; }
#map { cursor: grab; }
#orb { cursor: grab; margin-top: 12px; }
.hintbox { position: relative; }
.hint { position: absolute; bottom: 10px; left: 12px; font-size: 12px; color: #8890a8; pointer-events: none; }

.controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.controls label { font-size: 13px; color: #a8aec4; }
input[type=range] { flex: 1; min-width: 120px; accent-color: #7a86ff; }

.legend { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: #a8aec4; flex-wrap: wrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: -1px; margin-right: 4px; }
.dot-hz { box-shadow: 0 0 0 2px rgba(223,255,232,0.9); }

#detail { display: none; margin-top: 16px; }
.dhead { display: flex; justify-content: space-between; align-items: flex-start; }
#dName { font-size: 16px; font-weight: 600; }
#dSub { font-size: 13px; color: #8890a8; margin-top: 2px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.cell { background: #1e2236; border-radius: 8px; padding: 10px 14px; }
.cell .label { font-size: 11px; color: #8890a8; }
.cell .value { font-size: 15px; font-weight: 600; margin-top: 2px; }

#pCard { display: none; margin-top: 12px; background: #1e2236; border-radius: 8px; padding: 12px 16px; }
#pName { font-size: 14px; font-weight: 600; }
#pInfo { font-size: 13px; color: #a8aec4; margin-top: 4px; line-height: 1.6; }
#dBody { margin-top: 12px; font-size: 14px; color: #a8aec4; line-height: 1.7; }

#dPhoto img, #pPhoto img { max-width: 100%; border-radius: 8px; display: block; cursor: zoom-in; }
#dPhotoCap, #pPhotoCap { font-size: 12px; color: #8890a8; margin-top: 6px; line-height: 1.5; }

#lightbox {
  display: none; position: fixed; inset: 0; background: rgba(5,6,15,0.92);
  z-index: 1000; align-items: center; justify-content: center; cursor: zoom-out; padding: 24px;
}
#lightbox.on { display: flex; }
#lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,0.6); }

footer { margin-top: 16px; font-size: 12px; color: #68708c; line-height: 1.6; }
footer a { color: #9db4ff; }

@media (max-width: 480px) {
  body { padding: 12px; }
  h1 { font-size: 18px; }
  .stats { gap: 8px; }
  .stat { min-width: 100px; padding: 10px 12px; }
  .toolbar { gap: 6px; }
  .toolbar button { flex: 1 1 auto; padding: 8px 10px; font-size: 12.5px; }
  .searchWrap { flex: 1 1 100%; }
  #searchBox { min-width: 0; width: 100%; }
  .toolbar .spacer { display: none; }
  #locControls label { flex: 1 1 100%; margin-top: 4px; }
  #yearSlider { flex: 1 1 auto; max-width: none !important; }
  .controls { gap: 8px; }
}
@media (max-width: 360px) {
  .stats { flex-direction: column; }
  .toolbar button { font-size: 12px; padding: 8px; }
}
