:root {
  --bg: #04070d;
  --panel: rgba(7, 12, 24, 0.78);
  --panel-strong: rgba(8, 14, 28, 0.92);
  --line: rgba(150, 182, 255, 0.14);
  --text: #f4f7ff;
  --muted: rgba(228, 235, 255, 0.7);
  --ice: #b9dcff;
  --cyan: #6de4ff;
  --gold: #e3d64f;
  --gold-soft: rgba(227, 214, 79, 0.18);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(54, 94, 170, 0.2), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(7, 179, 255, 0.1), transparent 24%),
    linear-gradient(180deg, #04070d 0%, #02040a 100%);
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

body.embed-mode {
  min-height: 100%;
  background: transparent;
}

.lab-shell {
  width: min(1560px, calc(100% - 48px));
  margin: 0 auto;
  padding: 40px 0 48px;
}

.lab-copy {
  max-width: 980px;
  margin-bottom: 28px;
}

.eyebrow,
.panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ice);
}

.eyebrow::before,
.panel-kicker::before {
  content: "";
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(185, 220, 255, 0.8));
}

h1,
h2 {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 600;
}

h1 {
  margin-top: 12px;
  font-size: clamp(2.7rem, 4vw, 4.6rem);
  line-height: 0.95;
}

.lead,
.note,
.panel-head p,
.route-meta,
.route-description,
.route-stat {
  color: var(--muted);
}

.lead {
  max-width: 640px;
  margin: 18px 0 0;
  font-size: 1rem;
  line-height: 1.7;
}

.note {
  max-width: 680px;
  margin: 10px 0 0;
  font-size: 0.92rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.85rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dot,
.line {
  display: inline-block;
  flex: 0 0 auto;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dot.hub {
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(109, 228, 255, 0.8);
}

.dot.compare {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.28);
}

.line {
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, rgba(227, 214, 79, 0.14), rgba(227, 214, 79, 1));
}

.lab-stage {
  display: block;
}

.globe-frame,
.compare-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.globe-frame {
  min-height: 840px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.country-rail {
  position: absolute;
  z-index: 3;
  top: 22px;
  left: 22px;
  width: min(220px, calc(100% - 44px));
  padding: 18px;
  border: 1px solid rgba(185, 220, 255, 0.14);
  border-radius: 22px;
  background: rgba(5, 10, 20, 0.72);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.country-rail-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ice);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.country-rail-kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(185, 220, 255, 0.8));
}

.country-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.country-chip {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(185, 220, 255, 0.12);
  border-radius: 999px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.country-chip:hover,
.country-chip.is-active {
  border-color: rgba(255, 225, 92, 0.52);
  background: linear-gradient(135deg, rgba(109, 228, 255, 0.08), rgba(255, 225, 92, 0.18));
  transform: translateX(4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
}

.country-chip.is-active {
  color: #fff8d0;
}

.globe-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(102, 174, 255, 0.12), transparent 30%),
    radial-gradient(circle at 50% 120%, rgba(18, 46, 102, 0.28), transparent 45%);
  pointer-events: none;
}

.globe-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 840px;
  transform: none;
}

body.embed-mode .lab-shell {
  width: 100%;
  padding: 0;
}

body.embed-mode .lab-copy,
body.embed-mode .compare-panel,
body.embed-mode .country-rail {
  display: none;
}

body.embed-mode .globe-frame {
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.embed-mode .globe-frame::before {
  background:
    radial-gradient(circle at 50% 18%, rgba(102, 174, 255, 0.08), transparent 30%),
    radial-gradient(circle at 50% 120%, rgba(18, 46, 102, 0.18), transparent 45%);
}

body.embed-mode .globe-canvas {
  min-height: 100vh;
  transform: none;
}

.compare-panel {
  margin-top: 24px;
  padding: 28px;
  background: var(--panel-strong);
}

.panel-head h2 {
  margin-top: 10px;
  font-size: 1.8rem;
  line-height: 1.05;
}

.panel-head p {
  margin: 12px 0 0;
  line-height: 1.65;
}

.compare-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(185, 220, 255, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
  margin-top: 22px;
  padding: 24px;
  transition: border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}

.compare-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0));
  transform: translateX(0);
  pointer-events: none;
}

