/* Visitor globe. Self-contained so globe-lab.html can load it alone.
   The three looks are driven by data-style on .globe-card (set by js/globe.js). */
.globe-card {
  --g-bg: #1a1b1d; --g-border: rgba(255, 255, 255, 0.10); --g-text: #f2eee5; --g-dim: rgba(242, 238, 229, 0.62);
  --g-chip: rgba(255, 255, 255, 0.045); --g-line: rgba(255, 255, 255, 0.10); --g-accent: #e4572e; --g-accent2: #f29a72;
  --g-tip-bg: #121315; --g-tip-text: #f2eee5; --g-btn-bg: rgba(18, 19, 21, 0.82); --g-hover: rgba(255, 255, 255, 0.07);
  width: 100%; max-width: 520px; justify-self: end;
  padding: 14px; border-radius: 22px; color: var(--g-text);
  background: var(--g-bg); border: 1px solid var(--g-border);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.42);
}
.globe-card[data-style="graphite"] {
  --g-bg: #131519; --g-border: rgba(255, 255, 255, 0.09); --g-accent: #ffb347; --g-accent2: #ffd08a;
  --g-tip-bg: #0b0c0e;
}
.globe-card[data-style="paper"] {
  --g-bg: #f3eee0; --g-border: rgba(40, 34, 20, 0.16); --g-text: #1d1b16; --g-dim: rgba(29, 27, 22, 0.62);
  --g-chip: rgba(40, 34, 20, 0.05); --g-line: rgba(40, 34, 20, 0.14); --g-accent: #d1402a; --g-accent2: #e8826a;
  --g-tip-bg: #fffaf0; --g-tip-text: #1d1b16; --g-btn-bg: rgba(255, 250, 240, 0.9); --g-hover: rgba(40, 34, 20, 0.06);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.32);
}

.globe-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 2px 6px 8px; font-size: 0.86rem; font-weight: 600; letter-spacing: 0.01em; }
.globe-head .badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; padding: 4px 10px;
  border-radius: 999px; border: 1px solid var(--g-line); color: var(--g-dim); white-space: nowrap;
}
.globe-head .badge.live { color: var(--g-text); }
.globe-head .badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3fbf72; animation: gblink 1.8s ease-in-out infinite; }
@keyframes gblink { 50% { opacity: 0.35; } }

.globe-wrap { position: relative; width: 100%; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; border-radius: 16px; }
.globe-wrap.holding { cursor: grabbing; }
#globeCanvas { display: block; width: 100%; border-radius: 16px; }
.globe-wrap.no-globe { min-height: 120px; }
.globe-wrap.no-globe::after { content: "The globe needs a browser with canvas support."; position: absolute; inset: 0; display: grid; place-items: center; color: var(--g-dim); font-size: 0.86rem; }

.globe-tip {
  position: absolute; z-index: 3; display: grid; gap: 2px; width: max-content; max-width: 230px;
  padding: 8px 12px; border-radius: 10px; pointer-events: none;
  background: var(--g-tip-bg); color: var(--g-tip-text); border: 1px solid var(--g-line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); font-size: 0.82rem;
}
.globe-tip[hidden] { display: none; }
.globe-tip span { opacity: 0.72; font-size: 0.75rem; }

.globe-zoom { position: absolute; right: 8px; bottom: 8px; display: grid; gap: 6px; z-index: 2; }
.globe-zoom button {
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font: inherit; font-size: 1.15rem; line-height: 1;
  color: var(--g-text); background: var(--g-btn-bg); border: 1px solid var(--g-line);
}
.globe-zoom button:hover, .globe-zoom button.g-hover { border-color: var(--g-accent); }

.globe-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 2px 8px; }
.globe-stats div { padding: 10px 8px; text-align: center; border-radius: 12px; border: 1px solid var(--g-line); background: var(--g-chip); }
.globe-stats b { display: block; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: 1.6rem; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--g-text); }
.globe-stats span { display: block; margin-top: 3px; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--g-dim); }

