:root {
  color-scheme: light;
  --bg: #d9d9d7;
  --ink: #303633;
  --muted: #707a73;
  --line: #d9ded9;
  --panel: #ffffff;
  --green: #1f4d25;
  --green-dark: #183d1d;
  --green-soft: #e7efe7;
  --highlight: #7ba946;
  --gold: #b57b20;
  --content-width: 1196px;
  --header-width: var(--content-width);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.poy-captain-width-page,
.poy-tournament-page {
  --content-width: 1040px;
  --header-width: 1180px;
}

.poy-hero {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) minmax(260px, 360px);
  align-items: center;
  gap: 20px;
  min-height: 124px;
  background: var(--green);
  border-bottom: 3px solid var(--highlight);
  color: #fff;
  padding: 16px max(20px, calc((100vw - var(--header-width)) / 2));
}

.home-link {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
}

.home-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: #cfe4d4;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--muted);
}

.poy-hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1;
}

.poy-shell {
  width: calc(100% - 32px);
  max-width: var(--content-width);
  margin: 20px auto 56px;
  font-size: 0.75rem;
  overflow-x: clip;
}

.tournament-intro {
  display: grid;
  grid-template-columns: minmax(0, 500px);
  align-items: center;
  margin: 0 0 14px;
}

.tournament-logo {
  display: block;
  justify-self: start;
  max-width: 100%;
  max-height: 140px;
}

.standings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.updated {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.updated.tournament-updated {
  margin: 8px 0 0;
  color: #d9e8dc;
  font-size: 0.82rem;
  text-align: right;
}

.updated span::before {
  content: " | ";
}

.page-heading {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.1;
}

.small-link-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #c8d0c8;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 850;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}

.small-link-button:hover,
.small-link-button:focus-visible {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.year-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.year-switcher a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #c8d0c8;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 850;
  padding: 0 11px;
  text-decoration: none;
}

.year-switcher a:hover,
.year-switcher a:focus-visible,
.year-switcher a.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.leader-strip {
  display: grid;
  grid-template-columns: 1.4fr repeat(2, minmax(120px, 0.35fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.leader-strip div {
  display: grid;
  gap: 5px;
  background: #fff;
  padding: 18px 20px;
}

.leader-strip span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.leader-strip strong {
  font-size: clamp(1.18rem, 2vw, 1.65rem);
  line-height: 1.1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.standings-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.standings-table th,
.standings-table td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: right;
  white-space: nowrap;
}

.standings-table th {
  background: #eff2ef;
  color: #4e5751;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.standings-table th:nth-child(3),
.standings-table td:nth-child(3) {
  text-align: left;
}

.standings-table th:first-child,
.standings-table td:first-child,
.standings-table th:nth-child(2),
.standings-table td:nth-child(2),
.standings-table th:nth-child(4),
.standings-table td:nth-child(4),
.standings-table th:nth-child(5),
.standings-table td:nth-child(5),
.standings-table th:nth-child(6),
.standings-table td:nth-child(6),
.standings-table th:nth-child(7),
.standings-table td:nth-child(7) {
  text-align: center;
}

.standings-table tbody tr:nth-child(even) {
  background: #f7f8f6;
}

.standings-table tbody tr:first-child {
  background: #fff8e8;
}

.standings-table tbody tr:last-child td {
  border-bottom: 0;
}

body:not(.show-all-standings) .standings-table .extra-row {
  display: none;
}

.player-cell {
  width: 100%;
  color: #1f2823;
  font-weight: 850;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(var(--flight-count, 2), minmax(0, 1fr));
  gap: 18px;
}

.results-section h3 {
  margin: 0 0 10px;
  color: #2f3933;
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.results-table {
  min-width: 0;
  table-layout: fixed;
}

.results-table th:first-child,
.results-table td:first-child {
  width: 56px;
  text-align: center;
}

.results-table th:last-child,
.results-table td:last-child {
  width: 80px;
  text-align: center;
}

.results-table th:nth-child(2),
.results-table td:nth-child(2) {
  width: auto;
  text-align: left;
}

.results-table .player-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hickory-page .poy-hero {
  grid-template-columns: 92px minmax(0, 1fr);
}

.hickory-head {
  min-height: 28px;
}

.hickory-table {
  min-width: 720px;
}

.hickory-table th:nth-child(3),
.hickory-table td:nth-child(3) {
  text-align: left;
}

.hickory-table th:nth-child(2),
.hickory-table td:nth-child(2),
.hickory-table th:nth-child(4),
.hickory-table td:nth-child(4),
.hickory-table th:nth-child(5),
.hickory-table td:nth-child(5) {
  text-align: center;
}

.hickory-table th:first-child,
.hickory-table td:first-child {
  width: 70px;
}

.hickory-table th:nth-child(2),
.hickory-table td:nth-child(2),
.hickory-table th:nth-child(4),
.hickory-table td:nth-child(4),
.hickory-table th:nth-child(5),
.hickory-table td:nth-child(5) {
  width: 140px;
}

.hickory-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 18px;
}

.hickory-editor-head,
.hickory-editor-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.55fr) minmax(0, 1.4fr) minmax(120px, 0.65fr) minmax(96px, 0.45fr);
  gap: 10px;
  align-items: center;
}

.hickory-editor-head {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hickory-editor-rows {
  display: grid;
  gap: 8px;
}

.hickory-editor input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cfd7cf;
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  padding: 8px 10px;
}

.hickory-editor input:focus {
  border-color: var(--green);
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--green);
}

.hickory-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hickory-success {
  border-left-color: var(--highlight);
  margin-bottom: 16px;
}

.tournament-picker {
  position: relative;
  margin-left: auto;
  width: 100%;
}

.hero-nav {
  display: grid;
  justify-items: end;
  width: 100%;
}

.tournament-picker summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  border: 1px solid #c8d0c8;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(26, 32, 28, 0.11);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
  padding: 0 14px;
  cursor: pointer;
  list-style: none;
}

.tournament-picker summary::-webkit-details-marker {
  display: none;
}

.tournament-picker summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-2px) rotate(45deg);
}

