/* ============================================================
   Visitors view — stat cards, dot map, rank lists
   (the Visitors link itself lives in .site-nav, styled by style.css)
   ============================================================ */

.visitors-section {
  padding-block: 28px 64px;
  /* keep the heading clear of the sticky site header when scrolled to */
  scroll-margin-top: 88px;
}

#view-schedule {
  scroll-margin-top: 88px;
}

/* ---------------- stat cards ---------------- */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
}

.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.stat-hint {
  font-size: 12px;
  color: var(--muted-2);
}

/* ---------------- map ---------------- */

.visitors-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.visitors-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.map-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(255, 59, 48, 0.07), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01));
  padding: 16px 16px 12px;
}

.map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted-2);
}

.map-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.map-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--f1);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.2);
}

.map-updated {
  font-variant-numeric: tabular-nums;
}

.map-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: radial-gradient(120% 140% at 50% 20%, rgba(20, 26, 40, 0.9), rgba(7, 8, 11, 0.95));
}

.visitor-map {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
}

.map-graticule line {
  stroke: rgba(255, 255, 255, 0.055);
  stroke-width: 0.25;
}

.map-land {
  fill: rgba(160, 178, 210, 0.32);
}

.map-pin-group {
  cursor: default;
}

.map-pin {
  fill: var(--f1);
  fill-opacity: 0.9;
}

.map-pin-halo {
  fill: var(--f1);
  fill-opacity: 0.14;
}

.map-pin-group.is-hot .map-pin {
  fill: var(--mgp);
}

.map-pin-group.is-hot .map-pin-halo {
  fill: var(--mgp);
  fill-opacity: 0.18;
}

.map-pin-group:hover .map-pin,
.map-pin-group:focus-visible .map-pin {
  fill: #ffffff;
}

.map-pin-group:hover .map-pin-halo {
  fill-opacity: 0.3;
}

.map-tooltip {
  position: absolute;
  transform: translate(-50%, -140%);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(9, 11, 16, 0.96);
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.map-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted-2);
}

/* ---------------- rank lists ---------------- */

.visitors-aside {
  display: grid;
  gap: 16px;
}

.visitors-aside h3 {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.rank-item {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  font-size: 13.5px;
}

.rank-item::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
}

.rank-bar {
  position: absolute;
  inset: auto auto 0 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--f1), var(--mgp));
}

.rank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-count {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12.5px;
}

.rank-empty {
  font-size: 12.5px;
  color: var(--muted-2);
  list-style: none;
}

@media (max-width: 980px) {
  .visitors-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-value {
    font-size: 26px;
  }
}

@media (max-width: 620px) {
  .map-tooltip {
    display: none;
  }

  .stat-card {
    padding: 12px 12px;
  }

  .stat-value {
    font-size: 24px;
  }
}
