:root {
  color-scheme: dark;
  --band: #071633;
  --ink: #f4f7fb;
  --muted: rgba(244, 247, 251, 0.72);
  --card: rgba(6, 16, 38, 0.82);
  --line: rgba(255, 255, 255, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #eef1f4;
  color: #18202b;
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
}

.map-band {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 90% at 50% 46%, #1b56ad 0%, #0d3b86 34%, #082454 68%, #061433 100%);
}

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

#globe canvas {
  display: block;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 46%, transparent 52%, rgba(3, 10, 28, 0.42) 100%);
  z-index: 1;
}

.globe-status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  margin: 0;
  color: white;
  letter-spacing: 0.04em;
}

.map-ui {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.map-title,
.order-card,
.legend,
.views,
.zoom,
.sim-controls {
  pointer-events: auto;
}

.map-title {
  position: absolute;
  top: 16px;
  left: 18px;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.map-sub {
  position: absolute;
  top: 38px;
  left: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.views {
  position: absolute;
  top: 64px;
  left: 18px;
  display: flex;
  gap: 6px;
}

.views button,
.zoom button,
.sim-controls button {
  border: 1px solid var(--line);
  background: rgba(6, 16, 38, 0.72);
  color: white;
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.views button[aria-pressed="true"],
.views button:hover,
.zoom button:hover,
.sim-controls button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.order-card {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 268px;
  padding: 12px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  color: white;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  cursor: pointer;
  text-align: left;
}

.order-card.is-fresh {
  border-color: rgba(255, 225, 74, 0.75);
}

.order-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3340;
}

.order-card.is-fresh .kicker-dot {
  background: #ffe14a;
  animation: pulse 1.3s ease-out infinite;
}

.order-body {
  display: flex;
  gap: 12px;
  align-items: center;
}

.order-body img {
  width: 68px;
  height: 102px;
  object-fit: cover;
  border-radius: 3px;
  background: #111;
  flex: none;
}

.order-city {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.order-country,
.order-from,
.order-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.order-from {
  font-weight: 600;
}

.legend {
  position: absolute;
  left: 14px;
  bottom: 12px;
  max-width: min(760px, calc(100% - 78px));
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(5, 14, 32, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 12px;
}

.legend-keys,
.legend-hubs,
.sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.legend-keys span,
.legend-hubs span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.dot-red { background: #ff3340; }
.dot-yellow { background: #ffe14a; }

.dash {
  width: 22px;
  border-top: 2px dashed #ff5a5a;
  display: inline-block;
}

.hub-swatch {
  width: 14px;
  height: 3px;
  border-radius: 99px;
  display: inline-block;
}

#stats {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.zoom {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zoom button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
}

.region-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #17325f;
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.region-count {
  color: #e10600;
  font-weight: 800;
}

.tip {
  position: fixed;
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
  width: max-content;
  max-width: 240px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(6, 16, 38, 0.92);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.16);
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.tip[hidden] { display: none; }

.tip img {
  width: 42px;
  height: 63px;
  object-fit: cover;
  border-radius: 2px;
}

.tip p { margin: 0; }
.tip .tip-city { font-weight: 700; }
.tip .tip-meta { margin-top: 2px; font-size: 12px; color: rgba(255, 255, 255, 0.75); }

.notes {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 22px 48px;
}

.notes h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.notes p, .notes li { line-height: 1.5; }
.notes ul { padding-left: 18px; }

.routes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.routes li {
  background: white;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #e1e6ee;
}

.routes strong { display: block; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 225, 74, 0.7); }
  100% { box-shadow: 0 0 0 8px rgba(255, 225, 74, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .order-card.is-fresh .kicker-dot { animation: none; }
}

@media (max-width: 800px) {
  .map-sub { display: none; }
  .views { top: 40px; }
  .order-card {
    top: 78px;
    right: 56px;
    left: 10px;
    bottom: auto;
    width: auto;
    padding: 8px;
  }
  .order-body img { width: 46px; height: 69px; }
  .order-city { font-size: 18px; }
  .order-hint, .legend-hubs, .region-pill { display: none; }
  .legend {
    left: 8px;
    right: 52px;
    max-width: none;
    bottom: 8px;
    padding: 6px 8px;
  }
}
