/* RUST12 Event Viewer – Synthwave/Cyberpunk-Design */

:root {
  --bg-0: #0d0221;
  --bg-1: #150636;
  --bg-2: #1f0a4d;
  --panel: rgba(16, 4, 43, 0.92);
  --line: #2b1263;
  --neon-pink: #ff2d95;
  --neon-cyan: #00e5ff;
  --neon-purple: #b967ff;
  --text: #e8e3ff;
  --text-dim: #9d8fc7;
  --danger: #ff4365;
  --topbar-h: 52px;
  --font-display: "Orbitron", sans-serif;
  --font-body: "Rajdhani", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse at 20% -10%, rgba(185, 103, 255, 0.22), transparent 55%),
    radial-gradient(ellipse at 85% 110%, rgba(255, 45, 149, 0.16), transparent 55%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 60%, var(--bg-2));
  background-attachment: fixed;
  overflow: hidden;
}

/* Dezentes Neon-Grid im Hintergrund */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  z-index: 0;
}

button, select, input {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
}

button {
  background: rgba(185, 103, 255, 0.12);
  border: 1px solid var(--neon-purple);
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s, transform 0.1s;
}
button:hover {
  background: rgba(185, 103, 255, 0.28);
  box-shadow: 0 0 10px rgba(185, 103, 255, 0.55);
}
button.primary {
  border-color: var(--neon-pink);
  background: rgba(255, 45, 149, 0.16);
  width: 100%;
  font-weight: 600;
  letter-spacing: 0.06em;
}
button.primary:hover { box-shadow: 0 0 12px rgba(255, 45, 149, 0.6); }

input[type="search"], input[type="text"], select {
  width: 100%;
  background: rgba(13, 2, 33, 0.8);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
}
input:focus, select:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 8px rgba(0, 229, 255, 0.4); }

.is-off { display: none !important; }

/* ---------- Topbar ---------- */

#topbar {
  position: relative;
  z-index: 5;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1rem;
  background: rgba(13, 2, 33, 0.9);
  border-bottom: 1px solid var(--neon-pink);
  box-shadow: 0 0 18px rgba(255, 45, 149, 0.35);
}

#panel-toggle,
#commentary-button,
#events-button,
#play-all,
#pause-all,
#clear-view,
#global-mute {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding-block: 0;
  line-height: 1;
  white-space: nowrap;
}

.topbar-actions,
.topbar-playback,
.topbar-audio {
  display: flex;
  align-items: center;
}

.button-icon { line-height: 1; }

#topbar h1 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--text);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.8);
  white-space: nowrap;
}

#topbar h1 .glitch {
  color: var(--neon-pink);
  text-shadow: 0 0 10px rgba(255, 45, 149, 0.9), 0 0 30px rgba(255, 45, 149, 0.5);
}

#stream-count {
  color: var(--text-dim);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.topbar-actions {
  margin-left: auto;
  gap: 0.4rem;
}

.topbar-playback {
  gap: 0.3rem;
}

#play-all,
#pause-all {
  width: 34px;
  padding-inline: 0;
}

#clear-view { padding-inline: 0.6rem; }

.events-menu { display: flex; align-items: center; }

#commentary-button {
  border-color: var(--neon-pink);
  background: rgba(255, 45, 149, 0.13);
}
#commentary-button.active {
  box-shadow: 0 0 10px rgba(255, 45, 149, 0.55);
}

#events-button[aria-expanded="true"] {
  border-color: var(--neon-cyan);
  background: rgba(0, 229, 255, 0.16);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
}

#header-clock {
  min-width: 3.4rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--neon-cyan);
  text-align: center;
  letter-spacing: 0.08em;
  text-shadow: 0 0 7px rgba(0, 229, 255, 0.65);
  white-space: nowrap;
}

#events-popover {
  display: none;
  position: fixed;
  z-index: 45;
  top: calc(var(--topbar-h) + 0.45rem);
  right: 0.75rem;
  width: min(390px, calc(100vw - 1.5rem));
  max-height: calc(100vh - var(--topbar-h) - 1rem);
  overflow-y: auto;
  padding: 0.7rem;
  background: rgba(13, 2, 33, 0.97);
  border: 1px solid var(--neon-cyan);
  border-radius: 7px;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.35), 0 12px 40px rgba(0, 0, 0, 0.65);
}
#events-popover[aria-hidden="false"] { display: block; }

