:root {
  color-scheme: light;
  --grass: #0b3b2e;
  --grass-2: #14614e;
  --grass-3: #0f7c5e;
  --chalk: #f7fbf7;
  --ink: #10231f;
  --muted: #65766f;
  --line: #d6e2dc;
  --surface: #ffffff;
  --wash: #eff5f1;
  --gold: #d3a13a;
  --gold-soft: #fff1c7;
  --red: #b64b3a;
  --blue: #286da8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(211, 161, 58, 0.22), transparent 24%),
    linear-gradient(90deg, rgba(255,255,255,0.22) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(180deg, #e4f0e9 0%, #f8fbf9 42%, #edf6f1 100%);
}

body,
button,
input,
select {
  font: inherit;
}

button,
select,
input {
  border-radius: 8px;
}

button {
  cursor: pointer;
}

.topbar {
  color: var(--chalk);
  background:
    radial-gradient(circle at 72% 24%, rgba(211, 161, 58, 0.36), transparent 18%),
    linear-gradient(135deg, rgba(7,45,35,0.98), rgba(16,124,94,0.94)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0 1px, transparent 1px 72px);
  min-height: 198px;
  padding: 28px clamp(18px, 5vw, 56px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  width: min(62vw, 600px);
  aspect-ratio: 1;
  border: 3px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  right: -140px;
  bottom: -280px;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 8px;
  font-size: clamp(3rem, 9vw, 5.6rem);
  line-height: 0.92;
}

h2 {
  margin-top: 5px;
  font-size: clamp(1.45rem, 4vw, 2.3rem);
}

h3 {
  font-size: 1.05rem;
}

main {
  width: min(1180px, calc(100% - 28px));
  margin: -54px auto 0;
  position: relative;
  z-index: 2;
}

.hero-line {
  width: min(560px, 100%);
  margin: 12px 0 0;
  color: rgba(247, 251, 247, 0.83);
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  line-height: 1.35;
}

.scoreboard,
.view,
.owner-block,
.team-block,
.group-block,
.knockout-round {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(28, 61, 49, 0.09);
}

.scoreboard,
.view {
  padding: clamp(16px, 3vw, 26px);
}

.scoreboard,
.view,
.tabs,
.owner-block,
.team-block,
.group-block,
.knockout-round {
  border-radius: 8px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.share-button,
.text-button,
.tab {
  border: 1px solid rgba(255,255,255,0.36);
  background: rgba(255,255,255,0.12);
  color: inherit;
  font-weight: 800;
  min-height: 42px;
  padding: 0 14px;
}

.share-button {
  background: var(--gold);
  border-color: rgba(255,255,255,0.2);
  color: #173127;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.share-button:hover,
.tab:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.text-button {
  color: var(--grass);
  background: var(--wash);
  border-color: var(--line);
}

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

.standing {
  border: 1px solid rgba(255,255,255,0.74);
  border-top: 5px solid var(--owner-color);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(239,245,241,0.92));
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.standing::after {
  content: "";
  position: absolute;
  width: 72px;
  height: 72px;
  right: -30px;
  bottom: -36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--owner-color) 20%, transparent);
}

.standing-top {
  display: flex;
  align-items: center;
  gap: 7px;
  position: relative;
  z-index: 1;
}

.standing-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 26px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--chalk);
  font-size: 0.78rem;
  font-weight: 900;
}

.standing strong {
  font-size: 1.05rem;
}

.standing-meta,
.standing-record {
  display: block;
  color: var(--muted);
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
}

.standing .points {
  color: var(--ink);
  margin-top: 8px;
  position: relative;
  z-index: 1;
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 900;
  line-height: 1;
}

.standing-record {
  margin-top: 5px;
  font-weight: 800;
  color: var(--grass);
}

.score-status {
  margin: -4px 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

.next-games {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.next-games-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.next-games-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.next-game-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(239,245,241,0.94));
}

.next-game-time strong,
.next-game-time span,
.next-game-owners,
.next-games-empty {
  display: block;
}

.next-game-time strong {
  color: var(--grass);
  font-size: 1rem;
}

.next-game-time span,
.next-game-separator,
.next-games-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.next-game-body {
  min-width: 0;
}

.next-game-owners {
  margin-top: 8px;
  line-height: 1.5;
}

.next-game-owners .owner-pill + .next-game-separator {
  margin-left: 6px;
}

.next-game-separator {
  margin-right: 10px;
}

.score-status strong {
  color: var(--grass);
}

.favourites-board {
  margin-top: 14px;
  border-color: rgba(211, 161, 58, 0.38);
  background:
    linear-gradient(135deg, rgba(255, 241, 199, 0.9), rgba(255,255,255,0.95) 42%),
    var(--surface);
}

.favourites-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(240px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.favourites-layout .table-wrap {
  min-width: 0;
}

.favourites-table {
  font-size: 0.92rem;
}

.favourites-table th,
.favourites-table td {
  padding-left: 10px;
  padding-right: 10px;
}

.favourites-sidebar {
  padding: 12px;
  border: 1px solid rgba(211, 161, 58, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.favourites-sidebar-head {
  margin-bottom: 10px;
}

.favourites-list {
  display: grid;
  gap: 8px;
  max-height: 540px;
  overflow: auto;
  padding-right: 4px;
}

.favourite-team-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(239,245,241,0.88));
}

.favourite-team-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  background: var(--grass);
  color: var(--chalk);
  font-size: 0.76rem;
  font-weight: 900;
}

.favourite-team-body strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.favourite-team-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  color: var(--grass);
  font-size: 0.78rem;
  font-weight: 800;
}