.globe-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.g-row {
  width: 100%; display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(40px, 90px) auto; gap: 10px; align-items: center;
  padding: 7px 10px; border-radius: 10px; cursor: pointer; text-align: left; font: inherit; font-size: 0.86rem;
  color: var(--g-text); background: transparent; border: 1px solid transparent;
}
.g-row:hover, .g-row.g-hover { background: var(--g-hover); border-color: var(--g-line); }
.g-flag { font-size: 1.05rem; line-height: 1; }
.g-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-bar { height: 5px; border-radius: 3px; background: var(--g-line); overflow: hidden; }
.g-bar i { display: block; height: 100%; border-radius: 3px; background: var(--g-accent); transition: width 600ms ease; }
.g-row b { font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }

.globe-card .link-btn { color: var(--g-dim); border-bottom-color: var(--g-line); }
.globe-note { margin: 10px 6px 0; font-size: 0.74rem; line-height: 1.5; color: var(--g-dim); text-align: center; }
.globe-note a { color: var(--g-text); text-decoration: underline; text-underline-offset: 2px; }
.globe-status { min-height: 1em; margin: 6px 6px 0; font-size: 0.74rem; line-height: 1.45; text-align: center; color: var(--g-dim); }
.globe-card .tornado-switch small { color: var(--g-dim); }
.globe-card .tornado-switch .pill-btn { color: var(--g-text); border-color: var(--g-line); background: var(--g-chip); }
.globe-card .tornado-switch .pill-btn.on { background: var(--g-accent); border-color: var(--g-accent); color: #fff; }
.globe-card[data-style="graphite"] .tornado-switch .pill-btn.on { color: #17130a; }

@media (max-width: 1000px) { .globe-card { justify-self: center; } }
@media (prefers-reduced-motion: reduce) { .globe-head .badge.live::before { animation: none; } .g-bar i { transition: none; } }

/* ---------- Compact layout: the hero (header + globe card) must fit one screen ---------- */
.globe-card { padding: 12px; }
.globe-head { margin: 0 4px 6px; }
/* The globe is sized by the WINDOW HEIGHT, not the card width, so it can never push the page taller than the screen */
.globe-wrap { width: min(100%, max(236px, calc(100vh - 400px))); width: min(100%, max(236px, calc(100svh - 400px))); max-width: 470px; margin: 0 auto; }
.globe-stats { gap: 6px; margin: 8px 0 6px; }
.globe-stats div { padding: 6px 4px; border-radius: 10px; }
.globe-stats b { font-size: 1.3rem; }
.globe-stats span { margin-top: 1px; font-size: 0.6rem; }
.globe-list { gap: 1px; }
.g-row { padding: 4px 8px; font-size: 0.82rem; gap: 8px; }
.globe-card .link-btn { font-size: 0.76rem; padding: 2px 8px; }
.globe-status:empty { display: none; }
.globe-status { margin: 4px 6px 0; }
.globe-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding: 0 2px; }
.globe-foot .globe-note { margin: 0; text-align: left; font-size: 0.7rem; }
.globe-foot .pill-btn { padding: 5px 11px; font-size: 0.74rem; white-space: nowrap; font: inherit; font-size: 0.74rem; cursor: pointer; border-radius: 999px;
  color: var(--g-text); border: 1px solid var(--g-line); background: var(--g-chip); }
.globe-foot .pill-btn.on { background: var(--g-accent); border-color: var(--g-accent); color: #fff; }
.globe-card[data-style="graphite"] .globe-foot .pill-btn.on { color: #17130a; }
@media (max-width: 900px) { .globe-wrap { width: min(100%, 380px); } }
@media (max-width: 480px) { .globe-foot { flex-direction: column; align-items: stretch; } .globe-foot .globe-note { text-align: center; } }
