@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@500;700;800&family=Oswald:wght@500;600;700&display=swap');

:root {
  --panel: #181b20;
  --line: #3d4450;
  --text: #f4f5f7;
  --muted: #bec5ce;
  --red: #f04450;
  --display: "Oswald", "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: "Barlow", system-ui, sans-serif;
}

.overlay-scoreboard {
  width: 100%;
  min-height: 100vh;
  display: grid;
  align-content: end;
  padding: clamp(8px, 1.5vh, 16px) clamp(12px, 2vw, 40px);
}

.broadcast-bottom {
  justify-self: center;
  width: min(740px, 100%);
  margin-bottom: clamp(0px, 1.8vh, 18px);
  border: 1px solid var(--line);
  background: #101215;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%, 0 12px);
}
.broadcast-title {
  text-align: center;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .05em;
  font-size: clamp(10px, 1vw, 15px);
  color: var(--muted);
  margin: 5px 0;
}
.broadcast-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.broadcast-table th, .broadcast-table td {
  padding: clamp(3px, .7vh, 9px) 4px;
  text-align: center;
  border: 1px solid #ffffff26;
}
.broadcast-table th:first-child { width: 32%; }
.broadcast-table thead { color: var(--muted); font-size: clamp(10px, 1vw, 15px); }
.broadcast-table tbody { font: 600 clamp(13px, 1.5vw, 24px)/1.15 var(--display); }
.broadcast-table tbody .home { background: #681321; }
.broadcast-table tbody .away { background: #242730; }
.broadcast-team-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.broadcast-table .broadcast-total { background: #101215a8; font-weight: 700; }
.broadcast-table thead .current { border-top: 3px solid var(--red); color: var(--text); }
.broadcast-table tbody .current { background: #0003; }

.overlay-round {
  width: min(1160px, calc(100% - 32px));
  margin: clamp(18px, 7vh, 76px) auto 0;
  padding: clamp(14px, 3vw, 44px);
  background: linear-gradient(145deg, #29171e, #101215 55%);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
}

.overlay-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.overlay-header img { width: 64px; height: 64px; object-fit: contain; }
.overlay-header h1 {
  font: 700 clamp(28px, 4.8vw, 76px)/1 var(--display);
  text-transform: uppercase;
  margin: 0;
}
.overlay-header p, .fixture-label { margin: 6px 0 0; color: var(--muted); }

.fixture {
  background: var(--panel);
  border: 1px solid var(--line);
  min-width: 0;
}

.overlay-round .fixture + .fixture { margin-top: 10px; }
.overlay-scoreboard .fixture { border-top: 3px solid var(--red); }

.fixture-label {
  margin: 0;
  padding: 5px 12px;
  background: #101215;
  color: var(--muted);
  text-align: center;
  font-size: clamp(12px, 1.15vw, 18px);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.fixture-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
}

.fixture-team {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: clamp(5px, 1vw, 16px);
  padding: clamp(6px, 1vw, 14px);
  border-inline-start: 3px solid var(--team-color, var(--red));
}

.fixture-team.away {
  flex-direction: row-reverse;
  text-align: right;
  border-inline-start: 0;
  border-inline-end: 3px solid var(--team-color, var(--line));
}

.team-logo {
  width: clamp(20px, 4vw, 56px);
  aspect-ratio: 1;
  flex: none;
  display: grid;
  place-items: center;
  background: #101215;
  font-weight: 800;
}
.team-logo img { width: 100%; height: 100%; object-fit: contain; }
.team-copy { min-width: 0; }
.team-role { display: block; color: var(--muted); font-size: 11px; }
.team-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 clamp(15px, 2.2vw, 34px)/1.1 var(--display);
}

.fixture-score {
  display: grid;
  place-items: center;
  min-width: clamp(42px, 9vw, 144px);
  padding: 4px 8px;
  background: #101215;
  color: var(--text);
  font: 700 clamp(18px, 3vw, 45px)/1 var(--display);
  font-variant-numeric: tabular-nums;
}
.fixture-score.finished { color: #ff939f; }

.overlay-message, #connection:not(:empty) {
  width: fit-content;
  max-width: calc(100% - 16px);
  margin: 8px auto;
  padding: 6px 15px;
  background: var(--panel);
  border-inline-start: 3px solid var(--red);
}
#connection:empty { display: none; }
