@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --background: #101412;
  --surface: #171d19;
  --surface-raised: #1c231e;
  --border: #2a342c;
  --text: #eff3ed;
  --muted: #89958b;
  --green: #c1fa58;
  --green-dark: #203018;
  --orange: #ff9a62;
  --mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "DM Sans", Inter, ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(ellipse at 9% 0%, rgb(83 130 53 / 12%), transparent 31rem),
    var(--background);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgb(255 255 255 / 7%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #141a10;
  font-size: 16px;
  letter-spacing: -.08em;
}

.brand-light {
  color: var(--muted);
  font-weight: 500;
}

.live-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgb(193 250 88 / 55%);
}

.live-dot.is-error {
  background: var(--orange);
  box-shadow: 0 0 12px rgb(255 154 98 / 45%);
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, transform .2s ease;
}

.icon-button:hover {
  border-color: var(--green);
  color: var(--green);
}

.icon-button.is-loading svg {
  animation: rotate .8s linear infinite;
}

.icon-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.intro {
  min-height: 277px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 48px 0 56px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .11em;
}

.eyebrow-line {
  width: 17px;
  height: 1px;
  background: var(--green);
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(42px, 6vw, 66px);
  font-weight: 700;
  letter-spacing: -.065em;
  line-height: .96;
}

.accent-text {
  color: var(--green);
}

.intro-description {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.intro-aside {
  width: min(310px, 42%);
  margin: 20px 0 0 24px;
}

.player-form {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(145deg, #1d251e, #171d19);
}

.player-form > label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
}

.player-input-row {
  display: flex;
  gap: 6px;
}

.player-input-row input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  background: #111713;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
}

.player-input-row input:focus {
  border-color: var(--green);
}

.player-input-row button {
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #17200f;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.player-input-row button:hover {
  background: #d3ff7e;
}

.player-form > span {
  color: var(--muted);
  font-size: 10px;
}

.up-next-section {
  padding: 25px 0 44px;
  border-top: 1px solid rgb(255 255 255 / 7%);
}

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

.section-heading .eyebrow {
  margin-bottom: 6px;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.045em;
}

.heading-dot {
  color: var(--green);
}

.result-count,
.section-note {
  padding-bottom: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .03em;
}

.section-note {
  font-family: var(--sans);
  letter-spacing: 0;
}

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

.match-card,
.empty-card,
.loading-card {
  min-height: 118px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(145deg, rgb(29 37 30 / 86%), rgb(22 28 24 / 86%));
}

.match-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px 16px 13px;
  overflow: hidden;
}

.match-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--green);
  content: "";
}

.match-top,
.match-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.match-map {
  color: var(--green);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
}

.match-timing {
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
}

.match-server {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-event {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 10px;
}

.match-join {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-decoration: none;
}

.match-join:hover {
  color: var(--green);
}

.empty-card,
.loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 100px;
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.empty-card {
  flex-direction: column;
  gap: 7px;
  border-style: dashed;
  background: rgb(23 29 25 / 48%);
  text-align: center;
}

.empty-card strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: rotate .8s linear infinite;
}

.events-section {
  padding: 25px 0 54px;
  border-top: 1px solid rgb(255 255 255 / 7%);
}

.events-heading {
  margin-bottom: 21px;
}

.events {
  display: grid;
  gap: 17px;
}

.event-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgb(23 29 25 / 78%);
}

.event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 1%);
}

.event-title-group {
  min-width: 0;
}