.events-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.events-popover-header strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--neon-cyan);
  text-transform: uppercase;
}
.events-popover-header small { display: block; margin-top: 0.15rem; color: var(--text-dim); }

.events-group + .events-group { margin-top: 0.7rem; }
.events-group-title {
  margin-bottom: 0.3rem;
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.event-row {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.1rem;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid rgba(43, 18, 99, 0.65);
  background: rgba(157, 143, 199, 0.08);
}
.event-row:nth-child(even) { background: rgba(157, 143, 199, 0.14); }
.event-icon { color: var(--text); text-shadow: 0 0 7px currentColor; }
.event-row.danger .event-icon { color: var(--danger); }
.event-name { min-width: 0; font-weight: 600; line-height: 1.05; }
.event-time,
.event-live {
  padding: 0.12rem 0.42rem;
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.event-time { color: #bdefff; background: rgba(0, 158, 219, 0.42); }
.event-live { color: #eaffc2; background: rgba(93, 181, 37, 0.46); }

#results-open {
  width: 100%;
  margin-top: 0.7rem;
  border-color: #ffd84d;
  color: #fff5b4;
  background: linear-gradient(90deg, rgba(255, 45, 149, 0.18), rgba(255, 216, 77, 0.13));
  font-weight: 700;
  letter-spacing: 0.04em;
}
#results-open:hover { box-shadow: 0 0 14px rgba(255, 216, 77, 0.55); }

.topbar-audio {
  gap: 0.6rem;
}

#global-mute.active {
  border-color: var(--danger);
  background: rgba(255, 67, 101, 0.2);
  box-shadow: 0 0 10px rgba(255, 67, 101, 0.5);
}

input[type="range"] { accent-color: var(--neon-cyan); width: 110px; }

/* ---------- Layout ---------- */

#layout {
  position: relative;
  display: flex;
  height: calc(100% - var(--topbar-h));
}

/* ---------- Control Panel ---------- */

#panel {
  width: 300px;
  flex: 0 0 300px;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(4px);
  transition: margin-left 0.2s ease;
}
#panel.collapsed { margin-left: -300px; }

.panel-section { padding: 0.9rem 0.9rem 1rem; border-bottom: 1px solid var(--line); }

.panel-section h3 {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.6);
  margin-bottom: 0.6rem;
}

.hint { color: var(--text-dim); font-size: 0.82rem; margin-bottom: 0.5rem; }

.matchup { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; }
.matchup .vs {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 45, 149, 0.8);
}

/* Teamliste */
.team-item { border: 1px solid transparent; border-radius: 4px; margin-bottom: 2px; }
.team-item[open] { border-color: var(--line); background: rgba(13, 2, 33, 0.5); }
.team-item summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem;
  cursor: pointer;
  list-style: none;
}
.team-item summary::-webkit-details-marker { display: none; }
.team-item summary:hover { background: rgba(185, 103, 255, 0.1); }
.team-dot, .zone-dot, .tile-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--team-color, var(--neon-cyan));
  box-shadow: 0 0 6px var(--team-color, var(--neon-cyan));
  flex: 0 0 auto;
}
.team-name { flex: 1; font-weight: 600; }
.team-item summary button { font-size: 0.8rem; padding: 0.15rem 0.5rem; }

.member-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.22rem 0.4rem 0.22rem 1.5rem;
  cursor: pointer;
  font-size: 0.95rem;
}
.member-row:hover { background: rgba(0, 229, 255, 0.08); }
.member-row input { accent-color: var(--neon-pink); }
.member-row.search-hit span { color: var(--neon-cyan); text-shadow: 0 0 6px rgba(0, 229, 255, 0.6); }

.save-row { display: flex; gap: 0.4rem; margin-bottom: 0.5rem; }
.saved-row, .hidden-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}
.saved-row .saved-load { flex: 1; text-align: left; border-color: var(--neon-cyan); }
.hidden-row span { flex: 1; color: var(--text-dim); }

/* ---------- Bühne / Zonen ---------- */

#stage { flex: 1; position: relative; overflow: hidden; padding: 0.4rem; min-width: 0; }

#zones { display: grid; gap: 0.4rem; height: 100%; }

