/* Lineage Globe — globe.html
   Layered on top of styles.css. Reuses the navbar + brand palette,
   adds a dedicated cinematic stage for the interactive globe. */

.globe-body {
  /* lighter, atmospheric — the in-flight-map vibe.
     Hint of sky-blue at top fading into deep navy so the realistic earth
     still has contrast without feeling like deep space. */
  background:
    radial-gradient(ellipse at 50% 0%, #1b2a44 0%, #0a1220 55%, #05080f 100%);
  min-height: 100vh;
}

.nav-link-active {
  color: #F5C518;
  opacity: 1;
}

/* Hero */
.globe-hero {
  padding: 72px 24px 24px;
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}
.globe-eyebrow {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.24em;
  color: #F5C518;
  font-size: 0.85rem;
  margin: 0 0 12px;
}
.globe-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.globe-subtitle {
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  color: var(--ink-dim);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.55;
}

/* Stage */
.globe-stage-wrap {
  position: relative;
  margin: 12px auto 48px;
  max-width: 1280px;
  padding: 0 16px;
}
.globe-stage {
  position: relative;
  width: 100%;
  height: clamp(520px, 72vh, 780px);
  border-radius: 18px;
  overflow: hidden;
  /* Soft sky gradient behind the globe — feels like looking out a window
     rather than into deep space. */
  background:
    radial-gradient(ellipse at 50% 35%, #2a4a78 0%, #11243f 55%, #050a14 100%);
  border: 1px solid rgba(158, 197, 255, 0.18);
  box-shadow:
    inset 0 0 100px rgba(0, 0, 0, 0.55),
    0 24px 60px -20px rgba(0, 0, 0, 0.8);
  cursor: grab;
}
.globe-stage:active { cursor: grabbing; }
.globe-stage canvas { display: block; }

/* Legend strip above the globe */
.globe-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  margin: 0 0 14px;
  padding: 0 16px;
  text-transform: uppercase;
}
.legend-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.legend-dot-origin {
  background: #F5C518;
  box-shadow: 0 0 10px rgba(245, 197, 24, 0.7);
}
.legend-dot-country {
  background: #EF4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
.legend-sep { opacity: 0.35; }
.legend-hint {
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(245, 241, 232, 0.5);
}

/* Stats strip below the globe */
.globe-stats {
  display: flex;
  justify-content: center;
  gap: clamp(28px, 6vw, 96px);
  margin-top: 28px;
  padding: 24px 16px 0;
  border-top: 1px solid var(--line);
}
.stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  color: #F5C518;
  line-height: 1;
}
.stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* Tooltip rendered by Globe.gl onPolygonHover */
.country-tooltip {
  font-family: var(--sans);
  background: rgba(10, 14, 20, 0.92);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(245, 197, 24, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
  pointer-events: none;
}
.country-tooltip .tt-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.country-tooltip .tt-count {
  color: #F5C518;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  text-transform: uppercase;
}
.country-tooltip.empty {
  border-color: var(--line);
}
.country-tooltip.empty .tt-count { color: var(--ink-dim); }

/* Country modal — shows belt grid for the clicked country */
.country-modal[hidden] { display: none; }
.country-modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.country-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(2, 4, 8, 0.78);
  backdrop-filter: blur(6px);
  animation: fadein 200ms ease-out;
}
.country-modal-panel {
  position: relative;
  background: linear-gradient(180deg, #0f1620 0%, #0a0e14 100%);
  border: 1px solid rgba(245, 197, 24, 0.25);
  border-radius: 16px;
  max-width: 880px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px 28px 32px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7);
  animation: rise 220ms cubic-bezier(.2,.7,.2,1);
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

.country-modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none;
  color: var(--ink-dim);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.country-modal-close:hover { color: var(--ink); }

.country-modal-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.country-modal-flag {
  font-size: 2.4rem;
  line-height: 1;
}
.country-modal-flag img {
  width: 2.4em; height: auto; vertical-align: middle;
  border-radius: 4px;
}
.country-modal-eyebrow {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
  font-size: 0.78rem;
  margin: 0;
}
.country-modal-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 4px 0 0;
}

.country-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}
.belt-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 16px 12px;
  background: rgba(245, 241, 232, 0.02);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: transform 180ms ease, border-color 180ms ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.belt-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 197, 24, 0.45);
}
.belt-card-photo {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #2a2f3a, #0f1620);
  overflow: hidden;
  border: 2px solid var(--rank-color, rgba(245, 197, 24, 0.5));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 18px var(--rank-glow, rgba(245, 197, 24, 0.25));
}
.belt-card-photo img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.belt-card-initials {
  font-family: var(--serif);
  color: var(--ink);
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}
.belt-card-name {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.2;
  margin: 0;
}
.belt-card-rank {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: var(--rank-color, #F5C518);
}

/* MOBILE — most visitors arrive from a phone, the globe must be the hero. */
@media (max-width: 640px) {
  /* styles.css already shows the last two nav items (Globe + Game) on
     mobile. That's the right pair here too — globe.html doesn't need a
     Lineage backlink in the nav, the Game pill + browser back work. */
  .nav-link { font-size: 0.82rem; }

  .globe-hero { padding: 28px 18px 12px; }
  .globe-eyebrow { font-size: 0.72rem; margin-bottom: 8px; }
  .globe-title { font-size: clamp(1.6rem, 7vw, 2.1rem); margin-bottom: 10px; }
  .globe-subtitle { font-size: 0.92rem; line-height: 1.5; }

  /* Legend: stack into two compact lines, drop the trailing hint to save
     room — the country tooltip on tap teaches the same affordance. */
  .globe-legend {
    font-size: 0.7rem;
    gap: 6px 12px;
    margin-bottom: 10px;
    padding: 0 12px;
  }
  .legend-sep { display: none; }
  .legend-hint { display: none; }

  /* Globe stage: nearly square on phones so the planet fills the frame
     and country dots are big targets. */
  .globe-stage {
    height: 78vh;
    min-height: 460px;
    max-height: 620px;
    border-radius: 14px;
  }
  .globe-stage-wrap { padding: 0 10px; margin-bottom: 28px; }

  /* Stats: smaller numbers, tighter row, so they don't push the globe up. */
  .globe-stats {
    gap: 28px;
    margin-top: 18px;
    padding-top: 18px;
  }
  .stat-num { font-size: 2rem; }
  .stat-label { font-size: 0.68rem; letter-spacing: 0.14em; }

  /* Country tooltip — bigger touch-friendly font, more padding. */
  .country-tooltip { font-size: 1rem; padding: 12px 16px; }

  /* Modal: edge-to-edge feel on phones. */
  .country-modal { padding: 0; align-items: flex-end; }
  .country-modal-panel {
    padding: 22px 18px 28px;
    border-radius: 18px 18px 0 0;
    max-height: 86vh;
    border-bottom: none;
    border-left: none;
    border-right: none;
  }
  .country-modal-close { top: 8px; right: 12px; font-size: 2rem; padding: 8px 12px; }
  .country-modal-head { gap: 14px; margin-bottom: 18px; padding-bottom: 14px; }
  .country-modal-flag { font-size: 2rem; }
  .country-modal-title { font-size: 1.6rem; }
  .country-modal-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
  .belt-card { padding: 12px 8px; gap: 8px; }
  .belt-card-photo { width: 68px; height: 68px; }
  .belt-card-name { font-size: 0.95rem; }
  .belt-card-rank { font-size: 0.68rem; }
}
