/* Spiel-Ansicht (#/spiel/…): Kopf, Spiel-Reiter mit Statuszeile, Stream-Leiste, Anzeigetafel, Gold-Graph,
   Ereignis-Zeitleiste, Spieler, Hinweis-Karten. Werte nach docs/DESIGN.md 4.2 („Broadcast-Terminal“).
   Farben nur über Variablen aus app.css (auch die Drachenfarben --drake-*). */

.match-page { gap: var(--s-4); }

/* ---------- Kopf (.page-hero) ---------- */

.match-head { padding: var(--s-5) var(--s-6) var(--s-6); }

.match-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  min-width: 0;
}
.match-head-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-2);
  min-width: 0;
  color: var(--text-2);
}
.match-dot { color: var(--muted); }
.match-league { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--text-2); }
a.match-league:hover { color: var(--text); text-decoration: none; }
.match-league-img { width: 18px; height: 18px; }
.match-head-status { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--text-2); font-size: var(--fs-small); font-weight: 600; }
.match-head-done { font-weight: 500; }
.match-head-time { color: var(--text); font-size: 16px; font-weight: 700; }

.match-head-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s-6);
  margin-top: var(--s-5);
}
.match-team { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.match-team.is-right { flex-direction: row-reverse; }
.match-team-link { display: flex; align-items: center; gap: var(--s-4); min-width: 0; color: var(--text); }
a.match-team-link:hover { text-decoration: none; }
.match-team-name { transition: color var(--dur-1); }
a.match-team-link:hover .match-team-name { color: var(--accent); }
.match-team.is-right .match-team-link { flex-direction: row-reverse; text-align: right; }
.match-team-logo { display: inline-flex; flex: none; transition: opacity var(--dur-2); }
.match-team-name {
  min-width: 0;
  overflow: hidden;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-team-short { display: none; }
/* Verlierer: Name zurückgenommen, Logo .55 (nicht der ganze Block) */
.match-team.is-loser .match-team-name { color: var(--text-2); }
.match-team.is-loser .match-team-logo { opacity: .55; }
.match-fav.btn-icon { width: 32px; height: 32px; flex: none; color: var(--muted); }
.match-fav.is-on { color: var(--accent); }

.match-score { display: flex; flex-direction: column; align-items: center; gap: var(--s-1); min-width: 120px; }
.match-score-nums { display: flex; align-items: center; gap: var(--s-3); color: var(--text-2); }
.match-score-nums .is-win { color: var(--accent); }
.match-score-sep { color: var(--muted); font-weight: 500; transform: translateY(-.06em); }
.match-score-label { color: var(--muted); }
.match-score.is-hidden .match-score-nums { color: var(--muted); }
.match-score-vs {
  display: inline-grid;
  place-items: center;
  height: 32px;
  padding: 0 var(--s-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: var(--fs-small);
  font-weight: 700;
}

/* ---------- Statuszeile: Spiel-Reiter (Segment) | Status, Patch, Verzögerung ---------- */

.match-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  min-width: 0;
}
.match-tabs { min-width: 0; max-width: 100%; }
.match-bar-slot { min-width: 0; margin-left: auto; }
.match-tabs[hidden] + .match-bar-slot { margin-left: 0; }
.match-bar-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3); min-width: 0; }
.match-bar-status { display: inline-flex; align-items: center; gap: var(--s-2); }
.match-bar-status:empty { display: none; }
.match-bar-clock { color: var(--text); font-size: 14px; font-weight: 700; }
.match-bar-patch { color: var(--muted); }
.match-bar-patch:empty { display: none; }

.match-tab { display: inline-flex; align-items: center; gap: 6px; }
.match-tab.is-unstarted { color: var(--muted); }
.tab.active .match-tab.is-unstarted { color: var(--text); }
.match-tab.is-unneeded { color: var(--muted); }
.match-tab.is-unneeded .match-tab-text { text-decoration: line-through; text-decoration-color: currentColor; }
.match-tab-done { display: inline-flex; color: var(--muted); }
.tab.active .match-tab-done { color: var(--text-2); }

