:root {
  --bg: #020702;
  --panel: rgba(0, 0, 0, 0.82);
  --panel-border: rgba(72, 255, 119, 0.32);
  --text-main: #d3ffd8;
  --text-bright: #effff1;
  --text-dim: #77c97f;
  --text-faint: #4b9b53;
  --accent: #8cff96;
  --accent-strong: #53ff69;
  --shadow: 0 0 30px rgba(53, 162, 73, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: Consolas, "Courier New", monospace;
  color: var(--text-main);
  background-color: #000;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.45)),
    radial-gradient(rgba(0, 150, 0, 0.32), #000 120%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.22;
}

.top-left-panel {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1;
  width: min(320px, calc(100vw - 32px));
}

.top-left-panel.has-details {
  width: min(560px, calc(100vw - 32px));
}

.top-left-panel.has-next-games {
  width: min(430px, calc(100vw - 32px));
}

.top-left-panel.has-details.has-next-games {
  width: min(560px, calc(100vw - 32px));
}

.top-left-panel.has-scorers {
  width: min(470px, calc(100vw - 32px));
}

.top-left-panel.has-fair-play {
  width: min(390px, calc(100vw - 32px));
}

.top-left-panel.has-visitors {
  width: min(440px, calc(100vw - 32px));
}

.top-status-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}

.system-clock,
.site-identity {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(72, 255, 119, 0.22);
  background: rgba(0, 0, 0, 0.58);
  box-shadow: 0 0 18px rgba(53, 162, 73, 0.14);
  font-size: 0.88rem;
  line-height: 1;
}

.system-clock {
  gap: 8px;
  min-width: 150px;
  color: var(--text-bright);
}

.clock-label {
  color: var(--text-faint);
}

.site-identity {
  margin: 0;
  color: var(--text-faint);
  white-space: nowrap;
}

.standings-panel {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid rgba(72, 255, 119, 0.22);
  background: rgba(0, 0, 0, 0.62);
  box-shadow: 0 0 18px rgba(53, 162, 73, 0.14);
}

.standings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 6px;
}

.standings-header h2 {
  margin: 0;
  color: var(--text-bright);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.2;
}

.standings-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.standings-header a,
.standings-toggle {
  color: var(--text-faint);
  font-size: 0.72rem;
  text-decoration: none;
}

.standings-toggle {
  min-width: 58px;
  padding: 3px 6px;
  border: 1px solid rgba(72, 255, 119, 0.22);
  background: rgba(72, 255, 119, 0.08);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.standings-header a:hover,
.standings-header a:focus-visible,
.standings-toggle:hover,
.standings-toggle:focus-visible {
  color: var(--accent);
  border-color: rgba(140, 255, 150, 0.45);
}

.standings-status {
  margin: 0;
  padding: 0 12px 8px;
  color: var(--text-faint);
  font-size: 0.72rem;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-main);
  font-size: 0.78rem;
}

.top-left-panel.has-details .standings-table {
  min-width: 430px;
}

.standings-table th,
.standings-table td {
  padding: 6px 8px;
  border-top: 1px solid rgba(72, 255, 119, 0.12);
  text-align: left;
  vertical-align: top;
}

.standings-table th {
  color: var(--text-faint);
  font-weight: 400;
  text-transform: lowercase;
}

.standings-table .col-rank,
.standings-table .col-games,
.standings-table .col-wins,
.standings-table .col-draws,
.standings-table .col-losses,
.standings-table .col-goals,
.standings-table .col-points,
.standings-table .col-total,
.standings-table .col-average {
  text-align: right;
}

.standings-table .col-rank {
  width: 34px;
  color: var(--text-dim);
}

.standings-table .col-points,
.standings-table .col-goals,
.standings-table .col-total,
.standings-table .col-average {
  color: var(--text-bright);
}

.standings-table .col-team {
  color: var(--text-bright);
  min-width: 126px;
}

.team-select {
  display: inline;
  max-width: 100%;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(140, 255, 150, 0.24);
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}

.team-select:hover,
.team-select:focus-visible,
.team-select[aria-pressed="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent-strong);
  outline: 0;
}