.team-zone {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--team-color, var(--line));
  border-radius: 6px;
  background: rgba(13, 2, 33, 0.55);
  box-shadow: 0 0 12px color-mix(in srgb, var(--team-color) 25%, transparent), inset 0 0 30px rgba(0, 0, 0, 0.35);
  padding: 0.35rem;
}

.zone-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; flex: 0 0 auto; }
.zone-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--team-color, var(--text));
  text-shadow: 0 0 8px color-mix(in srgb, var(--team-color) 70%, transparent);
}
.zone-audible { font-size: 0.8rem; opacity: 0.75; }
.zone-audible.active {
  opacity: 1;
  border-color: var(--neon-cyan);
  background: rgba(0, 229, 255, 0.18);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.55);
}

.zone-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 0.4rem;
}

/* ---------- Kacheln ---------- */

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #05010f;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.tile.is-audible, .tile.is-focus-audio {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.55);
}
.tile.is-offline { opacity: 0.75; }

.tile-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.55rem;
  background: linear-gradient(90deg, rgba(255, 45, 149, 0.14), rgba(0, 229, 255, 0.1));
  cursor: pointer;
  user-select: none;
}
.tile-header:hover { background: linear-gradient(90deg, rgba(255, 45, 149, 0.3), rgba(0, 229, 255, 0.22)); }
.tile-name { flex: 1; font-weight: 700; letter-spacing: 0.04em; }
.tile-status {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
}
.tile[data-status="online"] .tile-status { color: #57fb6f; border-color: #57fb6f; text-shadow: 0 0 6px rgba(87, 251, 111, 0.7); }
.tile[data-status="ready"] .tile-status { color: #ffcc00; border-color: #ffcc00; }
.tile[data-status="offline"] .tile-status, .tile[data-status="error"] .tile-status { color: var(--danger); border-color: var(--danger); }
.tile[data-status="blocked"] .tile-status { color: #ffcc00; border-color: #ffcc00; }

.player-mount { position: relative; flex: 1; min-height: 0; background: #000; }
.player-mount iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

.blocked-overlay {
  display: none;
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  font-size: 1.05rem;
  padding: 0.6rem 1.2rem;
  border-color: #ffcc00;
  background: rgba(13, 2, 33, 0.9);
  box-shadow: 0 0 14px rgba(255, 204, 0, 0.6);
}
.tile.is-blocked .blocked-overlay { display: block; }

.tile-bar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.4rem;
  background: rgba(13, 2, 33, 0.85);
}
.tile-bar button, .tile-bar a {
  font-size: 0.8rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--text-dim);
  text-decoration: none;
}
.tile-bar button:hover, .tile-bar a:hover { color: var(--text); border-color: var(--neon-purple); box-shadow: 0 0 8px rgba(185, 103, 255, 0.5); }
.tile-bar button svg { display: block; }
.tile.is-audible .t-audio,
.tile.is-focus-audio .t-audio {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.7);
}
.tile-bar .t-remove:hover { border-color: var(--danger); color: var(--danger); }
.tile-bar .t-link { margin-left: auto; }

/* 16er-Multiview: Player nutzen die komplette Kachelfläche. Kopf- und
   Steuerleisten liegen als kompakte Overlays darüber, statt Videohöhe zu
   verbrauchen. Die Bühne bleibt weiterhin vollständig ohne Scrollen. */
body.compact-multiview .team-zone { padding: 0.2rem; }
body.compact-multiview #zones,
body.compact-multiview .zone-grid { gap: 0.22rem; }
body.compact-multiview .zone-header {
  min-height: 22px;
  margin-bottom: 0.2rem;
  gap: 0.3rem;
}
body.compact-multiview .zone-title { font-size: 0.68rem; letter-spacing: 0.08em; }
body.compact-multiview .zone-audible { font-size: 0.68rem; padding: 0.08rem 0.35rem; }
body.compact-multiview .tile-header,
body.compact-multiview .tile-bar {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  opacity: 0.82;
  transition: opacity 0.15s, background 0.15s;
}
body.compact-multiview .tile-header {
  top: 0;
  min-height: 23px;
  padding: 0.1rem 0.32rem;
  background: linear-gradient(180deg, rgba(5, 1, 15, 0.96), rgba(13, 2, 33, 0.68));
}
body.compact-multiview .tile-bar {
  bottom: 0;
  gap: 0.18rem;
  padding: 0.1rem 0.25rem;
  background: linear-gradient(0deg, rgba(5, 1, 15, 0.96), rgba(13, 2, 33, 0.68));
}
body.compact-multiview .tile:hover .tile-header,
body.compact-multiview .tile:hover .tile-bar,
body.compact-multiview .tile:focus-within .tile-header,
body.compact-multiview .tile:focus-within .tile-bar { opacity: 1; }
body.compact-multiview .tile-name { font-size: 0.78rem; }
body.compact-multiview .tile-status { font-size: 0.58rem; padding: 0 0.22rem; }
body.compact-multiview .tile-bar button,
body.compact-multiview .tile-bar a { font-size: 0.68rem; padding: 0.05rem 0.28rem; }
body.compact-multiview .player-mount { position: absolute; inset: 0; }
body.compact-multiview .blocked-overlay { z-index: 4; }

/* ---------- Finaler Endstand ---------- */

.results-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: clamp(0.7rem, 2vw, 1.5rem);
  background:
    radial-gradient(circle at 50% 25%, rgba(185, 103, 255, 0.2), transparent 42%),
    rgba(4, 1, 14, 0.68);
  backdrop-filter: blur(9px) saturate(0.8);
  -webkit-backdrop-filter: blur(9px) saturate(0.8);
}
.results-overlay[aria-hidden="true"] { display: none; }