/* Verzögerung: Knopf + Popover (Ebene 2) */
.match-delay { position: relative; }
.match-delay-btn { color: var(--text-2); }
.match-delay-btn .num { color: var(--muted); font-weight: 700; }
.match-delay-btn.is-on .num { color: var(--text); }
.match-delay-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.match-delay-pop {
  position: absolute;
  top: calc(100% + var(--s-2));
  right: 0;
  z-index: 40;
  width: min(280px, calc(100vw - 32px));
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  box-shadow: var(--shadow-2);
  animation: fade-up var(--dur-2) var(--ease);
}
:root[data-theme="light"] .match-delay-pop { background: var(--surface); }
.match-delay-title { color: var(--text); font-size: 14px; font-weight: 700; }
.match-delay-hint { margin-top: 2px; color: var(--text-2); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.match-delay-ctrl {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-3) 0;
}
.match-delay-ctrl .btn { font-size: 18px; font-weight: 500; }
.match-delay-val { color: var(--text); font-size: 28px; text-align: center; }
.match-delay-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.match-delay-preset { justify-content: center; height: 28px; padding: 0 4px; font-size: var(--fs-caption); }

/* ---------- Spielbereich ---------- */

.match-game, .match-game-body { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.match-banner:empty, .match-game-body > :empty:not(.match-stream-frame) { display: none; }

/* ---------- Stream / VOD: Leiste 48 px, Rahmen darunter ---------- */

.match-stream { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.match-stream-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-3);
  min-width: 0;
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.match-stream-title { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.match-stream-title strong { flex: none; color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; }
.match-stream-label { min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--fs-caption); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.match-stream-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.match-stream-actions { display: flex; align-items: center; gap: var(--s-1); min-width: 0; }
.match-stream-select { height: 30px; font-size: 13px; }
.match-stream-frame {
  width: 100%;
  max-height: 72vh;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
}
.match-stream-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ---------- Raster ---------- */

.match-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "sb" "chart" "events" "players";
  gap: var(--s-4);
  min-width: 0;
}
.match-sb, .match-skel-sb { grid-area: sb; }
.match-chart-card, .match-skel-chart { grid-area: chart; }
.match-events { grid-area: events; }
.match-players { grid-area: players; }
.match-skel-sb, .match-skel-chart { border-radius: var(--r-md); }
.match-skel-sb { height: 440px; }
.match-skel-chart { height: 300px; }

@media (min-width: 760px) {
  .match-grid {
    grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
    grid-template-areas: "sb chart" "players players" "events events";
  }
  .match-skel-chart { height: 440px; }
}
@media (min-width: 760px) and (max-width: 1179.98px) {
  /* höhere Spezifität: die Grundregel für .match-ev-list (display: flex) steht weiter unten */
  .match-events .match-ev-list { display: block; columns: 2; column-gap: var(--s-8); }
  .match-events .match-ev { break-inside: avoid; }
}
@media (min-width: 1180px) {
  .match-grid {
    grid-template-columns: 360px minmax(0, 1fr);
    grid-template-areas: "sb chart" "events players";
  }
  /* Ereignis-Karte endet mit ihrem Inhalt, statt sich auf die Höhe der Spielertabelle zu strecken */
  .match-events { align-self: start; }
}

/* ---------- Anzeigetafel ---------- */

.match-sb { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-5); }
.match-sb.is-finished .match-sb-clock { color: var(--text-2); }