.follow-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: clamp(14px, 3vw, 20px);
  border: 1px solid rgba(20, 97, 78, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(11, 59, 46, 0.97), rgba(15, 124, 94, 0.93));
  color: var(--chalk);
  box-shadow: 0 18px 42px rgba(28, 61, 49, 0.13);
}

.follow-panel h2 {
  margin-top: 4px;
}

.follow-status {
  margin: 8px 0 0;
  max-width: 64ch;
  color: rgba(247, 251, 247, 0.82);
  line-height: 1.45;
}

.follow-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.primary-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 900;
}

.favourites-table td:last-child,
.favourites-table th:last-child {
  text-align: left;
}

.team-odds {
  display: inline-flex;
  margin: 2px 5px 2px 0;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--wash);
  color: var(--grass);
  font-size: 0.76rem;
  font-weight: 800;
}

.tabs {
  margin: 14px 0;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #dfeae4;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 12px 24px rgba(28, 61, 49, 0.08);
}

.tab {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.tab.is-active {
  color: var(--grass);
  background: var(--surface);
  box-shadow: 0 6px 14px rgba(28, 61, 49, 0.08);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.filter {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

select,
input {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 40px;
  padding: 0 10px;
}

.owner-block {
  border-left: 5px solid var(--owner-color);
  margin-bottom: 14px;
  padding: 14px;
}

.owner-summary,
.team-head,
.group-head,
.round-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.owner-summary {
  margin-bottom: 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  color: var(--grass);
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.82rem;
  font-weight: 800;
}

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

.team-block {
  border: 1px solid var(--line);
  overflow: hidden;
}

.team-head {
  padding: 12px;
  background: #f7faf8;
  border-bottom: 1px solid var(--line);
}

.team-meta,
.note,
footer {
  color: var(--muted);
  font-size: 0.9rem;
}

.fixture-list {
  display: grid;
}

.fixture-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 124px 76px;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.fixture-row:last-child {
  border-bottom: 0;
}

.fixture-date {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.match-title {
  display: block;
  font-weight: 800;
}

.match-extra {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  font-size: 0.82rem;
}

.score-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 5px;
  align-items: center;
}

.score-inputs input {
  width: 46px;
  text-align: center;
  padding: 0;
}

.result-badge {
  justify-self: end;
  min-width: 58px;
  text-align: center;
  border-radius: 999px;
  padding: 6px 8px;
  background: #eef2f0;
  color: var(--muted);
  font-weight: 900;
}

.result-badge.win {
  background: #e4f5ea;
  color: #116b38;
}

.result-badge.draw {
  background: #fff5dc;
  color: #93640d;
}

.result-badge.loss {
  background: #fae6e2;
  color: #a23224;
}

.group-grid,
.knockout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.group-block,
.knockout-round {
  overflow: hidden;
}

.group-head,
.round-head {
  padding: 13px 14px;
  background: var(--grass);
  color: var(--chalk);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

td:last-child,
th:last-child {
  text-align: right;
}

.owner-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.owner-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--owner-color);
}

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

.format-strip div {
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfb;
}

.format-strip strong,
.format-strip span {
  display: block;
}

.format-strip span {
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.45;
}

.knockout-list {
  display: grid;
}

.knockout-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.knockout-item:last-child {
  border-bottom: 0;
}

.knockout-item strong,
.knockout-item span {
  display: block;
}

.knockout-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

footer {
  width: min(1180px, calc(100% - 28px));
  margin: 18px auto 36px;
  line-height: 1.5;
}

@media (max-width: 920px) {
  .next-games-list,
  .team-grid,
  .group-grid,
  .knockout-grid,
  .format-strip {
    grid-template-columns: 1fr;
  }

  .owner-standings {
    grid-template-columns: repeat(5, minmax(145px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .standing {
    scroll-snap-align: start;
  }

  .fixture-row {
    grid-template-columns: 66px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .score-inputs {
    grid-column: 2 / 3;
    width: max-content;
  }

  .result-badge {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
  }
}

@media (max-width: 620px) {
  .topbar {
    min-height: 166px;
    flex-direction: column;
    gap: 12px;
    padding: 20px 16px 64px;
  }

  .topbar::after {
    width: 360px;
    right: -172px;
    bottom: -214px;
  }

  h1 {
    font-size: clamp(2.6rem, 17vw, 4.15rem);
  }

  h2 {
    font-size: 1.34rem;
  }

  h3 {
    font-size: 1rem;
  }

  .hero-line {
    font-size: 0.96rem;
    max-width: 28ch;
  }

  .share-button {
    min-height: 38px;
    padding: 0 12px;
  }

  main {
    width: min(100% - 18px, 1180px);
    margin-top: -50px;
  }

  .section-head,
  .owner-summary {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
  }

  .scoreboard,
  .view,
  .follow-panel {
    padding: 13px;
  }

  .score-status,
  .follow-status,
  .note,
  footer {
    font-size: 0.82rem;
  }

  .next-games-head {
    display: grid;
    align-items: start;
  }

  .next-game-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .follow-panel {
    display: grid;
  }

  .follow-actions {
    justify-content: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .primary-button,
  .follow-actions .text-button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.84rem;
  }

  .owner-standings {
    grid-template-columns: repeat(5, 132px);
    gap: 8px;
  }

  .standing {
    padding: 10px;
  }

  .standing strong {
    font-size: 0.95rem;
  }

  .standing-rank {
    min-width: 30px;
    min-height: 24px;
  }

  .standing-meta,
  .standing-record {
    font-size: 0.78rem;
  }

  .favourites-table {
    min-width: 0;
  }

  .favourites-layout {
    grid-template-columns: 1fr;
  }

  .favourites-sidebar {
    padding: 12px;
  }

  .favourites-list {
    max-height: none;
  }

  .favourites-table thead {
    display: none;
  }

  .favourites-table tbody,
  .favourites-table tr,
  .favourites-table td {
    display: block;
  }

  .favourites-table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .favourites-table tr:last-child {
    border-bottom: 0;
  }

  .favourites-table td {
    border-bottom: 0;
    padding: 5px 0;
    white-space: normal;
  }

  .favourites-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .team-odds {
    font-size: 0.76rem;
    padding: 4px 7px;
  }

  .tabs {
    grid-template-columns: repeat(3, 1fr);
    margin: 10px 0;
  }

  .tab {
    min-height: 38px;
    padding: 0 6px;
    font-size: 0.85rem;
  }

  .owner-block {
    padding: 12px;
  }

  .chips {
    max-height: 62px;
    overflow: hidden;
  }

  .chip {
    font-size: 0.72rem;
    padding: 4px 7px;
  }

  .team-head {
    padding: 10px;
  }

  .team-meta,
  .match-extra {
    font-size: 0.76rem;
  }

  .fixture-row {
    grid-template-columns: 52px minmax(0, 1fr) 60px;
    min-height: 48px;
    padding: 8px 9px;
  }

  .fixture-date {
    font-size: 0.72rem;
  }

  .match-title {
    font-size: 0.86rem;
  }

  .score-inputs {
    gap: 3px;
  }

  .score-inputs input {
    width: 36px;
    min-height: 34px;
  }

  .result-badge {
    min-width: 54px;
    padding: 5px 6px;
    font-size: 0.72rem;
  }

  .group-head,
  .round-head {
    padding: 10px 11px;
    font-size: 0.85rem;
  }

  table {
    min-width: 430px;
  }

  th,
  td {
    padding: 8px;
    font-size: 0.82rem;
  }

  .format-strip div,
  .knockout-item {
    padding: 10px 11px;
  }
}