.tournament-picker[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.tournament-picker summary:hover,
.tournament-picker summary:focus-visible {
  border-color: var(--green);
  outline: 0;
}

.tournament-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 4px;
  width: 100%;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid #d6ddd6;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(26, 32, 28, 0.14);
  padding: 10px;
}

.tournament-menu a {
  overflow: hidden;
  border-radius: 5px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
  padding: 10px 12px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tournament-menu a:hover,
.tournament-menu a:focus-visible,
.tournament-menu a.active {
  background: #f0f1ef;
  outline: 0;
}

.tournament-menu a.active {
  color: var(--green);
}

.show-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.show-more-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 900;
  padding: 0 18px;
}

.show-more-button:hover,
.show-more-button:focus-visible {
  background: var(--green-dark);
}

.notice {
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 6px;
  background: #fff;
  padding: 22px;
}

.notice h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.notice p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.notice p + p {
  margin-top: 10px;
}

code {
  border-radius: 4px;
  background: #eef1ee;
  color: #2f3933;
  font-size: 0.92em;
  padding: 2px 5px;
}

@media (max-width: 760px) {
  .poy-hero {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 13px;
    min-height: 92px;
    padding: 14px 16px;
  }

  .home-link {
    width: 64px;
    height: 64px;
  }

  .poy-tournament-page .poy-hero h1 {
    font-size: 1.38rem;
    white-space: nowrap;
  }

  .poy-hero .hero-nav,
  .poy-hero .small-link-button {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .updated.tournament-updated {
    justify-self: center;
    width: 100%;
    text-align: center;
  }

  .standings-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    width: 100%;
  }

  .updated span {
    display: block;
    margin-top: 4px;
  }

  .updated span::before {
    content: "";
  }

  .year-switcher {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 3px;
    width: 100%;
  }

  .year-switcher a {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
    min-height: 28px;
    font-size: 0.64rem;
    padding: 0 2px;
  }

  .leader-strip {
    grid-template-columns: minmax(0, 1.4fr) minmax(64px, 0.55fr) minmax(54px, 0.45fr);
  }

  .leader-strip div {
    padding: 12px 10px;
  }

  .leader-strip strong {
    font-size: 1rem;
    overflow-wrap: anywhere;
  }

  .hickory-editor-head {
    display: none;
  }

  .hickory-editor-row {
    grid-template-columns: 1fr;
    gap: 7px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
  }

  .hickory-editor-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .tournament-intro {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .tournament-picker {
    width: 100%;
  }

  .table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    background: #fff;
  }

  .standings-table {
    display: table;
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .standings-table thead {
    display: table-header-group;
  }

  .standings-table tbody {
    display: table-row-group;
  }

  .standings-table tr {
    display: table-row;
  }

  .standings-table th,
  .standings-table td {
    display: table-cell;
    padding: 6px 3px;
    font-size: 0.66rem;
    white-space: nowrap;
  }

  .standings-table th {
    font-size: 0.54rem;
  }

  .standings-table:not(.results-table) th:first-child,
  .standings-table:not(.results-table) td:first-child,
  .standings-table:not(.results-table) th:nth-child(2),
  .standings-table:not(.results-table) td:nth-child(2),
  .standings-table:not(.results-table) th:nth-child(5),
  .standings-table:not(.results-table) td:nth-child(5) {
    width: 34px;
  }

  .standings-table:not(.results-table) th:nth-child(4),
  .standings-table:not(.results-table) td:nth-child(4) {
    width: 56px;
  }

  .standings-table:not(.results-table) th:nth-child(6),
  .standings-table:not(.results-table) td:nth-child(6),
  .standings-table:not(.results-table) th:nth-child(7),
  .standings-table:not(.results-table) td:nth-child(7) {
    width: 46px;
  }

  .standings-table .player-cell {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .standings-table td::before {
    content: none;
  }
}
