:root {
  color-scheme: dark;
  --ink: #f4efe3;
  --muted: #b7b09f;
  --line: rgba(244, 239, 227, 0.16);
  --panel: rgba(16, 31, 27, 0.86);
  --panel-strong: rgba(22, 45, 39, 0.96);
  --field: #0c2f25;
  --grass: #16a66a;
  --lime: #c9ff63;
  --gold: #ffca4b;
  --red: #e34848;
  --blue: #58a6ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px) 0 0 / 64px 64px,
    radial-gradient(circle at 75% 15%, rgba(201, 255, 99, 0.16), transparent 34rem),
    linear-gradient(135deg, #061210 0%, #0c2d24 48%, #15120b 100%);
  font-family: ui-sans-serif, "Avenir Next", "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: stretch;
  min-height: 220px;
  padding: 32px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(13, 84, 58, 0.92), rgba(12, 25, 22, 0.84)),
    repeating-linear-gradient(90deg, transparent 0 70px, rgba(255, 255, 255, 0.05) 70px 72px);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.26);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--lime);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 8vw, 6.4rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: #efe8d7;
  font-size: clamp(1rem, 1.8vw, 1.28rem);
  line-height: 1.5;
}

.source-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(201, 255, 99, 0.28);
  background: rgba(2, 10, 8, 0.42);
  border-radius: 8px;
}

.source-label,
.freshness,
.meta-pill {
  color: var(--muted);
  font-size: 0.82rem;
}

.source-card a {
  color: var(--lime);
  font-size: 1.3rem;
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.freshness[data-state="stale"] {
  color: var(--gold);
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.score-strip article,
.panel,
.match-card,
.group-table {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
}

.score-strip article {
  padding: 18px 20px;
}

.score-strip span {
  display: block;
  color: var(--lime);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.8rem;
  line-height: 1;
}

.score-strip p {
  margin: 5px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
}

.panel {
  padding: 20px;
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading h2,
.group-table h3 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

select {
  min-height: 36px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #10231f;
  border-radius: 6px;
  padding: 0 10px;
}

.source-list {
  display: grid;
  gap: 10px;
}

.source-link {
  display: grid;
  gap: 4px;
  padding: 12px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.source-link strong {
  color: var(--ink);
}

.source-link span,
.notice,
.match-foot,
.match-meta,
.highlight-state,
.recap {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.notice {
  margin-top: 16px;
  padding: 12px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 202, 75, 0.08);
}

.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.match-card {
  display: grid;
  gap: 14px;
  min-height: 230px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--panel-strong);
}

.match-card.live {
  border-color: rgba(227, 72, 72, 0.72);
}

.match-card.done {
  border-color: rgba(88, 166, 255, 0.4);
}

.match-meta,
.match-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.team {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.team img,
.standing-team img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.team strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.team span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.logo-fallback {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.versus {
  display: grid;
  place-items: center;
  min-height: 56px;
  color: var(--lime);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 800;
}

.highlight-state {
  width: fit-content;
  padding: 6px 9px;
  color: #ffe6a0;
  border: 1px solid rgba(255, 202, 75, 0.28);
  border-radius: 999px;
}

.highlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.highlight-actions a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 6px 10px;
  color: #07110f;
  background: var(--lime);
  border: 1px solid rgba(201, 255, 99, 0.62);
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 800;
  text-decoration: none;
}

.highlight-actions a:nth-child(n+2) {
  color: #ffe6a0;
  background: transparent;
  border-color: rgba(255, 202, 75, 0.32);
}

.recap {
  margin-bottom: 0;
}

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

.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.group-table {
  overflow: hidden;
  padding: 14px;
  background: var(--panel-strong);
}

.group-table h3 {
  margin: 0 0 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  padding: 8px 5px;
  border-top: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.75rem;
}

.standing-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: normal;
}

.standing-team img {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.empty {
  padding: 24px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.error {
  color: #ffd1d1;
}

@media (max-width: 920px) {
  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .source-card {
    min-height: 160px;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 10px;
  }

  .topbar,
  .panel {
    padding: 16px;
  }

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

  .split,
  .match-meta,
  .match-foot {
    align-items: flex-start;
    flex-direction: column;
  }

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