.match-sb-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: var(--s-2); }
.match-sb-side-col { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); min-width: 0; }
.match-sb-side-col.is-right { align-items: flex-end; }
.match-sb-team { display: flex; flex-direction: column; align-items: inherit; gap: 6px; min-width: 0; }
.match-sb-code { max-width: 100%; overflow: hidden; color: var(--text); font-size: 17px; font-weight: 800; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.match-sb-side { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.match-side-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.match-side-dot.is-red { background: var(--red); }
.match-sb-center { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 6px; }
.match-sb-clock { color: var(--text); }
.match-sb-clock-label { color: var(--muted); }

.match-sb-kills {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
/* Kill-Zahl + „Sieg“-Abzeichen (rechts gespiegelt); das Abzeichen sitzt auf der Grundlinie der Zahl */
.match-sb-kills-side { display: inline-flex; align-items: center; gap: var(--s-2); justify-self: start; min-width: 0; }
.match-sb-kills-side.is-right { justify-self: end; }
.match-sb-kills-side .match-sb-winner { flex: none; }
.match-sb-kills-num {
  padding: 0 4px;
  margin: 0 -4px;
  color: var(--text-2);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1;
}
.match-sb-kills-num.is-lead { color: var(--text); }
.match-sb-kills-icon { display: inline-flex; color: var(--muted); cursor: help; }

.match-sb-stats { display: flex; flex-direction: column; margin-top: calc(var(--s-1) * -1); }
.match-sb-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: var(--s-1) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.match-sb-row:last-child { border-bottom: 0; }
.match-sb-row > :first-child { justify-self: start; }
.match-sb-row > :last-child { justify-self: end; text-align: right; }
.match-sb-val { padding: 1px 4px; margin: 0 -4px; color: var(--text-2); font-size: 16px; font-weight: 600; }
.match-sb-val.is-lead { color: var(--text); font-weight: 700; }
.match-sb-label { display: inline-flex; align-items: center; justify-self: center; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.match-sb-label .icon { color: var(--muted); }
.match-sb-drakes { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.match-sb-drakes.is-red { justify-content: flex-end; }
.match-sb-none { color: var(--muted); }

.match-drake {
  --drake: var(--muted);
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--drake) 18%, transparent);
  color: var(--drake);
}
.match-drake.is-ocean { --drake: var(--drake-ocean); }
.match-drake.is-cloud { --drake: var(--drake-cloud); }
.match-drake.is-infernal { --drake: var(--drake-infernal); }
.match-drake.is-mountain { --drake: var(--drake-mountain); }
.match-drake.is-hextech { --drake: var(--drake-hextech); }
.match-drake.is-chemtech { --drake: var(--drake-chemtech); }
.match-drake.is-elder { --drake: var(--drake-elder); box-shadow: inset 0 0 0 1px var(--drake); }

/* Gold-Differenz als Seiten-Pille (Text --text, Seitenfarbe über Fläche und Punkt) */
.match-sb-diff { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-1) var(--s-3); }
.match-sb-diff-label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.match-sb-diff-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.match-sb-diff-pill strong { color: var(--text); font-weight: 700; }
.match-sb-diff-pill.is-blue { background: var(--blue-soft); }
.match-sb-diff-pill.is-red { background: var(--red-soft); }

.match-sb.is-finished .match-wc { display: none; }
.match-wc { display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--border); }
.match-wc-labels { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px var(--s-2); color: var(--text-2); font-size: 13px; font-weight: 600; }
.match-wc-labels > span:not(.match-wc-title) { white-space: nowrap; }
.match-wc-labels strong { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.match-wc-title { order: -1; width: 100%; color: var(--text-2); font-size: var(--fs-caption); font-weight: 500; cursor: help; }
.match-wc-bar { display: flex; gap: 2px; height: 8px; overflow: hidden; border-radius: var(--r-pill); background: var(--surface-2); }
.match-wc-fill { display: block; height: 100%; min-width: 2px; transition: width var(--dur-3) var(--ease); }
.match-wc-fill.is-blue { background: var(--blue); border-radius: var(--r-pill) 0 0 var(--r-pill); }
.match-wc-fill.is-red { background: var(--red); border-radius: 0 var(--r-pill) var(--r-pill) 0; }

/* ---------- Gold-Graph (chart.js) ---------- */

.match-chart-card { display: flex; flex-direction: column; min-width: 0; }
.match-chart-card .card-head { flex-wrap: wrap; }
.match-chart-now { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.match-chart-now strong { color: var(--text); font-size: 15px; font-weight: 700; }
.match-chart-loading { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption); }
.match-chart-loading[hidden] { display: none; }
.match-mini-spin {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.match-chart-box { position: relative; flex: 1 1 auto; min-width: 0; min-height: 240px; }
@media (min-width: 760px) { .match-chart-box { min-height: 260px; } }
.match-chart.is-fill { position: absolute; inset: 0; }

.match-chart { position: relative; min-width: 0; }
.match-chart-svg {
  display: block;
  width: 100%;
  overflow: visible;
  border-radius: var(--r-xs);
  cursor: crosshair;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}
.match-chart-svg:focus { outline: none; }
.match-chart-svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.match-chart-grid line { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.match-chart-grid line.is-v { opacity: .6; }
.match-chart-zero { stroke: var(--text-2); stroke-width: 1; opacity: .55; shape-rendering: crispEdges; }
.match-chart-axis text { fill: var(--muted); font-family: var(--font); font-size: 11px; font-variant-numeric: tabular-nums; }
.match-chart-axis text.is-zero { fill: var(--text-2); }
.match-chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.match-chart-line-blue { stroke: var(--blue); }
.match-chart-line-red { stroke: var(--red); }
.match-chart-stop-blue { stop-color: var(--blue); }
.match-chart-stop-red { stop-color: var(--red); }
.match-chart-dot { stroke: var(--surface); stroke-width: 2; }
.match-chart-dot.is-blue { fill: var(--blue); }
.match-chart-dot.is-red { fill: var(--red); }
.match-chart-cross { stroke: var(--text-2); stroke-width: 1; opacity: .5; shape-rendering: crispEdges; }
.match-chart-hit { fill: transparent; }
.match-chart-marker { color: var(--blue); }
.match-chart-marker.is-red { color: var(--red); }
.match-chart-marker-bg { fill: var(--surface-2); stroke: var(--border); stroke-width: 1; }
.match-chart-marker.is-elder .match-chart-marker-bg { stroke: var(--drake-elder); }

.match-chart-tip {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  min-width: 156px;
  max-width: 240px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  box-shadow: var(--shadow-2);
  font-size: 13px;
  pointer-events: none;
}
:root[data-theme="light"] .match-chart-tip { background: var(--surface); }
.match-chart-tip-time { color: var(--muted); font-size: var(--fs-caption); font-weight: 600; }
.match-chart-tip-row { display: flex; align-items: center; gap: var(--s-2); color: var(--text-2); }
.match-chart-tip-row strong { color: var(--text); font-size: 14px; font-weight: 700; }
.match-chart-tip-label { color: var(--text-2); }
.match-chart-key { flex: none; width: 12px; height: 2px; border-radius: 2px; background: var(--muted); }
.match-chart-key.is-blue { background: var(--blue); }
.match-chart-key.is-red { background: var(--red); }
.match-chart-key.is-kills { background: var(--text-2); }
.match-chart-tip-events { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 0; padding: var(--s-1) 0 0; border-top: 1px solid var(--border); list-style: none; }
.match-chart-tip-events li { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.match-chart-tip-events li.is-blue .icon { color: var(--blue); }
.match-chart-tip-events li.is-red .icon { color: var(--red); }
.match-chart-empty {
  position: absolute;
  inset: 0 0 40px 60px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

.match-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s-4); margin-top: auto; padding-top: var(--s-3); color: var(--text-2); font-size: var(--fs-small); }
.match-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.match-legend-swatch { width: 14px; height: 10px; border-top: 2px solid var(--blue); border-radius: 2px; background: var(--blue-soft); }
.match-legend-swatch.is-red { border-top-color: var(--red); background: var(--red-soft); }
.match-legend-marks { margin-left: auto; }
.match-legend-icons { display: inline-flex; gap: 2px; color: var(--muted); }

/* ---------- Ereignisse: Zeitleiste ---------- */

.match-events { display: flex; flex-direction: column; min-width: 0; }
.match-ev-chip { height: 28px; padding: 0 10px; font-size: var(--fs-caption); }
.match-ev-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.match-ev {
  display: grid;
  grid-template-columns: 34px 12px 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 var(--s-3);
  min-height: 40px;
}
.match-ev-min { color: var(--muted); font-size: 13px; font-weight: 600; text-align: right; }
/* Punkt in Seitenfarbe auf einer senkrechten Hairline */
.match-ev-rail { position: relative; align-self: stretch; }
.match-ev-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  margin-left: -.5px;
  background: var(--border-strong);
}
.match-ev-rail::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px var(--surface);
}
.match-ev.is-red .match-ev-rail::after { background: var(--red); }
.match-ev-list > .match-ev:first-child .match-ev-rail::before { top: 50%; }
.match-ev-list > .match-ev:last-child .match-ev-rail::before { bottom: 50%; }
.match-ev-list > .match-ev:only-child .match-ev-rail::before { display: none; }
.match-ev-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
}
.match-ev.is-red .match-ev-icon { background: var(--red-soft); color: var(--red); }
.match-ev.is-dragon .match-ev-icon { background: none; }
.match-ev.is-dragon .match-drake { width: 26px; height: 26px; }
.match-ev-text { min-width: 0; overflow: hidden; color: var(--text); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.match-ev.is-kill .match-ev-text { color: var(--text-2); font-weight: 500; }
.match-ev.is-baron .match-ev-text, .match-ev.is-inhibitor .match-ev-text { font-weight: 700; }
.match-ev-team { color: var(--text-2); font-size: 13px; font-weight: 600; }
.match-ev-empty { padding: var(--s-3) 0; color: var(--muted); font-size: 14px; }
.match-ev-more { align-self: center; margin-top: var(--s-2); }
/* Verlauf kam nicht rechtzeitig: kompakter Leerzustand statt endloser Skeleton-Zeilen */
.match-ev-failed { margin-top: var(--s-1); }

/* Laden: Platzhalter in Form der Zeitleiste */
.match-ev-skel { display: flex; flex-direction: column; }
.match-ev-skel-row .match-ev-rail::after { background: var(--surface-3); }
.match-ev-skel-row:first-of-type .match-ev-rail::before { top: 50%; }
.match-ev-skel-row:last-child .match-ev-rail::before { bottom: 50%; }
.match-ev-skel-min { justify-self: end; width: 22px; height: 12px; }
.match-ev-skel-icon { width: 26px; height: 26px; border-radius: 7px; }
.match-ev-skel-text { height: 12px; }
.match-ev-skel-team { width: 32px; height: 12px; }

/* ---------- Spieler (.card--flush) ---------- */

.match-pt-legend { display: inline-flex; align-items: center; gap: var(--s-3); color: var(--text-2); font-size: 13px; font-weight: 600; }
.match-pt-legend > span { display: inline-flex; align-items: center; gap: 6px; }
/* nur die Farbe: die Scroll-Hinweise (util.scrollShadows) liegen als background-image auf .table-wrap */
.match-players .match-pt-wrap { border-top: 1px solid var(--border); background-color: transparent; }
.match-pt { min-width: 740px; }
.match-pt th, .match-pt td { padding: 6px 8px; vertical-align: middle; }
.match-pt thead th { padding-top: 0; padding-bottom: 0; }
.match-pt thead th:first-child, .match-pt tbody th { padding-left: var(--s-4); }
.match-pt thead th:last-child, .match-pt tbody td:last-child { padding-right: var(--s-4); }

/* Zeilenkopf (Spieler) nicht wie Spaltenkopf aussehen lassen */
.match-pt tbody th {
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  transition: background-color var(--dur-1);
}
.match-pt-who { position: sticky; left: 0; z-index: 1; min-width: 180px; }
.match-pt thead .match-pt-who { z-index: 2; }
.match-pt tbody tr:hover th { background: var(--surface-2); }
.match-pt-row.is-blue .match-pt-who { box-shadow: inset 3px 0 0 var(--blue); }
.match-pt-row.is-red .match-pt-who { box-shadow: inset 3px 0 0 var(--red); }
/* Paare je Rolle: zwischen Blau und Rot keine Linie */
.match-pt-row.is-blue th, .match-pt-row.is-blue td { border-bottom-color: transparent; }
.match-pt-row.is-pair-start th, .match-pt-row.is-pair-start td { padding-top: 10px; }
.match-pt-row.is-red th, .match-pt-row.is-red td { padding-bottom: 10px; }

.match-pt-player { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.match-pt-champ-wrap { position: relative; flex: none; width: 36px; height: 36px; }
.match-pt-champ { display: block; width: 36px; height: 36px; border-radius: 8px; background: var(--surface-3); transition: filter var(--dur-3), opacity var(--dur-3); }
.match-pt-lvl {
  position: absolute;
  right: -6px;
  bottom: -5px;
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 17px;
  padding: 0 3px;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.match-pt-rune {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 20px;
  height: 20px;
  padding: 1px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
}
/* Runen-Symbole sind hell → auch im hellen Design auf dunklem Grund */
:root[data-theme="light"] .match-pt-rune { border-color: var(--logo-bg); background: var(--logo-bg); }
.match-pt-names { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.3; }
.match-pt-pname { overflow: hidden; color: var(--text); font-size: 14px; font-weight: 700; text-overflow: ellipsis; }
.match-pt-sub { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: var(--fs-caption); font-weight: 500; }
.match-pt-role { color: var(--text-2); font-size: var(--fs-caption); font-weight: 700; }
.match-pt-hp { display: block; width: 110px; height: 4px; margin-top: 3px; overflow: hidden; border-radius: 2px; background: var(--surface-3); }
.match-pt-hp-fill { display: block; height: 100%; border-radius: 2px; background: var(--win); transition: width var(--dur-3) var(--ease); }
.match-pt-hp.is-low .match-pt-hp-fill { background: var(--loss); }
.match-pt-row.is-dead .match-pt-champ { opacity: .45; filter: grayscale(1); }
.match-pt-row.is-dead .match-pt-pname { color: var(--muted); }

.match-pt-kda { font-weight: 600; white-space: nowrap; }
.match-pt-slash { margin: 0 3px; color: var(--muted); font-weight: 400; }
.match-pt-items { min-width: 180px; }
.match-pt-itemlist { display: flex; gap: 2px; }
.match-pt-item { flex: none; width: 22px; height: 22px; border-radius: 5px; background: var(--surface-3); }

/* ---------- Hinweis-Karten (emptyState in Kartenform: noch nicht gestartet, abgeschaltet, Spoiler) ---------- */

.match-info.state-empty { padding: var(--s-8) var(--s-5); border: 1px solid var(--border); border-radius: var(--r-md); }
.match-info .state-icon { width: 48px; height: 48px; background: var(--accent-soft); color: var(--accent); }
.match-info .state-icon .icon { width: 24px; height: 24px; }
.match-info .state-text { max-width: 52ch; }
.match-info-countdown { margin: 2px 0; color: var(--text); font-size: 28px; }
.match-info-sides { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 2px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.match-info-sides > span { display: inline-flex; align-items: center; gap: var(--s-2); }
.match-info .spinner { margin: var(--s-2) auto 0; width: 22px; height: 22px; }

/* ---------- Handy ---------- */

@media (max-width: 759.98px) {
  .match-page { gap: var(--s-3); }

  .match-head { padding: var(--s-4) var(--s-4) var(--s-5); }
  .match-head-teams { gap: var(--s-2); margin-top: var(--s-4); }
  .match-team, .match-team.is-right { flex-direction: column; align-items: center; gap: 2px; text-align: center; }
  .match-team-link, .match-team.is-right .match-team-link { flex-direction: column; gap: var(--s-2); text-align: center; }
  .match-team-logo .tlogo { width: 56px !important; height: 56px !important; }
  .match-team-long { display: none; }
  .match-team-short { display: inline; }
  .match-team-name { max-width: 100%; font-size: 18px; }
  .match-score { min-width: 0; }
  .match-score-nums { gap: var(--s-2); }
  .match-score .spoiler-reveal-label { display: none; }

  /* Spiel-Reiter volle Breite, Status darunter als rechtsbündige caption-Zeile (Abstand 12 zum Segment) */
  .match-bar { flex-direction: column; align-items: stretch; gap: var(--s-3); }
  .match-bar-slot { margin-left: 0; }
  .match-bar-meta { justify-content: flex-end; column-gap: var(--s-2); }
  .match-bar-status .badge-done {
    height: auto;
    padding: 0;
    background: none;
    color: var(--text-2);
    font-size: var(--fs-caption);
    font-weight: 500;
    letter-spacing: 0;
    line-height: var(--lh-caption);
    text-transform: none;
  }
  .match-bar-status:has(.badge-done) + .match-bar-patch::before { content: "·"; margin-right: var(--s-2); color: var(--muted); }
  .match-tabs .tabs--segment { display: flex; width: 100%; }
  .match-tabs .tabs--segment .tab { flex: 1 1 auto; min-width: 0; padding: 0 4px; }
  .match-tab-done { display: none; }
  .match-bar-meta { min-height: 20px; }
  .match-bar-meta:has(.match-delay:not([hidden])) { min-height: 36px; }
  .match-delay-word { display: none; }
  .match-delay-btn { height: 36px; padding: 0 12px; }

  /* Stream-Leiste zweizeilig: Titel / Knöpfe volle Breite */
  .match-stream-bar { flex-direction: column; align-items: stretch; padding: var(--s-3); }
  .match-stream-actions { flex-wrap: wrap; gap: var(--s-2); }
  .match-stream-select { flex: 1 1 100%; min-width: 0; height: 36px; }
  .match-stream-actions > .btn { flex: 1 1 0; height: 36px; }

  .match-sb { padding: var(--s-4); }
  .match-sb-kills-num { font-size: 30px; }

  .match-info.state-empty { padding: var(--s-6) var(--s-4); }

  .match-legend-marks { margin-left: 0; }
  .match-pt-who { min-width: 160px; }
  .match-pt-hp { width: 80px; }
}
