:root {
  --ink: #17241f;
  --ink-soft: #52615a;
  --chalk: #f7f8f4;
  --surface: #ffffff;
  --surface-muted: #eef2ea;
  --pitch: #123b2d;
  --pitch-2: #0c2d23;
  --line: rgba(23, 36, 31, 0.16);
  --line-dark: rgba(247, 248, 244, 0.18);
  --green: #0f7a4f;
  --red: #d33d2f;
  --gold: #e5b949;
  --shadow: 0 18px 55px rgba(12, 45, 35, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, var(--pitch) 0 360px, var(--chalk) 360px 100%);
  font-family: Aptos, "Segoe UI Variable", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 56px);
  border-bottom: 1px solid var(--line-dark);
  background: rgba(12, 45, 35, 0.96);
  color: var(--chalk);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  text-decoration: none;
}

.brand img {
  display: block;
}

.topbar nav {
  display: flex;
  gap: 16px;
  font-size: 0.92rem;
  font-weight: 800;
}

.topbar nav a {
  color: rgba(247, 248, 244, 0.82);
  text-decoration: none;
}

.topbar nav a:hover {
  color: var(--chalk);
}

.matchday-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: 28px;
  padding: 36px clamp(16px, 4vw, 56px) 30px;
  color: var(--chalk);
  background:
    linear-gradient(90deg, rgba(247, 248, 244, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(247, 248, 244, 0.05) 1px, transparent 1px),
    var(--pitch);
  background-size: 72px 72px;
  overflow: hidden;
}

.board-main {
  min-width: 0;
}

.board-main,
.watchlist-card,
.control-grid,
.quick-chips,
.matchday-summary,
.schedule-section,
.utility-band,
.source-table {
  max-width: 100%;
  min-width: 0;
}

.board-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.board-kicker .eyebrow {
  margin: 0;
  color: var(--gold);
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 32px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(247, 248, 244, 0.09);
  color: rgba(247, 248, 244, 0.86);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: normal;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 960px;
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.25rem;
  line-height: 0.96;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.85rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.intro {
  max-width: 780px;
  color: rgba(247, 248, 244, 0.78);
  font-size: 1.12rem;
  line-height: 1.58;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 16px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span {
  color: rgba(247, 248, 244, 0.7);
  font-size: 0.82rem;
  font-weight: 900;
}

select,
input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: rgba(247, 248, 244, 0.95);
  color: var(--ink);
  padding: 0 12px;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  overflow: hidden;
}

.quick-chips button,
.ghost-button {
  max-width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: rgba(247, 248, 244, 0.08);
  color: var(--chalk);
  padding: 0 13px;
  font-weight: 900;
}

.quick-chips button:hover,
.ghost-button:hover {
  background: rgba(247, 248, 244, 0.16);
}

.matchday-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 920px;
  border-top: 1px solid var(--line-dark);
  padding-top: 20px;
}

.matchday-summary article,
.feed-ribbon article {
  min-width: 0;
}

.matchday-summary span,
.feed-ribbon span,
.match-card header,
.match-meta,
.watchlist-items span {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.matchday-summary span {
  color: rgba(247, 248, 244, 0.64);
}

.matchday-summary strong,
.feed-ribbon strong {
  display: block;
  margin: 7px 0;
  overflow-wrap: anywhere;
  font-size: 1.28rem;
}

.matchday-summary small {
  color: rgba(247, 248, 244, 0.7);
}

.watchlist-card {
  position: sticky;
  top: 86px;
  align-self: start;
  border: 1px solid rgba(247, 248, 244, 0.28);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 22px;
}

.watchlist-card .eyebrow {
  color: var(--red);
}

.watchlist-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.watchlist-head h2 {
  font-size: 1.55rem;
}

.watchlist-card .ghost-button {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--ink);
}

.watchlist-items {
  display: grid;
  margin: 14px 0 18px;
}