.results-card {
  position: relative;
  isolation: isolate;
  width: min(590px, 100%);
  max-height: calc(100vh - 1.4rem);
  overflow: hidden auto;
  padding: clamp(1rem, 2.6vh, 1.45rem);
  border: 2px solid transparent;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(20, 5, 52, 0.98), rgba(7, 2, 24, 0.98)) padding-box,
    conic-gradient(from 0deg, var(--neon-pink), var(--neon-purple), var(--neon-cyan), #ffd84d, var(--neon-pink)) border-box;
  box-shadow:
    0 0 14px rgba(255, 45, 149, 0.68),
    0 0 38px rgba(0, 229, 255, 0.3),
    0 26px 80px rgba(0, 0, 0, 0.78),
    inset 0 0 44px rgba(185, 103, 255, 0.11);
  animation: results-border-glow 2.8s ease-in-out infinite alternate;
}
.results-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.42;
  background:
    linear-gradient(rgba(0, 229, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 45, 149, 0.07) 1px, transparent 1px);
  background-size: 27px 27px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}
.results-card:focus { outline: none; }

.results-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 2;
  width: 34px;
  height: 34px;
  padding: 0;
  border-color: var(--neon-pink);
  border-radius: 50%;
  background: rgba(255, 45, 149, 0.13);
  font-weight: 700;
}
.results-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding-inline: 2.2rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--neon-cyan);
  text-transform: uppercase;
  text-shadow: 0 0 9px rgba(0, 229, 255, 0.85);
}
.results-kicker span {
  width: min(78px, 14vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan));
  box-shadow: 0 0 7px var(--neon-cyan);
}
.results-kicker span:last-child { transform: scaleX(-1); }
.results-trophy {
  margin-top: 0.35rem;
  font-size: clamp(2rem, 6vh, 3rem);
  line-height: 1;
  text-align: center;
  filter: drop-shadow(0 0 10px rgba(255, 216, 77, 0.72));
  animation: results-trophy-float 2.4s ease-in-out infinite;
}
.results-card h2 {
  margin-top: 0.15rem;
  padding-inline: 2rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.5vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: 0.08em;
  color: #fff6b7;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(255, 216, 77, 0.85), 0 0 24px rgba(255, 45, 149, 0.55);
}
#results-summary {
  margin: 0.35rem 0 0.85rem;
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
}
.results-table {
  padding: 0.55rem;
  border: 1px solid rgba(0, 229, 255, 0.32);
  border-radius: 8px;
  background: rgba(3, 1, 14, 0.54);
  box-shadow: inset 0 0 22px rgba(0, 229, 255, 0.07);
}
.results-table-head,
.results-ranking li {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr) 4rem;
  align-items: center;
}
.results-table-head {
  padding: 0 0.55rem 0.38rem;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  color: var(--neon-cyan);
  text-transform: uppercase;
}
.results-table-head span:first-child { grid-column: 1 / 3; }
.results-table-head span:last-child { text-align: right; }
.results-ranking {
  display: grid;
  gap: 0.22rem;
  list-style: none;
}
.results-ranking li {
  min-height: 31px;
  padding: 0.18rem 0.55rem;
  border-left: 2px solid rgba(185, 103, 255, 0.55);
  background: linear-gradient(90deg, rgba(185, 103, 255, 0.18), rgba(0, 229, 255, 0.05));
  font-size: 0.96rem;
}
.results-ranking li:nth-child(even) {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.13), rgba(185, 103, 255, 0.05));
}
.results-ranking .rank {
  width: 1.72rem;
  padding: 0.08rem 0;
  border: 1px solid rgba(157, 143, 199, 0.35);
  border-radius: 3px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1;
}
.results-ranking strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results-ranking .score {
  font-family: var(--font-display);
  font-size: 0.74rem;
  color: #dffbff;
  text-align: right;
}
.results-ranking .rank-first {
  min-height: 39px;
  border-color: #ffd84d;
  background: linear-gradient(90deg, rgba(255, 216, 77, 0.28), rgba(255, 45, 149, 0.12));
  box-shadow: 0 0 12px rgba(255, 216, 77, 0.17);
}
.results-ranking .rank-first .rank {
  border-color: #ffd84d;
  color: #291700;
  background: #ffd84d;
  box-shadow: 0 0 9px rgba(255, 216, 77, 0.7);
}
.results-ranking .rank-first strong,
.results-ranking .rank-first .score { color: #fff5a6; }
.results-ranking .rank-second { border-color: #c9dbeb; }
.results-ranking .rank-third { border-color: #dd8a42; }
.results-done {
  display: block;
  width: min(280px, 100%);
  margin: 0.85rem auto 0;
  border-color: var(--neon-pink);
  background: linear-gradient(90deg, rgba(255, 45, 149, 0.24), rgba(185, 103, 255, 0.2));
  font-weight: 700;
  letter-spacing: 0.07em;
  box-shadow: 0 0 12px rgba(255, 45, 149, 0.25);
}

@keyframes results-border-glow {
  from {
    box-shadow: 0 0 12px rgba(255, 45, 149, 0.58), 0 0 32px rgba(0, 229, 255, 0.22), 0 26px 80px rgba(0, 0, 0, 0.78);
  }
  to {
    box-shadow: 0 0 22px rgba(255, 45, 149, 0.85), 0 0 52px rgba(0, 229, 255, 0.42), 0 26px 80px rgba(0, 0, 0, 0.78);
  }
}

@keyframes results-trophy-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ---------- Schnellfokus ---------- */

.tile.focused,
.commentary-focus[aria-hidden="false"] {
  position: fixed;
  z-index: 60;
  left: max(1rem, 4vw);
  right: max(1rem, 4vw);
  top: calc(var(--topbar-h) + 1rem);
  bottom: 1.2rem;
  border-color: var(--neon-pink);
  box-shadow: 0 0 30px rgba(255, 45, 149, 0.7);
}
.tile.focused .player-mount { aspect-ratio: auto; flex: 1; }

.commentary-focus {
  display: none;
  --team-color: var(--neon-pink);
}
.commentary-focus[aria-hidden="false"] { display: flex; }
.commentary-focus .player-mount { aspect-ratio: auto; flex: 1; }
.commentary-header { cursor: default; }
.commentary-header:hover { background: linear-gradient(90deg, rgba(255, 45, 149, 0.14), rgba(0, 229, 255, 0.1)); }
.commentary-note { color: var(--text-dim); font-size: 0.86rem; }
.commentary-focus .tile-bar { justify-content: flex-end; }
.commentary-focus .commentary-note { margin-right: auto; }
.commentary-focus[data-status="online"] .tile-status { color: #57fb6f; border-color: #57fb6f; }
.commentary-focus[data-status="ready"] .tile-status { color: #ffcc00; border-color: #ffcc00; }
.commentary-focus[data-status="offline"] .tile-status,
.commentary-focus[data-status="error"] .tile-status { color: var(--danger); border-color: var(--danger); }
.commentary-focus[data-status="blocked"] .tile-status { color: #ffcc00; border-color: #ffcc00; }
.commentary-focus.is-blocked .blocked-overlay { display: block; }

#focus-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 1, 15, 0.82);
}
#focus-backdrop.visible { display: block; }

/* ---------- Leerzustand, Hinweise, Toast ---------- */

#empty-state { display: flex; justify-content: center; padding-top: 12vh; }
.empty-inner { text-align: center; max-width: 420px; }
.empty-inner h2 {
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  color: var(--neon-purple);
  text-shadow: 0 0 12px rgba(185, 103, 255, 0.7);
  margin-bottom: 0.8rem;
}
.empty-inner p { color: var(--text-dim); margin-bottom: 0.4rem; }
.empty-tip { font-size: 0.85rem; }

#audio-hint {
  display: none;
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 70;
  font-size: 1rem;
  padding: 0.6rem 1.1rem;
  border-color: var(--neon-cyan);
  background: rgba(13, 2, 33, 0.95);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.7);
  animation: pulse 1.6s ease-in-out infinite;
}
#audio-hint.visible { display: block; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 229, 255, 0.4); }
  50% { box-shadow: 0 0 22px rgba(0, 229, 255, 0.9); }
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%) translateY(20px);
  z-index: 80;
  background: rgba(13, 2, 33, 0.95);
  border: 1px solid var(--neon-pink);
  border-radius: 4px;
  box-shadow: 0 0 16px rgba(255, 45, 149, 0.6);
  padding: 0.6rem 1.1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
#toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- file://-Warnung ---------- */

#protocol-warning {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 1, 15, 0.92);
  backdrop-filter: blur(4px);
}
.warning-inner {
  max-width: 560px;
  margin: 1rem;
  padding: 1.6rem 1.8rem;
  background: var(--panel);
  border: 1px solid var(--danger);
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(255, 67, 101, 0.5);
}
.warning-inner h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--danger);
  text-shadow: 0 0 10px rgba(255, 67, 101, 0.7);
  margin-bottom: 0.9rem;
}
.warning-inner p { margin-bottom: 0.7rem; }
.warning-inner ol { margin: 0.4rem 0 0 1.2rem; }
.warning-inner li { margin-bottom: 0.6rem; }
.warning-inner code {
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  color: var(--neon-cyan);
  font-size: 0.9em;
}
.warning-inner a { color: var(--neon-cyan); }
.warning-dim { color: var(--text-dim); font-size: 0.85rem; }

