* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #131314;
  color: #e5e2e3;
  min-height: 100vh;
}

/* Spectator live view — atmospheric animated backdrop (behind map + panel) */
body.watch-page {
  position: relative;
}

.watch-live-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.watch-live-bg__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 240, 255, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(103, 232, 249, 0.06), transparent 45%),
    radial-gradient(ellipse 50% 35% at 0% 100%, rgba(52, 211, 153, 0.05), transparent 50%);
}

.watch-live-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: watch-live-orb-float 18s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .watch-live-bg__orb {
    animation: none;
  }
}

.watch-live-bg__orb--a {
  width: min(520px, 90vw);
  height: min(520px, 90vw);
  top: -12%;
  right: -15%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.22) 0%, transparent 70%);
}

.watch-live-bg__orb--b {
  width: min(380px, 70vw);
  height: min(380px, 70vw);
  bottom: 5%;
  left: -10%;
  background: radial-gradient(circle, rgba(103, 232, 249, 0.12) 0%, transparent 70%);
  animation-delay: -6s;
}

@keyframes watch-live-orb-float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-12px, 16px) scale(1.03);
  }
}

.watch-live-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 35%, black 0%, transparent 72%);
  opacity: 0.65;
}

body.watch-page > .top,
body.watch-page > .layout {
  position: relative;
  z-index: 1;
}

body.watch-page .panel {
  background: linear-gradient(180deg, rgba(28, 27, 28, 0.78) 0%, rgba(19, 19, 20, 0.85) 100%);
  backdrop-filter: blur(14px);
}

body.watch-page .map-wrap {
  box-shadow: inset 0 0 80px rgba(0, 240, 255, 0.04);
}
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 14px 18px;
  background: rgba(19, 19, 20, 0.92);
  border-bottom: 1px solid #3b494b;
  backdrop-filter: blur(12px);
}
.brand {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.03em;
  color: #00f0ff;
  text-transform: uppercase;
  font-size: 1.15rem;
}
.session {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  color: #b9cacb;
}
.top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #67e8f9;
}
.watch-leave-btn {
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(103, 232, 249, 0.45);
  background: rgba(103, 232, 249, 0.1);
  color: #a5f3fc;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.watch-leave-btn:hover {
  background: rgba(103, 232, 249, 0.18);
  border-color: rgba(103, 232, 249, 0.65);
}
.watch-leave-btn:focus-visible {
  outline: 2px solid #67e8f9;
  outline-offset: 2px;
}
.layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 52px);
}
@media (min-width: 900px) {
  .layout {
    flex-direction: row;
  }
  .map-wrap {
    flex: 1.2;
  }
  .panel {
    flex: 0.9;
    max-width: 560px;
    border-left: 1px solid #3b494b;
  }
}
.map-wrap {
  min-height: 42vh;
  position: relative;
}
#map {
  position: absolute;
  inset: 0;
}
.panel {
  padding: 16px;
  overflow: auto;
  background: linear-gradient(180deg, #1c1b1c 0%, #131314 100%);
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}
.hint {
  font-weight: 400;
  font-size: 12px;
  color: #9aa0a6;
}
.table-scroll {
  overflow: auto;
  border-radius: 8px;
  border: 1px solid #3b494b;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #3b494b;
}
th {
  background: #161a21;
  color: #9aa0a6;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
}
tr:last-child td {
  border-bottom: none;
}
.foot {
  margin-top: 16px;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.45;
}

.hr-chart-section {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(22, 26, 33, 0.95) 0%, rgba(12, 14, 18, 0.98) 100%);
  border: 1px solid rgba(94, 234, 212, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.hr-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.chart-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e8eaed;
}
.chart-sub {
  font-size: 11px;
  color: #6b7280;
}
.hr-chart-canvas-wrap {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #3b494b;
}
#hr-chart {
  display: block;
  width: 100%;
  height: 200px;
  vertical-align: middle;
}
.hr-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 12px;
  font-size: 11px;
}
.hr-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9aa0a6;
}
.hr-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
@media (max-width: 899px) {
  .table-scroll {
    font-size: 11px;
  }
  th,
  td {
    padding: 8px 6px;
  }
}

/* Leaflet divIcon markers — hide default leaflet marker box */
.runwiv-avatar-marker {
  background: transparent !important;
  border: none !important;
}
.avatar-pin {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #00f0ff;
  background: #1a1d24;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.avatar-pin.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-pin .avatar-emoji {
  font-size: 22px;
  line-height: 1;
}
.avatar-pin .avatar-letter {
  font-size: 18px;
  font-weight: 800;
  color: #f5f5f5;
  font-family: system-ui, sans-serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.live-layout .map-wrap {
  min-height: 48vh;
}

.live-gauges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.gauge {
  background: #201f20;
  border: 1px solid #3b494b;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}

.gauge-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9aa0a6;
  margin-bottom: 6px;
}

.gauge-val {
  font-size: 20px;
  font-weight: 800;
  color: #22d3ee;
  font-variant-numeric: tabular-nums;
}

.live-interact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.live-interact input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #3b494b;
  background: #131314;
  color: #e5e2e3;
  font-size: 14px;
}

.live-interact .btn-cheer,
.live-interact .btn-hype {
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

.live-interact .btn-cheer {
  background: #0e7490;
  color: #ecfeff;
}

.live-interact .btn-hype {
  background: #22d3ee;
  color: #0b0d10;
}

.live-dot-wrap,
.ghost-dot-wrap {
  background: transparent !important;
  border: none !important;
}

.live-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 12px 4px rgba(34, 211, 238, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.ghost-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #9ca3af;
  opacity: 0.85;
  border: 2px dashed rgba(255, 255, 255, 0.5);
}

/* Club safety broadcast — spectator /watch (matches in-app banner) */
.watch-safety-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10050;
  padding: 12px 16px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  animation: watch-safety-pulse 0.6s ease-out 1;
}

@keyframes watch-safety-pulse {
  from {
    transform: translateY(-8px);
    opacity: 0.85;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .watch-safety-banner {
    animation: none;
  }
}

.watch-safety-banner--emergency {
  background: linear-gradient(180deg, #b91c1c 0%, #991b1b 100%);
  color: #fff;
}

.watch-safety-banner--hazard {
  background: linear-gradient(180deg, #c2410c 0%, #9a3412 100%);
  color: #fff;
}

.watch-safety-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.watch-safety-banner__eyebrow {
  display: block;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.95;
  margin-bottom: 6px;
}

.watch-safety-banner__msg {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
}
