:root {
  color-scheme: dark;
  --page: #101828;
  --arena: #1c2740;
  --panel: #212d41;
  --line: #41567e;
  --signal: #7ba8d9;
  --text: #ddebff;
  --muted: #a9c5e8;
  --live: #71d6a3;
  --bot: #e8b86a;
  --stale: #ef8f8f;
  --shadow: 0 15px 35px rgba(4, 8, 18, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-width: 300px;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Verdana, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

::selection {
  background: var(--signal);
  color: var(--page);
}

* {
  scrollbar-color: var(--signal) var(--arena);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: var(--arena);
}

::-webkit-scrollbar-thumb {
  background: var(--signal);
  border: 3px solid var(--arena);
}

a {
  color: #a9d2ff;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  color: #ffffff;
}

a:focus-visible,
button:focus-visible,
[tabindex="0"]:focus-visible,
summary:focus-visible {
  outline: 2px solid #a9d2ff;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--text);
  color: var(--page);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  padding-top: 20px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  border-top: 1px solid var(--signal);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.brand-xir {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
}

.brand-channel {
  color: var(--signal);
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(1rem, 2.5vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0;
}

nav {
  display: flex;
  gap: 24px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.broadcast-title {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
  gap: 48px;
  align-items: end;
  padding: 58px 0 52px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 18ch;
  margin-bottom: 14px;
  color: #f5f9ff;
  font-size: clamp(2.15rem, 6vw, 5.3rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.broadcast-title > div > p {
  max-width: 65ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.8vw, 1.12rem);
}

.totals-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--signal);
  border-bottom: 1px solid var(--line);
  background: var(--arena);
  box-shadow: var(--shadow);
}

.totals-strip div {
  min-width: 0;
  padding: 15px 17px;
}

.totals-strip div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.totals-strip div:nth-child(-n + 2) {
  border-bottom: 1px solid var(--line);
}

.totals-strip dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.totals-strip dd {
  overflow: hidden;
  margin: 3px 0 0;
  color: #ffffff;
  font-family: "Courier New", Courier, monospace;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-board,
.record-board {
  border-top: 1px solid var(--signal);
  background: var(--arena);
  box-shadow: var(--shadow);
}

.live-board {
  padding: 30px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin-bottom: 4px;
  color: #f5f9ff;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.refresh-readout {
  color: var(--signal) !important;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.72rem !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.server-channel {
  min-width: 0;
  background: var(--panel);
}

.server-channel + .server-channel {
  border-left: 1px solid var(--line);
}

.server-visual {
  position: relative;
  display: grid;
  grid-template-columns: minmax(140px, 260px) minmax(0, 1fr);
  min-height: 170px;
  overflow: hidden;
  background: #151f33;
}

.server-visual img {
  width: 100%;
  height: 100%;
  min-height: 170px;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.05);
}

.server-identity {
  padding: 24px 22px;
  border-bottom: 1px solid var(--line);
}

.server-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-light {
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.server-channel[data-state="online"] .server-status {
  color: var(--live);
}

.server-channel[data-state="unreachable"] .server-status,
.server-channel[data-state="stale"] .server-status {
  color: var(--stale);
}

.server-identity h3 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.25;
}

.server-map,
.server-address {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-address {
  margin-top: 4px;
}

.join-server {
  display: inline-block;
  margin-top: 16px;
  padding: 7px 11px;
  border: 1px solid var(--signal);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.join-server:hover {
  background: var(--signal);
  color: var(--page);
}

.channel-readout {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.player-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.player-table th,
.player-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #344769;
  text-align: right;
}

.player-table th {
  color: var(--muted);
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.player-table th:first-child,
.player-table td:first-child {
  overflow: hidden;
  width: 52%;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-kind {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.participant-kind.bot {
  color: var(--bot);
}

.empty-message,
.loading-panel {
  color: var(--muted);
}

.channel-empty {
  min-height: 95px;
  margin: 0;
  padding: 28px 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.loading-panel {
  min-height: 355px;
  padding: 30px;
}

.live-error {
  grid-column: 1 / -1;
  min-height: 150px;
}

.server-channel.is-updated .server-visual {
  animation: signal-acquired 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes signal-acquired {
  from {
    clip-path: inset(0 100% 0 0);
    filter: brightness(1.7);
  }
  to {
    clip-path: inset(0 0 0 0);
    filter: brightness(1);
  }
}

.record-board {
  margin-top: 28px;
}

.leaderboard-block,
.matches-block {
  padding: 30px;
}

.matches-block {
  border-top: 1px solid var(--line);
}

.compact-heading {
  margin-bottom: 18px;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
}

.score-table,
.match-scoreboard {
  width: 100%;
  border-collapse: collapse;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.score-table {
  min-width: 690px;
}

.table-scroll.is-empty .score-table {
  min-width: 0;
}

.table-scroll.is-empty .score-table thead {
  display: none;
}

.score-table th,
.score-table td,
.match-scoreboard th,
.match-scoreboard td {
  padding: 10px 12px;
  border-bottom: 1px solid #344769;
  text-align: right;
}

.score-table th,
.match-scoreboard th {
  background: #172238;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.score-table th:first-child,
.score-table td:first-child,
.match-scoreboard th:first-child,
.match-scoreboard td:first-child {
  text-align: left;
}

.score-table tbody tr:hover,
.match-scoreboard tbody tr:hover {
  background: #263651;
}

.rank-number {
  display: inline-block;
  width: 3ch;
  color: var(--signal);
}

.table-message {
  padding: 28px !important;
  color: var(--muted);
  text-align: left !important;
}

.match-heading {
  align-items: center;
}

.filter-control {
  display: flex;
  border: 1px solid var(--line);
}

.filter-control button {
  min-height: 38px;
  padding: 7px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #172238;
  color: var(--muted);
  font: 700 0.68rem Verdana, Arial, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.filter-control button:last-child {
  border-right: 0;
}

.filter-control button:hover,
.filter-control button[aria-pressed="true"] {
  background: var(--signal);
  color: var(--page);
}

.match-ledger {
  border: 1px solid var(--line);
}

.match-report + .match-report {
  border-top: 1px solid var(--line);
}

.match-report summary {
  display: grid;
  grid-template-columns: minmax(170px, 1.25fr) minmax(120px, 0.8fr) minmax(130px, 0.8fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  background: #172238;
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.76rem;
  cursor: pointer;
  list-style: none;
}

.match-report summary::-webkit-details-marker {
  display: none;
}

.match-report summary::after {
  content: "OPEN";
  color: var(--signal);
  font: 700 0.62rem Verdana, Arial, sans-serif;
  letter-spacing: 0.05em;
}

.match-report[open] summary::after {
  content: "CLOSE";
}

.match-map {
  overflow: hidden;
  color: #ffffff;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-meta {
  color: var(--muted);
}

.match-scoreboard th:first-child,
.match-scoreboard td:first-child {
  width: 42%;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding: 35px 0 56px;
  color: var(--muted);
  font-size: 0.72rem;
}

footer p {
  margin: 0;
}

.noscript-message {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 14px;
  border: 1px solid var(--stale);
  background: var(--arena);
  color: var(--text);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .broadcast-title {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-block: 42px;
  }

  .totals-strip {
    max-width: 600px;
  }

  .server-grid {
    grid-template-columns: 1fr;
  }

  .server-channel + .server-channel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .masthead {
    align-items: flex-start;
    padding: 12px 0;
  }

  nav {
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    padding-top: 5px;
  }

  h1 {
    font-size: clamp(2.4rem, 14vw, 4.2rem);
  }

  .live-board,
  .leaderboard-block,
  .matches-block {
    padding: 20px 14px;
  }

  .section-heading,
  .match-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .server-visual {
    grid-template-columns: 1fr;
  }

  .server-visual img {
    max-height: 190px;
  }

  .filter-control {
    width: 100%;
  }

  .filter-control button {
    flex: 1;
  }

  .match-report summary {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
  }

  .match-report summary::after {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .match-date {
    display: none;
  }

  .match-duration {
    grid-column: 2;
    grid-row: 2;
    text-align: right;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .server-channel.is-updated .server-visual {
    animation: none;
  }
}
