:root {
  --bg: #080a0d;
  --panel: #10151c;
  --panel-2: #141b24;
  --line: #253140;
  --line-strong: #35465b;
  --text: #e8eef5;
  --muted: #93a3b5;
  --faint: #6e7f92;
  --accent: #4aa3ff;
  --accent-2: #6fd3ff;
  --gold: #f0b35b;
  --blue: #4aa3ff;
  --red: #ff6b6b;
  --radius: 12px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 78% -12%, rgba(74, 163, 255, 0.16), transparent 62%),
    radial-gradient(900px 620px at 12% 120%, rgba(255, 107, 107, 0.09), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

button,
select,
input {
  font: inherit;
}

.banner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  padding: 8px 20px;
  background: linear-gradient(90deg, rgba(240, 179, 91, 0.14), rgba(240, 179, 91, 0.03));
  border-bottom: 1px solid rgba(240, 179, 91, 0.28);
  color: #ffd99a;
  font-size: 12.5px;
}

.banner strong {
  letter-spacing: 0.11em;
  font-size: 11px;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  padding: 18px 24px 12px;
  max-width: 1560px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 13px;
}

.brand span span {
  color: var(--accent);
}

.brand-mark {
  display: inline-grid;
  grid-template-columns: repeat(3, 7px);
  gap: 3px;
  align-items: end;
}

.brand-mark span {
  display: block;
  width: 7px;
  border-radius: 2px;
  background: var(--accent);
}

.brand-mark span:nth-child(1) {
  height: 11px;
  opacity: 0.55;
}

.brand-mark span:nth-child(2) {
  height: 16px;
}

.brand-mark span:nth-child(3) {
  height: 20px;
  opacity: 0.8;
}

.match-title {
  flex: 1;
  min-width: 220px;
}

.match-title h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.chip.strong {
  border-color: rgba(74, 163, 255, 0.45);
  color: #bcdcff;
}

.clock-block {
  text-align: right;
  min-width: 110px;
}

