:root {
  --bg: #050705;
  --panel: rgba(0, 0, 0, 0.74);
  --panel-strong: rgba(0, 0, 0, 0.9);
  --line: rgba(255, 255, 255, 0.2);
  --text: #ffffff;
  --muted: #b8c2b7;
  --lime: #39ff14;
  --purple: #8619dc;
  --orange: #ff8a00;
  --yellow: #ffe16a;
  --danger: #ff4d4d;
  --ok: #39ff14;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.9)),
    radial-gradient(circle at 10% 8%, rgba(57, 255, 20, 0.18), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(134, 25, 220, 0.28), transparent 30%),
    linear-gradient(135deg, #071307 0%, #040504 45%, #13071d 100%),
    var(--bg);
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 10%, rgba(57, 255, 20, 0.16), transparent 26%),
    radial-gradient(circle at 82% 8%, rgba(134, 25, 220, 0.22), transparent 28%),
    radial-gradient(circle at 88% 76%, rgba(255, 138, 0, 0.16), transparent 24%);
  mix-blend-mode: screen;
}

button {
  font: inherit;
}

.scoreboard-shell {
  position: relative;
  z-index: 1;
  width: min(1920px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(16px, 1.6vw, 30px);
  display: grid;
  gap: clamp(12px, 1vw, 18px);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 18px 22px;
  border: 2px solid rgba(57, 255, 20, 0.74);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.brand-lockup {
  min-width: 0;
}

.brand-lockup p,
.brand-lockup h1 {
  margin: 0;
}

.event-name {
  color: var(--muted);
  font-size: clamp(16px, 1.2vw, 24px);
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  color: var(--lime);
  font-size: clamp(52px, 5vw, 96px);
  line-height: 0.92;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 4px 0 #10260d, 0 0 22px rgba(57, 255, 20, 0.28);
}

.venue {
  margin-top: 4px !important;
  color: var(--yellow);
  font-size: clamp(18px, 1.3vw, 28px);
  font-weight: 900;
  text-transform: uppercase;
}

.status-cluster {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(210px, auto) 52px 52px;
  align-items: center;
  gap: 12px;
}

.score-progress {
  display: grid;
  gap: 8px;
}

.score-progress span {
  color: var(--yellow);
  font-size: 22px;
  font-weight: 900;
  text-align: right;
}

.progress-track {
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--yellow));
  transition: width 420ms ease;
}

.live-status {
  min-height: 52px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 12px auto;
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.live-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 18px currentColor;
}

.live-dot.ok {
  color: var(--ok);
  background: var(--ok);
}

.live-dot.error {
  color: var(--danger);
  background: var(--danger);
}

.live-status span:nth-child(2) {
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.live-status span:nth-child(3) {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(57, 255, 20, 0.5);
  border-radius: 8px;
  color: var(--lime);
  background: rgba(57, 255, 20, 0.08);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  outline: none;
  background: rgba(57, 255, 20, 0.18);
}

.icon-button svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.focus-strip,
.lower-grid {
  display: grid;
  gap: 14px;
}

.focus-strip {
  grid-template-columns: 1.3fr 1.3fr 1fr;
}

.focus-strip article,
.group-panel,
.match-panel,
.wildcard-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.focus-strip article {
  min-width: 0;
  padding: 14px 18px;
  display: grid;
  gap: 4px;
}

.focus-strip span,
.section-title span,
.group-heading span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.focus-strip strong {
  color: var(--text);
  font-size: clamp(18px, 1.35vw, 28px);
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.standings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.group-panel {
  min-width: 0;
  overflow: hidden;
  border-width: 2px;
}

.accent-a {
  border-color: rgba(57, 255, 20, 0.72);
}

.accent-b {
  border-color: rgba(134, 25, 220, 0.9);
}

.accent-c {
  border-color: rgba(255, 138, 0, 0.9);
}

.group-heading,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.group-heading {
  min-height: 70px;
  padding: 14px 18px;
}

.accent-a .group-heading {
  background: linear-gradient(90deg, rgba(57, 255, 20, 0.95), rgba(57, 255, 20, 0.5));
}

.accent-b .group-heading {
  background: linear-gradient(90deg, rgba(134, 25, 220, 0.95), rgba(134, 25, 220, 0.5));
}

.accent-c .group-heading {
  background: linear-gradient(90deg, rgba(255, 138, 0, 0.98), rgba(255, 138, 0, 0.5));
}

.group-heading h2,
.section-title h2 {
  margin: 0;
  font-weight: 900;
  text-transform: uppercase;
}

.group-heading h2 {
  color: #020502;
  font-size: clamp(28px, 2.2vw, 44px);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}

.group-heading span {
  color: rgba(0, 0, 0, 0.8);
}

.table-wrap {
  padding: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  text-align: right;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  font-size: clamp(19px, 1.25vw, 26px);
  font-weight: 800;
}

td.team-cell,
th:nth-child(2) {
  text-align: left;
}

td.team-cell {
  width: 54%;
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tr.rank-1 td,
tr.rank-2 td {
  color: var(--lime);
}

tr.wildcard td {
  color: var(--yellow);
}

.rank-pill {
  min-width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #020502;
  background: var(--text);
  font-size: 20px;
  font-weight: 900;
}

tr.rank-1 .rank-pill,
tr.rank-2 .rank-pill {
  background: var(--lime);
}

tr.wildcard .rank-pill {
  background: var(--yellow);
}

.lower-grid {
  grid-template-columns: 1.35fr 0.65fr;
}

.match-panel,
.wildcard-panel {
  min-height: 230px;
  padding: 16px;
}

.section-title {
  margin-bottom: 12px;
}

.section-title h2 {
  color: var(--text);
  font-size: clamp(22px, 1.6vw, 34px);
}

.match-list,
.qualifier-list {
  display: grid;
  gap: 8px;
}

.match-row,
.qualifier-row {
  display: grid;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.match-row {
  grid-template-columns: 72px 118px minmax(0, 1fr) 64px minmax(0, 1fr) 92px;
  padding: 10px 12px;
}

.qualifier-row {
  grid-template-columns: 44px minmax(0, 1fr) 82px;
  padding: 9px 11px;
}

.match-no,
.match-time,
.score-chip,
.source-chip {
  font-weight: 900;
  text-transform: uppercase;
}

.match-no {
  color: var(--yellow);
}

.match-time,
.source-chip {
  color: var(--muted);
  font-size: 13px;
}

.match-team,
.qualifier-team {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(16px, 1.05vw, 22px);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-chip {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #020502;
  background: var(--yellow);
  font-size: 19px;
}

.score-chip.pending {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.qualifier-rank {
  width: 46px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #030503;
  background: var(--lime);
  font-weight: 900;
}

.qualifier-meta {
  color: var(--muted);
  font-weight: 900;
  text-align: right;
}

.error-banner {
  padding: 18px;
  border: 1px solid rgba(255, 77, 77, 0.6);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 77, 77, 0.18);
}

@media (max-width: 1180px) {
  .topbar,
  .focus-strip,
  .standings-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .status-cluster {
    grid-template-columns: 1fr auto auto;
  }

  .score-progress,
  .live-status {
    grid-column: 1 / -1;
  }

  .score-progress span {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .scoreboard-shell {
    padding: 10px;
  }

  .topbar,
  .focus-strip article,
  .match-panel,
  .wildcard-panel {
    padding: 12px;
  }

  .match-row {
    grid-template-columns: 56px minmax(0, 1fr) 52px;
  }

  .match-time,
  .match-team:nth-of-type(2),
  .match-row .match-team + .score-chip + .match-team {
    display: none;
  }
}