.team-select[aria-pressed="true"] {
  text-shadow: 0 0 10px rgba(83, 255, 105, 0.24);
}

.empty-row {
  color: var(--text-faint);
  text-align: left;
}

.top-left-panel.has-fair-play .standings-table th,
.top-left-panel.has-fair-play .standings-table td,
.top-left-panel.has-visitors .standings-table th,
.top-left-panel.has-visitors .standings-table td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.top-left-panel.has-fair-play .standings-table .col-team,
.top-left-panel.has-visitors .standings-table .col-team {
  min-width: 180px;
}

.top-left-panel.has-scorers .standings-table th:nth-child(2),
.top-left-panel.has-scorers .standings-table td:nth-child(2) {
  min-width: 112px;
}

.top-left-panel.has-scorers .standings-table th:nth-child(3),
.top-left-panel.has-scorers .standings-table td:nth-child(3) {
  min-width: 108px;
}

.top-left-panel.has-scorers .standings-table .col-rank,
.top-left-panel.has-scorers .standings-table .col-goals {
  width: 30px;
}

.top-left-panel.has-details .standings-table th:not(:nth-child(2)),
.top-left-panel.has-details .standings-table td:not(:nth-child(2)) {
  text-align: right;
}

.top-left-panel.has-details .standings-table th:nth-child(2),
.top-left-panel.has-details .standings-table td:nth-child(2) {
  min-width: 118px;
}

.top-left-panel.has-details .standings-table th,
.top-left-panel.has-details .standings-table td {
  padding-left: 5px;
  padding-right: 5px;
}

.next-games {
  padding: 9px 10px 10px;
  border-top: 1px solid rgba(72, 255, 119, 0.12);
  background: rgba(72, 255, 119, 0.045);
}

.next-games-title,
.next-games-empty {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.72rem;
}

.next-games-title {
  color: var(--accent);
}

.next-games-list {
  display: grid;
  gap: 7px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.next-games-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding-top: 7px;
  border-top: 1px solid rgba(72, 255, 119, 0.1);
}

.next-game-meta,
.next-game-teams {
  min-width: 0;
}

.next-game-meta {
  grid-column: 1 / -1;
  color: var(--text-faint);
  font-size: 0.68rem;
}

.next-game-teams {
  color: var(--text-bright);
  font-size: 0.74rem;
}

.match-info-toggle {
  align-self: start;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(140, 255, 150, 0.24);
  background: transparent;
  color: var(--text-faint);
  font: inherit;
  font-size: 0.7rem;
  line-height: inherit;
  cursor: pointer;
}

.match-info-toggle:hover,
.match-info-toggle:focus-visible,
.match-info-toggle[aria-expanded="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent-strong);
  outline: 0;
}

.match-details {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  margin-top: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(72, 255, 119, 0.14);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-dim);
  font-size: 0.7rem;
}

.match-details p {
  margin: 0;
}

.match-details span {
  color: var(--text-faint);
}

.protocol-lineups {
  display: grid;
  gap: 4px;
  margin-top: 3px;
  padding-top: 6px;
  border-top: 1px solid rgba(72, 255, 119, 0.12);
}

.standings-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(72, 255, 119, 0.12);
}

.table-switch {
  position: relative;
  min-width: 0;
  padding: 6px 9px 7px;
  border: 1px solid rgba(72, 255, 119, 0.22);
  background: rgba(72, 255, 119, 0.08);
  color: var(--text-faint);
  font: inherit;
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
}

.table-switch:hover,
.table-switch:focus-visible,
.table-switch.active {
  color: var(--accent);
  border-color: rgba(140, 255, 150, 0.45);
}

.table-switch.active {
  background: rgba(72, 255, 119, 0.16);
  box-shadow:
    inset 0 -2px 0 var(--accent-strong),
    0 0 14px rgba(83, 255, 105, 0.12);
}

