:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel-2: #1c232d;
  --border: #2a3240;
  --text: #e6edf3;
  --muted: #8b96a5;
  --radiant: #5fd35f;
  --dire: #e0555c;
  --accent: #4f9dff;
  --warn: #e0a53c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
}

.site-header {
  padding: 28px 20px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.site-header .accent { color: var(--accent); }

.subtitle {
  color: var(--muted);
  margin-top: 6px;
  font-size: 14px;
}

.updated-line {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.site-nav {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.site-nav a {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 26px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.site-nav a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.site-nav a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0e1116;
}

.matches-root {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  font-size: 15px;
}

.match-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  overflow: hidden;
}

.match-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.match-card__meta .match-id {
  color: var(--muted);
  opacity: 0.7;
}

.copy-id-btn {
  font-family: inherit;
  font-size: 11px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 7px;
  cursor: pointer;
  line-height: 1.6;
}

.copy-id-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-id-btn.copied {
  border-color: var(--radiant);
  color: var(--radiant);
}

.series-games-row {
  display: flex;
  gap: 8px;
}

.series-game-btn {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

a.series-game-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.series-game-btn.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #0e1116;
}

.series-game-btn.pending {
  color: var(--muted);
  font-weight: 500;
  opacity: 0.6;
}

.match-card__meta .tier {
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--warn);
}

.teams-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.team-name {
  font-size: 17px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-name.radiant { color: var(--radiant); text-align: left; }
.team-name.dire { color: var(--dire); text-align: right; }

.score {
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
  padding: 0 6px;
}

.duration {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: -6px;
  margin-bottom: 12px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.bar-row .bar-label {
  flex: 0 0 auto;
  width: 78px;
}

.bar-row .bar-label.right {
  text-align: right;
}

.bar-track {
  flex: 1;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.bar-fill { transition: width 0.6s ease; }
.bar-fill.radiant { background: var(--radiant); }
.bar-fill.dire { background: var(--dire); }

.structures-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 14px;
  flex-wrap: wrap;
  gap: 6px;
}

.structures-row .side { display: flex; gap: 10px; }

.draft-board {
  margin: 14px 0;
  font-size: 13px;
}

.draft-board-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin-bottom: 4px;
}

.draft-pick-row {
  display: grid;
  grid-template-columns: 1fr auto auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.draft-pick-row:last-child { border-bottom: none; }

.draft-name { color: var(--text); }
.draft-name.radiant { text-align: left; }
.draft-name.dire { text-align: right; }
.draft-name .pos { color: var(--muted); font-size: 11px; margin: 0 4px; }
.draft-name.banned { color: var(--muted); }
.draft-name.banned .pos { color: var(--dire); }
.ban-tag {
  color: var(--dire);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.draft-icon {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--panel-2);
}
.draft-icon--empty { display: inline-block; border: 1px solid var(--border); }
.draft-icon--banned {
  filter: grayscale(1) brightness(0.6);
  border: 1px solid var(--dire);
}

.hero-cell { white-space: nowrap; }
.hero-icon {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 6px;
  background: var(--panel-2);
}

.players-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 10px;
}

.players-table th, .players-table td {
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.players-table th { color: var(--muted); font-weight: 500; }
.players-table tr.side-radiant + tr.side-dire td { padding-top: 16px; }
.players-table .side-radiant td:first-child { border-left: 3px solid var(--radiant); }
.players-table .side-dire td:first-child { border-left: 3px solid var(--dire); }
.players-table .items {
  color: var(--muted);
  font-size: 11px;
  white-space: normal;
  max-width: none;
  overflow: visible;
  line-height: 48px;
}
.players-table .dead { opacity: 0.55; }
.item-icon {
  width: 45px;
  height: 33px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 3px;
  vertical-align: middle;
  background: var(--panel-2);
}
.item-icon--neutral {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  margin-left: 8px;
  border: 1px solid var(--warn);
}
.item-icon--empty {
  display: inline-block;
  border: 1px solid var(--border);
}

.status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.status-badge.drafting { color: var(--warn); border-color: var(--warn); }

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

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  padding: 20px;
}

.finished-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.finished-card:hover {
  border-color: var(--accent);
}

.team-name.winner {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.finished-winner-line {
  text-align: center;
  color: var(--warn);
  font-size: 13px;
  margin-top: 2px;
}

.finished-prediction-line {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 4px;
}

.pred-correct { color: var(--radiant); margin-left: 6px; }
.pred-incorrect { color: var(--dire); margin-left: 6px; }

.section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin: 16px 0 6px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

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

.predictor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 6px;
}

.predictor-table th, .predictor-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.predictor-table th { color: var(--muted); font-weight: 500; }

.chart-wrap {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 10px 4px;
  cursor: crosshair;
}

.chart-inner {
  position: relative;
}

.nw-chart {
  width: 100%;
  height: 160px;
  display: block;
}

.chart-zero-line {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}

.chart-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fight-marker {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--muted);
  border: 1.5px solid var(--panel-2);
}

.fight-marker.radiant { background: var(--radiant); }
.fight-marker.dire { background: var(--dire); }

.scrubber-line {
  stroke: var(--warn);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}

.chart-axis-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  padding: 2px 2px 6px;
}

.tp-slider {
  width: 100%;
  margin: 10px 0 4px;
  accent-color: var(--accent);
}

.tp-readout {
  font-size: 13px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 4px;
}

.tp-readout-fight {
  color: var(--muted);
  font-size: 12px;
}
