:root {
  color-scheme: light;
  --bg: #f4f7f4;
  --surface: #ffffff;
  --surface-2: #f8fbf8;
  --ink: #111827;
  --muted: #667085;
  --line: #d8e2dc;
  --green: #0f4d31;
  --green-2: #197447;
  --blue: #245f9f;
  --gold: #c88718;
  --red: #b4233a;
  --amber-bg: #fff6d8;
  --shadow: 0 18px 48px rgba(18, 40, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    linear-gradient(180deg, rgba(15, 77, 49, 0.08), transparent 280px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button,
.primary-link {
  align-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  text-decoration: none;
}

button {
  background: #e9f2ec;
  color: var(--green);
}

button:hover,
.primary-link:hover {
  filter: brightness(0.97);
}

.primary-link {
  background: #ffffff;
  color: var(--green);
}

.app-header {
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  left: 0;
  min-height: 72px;
  padding: 12px 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 12px;
  min-width: max-content;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--green);
  border-radius: 8px;
  color: #fff;
  display: grid;
  font-weight: 950;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.nav-links a {
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  padding: 8px 12px;
  text-decoration: none;
}

.nav-links a:hover {
  background: #edf5ef;
  color: var(--green);
}

.shell {
  margin: 0 auto;
  max-width: 1320px;
  padding: 28px;
}

.hero {
  background:
    linear-gradient(115deg, rgba(15, 77, 49, 0.97), rgba(36, 95, 159, 0.9)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1400 620'%3E%3Crect width='1400' height='620' fill='%23197447'/%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.25' stroke-width='8'%3E%3Cpath d='M700 0v620'/%3E%3Ccircle cx='700' cy='310' r='116'/%3E%3Crect x='50' y='145' width='220' height='330' rx='4'/%3E%3Crect x='1130' y='145' width='220' height='330' rx='4'/%3E%3Cpath d='M50 242h78v136H50M1350 242h-78v136h78'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.13'%3E%3Ccircle cx='280' cy='180' r='28'/%3E%3Ccircle cx='1080' cy='430' r='34'/%3E%3Ccircle cx='840' cy='120' r='18'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #fff;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  min-height: 340px;
  overflow: hidden;
  padding: 38px;
}

.eyebrow {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(3.2rem, 9vw, 7.4rem);
  line-height: 0.88;
  margin-bottom: 18px;
}

h2 {
  font-size: 1.28rem;
  margin-bottom: 5px;
}

.intro {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.12rem;
  line-height: 1.58;
  max-width: 660px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-actions button {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}

.hero-panel {
  align-self: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  display: grid;
  min-height: 102px;
  padding: 18px;
}

.stat span {
  font-size: 2.05rem;
  font-weight: 950;
}

.stat small {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 850;
}

.controls {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 0.82fr);
  margin-top: 22px;
}

.control-block,
.board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(18, 40, 31, 0.07);
}

.control-block {
  padding: 18px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  font-weight: 900;
  gap: 7px;
  text-transform: uppercase;
}

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

.automation-grid div,
.rules-grid article {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 82px;
  padding: 13px;
}

.automation-grid strong,
.rules-grid strong {
  color: var(--green);
  display: block;
  font-size: 1.42rem;
  font-weight: 950;
}

.automation-grid span,
.rules-grid span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rules-grid p {
  color: var(--muted);
  line-height: 1.45;
  margin: 8px 0 0;
}

.prize-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.prize-strip div {
  align-items: center;
  background: var(--amber-bg);
  border: 1px solid rgba(200, 135, 24, 0.42);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  min-height: 56px;
  padding: 12px 14px;
}

.prize-strip span {
  color: #7a4d00;
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.prize-strip strong {
  color: #7a4d00;
  font-size: 1.48rem;
  font-weight: 950;
}

.bonus-rules {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  overflow: hidden;
}

.bonus-rules div {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 12px;
}

.bonus-rules div + div {
  border-top: 1px solid var(--line);
}

.bonus-rules span {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.bonus-rules strong {
  color: var(--blue);
  font-weight: 950;
}

input,
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 44px;
  padding: 9px 11px;
  width: 100%;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(36, 95, 159, 0.28);
  outline-offset: 2px;
}

input[readonly],
select:disabled {
  background: #f7faf8;
  color: var(--ink);
  opacity: 1;
}

.button-row,
.filters,
.fixture-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.filter,
.fixture-filter {
  background: #edf3f0;
  color: var(--green);
}

.filter.active,
.fixture-filter.active {
  background: var(--green);
  color: #fff;
}

.board {
  margin-top: 22px;
  overflow: hidden;
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px 18px 0;
}

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

.fixtures-board {
  padding: 0;
}

.fixture-table-wrap {
  max-height: 680px;
  overflow: auto;
  padding: 16px 18px 18px;
}

.fixture-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1080px;
  width: 100%;
}

.fixture-table th,
.fixture-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: middle;
}

.fixture-table th:first-child,
.fixture-table td:first-child {
  border-left: 1px solid var(--line);
}

.fixture-table th {
  background: var(--green);
  color: #fff;
  font-size: 0.94rem;
  position: sticky;
  text-align: left;
  top: 0;
  z-index: 2;
}

.fixture-table th:nth-child(3),
.fixture-table td.match-cell,
.fixture-table td.score-cell,
.fixture-table td.fixture-cell {
  text-align: center;
}

.fixture-table td {
  background: #fff;
  font-size: 0.92rem;
}

.fixture-table tr.live-row td {
  background: #fff8df;
}

.fixture-table tr.finished-row td {
  background: #f8fbf8;
}

.fixture-table td.owner-cell {
  font-weight: 900;
  text-align: center;
}

.fixture-table td.guaranteed {
  background: #ffd966;
}

.fixture-table .score-cell {
  font-weight: 950;
  white-space: nowrap;
}

.fixture-table .status-pill {
  border-radius: 999px;
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 950;
  padding: 5px 9px;
  text-transform: uppercase;
}

.status-live {
  background: #ffe5e9;
  color: #a4122f;
}

.status-finished {
  background: #e9f6ec;
  color: var(--green);
}

.status-timed {
  background: #eef2f6;
  color: #334155;
}

.empty-cell {
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.leaderboard {
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
}

.leader-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 42px 1fr auto;
  min-height: 62px;
  padding: 10px 12px;
}

.rank {
  align-items: center;
  background: #e9f6ec;
  border-radius: 999px;
  color: var(--green);
  display: grid;
  font-weight: 950;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.leader-name {
  font-weight: 950;
}

.leader-meta,
.score {
  color: var(--muted);
  font-size: 0.92rem;
}

.score {
  color: var(--green);
  font-weight: 950;
  text-align: right;
}

.leader-prize {
  color: #8a5a00;
  display: block;
  font-size: 0.78rem;
  font-weight: 950;
  margin-top: 2px;
  text-transform: uppercase;
}

.rules-board {
  padding-bottom: 18px;
}

.rules-grid {
  padding: 16px 18px 0;
}

.teams-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  padding: 16px 18px 18px;
}

.team-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.team-card.out {
  opacity: 0.62;
}

.team-card.winner {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px rgba(200, 135, 24, 0.24);
}

.team-topline,
.badge {
  align-items: center;
  display: flex;
}

.team-topline {
  justify-content: space-between;
}

.badge {
  gap: 9px;
  font-weight: 950;
}

.flag {
  font-size: 1.55rem;
  line-height: 1;
}

.group {
  background: #edf5f0;
  border-radius: 999px;
  color: var(--green);
  padding: 5px 9px;
}

.status {
  max-width: 110px;
}

.mini-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.toast {
  background: var(--ink);
  border-radius: 8px;
  bottom: 22px;
  color: #fff;
  font-weight: 850;
  left: 50%;
  padding: 12px 16px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 30;
}

.app-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 14px;
  justify-content: center;
  padding: 24px 14px 32px;
}

.app-footer a {
  color: var(--green);
  font-weight: 850;
  text-decoration: none;
}

.legal-page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  line-height: 1.6;
  margin: 32px auto;
  max-width: 860px;
  padding: 28px;
}

.legal-page h1 {
  color: var(--green);
  font-size: clamp(2.2rem, 8vw, 4rem);
}

@media (max-width: 920px) {
  .app-header {
    align-items: flex-start;
    display: grid;
    gap: 10px;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero,
  .controls {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 28px;
  }

  .automation-grid,
  .rules-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .shell {
    padding: 14px;
  }

  .app-header {
    padding: 10px 14px;
  }

  .nav-links a {
    padding: 7px 9px;
  }

  .hero {
    min-height: auto;
    padding: 22px;
  }

  h1 {
    font-size: clamp(2.8rem, 18vw, 4.8rem);
  }

  .hero-panel,
  .prize-strip {
    grid-template-columns: 1fr 1fr;
  }

  .section-heading {
    align-items: start;
    display: grid;
  }

  .leader-row {
    grid-template-columns: 36px 1fr;
  }

  .score {
    grid-column: 2;
    text-align: left;
  }
}
