:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #15202b;
  --muted: #5d6975;
  --line: #d9e1e8;
  --panel: #ffffff;
  --page: #f4f7f8;
  --accent: #0b7a75;
  --accent-strong: #075f5b;
  --gold: #b88114;
  --rose: #b23a48;
  --blue: #245b96;
  --shadow: 0 18px 45px rgba(26, 41, 55, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(11, 122, 117, 0.08), transparent 320px),
    var(--page);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.topbar {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 340px);
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--rose);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.1rem;
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: end;
  gap: 12px;
}

.identity {
  display: grid;
  gap: 6px;
  width: min(340px, 100%);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--accent-strong);
  padding: 0 14px;
  font-weight: 850;
  text-decoration: none;
}

.nav-link:hover {
  border-color: var(--accent);
}

label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(11, 122, 117, 0.22);
  outline-offset: 2px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.status-strip > div,
.icon-button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 24px rgba(26, 41, 55, 0.05);
}

.status-strip > div {
  display: flex;
  gap: 7px;
  align-items: baseline;
  padding: 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.metric {
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 900;
}

.icon-button {
  width: 86px;
  padding: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.workspace {
  display: block;
}

.predictor-panel,
.side-panel > section,
.league-page,
.rules-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.predictor-panel {
  padding: 16px;
}

.side-panel {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 18px;
}

.side-panel > section {
  padding: 14px;
}

.league-page,
.rules-page {
  padding: 16px;
  margin-bottom: 18px;
}

.section-heading {
  display: flex;
  min-height: 44px;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.section-heading.compact {
  min-height: 28px;
}

.message {
  min-height: 22px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.message.error {
  color: var(--rose);
}

.round-group {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.round-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.match-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.match-card.locked {
  background: #f8fafb;
}

.match-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.team-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 10px;
  align-items: center;
  min-height: 42px;
}

.team {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.score-input {
  text-align: center;
  font-weight: 900;
}

.match-meta {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 6px;
  min-width: 90px;
}

.badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #edf2f6;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.status.final {
  background: rgba(184, 129, 20, 0.14);
  color: var(--gold);
}

.result {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}

.draw-options {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.5fr);
  gap: 8px;
}

.draw-options[hidden] {
  display: none;
}

.leaderboard {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}

.leaderboard-large li {
  grid-template-columns: 56px minmax(0, 1fr) 90px minmax(150px, auto);
  min-height: 58px;
}

.leaderboard li:last-child {
  border-bottom: 0;
}

.rank {
  color: var(--gold);
  font-size: 1rem;
  font-weight: 900;
}

.player {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.points {
  font-weight: 950;
}

.subtle {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.rules dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.rules dl > div,
.multipliers {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-weight: 750;
}

.rules dd {
  margin: 0;
  color: var(--ink);
  font-weight: 950;
}

.multipliers {
  flex-wrap: wrap;
  margin-top: 14px;
  justify-content: flex-start;
}

.multipliers span {
  border-radius: 999px;
  background: #eef5f2;
  color: var(--accent-strong);
  padding: 5px 9px;
  font-size: 0.78rem;
}

.empty {
  padding: 36px 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

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

  .side-panel {
    position: static;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 16px;
  }

  .topbar,
  .status-strip,
  .match-grid,
  .side-panel,
  .header-actions {
    grid-template-columns: 1fr;
  }

  .header-actions {
    display: grid;
    justify-content: stretch;
  }

  .status-strip {
    gap: 8px;
  }

  .icon-button {
    width: 100%;
  }

  .leaderboard-large li {
    grid-template-columns: 46px minmax(0, 1fr) auto;
  }

  .leaderboard-large .subtle {
    grid-column: 2 / -1;
  }

  .match-card {
    grid-template-columns: 1fr;
  }

  .match-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .draw-options {
    grid-template-columns: 1fr;
  }
}