.event-title-group h3 {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.event-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.event-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.stat-pill {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.stat-pill strong {
  color: var(--text);
  font-weight: 500;
}

.server-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.server-card {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  padding: 11px 12px;
  border: 1px solid rgb(255 255 255 / 5%);
  border-radius: 8px;
  background: #141a16;
}

.server-main {
  min-width: 0;
}

.server-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-bottom: 7px;
}

.server-name {
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
}

.server-dot.is-idle {
  background: #667168;
}

.server-map-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.map-chip {
  padding: 4px 6px;
  border: 1px solid #303a31;
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.map-chip.is-selected {
  border-color: rgb(193 250 88 / 38%);
  background: var(--green-dark);
  color: var(--green);
}

.map-chip .map-label {
  margin-right: 3px;
  color: #657067;
  font-family: var(--sans);
}

.server-extra {
  align-self: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-align: right;
  white-space: nowrap;
}

.server-extra .players {
  display: block;
  margin-bottom: 5px;
  color: #a7b2a7;
}

.join-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  text-decoration: none;
}

.join-button:hover {
  text-decoration: underline;
}

.server-error {
  padding: 16px;
  color: var(--orange);
  font-size: 12px;
}

.map-picker {
  padding: 15px 16px 17px;
  border-top: 1px solid var(--border);
}

.map-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.map-picker-title {
  color: #c6cec5;
  font-size: 11px;
  font-weight: 600;
}

.map-picker-help {
  color: var(--muted);
  font-size: 10px;
}

.map-grid-wrap {
  max-height: 210px;
  overflow: auto;
  scrollbar-color: #3a463a transparent;
  scrollbar-width: thin;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  gap: 4px;
}

.map-button {
  position: relative;
  min-width: 0;
  min-height: 27px;
  padding: 0 2px;
  border: 1px solid #303a32;
  border-radius: 5px;
  background: #171e19;
  color: #9aa59a;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9px;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.map-button.is-completed {
  opacity: .48;
}

.map-button.is-completed::after {
  position: absolute;
  top: 1px;
  right: 2px;
  color: var(--green);
  content: "✓";
  font-family: var(--sans);
  font-size: 8px;
  line-height: 1;
}

.map-button:hover {
  border-color: #77943f;
  color: var(--text);
}

.map-button.is-selected {
  border-color: var(--green);
  background: var(--green);
  color: #17200f;
  font-weight: 500;
}

.map-button.is-selected.is-completed {
  opacity: .62;
}

.map-button.is-selected.is-completed::after {
  color: #17200f;
}

.map-button:focus-visible,
.icon-button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.no-maps {
  padding: 13px 0;
  color: var(--muted);
  font-size: 11px;
}

.notice {
  margin: 0 0 22px;
  padding: 11px 13px;
  border: 1px solid rgb(255 154 98 / 25%);
  border-radius: 8px;
  background: rgb(255 154 98 / 7%);
  color: #ffb38b;
  font-size: 12px;
}

.notice:empty {
  display: none;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 24px;
  border-top: 1px solid rgb(255 255 255 / 7%);
  color: var(--muted);
  font-size: 10px;
}

footer > span:first-child {
  font-family: var(--mono);
  letter-spacing: .07em;
}

footer a {
  color: #bac5b9;
  text-decoration: none;
}

footer a:hover {
  color: var(--green);
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 32px, 620px);
  }

  .intro {
    min-height: 245px;
    padding: 40px 0;
  }

  .intro-aside {
    margin-right: 0;
  }

  .matches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .map-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: calc(100% - 28px);
  }

  .topbar {
    min-height: 66px;
  }

  .live-status {
    gap: 7px;
    font-size: 9px;
  }

  .intro {
    min-height: auto;
    padding: 42px 0;
  }

  h1 {
    font-size: 50px;
  }

  .intro-description {
    max-width: 230px;
    font-size: 12px;
    line-height: 1.6;
  }

  .intro-aside {
    width: 42%;
    margin-left: 12px;
  }

  .player-form {
    padding: 10px;
  }

  .player-input-row {
    flex-direction: column;
  }

  .player-input-row button {
    min-height: 31px;
  }

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

  .match-card {
    min-height: 105px;
  }

  .section-note {
    max-width: 110px;
    font-size: 9px;
    text-align: right;
  }

  .event-header {
    align-items: flex-start;
    padding: 14px;
  }

  .event-stats {
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }

  .stat-pill {
    padding: 5px 7px;
    font-size: 9px;
  }

  .server-list {
    padding: 8px;
  }

  .map-picker {
    padding: 12px;
  }

  .map-picker-help {
    max-width: 110px;
    text-align: right;
  }

  .map-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  footer {
    flex-direction: column;
    font-size: 9px;
  }
}
