:root {
  --navy: #0b1f33;
  --navy-2: #102b46;
  --sand: #efe4d0;
  --cream: #f8f4ec;
  --gold: #c99a38;
  --blue: #215fa6;
  --white: #ffffff;
  --ink: #17212b;
  --muted: #66717b;
  --line: #d9ddd9;
  --shadow: 0 12px 36px rgba(11, 31, 51, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--cream);
}

body.locked {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.container {
  width: min(1500px, calc(100% - 28px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11, 31, 51, 0.97);
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: 11px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link,
.small-btn {
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.nav-link:hover,
.small-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.hero {
  padding: 54px 0 42px;
  background: radial-gradient(circle at 50% 0%, rgba(201, 154, 56, 0.19), transparent 34%), linear-gradient(135deg, #102b46, #0b1f33 60%, #071522);
  color: var(--white);
}

.hero-title {
  margin-bottom: 30px;
  text-align: center;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
  font-weight: 900;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 1;
}

.overall-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: stretch;
  max-width: 1000px;
  margin: 0 auto;
}

.team-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

.team-score.blue {
  background: var(--blue);
}

.team-score.gold {
  background: var(--gold);
  color: #17130a;
}

.team-score input {
  width: 100%;
  max-width: 260px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-weight: 900;
  font-size: clamp(18px, 3vw, 28px);
  text-transform: uppercase;
}

.team-score.gold input {
  text-align: right;
}

.big-score {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 6vw, 76px);
  line-height: 1;
  font-weight: 700;
}

.score-divider {
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.75);
}

.score-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.team-score.gold .score-breakdown {
  justify-content: flex-end;
}

.score-pill {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.team-score.gold .score-pill {
  background: rgba(11, 31, 51, 0.1);
  border-color: rgba(11, 31, 51, 0.14);
}

.team-label-wrap {
  flex: 1;
  min-width: 0;
}

.team-score.gold .team-label-wrap {
  text-align: right;
}

.round-filter-wrap {
  padding: 0 0 28px;
  background: var(--navy);
}

.win-target-wrap {
  padding: 0 0 26px;
  background: var(--navy);
}

.win-target {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 700px;
  margin: 0 auto;
  padding: 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
  text-align: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.win-target-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.win-target-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 700;
}

.win-target-winner {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.win-target.winner-blue,
.win-target.projected-blue {
  border-color: rgba(33, 95, 166, 0.6);
  background: rgba(33, 95, 166, 0.22);
}

.win-target.winner-gold,
.win-target.projected-gold {
  border-color: rgba(201, 154, 56, 0.6);
  background: rgba(201, 154, 56, 0.22);
}

.win-target.winner-blue .win-target-winner,
.win-target.winner-gold .win-target-winner {
  color: var(--white);
}

.round-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
}

.round-filter button {
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.round-filter button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.round-filter button.active {
  background: #d9dde2;
  border-color: #d9dde2;
  color: var(--navy);
}

.content {
  padding: 34px 0 80px;
}

.session {
  margin-bottom: 42px;
  scroll-margin-top: 88px;
}

.session.is-hidden {
  display: none;
}

.session-card {
  overflow: hidden;
  border: 1px solid rgba(11, 31, 51, 0.1);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.session-head {
  padding: 22px;
  background: #f2f2ef;
  border-bottom: 1px solid var(--line);
}

.session-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.session-head h2 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 42px);
}

.session-points {
  white-space: nowrap;
  color: var(--navy);
  font-weight: 900;
}

.round-format {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.round-meta-static {
  display: grid;
  grid-template-columns: 1.25fr 0.8fr;
  gap: 12px;
  margin-top: 15px;
}

.meta-box {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.meta-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.meta-value {
  min-height: 20px;
  font-weight: 800;
  color: var(--ink);
}

.match-card {
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.match-card:first-of-type {
  border-top: 0;
}

.match-top {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: #fbfbf9;
}

.side-name.gold {
  display: flex;
  justify-content: flex-end;
}

.pair-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
}

.side-name.gold .pair-input {
  text-align: right;
}

.pair-static {
  display: flex;
  align-items: center;
  min-height: 39px;
  cursor: default;
}

.side-name.gold .pair-static {
  justify-content: flex-end;
}

.side-name .pair-static.blue-name {
  border-color: rgba(33, 95, 166, 0.42);
  background: rgba(33, 95, 166, 0.18);
  color: #123f73;
}

.side-name.gold .pair-static.gold-name {
  border-color: rgba(201, 154, 56, 0.5);
  background: rgba(201, 154, 56, 0.22);
  color: #6b4a08;
}

.match-status {
  min-width: 145px;
  padding: 8px 14px;
  border-radius: 14px;
  color: var(--navy);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.match-status.status-won-blue {
  background: var(--blue);
  color: var(--white);
}

.match-status.status-won-gold {
  background: var(--gold);
  color: #17130a;
}

.match-status.status-halved {
  background: rgba(11, 31, 51, 0.1);
}

.match-status.status-won-blue small,
.match-status.status-won-gold small,
.match-status.status-halved small {
  color: inherit;
  opacity: 0.75;
}

.match-status small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.table-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
}

.score-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0;
}

.score-table th,
.score-table td {
  border-right: 1px solid #e5e7e5;
  border-bottom: 1px solid #e5e7e5;
  text-align: center;
}

.score-table th:last-child,
.score-table td:last-child {
  border-right: 0;
}

.score-table thead th {
  height: 34px;
  background: #f7f7f4;
  color: #69737c;
  font-size: 11px;
  font-weight: 900;
}

.score-table .label-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 90px;
  min-width: 90px;
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.score-table thead .label-cell {
  background: var(--navy);
}

.par-row .label-cell {
  background: #6b746d;
}

.blue-row .label-cell {
  background: var(--blue);
}

.gold-row .label-cell {
  background: var(--gold);
  color: #17130a;
}

.hole-cell {
  height: 48px;
  min-width: 47px;
  padding: 0;
}

.hole-cell input {
  width: 100%;
  height: 48px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  font-weight: 900;
  appearance: textfield;
  -moz-appearance: textfield;
}

.hole-cell input::-webkit-inner-spin-button,
.hole-cell input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.par-cell input {
  height: 38px;
  color: var(--ink);
}

.par-value {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  color: var(--muted);
  font-weight: 900;
}

.total-cell {
  font-weight: 900;
  color: var(--navy);
}

.blue-win {
  background: rgba(33, 95, 166, 0.12);
}

.gold-win {
  background: rgba(201, 154, 56, 0.14);
}

.match-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 14px 16px 18px;
  color: var(--muted);
  font-size: 13px;
}

.match-footer-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.match-footer .clear-match,
.match-footer .lock-match {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid rgba(11, 31, 51, 0.18);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font-weight: 800;
  cursor: pointer;
}

.match-footer .clear-match:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.match-footer .lock-match.is-active {
  border-color: rgba(201, 154, 56, 0.5);
  background: rgba(201, 154, 56, 0.14);
}

.match-card.is-locked .hole-cell input[disabled] {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  opacity: 1;
}

.save-indicator {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(11, 31, 51, 0.9);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.save-indicator.show {
  opacity: 1;
  transform: translateY(0);
}

#passwordGate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 25%, rgba(201, 154, 56, 0.2), transparent 34%), linear-gradient(135deg, #102b46, #0b1f33 60%, #071522);
  color: var(--white);
}

.password-box {
  width: min(430px, 100%);
  padding: 38px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.gate-logo {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-weight: 900;
}

.password-box h2 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
}

.password-box p {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.68);
}

.password-box input {
  width: 100%;
  height: 52px;
  margin-bottom: 14px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  text-align: center;
}

.password-box button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  background: var(--sand);
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
}

.password-error {
  min-height: 24px;
  margin-top: 12px;
  color: #ffb5b5;
  font-size: 14px;
}

@media (max-width: 800px) {
  .topbar-inner {
    flex-wrap: wrap;
    row-gap: 10px;
    padding: 12px 0;
    min-height: 0;
  }

  .brand {
    flex: 1 1 100%;
  }

  .nav-actions {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .overall-score {
    grid-template-columns: 1fr;
  }

  .score-divider {
    display: none;
  }

  .team-score.gold {
    flex-direction: row-reverse;
  }

  .team-score.gold input {
    text-align: left;
  }

  .team-score.gold .team-label-wrap {
    text-align: left;
  }

  .session-headline,
  .round-meta-static {
    display: grid;
    grid-template-columns: 1fr;
  }

  .match-top {
    grid-template-columns: 1fr;
  }

  .side-name.gold {
    justify-content: initial;
  }

  .side-name.gold .pair-input {
    text-align: left;
  }

  .match-status {
    order: -1;
  }
}

@media (max-width: 520px) {
  .brand span:last-child {
    display: none;
  }
}
