:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #63716c;
  --line: #dce5df;
  --panel: #ffffff;
  --field: #f5f8f6;
  --green: #0d7a52;
  --green-dark: #063d35;
  --red: #c73434;
  --gold: #dba849;
  --blue: #1e5b9b;
  --shadow: 0 18px 45px rgba(10, 41, 33, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f2f6f3;
  color: var(--ink);
}

.identity-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(6, 31, 27, 0.72);
  backdrop-filter: blur(10px);
}

.identity-modal.active {
  display: grid;
}

.identity-panel {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.identity-panel h2 {
  margin-bottom: 16px;
}

.identity-panel .text-button {
  width: 100%;
}

.identity-access-pin {
  width: 100%;
  margin-bottom: 10px;
  -webkit-text-security: disc;
  text-security: disc;
}

button,
input,
select {
  font: inherit;
}

.hero {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  color: #ffffff;
  background:
    linear-gradient(110deg, rgba(5, 36, 31, 0.96) 0%, rgba(6, 61, 53, 0.9) 44%, rgba(12, 117, 80, 0.62) 100%),
    #073c33;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 88px;
  background: #f2f6f3;
  clip-path: polygon(0 62%, 100% 18%, 100% 100%, 0 100%);
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.identity-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  max-width: 190px;
  overflow: hidden;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-logout {
  cursor: pointer;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: #fff4cf;
}

.tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.tab,
.icon-button {
  border: 0;
  cursor: pointer;
}

.tab {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  font-weight: 700;
}

.tab.active {
  color: var(--green-dark);
  background: #ffffff;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  margin: 58px auto 0;
  padding-bottom: 96px;
}

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

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 5.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.hero-stats div {
  min-width: 136px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
}

.hero-stats strong {
  display: block;
  font-size: 1.65rem;
}

.hero-stats span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
}

.hero-art {
  position: absolute;
  right: max(16px, calc((100vw - 1180px) / 2));
  bottom: 52px;
  width: min(41vw, 480px);
  aspect-ratio: 1.18;
  opacity: 0.95;
}

.oracle-board {
  position: absolute;
  inset: 4% 9% 8% 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 244, 207, 0.34), rgba(255, 244, 207, 0) 34%),
    linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04)),
    #0b503f;
  box-shadow: var(--shadow);
  transform: rotate(-5deg);
}

.oracle-board::before,
.oracle-board::after {
  content: "";
  position: absolute;
  border-radius: inherit;
}

.oracle-board::before {
  inset: 16px;
  border: 2px solid rgba(255, 255, 255, 0.24);
}

.oracle-board::after {
  inset: auto 10% 13%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.oracle-orbit {
  position: absolute;
  width: 62%;
  aspect-ratio: 1;
  border: 3px solid rgba(255, 244, 207, 0.72);
  border-radius: 50%;
}

.oracle-orbit::before,
.oracle-orbit::after {
  content: "";
  position: absolute;
  inset: 18%;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
}

.oracle-orbit::after {
  inset: 45% -20%;
  height: 0;
  transform: rotate(-18deg);
}

.oracle-score {
  position: relative;
  z-index: 2;
  color: #fff4cf;
  font-size: clamp(3.2rem, 7vw, 5.6rem);
  font-weight: 1000;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.oracle-lines {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 19%;
  display: grid;
  gap: 7px;
}

.oracle-lines span {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.oracle-lines span:nth-child(2) {
  width: 78%;
}

.oracle-lines span:nth-child(3) {
  width: 54%;
}

.slip-stack {
  position: absolute;
  right: 8%;
  bottom: 2%;
  display: grid;
  gap: 10px;
}

.slip {
  width: 118px;
  padding: 14px 18px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  box-shadow: var(--shadow);
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
  transform: rotate(4deg);
}

.slip.gold {
  background: var(--gold);
  color: #2f2107;
  transform: rotate(-8deg);
}

.slip.red {
  background: var(--red);
  transform: rotate(6deg);
}

main {
  position: relative;
  z-index: 3;
  width: min(1180px, calc(100% - 32px));
  margin: -42px auto 56px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  letter-spacing: 0;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

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

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-dark);
  background: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.text-button.primary-action {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: #ffffff;
}

.text-button:disabled {
  color: var(--muted);
  background: #e9efeb;
  cursor: not-allowed;
}

.text-button.danger {
  color: var(--red);
}

.day-step {
  min-width: 96px;
}

.file-button input {
  display: none;
}

.admin-only {
  display: none;
}

.admin-unlocked .admin-only {
  display: inline-flex;
}

.status-line {
  min-height: 22px;
  margin: -6px 0 12px;
  color: var(--muted);
  font-weight: 800;
}

.scoring-note {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.scoring-note summary {
  cursor: pointer;
  font-weight: 900;
}

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

select,
input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.pin-input {
  width: 92px;
  padding: 0 10px;
  font-weight: 900;
}

select {
  padding: 0 38px 0 12px;
  font-weight: 800;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: var(--green-dark);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(14, 44, 37, 0.1);
  font-size: 1.3rem;
}

.leaderboard-wrap,
.match-card,
.bet-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 28px rgba(19, 55, 45, 0.08);
}

.leaderboard-wrap {
  overflow-x: auto;
}

.leaderboard {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

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

td {
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.player-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.rank-player {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.rank-player > strong {
  min-width: 18px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--green);
  font-size: 0.84rem;
}

.progress {
  width: 100%;
  height: 8px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8eee9;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.overview-matchday {
  margin-top: 22px;
}

.section-head.compact {
  margin-top: 28px;
}

.day-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.day-button {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 68px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(19, 55, 45, 0.06);
  cursor: pointer;
  text-align: left;
}

.day-button strong {
  font-size: 0.9rem;
}

.day-button span,
.day-button small,
.day-button em {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  font-style: normal;
}

.day-button.active {
  border-color: var(--green);
  color: #ffffff;
  background: var(--green);
}

.day-button.active span,
.day-button.active small,
.day-button.active em {
  color: rgba(255, 255, 255, 0.82);
}

.prediction-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
}

.prediction-match {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 28px rgba(19, 55, 45, 0.08);
}

.prediction-match header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 900;
}

.prediction-match header strong {
  color: var(--green);
}

.prediction-picks {
  display: grid;
  gap: 5px;
}

.prediction-picks div {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--field);
  font-size: 0.82rem;
  font-weight: 900;
}

.prediction-picks span {
  color: var(--muted);
  font-size: 0.72rem;
}

.payment-badge {
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid rgba(180, 45, 38, 0.28);
  border-radius: 999px;
  background: rgba(180, 45, 38, 0.1);
  color: #8d241f;
  font: inherit;
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.payment-badge.paid {
  border-color: rgba(46, 125, 88, 0.35);
  background: rgba(46, 125, 88, 0.14);
  color: #1f6c49;
}

.payment-badge:disabled {
  cursor: default;
  opacity: 1;
}

.prediction-picks strong {
  text-align: center;
}

.prediction-picks small {
  color: var(--green);
  font-size: 0.68rem;
}

.match-list,
.bet-grid {
  display: grid;
  gap: 12px;
}

.match-card {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr) minmax(180px, auto);
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 900;
}

.flag {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--field);
  font-size: 1.1rem;
}

.team span:last-child {
  overflow-wrap: anywhere;
}

.versus {
  color: var(--muted);
  font-weight: 900;
}

.score-row {
  display: grid;
  grid-template-columns: 62px 22px 62px;
  align-items: center;
  justify-content: end;
  gap: 7px;
}

.score-row input {
  width: 62px;
  padding: 0 8px;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 900;
}

.dash {
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.match-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.mini-tag {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--field);
}

.prediction-submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -4px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.prediction-submit-bar strong,
.prediction-submit-bar span {
  display: block;
}

.prediction-submit-bar span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

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

.submitted-tag {
  color: var(--green-dark);
}

.locked-tag {
  color: var(--red);
}

.lock-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green-dark);
  background: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

input:disabled {
  color: var(--muted);
  background: #e9efeb;
  cursor: not-allowed;
}

.bet-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.bet-card {
  padding: 16px;
}

.bet-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.bet-card h3,
.bet-card-head strong {
  margin: 0;
}

.bet-card-head > strong {
  color: var(--green);
  font-size: 1.45rem;
}

.bet-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.bet-summary div {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 28px rgba(19, 55, 45, 0.08);
}

.acca-picks {
  display: grid;
  gap: 8px;
}

.acca-picks div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: var(--field);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.acca-picks span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.acca-picks strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 1.02rem;
}

