:root {
  --bg: #f7f6f0;
  --surface: #ffffff;
  --surface-2: #f0efe8;
  --text: #141a17;
  --muted: #68716c;
  --border: #dedbd0;
  --green: #006747;
  --gold: #d7b54a;
  --red: #c0332d;
  --blue: #1a3a6b;
  --shadow: 0 12px 30px rgb(22 26 23 / 0.08);
  --display: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
.button-link {
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-weight: 800;
  padding: 0.68rem 0.9rem;
}

button.secondary,
.button-link.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

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

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

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.78rem 0.8rem;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

th button {
  background: transparent;
  color: inherit;
  padding: 0;
}

main {
  min-height: calc(100svh - 48px);
}

.topbar {
  background: var(--green);
  border-bottom: 1px solid rgb(255 255 255 / 0.13);
  color: white;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  align-items: center;
  display: flex;
  gap: 1rem;
  height: 48px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1160px;
  padding: 0 1rem;
}

.brand {
  font-family: var(--display);
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 800;
  white-space: nowrap;
}

.nav-links {
  align-items: center;
  display: flex;
  gap: 1rem;
  overflow-x: auto;
}

.nav-links a {
  color: rgb(255 255 255 / 0.62);
  flex: 0 0 auto;
  font-size: 0.84rem;
  font-weight: 700;
}

.nav-links a.active,
.nav-links a:hover {
  color: white;
}

.home-hero,
.tournament-hero {
  background: linear-gradient(135deg, #004d33 0%, #006747 55%, #0a4d3a 100%);
  color: white;
  overflow: hidden;
  position: relative;
}

.home-hero {
  min-height: 330px;
}

.hero-bg {
  height: 100%;
  inset: 0;
  object-fit: cover;
  opacity: 0.18;
  position: absolute;
  width: 100%;
}

.hero-content,
.tournament-hero {
  text-align: center;
}

.hero-content {
  margin: 0 auto;
  max-width: 960px;
  padding: 4rem 1rem;
  position: relative;
}

.hero-logo {
  height: 84px;
  margin: 0 auto 1.25rem;
  width: auto;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.hero-content h1,
.tournament-hero h1,
.admin-hero h1 {
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  font-style: italic;
  font-weight: 800;
  line-height: 0.96;
}

.hero-content p,
.tournament-hero p {
  color: rgb(255 255 255 / 0.72);
  margin-top: 0.75rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.4rem;
}

.hero-tags span {
  background: rgb(255 255 255 / 0.12);
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 999px;
  color: rgb(255 255 255 / 0.8);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
}

.hero-tags.small {
  margin-top: 1rem;
}

.shell {
  margin: 0 auto;
  max-width: 1160px;
  padding: 2rem 1rem 3rem;
}

.shell.narrow {
  max-width: 900px;
}

.section-head {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-head.compact {
  margin-top: 2rem;
}

.section-head h2 {
  font-size: 1.25rem;
}

.section-head span {
  color: var(--muted);
  font-size: 0.8rem;
}

.major-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.major-card,
.table-card,
.rules-panel,
.roast-card,
.upcoming-panel,
.draft-panel,
.admin-card,
.notice,
.live-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.major-card {
  display: flex;
  flex-direction: column;
  min-height: 275px;
}

.major-card-head {
  background: var(--major-bg);
  color: white;
  display: block;
  min-height: 145px;
  padding: 1rem;
  position: relative;
}

.major-card-head p {
  color: var(--major-accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.major-card-head h3 {
  font-family: var(--display);
  font-size: 1.4rem;
  font-style: italic;
  line-height: 1;
  margin: 0.25rem 4rem 1.2rem 0;
}

.major-card-head small {
  color: rgb(255 255 255 / 0.62);
  display: block;
  font-size: 0.74rem;
  line-height: 1.45;
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.22rem 0.52rem;
  text-transform: uppercase;
}

.major-card .status {
  position: absolute;
  right: 0.8rem;
  top: 0.8rem;
}

.status.complete {
  background: var(--gold);
  color: #1d1b12;
}

.status.live {
  background: #d9f99d;
  color: #245013;
}

.status.upcoming {
  background: rgb(255 255 255 / 0.12);
  color: rgb(255 255 255 / 0.78);
}

.card-action {
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: auto;
  padding: 1rem;
}

.card-action.live-link {
  color: #178a50;
}

.button-action {
  background: transparent;
  border-radius: 0;
  color: var(--green);
  text-align: left;
  width: 100%;
}

.registration-summary {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
}

.registration-summary span,
.registered-count span {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
}

.registration-summary strong {
  display: block;
  font-size: 0.95rem;
  margin-top: 0.15rem;
}

.registered-count {
  text-align: right;
}

.registered-count strong {
  color: var(--green);
  font-size: 1.45rem;
  line-height: 1;
}

.registered-count small {
  color: var(--muted);
  font-size: 0.72rem;
}

.registered-list,
.best-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.registered-list {
  padding: 0 1rem 1rem;
}

.registered-list span,
.best-tags span {
  background: color-mix(in srgb, var(--green) 10%, white);
  border: 1px solid color-mix(in srgb, var(--green) 18%, white);
  border-radius: 999px;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.17rem 0.48rem;
}

.registration-form {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
}

.registration-form input,
.registration-form select,
.field-toolbar input,
.draft-panel input,
.admin-card input,
.admin-card select {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 40px;
  padding: 0.62rem 0.72rem;
  width: 100%;
}

.button-row {
  display: flex;
  gap: 0.6rem;
}

.button-row.wrap {
  flex-wrap: wrap;
}

.season-grid {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(160px, 2fr) repeat(5, minmax(80px, 1fr));
}

.table-head {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.75rem 1rem;
  text-transform: uppercase;
}

.table-row {
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  padding: 0.8rem 1rem;
}

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

.table-row em {
  color: var(--muted);
  display: inline-block;
  font-style: normal;
  margin-right: 0.7rem;
  min-width: 1.2rem;
}

.winner-chip,
.winner-pill,
.pool-chip,
.mc {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.67rem;
  font-weight: 900;
  margin-left: 0.45rem;
  padding: 0.15rem 0.42rem;
}

.winner-chip,
.winner-pill {
  background: #fff1a8;
  color: #735600;
}

.pool-chip {
  background: #e0f2fe;
  color: #075985;
}

.mc {
  background: #fee2e2;
  color: #991b1b;
}

.under {
  color: var(--red);
  font-weight: 800;
}

.over,
.muted {
  color: var(--muted);
}

.even {
  color: var(--text);
  font-weight: 700;
}

.rules-panel {
  margin-top: 2rem;
  padding: 1.4rem;
}

.rules-panel h3 {
  margin-bottom: 0.65rem;
}

.rules-panel ul {
  color: var(--muted);
  line-height: 1.75;
  margin: 0;
  padding-left: 1.2rem;
}

.tournament-hero {
  background: linear-gradient(135deg, var(--major-bg) 0%, color-mix(in srgb, var(--major-bg) 86%, black) 100%);
  padding: 3rem 1rem 2.4rem;
}

.compact-hero {
  padding: 2.3rem 1rem 2rem;
}

.back-link {
  color: rgb(255 255 255 / 0.58);
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.tournament-hero .status {
  background: var(--major-accent);
  color: var(--major-bg);
  margin-bottom: 0.8rem;
}

.tournament-hero h1 {
  font-size: clamp(2.1rem, 6vw, 4rem);
}

.tournament-hero small {
  color: rgb(255 255 255 / 0.52);
  display: block;
  margin-top: 0.35rem;
}

.winner-line {
  color: var(--major-accent) !important;
  font-weight: 900;
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 1.2rem;
}

.hero-actions a {
  background: rgb(255 255 255 / 0.12);
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 8px;
  color: white;
  font-weight: 800;
  padding: 0.58rem 0.85rem;
}

.overflow {
  overflow-x: auto;
}

.team-row {
  cursor: pointer;
}

.team-row:hover {
  background: #fbfaf5;
}

.winner-row {
  background: #fffbe8;
}

.eliminated-row {
  background: #fff7f7;
}

.total-score {
  font-size: 1.05rem;
  font-weight: 900;
}

.score-note {
  background: #fee2e2;
  border-radius: 999px;
  color: #991b1b;
  display: inline-flex;
  font-size: 0.6rem;
  font-weight: 900;
  margin-left: 0.35rem;
  padding: 0.1rem 0.34rem;
  vertical-align: middle;
}

.details-row td {
  background: #fbfaf5;
  padding: 0;
}

.inner-table {
  padding: 0.7rem;
}

.inner-table table {
  background: white;
  border: 1px solid var(--border);
}

.golfer-cell {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
}

.golfer-flag {
  display: inline-block;
  font-size: 0.95rem;
  line-height: 1;
  text-align: center;
  width: 1.2rem;
}

.golfer-name {
  font-weight: 500;
}

.missed-cut {
  opacity: 0.58;
}

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

.roast-card {
  padding: 1.2rem;
}

.roast-card > p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.roast-card h3 {
  font-size: 1rem;
  line-height: 1.35;
  margin-bottom: 0.8rem;
}

.roast-card div p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 0.8rem;
  white-space: normal;
}

.roast-card .clamped {
  max-height: 6.2rem;
  overflow: hidden;
}

.roast-card button,
.small-button {
  background: transparent;
  color: var(--green);
  padding: 0;
}

.live-panel {
  min-height: 170px;
  padding: 1rem;
}

.loading-state,
.notice {
  color: var(--muted);
  padding: 1.3rem;
  text-align: center;
}

.notice {
  display: grid;
  gap: 0.35rem;
}

.live-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: right;
}

.leaderboard-split {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr);
}

.mini-head {
  background: var(--major-bg);
  color: var(--major-accent);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 0.8rem 1rem;
  text-transform: uppercase;
}

.upcoming-panel {
  padding: 1.5rem;
}

.upcoming-panel h2 {
  margin-bottom: 0.4rem;
}

.upcoming-panel p {
  color: var(--muted);
  margin-bottom: 1rem;
}

.field-toolbar {
  align-items: center;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr auto auto auto;
  margin-bottom: 1rem;
}

.field-toolbar label {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  white-space: nowrap;
}

.field-toolbar input[type="checkbox"] {
  min-height: auto;
  width: auto;
}

.best.won {
  background: #fff1a8;
  border: 1px solid #efd66d;
  border-radius: 999px;
  color: #6c5200;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 0.18rem 0.5rem;
}

.draft-layout {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: 280px minmax(0, 1fr);
}

.draft-panel {
  padding: 1.2rem;
  position: sticky;
  top: 64px;
}

.draft-panel h2 {
  font-size: 1rem;
  margin-bottom: 0.45rem;
}

.draft-panel strong {
  display: block;
  font-size: 1.35rem;
}

.draft-panel span {
  color: var(--muted);
  display: block;
  font-size: 0.84rem;
  margin: 0.2rem 0 1rem;
}

.draft-panel form {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.draft-table th,
.draft-table td {
  min-width: 140px;
  white-space: normal;
}

.draft-table td:first-child,
.draft-table th:first-child {
  min-width: 80px;
  position: sticky;
  left: 0;
  z-index: 1;
}

.draft-table td:first-child {
  background: white;
}

.on-clock {
  background: #ecfdf5;
  color: #047857;
  font-weight: 900;
}

.draft-pick-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

.draft-pick-grid article {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.draft-pick-grid h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.draft-pick-grid ol {
  color: var(--muted);
  margin: 0;
  padding-left: 1.2rem;
}

.admin-hero {
  background: linear-gradient(135deg, #004d33 0%, #006747 60%, #005a3c 100%);
  color: white;
  padding: 1.8rem 0;
}

.admin-hero p {
  color: rgb(255 255 255 / 0.6);
  margin-top: 0.35rem;
}

.admin-stack {
  display: grid;
  gap: 1rem;
}

.admin-card {
  padding: 1.2rem;
}

.admin-card h2 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.admin-table {
  display: grid;
  gap: 0.55rem;
}

.admin-row {
  align-items: center;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1.2fr 70px 1.5fr auto;
}

code {
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--muted);
  padding: 0.2rem 0.35rem;
}

.invite-list {
  display: grid;
  gap: 0.65rem;
}

.invite-list div,
.order-list div {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr auto auto;
  padding: 0.75rem;
}

.invite-list span {
  color: var(--muted);
  font-size: 0.82rem;
}

.invite-list a {
  color: var(--green);
  font-weight: 900;
}

.admin-controls {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr auto auto;
  margin-bottom: 0.8rem;
}

.order-list {
  display: grid;
  gap: 0.5rem;
}

.order-list div {
  grid-template-columns: 1fr auto auto;
}

.order-list button {
  background: var(--surface-2);
  color: var(--text);
  padding: 0.35rem 0.55rem;
}

@media (max-width: 980px) {
  .major-grid,
  .leaderboard-split,
  .roast-grid,
  .draft-pick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .draft-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    align-items: start;
    flex-direction: column;
    height: auto;
    padding-bottom: 0.75rem;
    padding-top: 0.75rem;
  }

  .nav-links {
    width: 100%;
  }

  .major-grid,
  .leaderboard-split,
  .roast-grid,
  .draft-pick-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .field-toolbar,
  .admin-row,
  .admin-controls,
  .invite-list div {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
    gap: 0.25rem;
  }

  .season-grid {
    grid-template-columns: minmax(120px, 1.6fr) repeat(2, minmax(70px, 0.8fr));
  }

  .season-grid span:nth-child(4),
  .season-grid span:nth-child(5),
  .season-grid span:nth-child(6) {
    display: none;
  }

  .hero-actions,
  .button-row {
    flex-direction: column;
  }
}