.compare-card.is-active {
  border-color: rgba(109, 228, 255, 0.42);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

.compare-card.is-active::before {
  transform: translateX(140%);
}

.compare-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compare-card h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.route-tag {
  border: 1px solid rgba(109, 228, 255, 0.24);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--cyan);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-description {
  margin: 12px 0 0;
  line-height: 1.6;
}

.route-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.route-stat {
  border-top: 1px solid rgba(185, 220, 255, 0.12);
  padding-top: 10px;
  font-size: 0.82rem;
}

.route-stat strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.route-actions button,
.route-actions a {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.route-actions button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.route-actions a {
  background: linear-gradient(135deg, rgba(109, 228, 255, 0.2), rgba(227, 214, 79, 0.22));
  color: var(--text);
}

.tooltip {
  position: fixed;
  z-index: 20;
  padding: 10px 12px;
  border: 1px solid rgba(185, 220, 255, 0.22);
  border-radius: 12px;
  background: rgba(5, 9, 17, 0.92);
  color: var(--text);
  font-size: 0.82rem;
  pointer-events: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

@media (max-width: 1100px) {
  .country-rail {
    top: auto;
    bottom: 18px;
    left: 18px;
    width: min(240px, calc(100% - 36px));
  }

  .globe-frame,
  .globe-canvas {
    min-height: 620px;
  }
}

@media (max-width: 720px) {
  .lab-shell {
    width: min(100% - 24px, 1560px);
    padding-top: 22px;
  }

  .globe-frame,
  .globe-canvas {
    min-height: 440px;
  }

  .country-rail {
    left: 14px;
    bottom: 14px;
    width: calc(100% - 28px);
    padding: 14px;
  }

  .country-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-right: -4px;
    scroll-snap-type: x proximity;
  }

  .country-chip {
    min-width: 150px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .compare-panel {
    padding: 18px;
  }

  .route-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .lab-shell {
    width: min(100% - 16px, 1560px);
  }

  .lab-copy {
    margin-bottom: 18px;
  }

  .lead {
    font-size: 0.96rem;
  }

  .legend {
    gap: 10px;
    font-size: 0.78rem;
  }

  .globe-frame,
  .globe-canvas {
    min-height: 380px;
  }

  .country-rail {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    padding: 12px;
  }

  .country-chip {
    min-width: 136px;
    padding: 10px 12px;
  }

  .compare-panel {
    padding: 16px;
  }

  .compare-card {
    padding: 18px;
  }
}

.globe-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 18px;
  padding: 48px 24px 120px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(109, 228, 255, 0.08), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(227, 214, 79, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(4, 7, 13, 0.3), rgba(4, 7, 13, 0.75));
}

.fallback-orb {
  position: relative;
  width: min(78vw, 760px);
  aspect-ratio: 1;
  max-height: 70vh;
}

.fallback-orb-core {
  position: absolute;
  inset: 21%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.25), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(109, 228, 255, 0.18), rgba(8, 17, 36, 0.95) 62%, rgba(4, 7, 13, 1) 100%);
  box-shadow:
    inset 0 0 48px rgba(109, 228, 255, 0.18),
    0 0 70px rgba(109, 228, 255, 0.12);
}

.fallback-ring {
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(185, 220, 255, 0.12);
  border-radius: 999px;
}

.fallback-ring-a {
  transform: rotate(18deg);
}

.fallback-ring-b {
  inset: 10%;
  transform: rotate(-24deg);
}

.fallback-ring-c {
  inset: 6%;
  transform: rotate(64deg);
}

.fallback-node {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 10px 12px;
  border: 1px solid rgba(185, 220, 255, 0.18);
  border-radius: 999px;
  background: rgba(5, 10, 20, 0.72);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
}

.fallback-node-panama {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff8d0;
  border-color: rgba(255, 225, 92, 0.42);
  background: linear-gradient(135deg, rgba(109, 228, 255, 0.14), rgba(255, 225, 92, 0.18));
}

.fallback-node-portugal { top: 8%; left: 60%; }
.fallback-node-canada { top: 20%; left: 7%; }
.fallback-node-greece { top: 30%; right: 2%; }
.fallback-node-spain { top: 58%; right: 8%; }
.fallback-node-usa { bottom: 18%; left: 10%; }
.fallback-node-uae { bottom: 28%; right: 10%; }
.fallback-node-caribbean { bottom: 6%; left: 50%; transform: translateX(-50%); }

.fallback-copy {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.fallback-copy strong {
  color: var(--text);
  font-size: 1rem;
}

.fallback-card .route-actions {
  justify-content: center;
}

body.embed-mode .globe-fallback {
  padding-bottom: 56px;
}

@media (max-width: 720px) {
  .globe-fallback {
    padding: 30px 16px 118px;
  }

  .fallback-orb {
    width: min(92vw, 520px);
  }

  .fallback-node {
    min-width: 78px;
    padding: 8px 10px;
    font-size: 0.78rem;
  }
}

@media (max-width: 520px) {
  .fallback-orb {
    width: min(96vw, 360px);
  }

  .fallback-node {
    min-width: 68px;
    padding: 7px 8px;
    font-size: 0.72rem;
  }

  .fallback-node-portugal { top: 10%; left: 55%; }
  .fallback-node-canada { top: 24%; left: 1%; }
  .fallback-node-greece { top: 28%; right: 0; }
  .fallback-node-spain { top: 58%; right: 2%; }
  .fallback-node-usa { bottom: 18%; left: 2%; }
  .fallback-node-uae { bottom: 30%; right: 2%; }
}