.clock {
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.clock-sub {
  margin-top: 4px;
  color: var(--faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 14px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 4px 24px 24px;
}

.panel {
  background: linear-gradient(180deg, rgba(20, 27, 36, 0.92), rgba(16, 21, 28, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px;
  align-self: start;
}

.side section {
  min-width: 0;
}

h2 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.section-head h2 {
  margin: 0;
}

.facts {
  display: grid;
  gap: 2px;
  margin: 0;
}

.facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(37, 49, 64, 0.7);
}

.facts dt {
  color: var(--faint);
}

.facts dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.players {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.player:hover {
  border-color: var(--line-strong);
}

.player.focused {
  border-color: var(--accent);
  background: rgba(74, 163, 255, 0.1);
}

.player.dimmed {
  opacity: 0.42;
}

.player .swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.player .who {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.player .hero {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 13px;
}

.player .team {
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.player .state {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.player .state.dead {
  color: var(--red);
}

.player .state.fresh {
  color: #7ee0b8;
}

.player .state.path {
  color: #9ecbff;
}

.hint {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 11.5px;
}

.layers {
  display: grid;
  gap: 6px;
}

.layers label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  cursor: pointer;
}

.layers input {
  accent-color: var(--accent);
}

.coverage-box {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.coverage-box p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.link-button {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.map-panel {
  padding: 12px;
}

.map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 248 / 208;
  max-height: min(68vh, 760px);
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  background: #0a0e13;
  border: 1px solid var(--line);
}

.map-image,
.overlay,
.dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-image {
  object-fit: fill;
  image-rendering: auto;
}

.overlay {
  overflow: visible;
  pointer-events: none;
}

.dots {
  pointer-events: none;
}

.map-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(8, 10, 13, 0.78);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
  backdrop-filter: blur(4px);
}

.map-tag b {
  color: var(--text);
  font-size: 12.5px;
}

.dot {
  position: absolute;
  width: 27px;
  height: 27px;
  margin: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: #0a0e13;
  border: 2px solid var(--team-color);
  box-shadow:
    0 0 0 2px rgba(8, 10, 13, 0.92),
    0 0 14px var(--team-color);
  transition: opacity 0.2s ease;
  will-change: left, top;
}

.dot-portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dot-initial {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: var(--team-color);
  color: #081018;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.dot.fresh {
  animation: pulse 1.1s ease-out infinite;
}

.dot.hearth-channel {
  border-color: #ffd27a;
  box-shadow:
    0 0 0 2px rgba(8, 10, 13, 0.92),
    0 0 0 4px rgba(255, 210, 122, 0.75),
    0 0 22px #ffd27a;
  animation: hearth-channel 0.9s ease-in-out infinite;
}

.dot.stale {
  opacity: 0.45;
}

.dot.relocating {
  outline: 2px dashed var(--dot-color);
  outline-offset: 4px;
}

.dot.dead {
  opacity: 0.24;
  box-shadow: none;
  filter: grayscale(1);
}

.dot.hero-label {
  width: auto;
  height: auto;
  padding: 1px 5px;
  border: 0;
  border-radius: 4px;
  background: rgba(8, 10, 13, 0.7);
  box-shadow: none;
  color: var(--dot-color);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 17px));
  opacity: 0;
  transition: opacity 0.15s ease;
}

.dot.hero-label.visible {
  opacity: 0.9;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.controls button,
.controls select {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 7px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.controls button:hover,
.controls select:hover {
  border-color: var(--accent);
}

.controls button.primary {
  min-width: 86px;
  border-color: rgba(74, 163, 255, 0.6);
  background: linear-gradient(180deg, rgba(74, 163, 255, 0.35), rgba(74, 163, 255, 0.16));
  color: #eaf4ff;
  font-weight: 700;
}

.speed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 12px;
}

.speed select {
  padding: 6px 8px;
}

.spacer {
  flex: 1;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  color: var(--faint);
  font-size: 11.5px;
}

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

.mkey {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid #93a3b5;
}

.mkey.solid {
  background: #93a3b5;
}

.mkey.line {
  width: 14px;
  height: 2px;
  border: 0;
  border-radius: 1px;
  background: var(--accent);
  opacity: 0.55;
}

.mkey.objective {
  background: transparent;
  border: 1.5px solid #f0b35b;
}

.mkey.death {
  border: 0;
  border-radius: 1px;
  background: var(--red);
  transform: rotate(45deg);
}

.mkey.camp {
  border: 0;
  border-radius: 1px;
  background: #7ee0b8;
  transform: rotate(45deg);
}

.mkey.structure {
  border: 0;
  border-radius: 1px;
  background: linear-gradient(90deg, #4aa3ff 50%, #ff6b6b 50%);
}

.timeline {
  position: relative;
  height: 34px;
  margin-top: 12px;
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.55);
  border: 1px solid var(--line);
  cursor: pointer;
  overflow: hidden;
}

.timeline-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(74, 163, 255, 0.35), rgba(74, 163, 255, 0.08));
}

.timeline-marks {
  position: absolute;
  inset: 0;
}

.tl-mark {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.tl-mark.death {
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 6px rgba(255, 107, 107, 0.55);
}

.tl-mark.camp {
  width: 5px;
  height: 5px;
  background: #7ee0b8;
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.tl-mark.relocation {
  width: 6px;
  height: 6px;
  border: 1px solid #eaf4ff;
  border-radius: 50%;
  background: transparent;
  opacity: 0.85;
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #eaf4ff;
  box-shadow: 0 0 12px rgba(234, 244, 255, 0.7);
  transform: translateX(-1px);
  pointer-events: none;
}

.playhead span {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #eaf4ff;
}

.scrub {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--accent);
}

.timeline-panel {
  padding: 14px 16px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--faint);
  font-size: 11.5px;
}

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

.key {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.key.death {
  background: var(--red);
  transform: rotate(45deg);
}

.key.camp {
  background: #7ee0b8;
  transform: rotate(45deg);
}

.event-log {
  display: grid;
  gap: 4px;
  max-height: 200px;
  overflow: auto;
  font-size: 12px;
}

.event-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(37, 49, 64, 0.55);
}

.event-row.past {
  opacity: 0.5;
}

.event-row.recent {
  background: rgba(74, 163, 255, 0.08);
}

.event-row .t {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.event-row .what {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-row .where {
  color: var(--faint);
  font-size: 11px;
}

.event-empty {
  color: var(--faint);
  font-size: 12px;
}

.footer {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 24px 32px;
  color: var(--faint);
  font-size: 11.5px;
}

.footer p {
  margin: 0 0 6px;
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer .fine {
  max-width: 900px;
  line-height: 1.6;
}

@keyframes hearth-channel {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(8, 10, 13, 0.92),
      0 0 0 4px rgba(255, 210, 122, 0.55),
      0 0 16px #ffd27a;
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(8, 10, 13, 0.92),
      0 0 0 7px rgba(255, 210, 122, 0.15),
      0 0 28px #ffd27a;
  }
}

@keyframes pulse {
  0% {
    box-shadow:
      0 0 0 2px rgba(8, 10, 13, 0.92),
      0 0 12px var(--team-color);
  }
  70% {
    box-shadow:
      0 0 0 5px rgba(74, 163, 255, 0),
      0 0 20px var(--team-color);
  }
  100% {
    box-shadow:
      0 0 0 2px rgba(8, 10, 13, 0.92),
      0 0 12px var(--team-color);
  }
}

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

  .side {
    order: 2;
  }

  .stage {
    order: 1;
  }

  .map-wrap {
    max-height: 62vh;
  }
}

@media (max-width: 620px) {
  .top,
  .layout,
  .footer {
    padding-left: 12px;
    padding-right: 12px;
  }

  .clock {
    font-size: 24px;
  }

  .match-title h1 {
    font-size: 20px;
  }
}


/* Win-probability estimate panel */
.win-prob-panel {
  padding: 14px 16px;
}

.win-prob-panel .section-head {
  align-items: center;
}

.wp-estimate {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(201, 250, 72, 0.35);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.wp-meta {
  margin: 2px 0 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.wp-note {
  margin: 6px 0;
  color: var(--muted);
  font-size: 12px;
}

#win-prob-chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.45);
}

.wp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
}

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

.wp-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 1px;
}

.wp-legend i[style*="border-radius: 50%"] {
  border-radius: 50%;
}

.wp-readout {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 13px;
  min-height: 18px;
}