@media (min-width: 641px) and (max-width: 1180px) {
  .top-left-panel {
    top: 20px;
    left: 20px;
    width: min(44rem, calc(100vw - 40px));
  }

  .top-left-panel.has-details,
  .top-left-panel.has-details.has-next-games {
    width: min(48rem, calc(100vw - 40px));
  }

  .top-left-panel.has-next-games,
  .top-left-panel.has-scorers,
  .top-left-panel.has-fair-play,
  .top-left-panel.has-visitors {
    width: min(44rem, calc(100vw - 40px));
  }

  .top-status-line {
    gap: 12px;
  }

  .system-clock,
  .site-identity {
    padding: 9px 11px;
    font-size: 0.92rem;
  }

  .standings-panel {
    margin-top: 12px;
  }

  .standings-header {
    padding: 12px 14px 7px;
  }

  .standings-header h2 {
    font-size: 0.9rem;
  }

  .standings-status {
    padding: 0 14px 9px;
    font-size: 0.76rem;
  }

  .standings-table {
    font-size: 0.82rem;
  }

  .standings-table th,
  .standings-table td {
    padding: 7px 9px;
  }

  .top-left-panel.has-details .standings-table {
    min-width: 0;
  }

  .top-left-panel.has-details .standings-table th,
  .top-left-panel.has-details .standings-table td {
    padding-left: 7px;
    padding-right: 7px;
  }

  .top-left-panel.has-scorers .standings-table th:nth-child(2),
  .top-left-panel.has-scorers .standings-table td:nth-child(2) {
    min-width: 140px;
  }

  .top-left-panel.has-scorers .standings-table th:nth-child(3),
  .top-left-panel.has-scorers .standings-table td:nth-child(3) {
    min-width: 132px;
  }

  .top-left-panel.has-fair-play .standings-table .col-team,
  .top-left-panel.has-visitors .standings-table .col-team {
    min-width: 220px;
  }

  .next-games {
    padding: 10px 12px 12px;
  }

  .next-games-title,
  .next-games-empty {
    font-size: 0.76rem;
  }

  .next-game-meta {
    font-size: 0.72rem;
  }

  .next-game-teams {
    font-size: 0.78rem;
  }

  .match-info-toggle,
  .match-details {
    font-size: 0.74rem;
  }

  .standings-footer {
    gap: 7px;
    padding: 9px 12px 12px;
  }

  .table-switch {
    padding: 7px 10px 8px;
    font-size: 0.76rem;
  }
}

@media (max-width: 640px) {
  .top-left-panel {
    top: 10px;
    left: 10px;
    width: min(300px, calc(100vw - 20px));
  }

  .top-left-panel.has-details {
    width: calc(100vw - 20px);
  }

  .top-left-panel.has-next-games {
    width: calc(100vw - 20px);
  }

  .top-left-panel.has-scorers {
    width: calc(100vw - 20px);
  }

  .top-left-panel.has-fair-play {
    width: calc(100vw - 20px);
  }

  .top-left-panel.has-visitors {
    width: calc(100vw - 20px);
  }

  .system-clock {
    min-width: 136px;
    font-size: 0.78rem;
  }

  .site-identity {
    font-size: 0.78rem;
  }

  .standings-panel {
    margin-top: 8px;
  }

  .standings-table {
    font-size: 0.72rem;
  }

  .top-left-panel.has-details .standings-table {
    min-width: 410px;
  }

  .top-left-panel.has-scorers .standings-table {
    min-width: 0;
    font-size: 0.68rem;
  }

  .top-left-panel.has-scorers .standings-table th,
  .top-left-panel.has-scorers .standings-table td {
    padding-left: 4px;
    padding-right: 4px;
  }

  .top-left-panel.has-scorers .standings-table th:nth-child(2),
  .top-left-panel.has-scorers .standings-table td:nth-child(2) {
    min-width: 100px;
  }

  .top-left-panel.has-scorers .standings-table th:nth-child(3),
  .top-left-panel.has-scorers .standings-table td:nth-child(3) {
    min-width: 92px;
  }

  .top-left-panel.has-visitors .standings-table {
    min-width: 360px;
  }

  .top-left-panel.has-fair-play .standings-table {
    min-width: 330px;
  }

  .top-status-line {
    gap: 8px;
    overflow-x: auto;
  }
}
