:root {
  --bg: #05070d;
  --panel: rgba(14, 18, 30, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8e6e1;
  --muted: #9aa0ad;
  --accent: #f2b45a;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

#globe { position: fixed; inset: 0; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 0.01em;
}
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.search input {
  width: 260px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.search input:focus { border-color: var(--accent); }

/* ---------- Globe tooltip ---------- */
.scene-tooltip, .globe-label {
  font-family: var(--sans);
}
.globe-label {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}
.globe-label small { color: var(--muted); display: block; }

/* ---------- Side panel ---------- */
.panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(460px, 100vw);
  background: var(--panel);
  backdrop-filter: blur(12px);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 28px 28px 48px;
  animation: slide-in 0.35s ease;
}
.panel[hidden] { display: none; }

@keyframes slide-in {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.close {
  position: absolute;
  top: 14px; right: 16px;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
}
.close:hover { background: rgba(255,255,255,0.08); color: var(--text); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--accent);
  margin: 0 0 6px;
}
.panel h2 {
  font-family: var(--serif);
  font-size: 34px;
  margin: 0 0 16px;
  line-height: 1.1;
}
.thumb {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 16px;
  background: #111;
}
.intro p { line-height: 1.65; font-size: 15px; margin: 0 0 12px; }

.eras h3 {
  font-family: var(--serif);
  font-size: 20px;
  margin: 28px 0 10px;
}
.eras details {
  border-top: 1px solid var(--border);
}
.eras details:last-child { border-bottom: 1px solid var(--border); }
.eras summary {
  cursor: pointer;
  padding: 12px 4px;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.eras summary::-webkit-details-marker { display: none; }
.eras summary::after { content: "+"; color: var(--accent); font-size: 18px; line-height: 1; }
.eras details[open] summary::after { content: "–"; }
.eras .body { padding: 0 4px 14px; }
.eras .body p { line-height: 1.6; font-size: 14px; color: #cfccc5; margin: 0 0 10px; }
.eras .body h4 { font-size: 13px; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: 0.06em; }

.source {
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
}
.source a { color: var(--accent); }

.status { color: var(--muted); font-size: 14px; }
.skeleton {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #1a1f2c, #262c3b, #1a1f2c);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  margin: 10px 0;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
}

@media (max-width: 640px) {
  .topbar { flex-direction: column; padding: 16px; }
  .brand h1 { font-size: 24px; }
  .search input { width: 100%; }
  .search { width: 100%; }
  .panel {
    top: auto;
    height: 65vh;
    width: 100vw;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    padding: 24px 16px 40px;
  }
}