/* ---------- Scrollbars ---------- */

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-purple); }

/* ---------- Mobil: Panel als Overlay ---------- */

@media (max-width: 900px) {
  #panel {
    position: fixed;
    z-index: 40;
    top: var(--topbar-h);
    bottom: 0;
    left: 0;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.6);
  }
  #topbar { gap: 0.45rem; padding-inline: 0.55rem; }
  #topbar h1 { font-size: 0.78rem; letter-spacing: 0.08em; }
  #stream-count { display: none; }
  .topbar-audio { gap: 0.35rem; }
  input[type="range"] { width: 80px; }
}

@media (max-width: 720px) {
  #topbar h1 { display: none; }
  .topbar-actions { margin-left: auto; }
  input[type="range"] { display: none; }
}

@media (max-width: 520px) {
  #topbar { gap: 0.2rem; padding-inline: 0.25rem; }
  #topbar button { padding-inline: 0.5rem; }
  .topbar-actions,
  .topbar-playback { gap: 0.2rem; }
  #panel-toggle .button-label,
  #commentary-button .button-label,
  #events-button .button-label,
  #global-mute .button-label { display: none; }
  #header-clock { min-width: 3rem; font-size: 0.7rem; }
  #events-popover { right: 0.35rem; width: calc(100vw - 0.7rem); }
  .commentary-focus[aria-hidden="false"] {
    left: 0.4rem;
    right: 0.4rem;
    bottom: 0.5rem;
  }
  .commentary-note { display: none; }
  .results-overlay { padding: 0.35rem; }
  .results-card {
    max-height: calc(100vh - 0.7rem);
    padding: 0.85rem 0.65rem;
    border-radius: 10px;
  }
  .results-trophy { font-size: 1.8rem; }
  .results-card h2 { padding-inline: 1.7rem; font-size: 1rem; }
  #results-summary { margin-bottom: 0.55rem; font-size: 0.78rem; }
  .results-table { padding: 0.4rem; }
  .results-ranking li { min-height: 27px; font-size: 0.84rem; }
  .results-ranking .rank-first { min-height: 31px; }
  .results-done { margin-top: 0.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .results-card,
  .results-trophy { animation: none; }
}