.watchlist-items article,
.empty-plan {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.watchlist-items strong {
  display: block;
  margin-bottom: 6px;
}

.watch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.watch-actions button,
.match-card footer button {
  min-height: 44px;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.watch-actions button:last-child {
  background: var(--red);
}

.microcopy {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.feed-ribbon {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(12, 45, 35, 0.08);
}

.feed-ribbon article {
  padding: 18px clamp(16px, 4vw, 56px);
  border-right: 1px solid var(--line);
}

.feed-ribbon article:last-child {
  border-right: 0;
}

.feed-ribbon strong {
  font-size: 1.18rem;
}

.feed-ribbon small {
  color: var(--ink-soft);
}

.schedule-section {
  padding: 34px clamp(16px, 4vw, 56px) 28px;
  background: var(--chalk);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 16px;
}

.section-head p:last-child {
  max-width: 620px;
  margin-bottom: 6px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.match-list {
  display: grid;
  gap: 10px;
}

.match-card {
  display: grid;
  grid-template-columns: minmax(160px, 0.68fr) minmax(300px, 1.45fr) minmax(190px, 0.85fr) minmax(170px, 0.55fr);
  gap: 16px;
  align-items: center;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.match-card.selected {
  border-color: rgba(15, 122, 79, 0.64);
  box-shadow: 0 10px 26px rgba(15, 122, 79, 0.12);
}

.match-card header {
  display: grid;
  gap: 8px;
}

.match-card time {
  color: var(--ink);
  font-weight: 900;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(229, 185, 73, 0.22);
  color: #6a4c05;
  font-weight: 900;
}

.status-pill.live,
.status-pill.next-up {
  background: rgba(211, 61, 47, 0.13);
  color: var(--red);
}

.status-pill.final {
  background: rgba(23, 36, 31, 0.09);
  color: var(--ink);
}

.teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.team-token {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.team-token img,
.flag-fallback {
  flex: 0 0 auto;
  width: 42px;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 4px;
  object-fit: cover;
  background: var(--surface-muted);
}

.flag-fallback {
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.team-token span {
  min-width: 0;
}

.team-token strong {
  display: block;
  overflow-wrap: anywhere;
}

.team-token small {
  color: var(--ink-soft);
  font-weight: 800;
}

.versus {
  min-width: 48px;
  border-radius: 999px;
  background: var(--pitch-2);
  color: var(--chalk);
  padding: 8px 10px;
  text-align: center;
  font-weight: 900;
}

.match-meta {
  display: grid;
  gap: 5px;
  color: var(--ink-soft);
}

.match-card footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.match-card footer a {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 900;
}

.empty-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
}

.empty-card strong,
.empty-card span {
  display: block;
}

.empty-card span {
  margin-top: 8px;
  color: var(--ink-soft);
}

.utility-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 clamp(16px, 4vw, 56px) 32px;
  background: var(--chalk);
}

.utility-band article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 24px;
}

.utility-band p,
.source-table td {
  color: var(--ink-soft);
  line-height: 1.55;
}

.source-table {
  margin: 0 clamp(16px, 4vw, 56px) 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 1180px) {
  h1 {
    font-size: 3.55rem;
  }

  .matchday-board,
  .match-card {
    grid-template-columns: 1fr;
  }

  .watchlist-card {
    position: static;
  }

  .match-card footer {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  body {
    background: var(--chalk);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .matchday-board {
    padding-top: 28px;
  }

  .board-kicker {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 2.02rem;
    line-height: 1.05;
  }

  h2 {
    font-size: 1.42rem;
  }

  .intro {
    font-size: 1rem;
  }

  .control-grid,
  .matchday-summary,
  .watch-actions,
  .feed-ribbon,
  .utility-band {
    grid-template-columns: 1fr;
  }

  .feed-ribbon article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .feed-ribbon article:last-child {
    border-bottom: 0;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .teams {
    grid-template-columns: 1fr;
  }

  .team-token {
    justify-content: space-between;
  }

  .team-token span {
    text-align: right;
  }

  .versus {
    justify-self: center;
  }

  .match-card footer {
    grid-template-columns: 1fr;
  }
}