.pot-total span,
.bet-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pot-total strong,
.bet-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 1.12rem;
}

.pot-total {
  min-width: 170px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: right;
}

@media (max-width: 780px) {
  .hero {
    min-height: 620px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    flex-wrap: wrap;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
  }

  .tab {
    flex: 1 0 auto;
  }

  .hero-copy {
    margin-top: 30px;
  }

  .hero-art {
    right: 16px;
    bottom: 72px;
    width: min(88vw, 430px);
    opacity: 0.55;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .controls,
  .pot-total,
  .utility-actions,
  .prediction-submit-bar {
    justify-content: stretch;
    text-align: left;
  }

  .text-button,
  .file-button {
    flex: 1 1 auto;
  }

  .controls select {
    width: 100%;
  }

  .day-step {
    min-width: 0;
  }

  .prediction-submit-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .prediction-submit-actions {
    justify-content: stretch;
  }

  .leaderboard-wrap {
    overflow-x: visible;
  }

  .leaderboard th,
  .leaderboard td {
    padding: 12px 8px;
  }

  .leaderboard th {
    font-size: 0.68rem;
  }

  .leaderboard td {
    font-size: 0.88rem;
  }

  .leaderboard .player-name {
    display: none;
  }

  .leaderboard .player-pill {
    gap: 0;
  }

  .leaderboard .rank-player {
    gap: 8px;
  }

  .leaderboard .avatar {
    width: 36px;
    height: 36px;
    font-size: 0.72rem;
  }

  .leaderboard .progress {
    height: 6px;
  }

  .prediction-board {
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 7px;
  }

  .day-selector {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 6px;
  }

  .day-button {
    min-height: 58px;
    padding: 7px;
  }

  .day-button strong {
    font-size: 0.78rem;
  }

  .day-button span,
  .day-button small,
  .day-button em {
    font-size: 0.64rem;
  }

  .prediction-match {
    padding: 7px;
  }

  .prediction-match header {
    margin-bottom: 6px;
    font-size: 0.82rem;
  }

  .prediction-picks div {
    grid-template-columns: 24px 1fr;
    min-height: 22px;
    padding: 3px 4px;
    font-size: 0.72rem;
  }

  .payment-badge {
    min-height: 18px;
    padding: 2px 4px;
    font-size: 0.56rem;
  }

  .prediction-picks small {
    display: none;
  }

  .bet-card-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .score-row {
    grid-column: 1 / -1;
    justify-content: stretch;
    grid-template-columns: 1fr 22px 1fr;
  }

  .score-row input {
    width: 100%;
  }
}
