:root {
  --pairings-purple: #531960;
  --pairings-purple-dark: #35113e;
  --pairings-border: #dfd2e4;
  --pairings-soft: #fbf7fc;
  --pairings-gold: #d5a827;
}

body {
  margin: 0;
  background: #f7f3f8;
  color: #261c2a;
}

.pairings-page {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.pairings-page[data-pairings-view="teetimes"] {
  width: min(600px, calc(100% - 28px));
}

.pairings-page[data-pairings-view="teetimes"] .pairings-header h1 {
  font-size: 26px;
}

.pairings-header,
.pairings-panel,
.pairings-empty {
  border: 1px solid var(--pairings-border);
  border-top: 4px solid var(--pairings-purple);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(53, 17, 62, 0.08);
}

.pairings-header {
  padding: 22px 24px;
}

.pairings-label {
  margin: 0 0 4px;
  color: var(--pairings-purple);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pairings-header h1 {
  margin: 0;
  color: var(--pairings-purple-dark);
  font-size: clamp(25px, 4vw, 36px);
}

.pairings-header p:last-child {
  margin: 6px 0 0;
  color: #67576f;
}

.pairings-panel,
.pairings-empty {
  margin-top: 20px;
  overflow: hidden;
}

.pairings-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  border-bottom: 1px solid var(--pairings-border);
  padding: 18px 20px;
}

.pairings-toolbar label {
  flex: 1 1 240px;
  color: var(--pairings-purple-dark);
  font-size: 13px;
  font-weight: 800;
}

.pairings-toolbar input,
.pairings-toolbar select {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: 5px;
  border: 1px solid #bfa8c6;
  border-radius: 7px;
  background: #fff;
  color: #261c2a;
  padding: 8px 11px;
}

.pairings-toolbar input:focus,
.pairings-toolbar select:focus {
  border-color: var(--pairings-purple);
  box-shadow: 0 0 0 3px rgba(83, 25, 96, 0.14);
  outline: none;
}

.pairings-toolbar button {
  min-height: 42px;
  border: 1px solid var(--pairings-purple);
  border-radius: 7px;
  background: var(--pairings-purple);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 9px 18px;
  text-decoration: none;
}

.pairings-summary {
  border-bottom: 1px solid var(--pairings-border);
  color: #67576f;
  padding: 11px 20px;
}

.tee-sheet-table-wrap {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-height: 65vh;
  overflow: auto;
  scrollbar-gutter: stable;
  scrollbar-color: #8c7095 #f1ebf3;
  padding: 0 14px 8px;
}

.tee-sheet-table {
  width: 450px;
  min-width: 450px;
  table-layout: fixed;
  border-collapse: collapse;
  color: #302735;
  font-size: 15px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.tee-sheet-table th,
.tee-sheet-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.tee-sheet-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 3px solid var(--pairings-purple);
  color: var(--pairings-purple-dark);
  background: var(--pairings-soft);
  font-size: 14px;
  font-weight: 700;
  padding: 7px 5px;
  text-align: left;
}

.tee-sheet-table td {
  border-bottom: 1px solid #ece5ee;
  padding: 4px 5px;
}

.tee-sheet-table tbody tr:nth-child(even) {
  background: #f8f5f9;
}

.tee-sheet-table tbody tr:hover {
  background: #f0e8f3;
}

.tee-sheet-table th:first-child,
.tee-sheet-table td:first-child {
  width: 170px;
}

.tee-sheet-table th:nth-child(2),
.tee-sheet-table td:nth-child(2) {
  width: 105px;
}

.tee-sheet-table th:nth-child(3),
.tee-sheet-table td:nth-child(3) {
  width: 40px;
  text-align: center;
  white-space: nowrap;
}

.tee-sheet-table th:nth-child(4),
.tee-sheet-table td:nth-child(4) {
  width: 45px;
  text-align: center;
  white-space: nowrap;
}

.tee-sheet-table th:nth-child(5),
.tee-sheet-table td:nth-child(5) {
  width: 90px;
  text-align: right;
}

.tee-time-list {
  display: grid;
}

.tee-time-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 18px;
  border-bottom: 1px solid #eadfec;
  padding: 16px 20px;
}

.tee-time-row:last-child {
  border-bottom: 0;
}

.tee-time-slot {
  display: flex;
  flex-direction: column;
  border-left: 4px solid var(--pairings-gold);
  padding-left: 12px;
}

.tee-time-slot strong {
  color: var(--pairings-purple-dark);
  font-size: 20px;
}

.tee-time-slot span {
  color: #67576f;
  font-size: 13px;
}

.tee-time-players,
.pairing-card ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tee-time-players li,
.pairing-card li {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 6px;
  background: var(--pairings-soft);
  padding: 8px 10px;
}

.tee-time-players span,
.pairing-card li span {
  color: var(--pairings-purple-dark);
  font-weight: 700;
}

.tee-time-players small,
.pairing-card small {
  min-height: 16px;
  color: #76667d;
}

.pairing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
  padding: 20px;
}

.pairing-card {
  overflow: hidden;
  border: 1px solid var(--pairings-border);
  border-radius: 8px;
  background: #fff;
}

.pairing-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--pairings-purple);
  color: #fff;
  padding: 11px 13px;
}

.pairing-card header div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.pairing-card header span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pairing-card header strong {
  font-size: 22px;
}

.pairing-card header p {
  margin: 0;
  font-size: 14px;
}

.pairing-card ol {
  grid-template-columns: 1fr;
  gap: 0;
  padding: 7px;
}

.pairing-card li {
  background: transparent;
  border-bottom: 1px solid #eee5f0;
}

.pairing-card li:last-child {
  border-bottom: 0;
}

.pairings-empty {
  padding: 28px;
  text-align: center;
}

.pairings-empty h2 {
  margin: 0;
  color: var(--pairings-purple-dark);
}

.pairings-empty p {
  margin: 8px 0 22px;
  color: #67576f;
}

.pairings-no-match {
  margin: 0;
  color: #67576f;
  padding: 36px 20px;
  text-align: center;
}

.pairings-status {
  margin: 12px 2px 0;
  color: #67576f;
  font-size: 13px;
}

@media (max-width: 640px) {
  .pairings-page {
    width: min(100% - 18px, 1120px);
    padding-top: 12px;
  }

  .pairings-header,
  .pairings-toolbar,
  .pairings-summary,
  .tee-sheet-table-wrap,
  .tee-time-row,
  .pairing-grid {
    padding-right: 14px;
    padding-left: 14px;
  }

  .tee-time-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tee-time-players {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .pairings-page {
    width: 100%;
    padding: 0;
  }

  .pairings-page[data-pairings-view="teetimes"] {
    width: 100%;
  }

  .pairings-toolbar,
  .pairings-status {
    display: none;
  }

  .pairings-header,
  .pairings-panel,
  .pairing-card {
    box-shadow: none;
  }

  .pairing-card,
  .tee-time-row {
    break-inside: avoid;
  }

  .tee-sheet-table-wrap {
    padding: 8px 0 0;
    max-height: none;
    overflow: visible;
  }

  .tee-sheet-table {
    min-width: 0;
    font-size: 10pt;
  }

  .tee-sheet-table th,
  .tee-sheet-table td {
    padding: 5px 6px;
    font-size: inherit;
  }

  .tee-sheet-table th {
    position: static;
  }

  .tee-sheet-table tr {
    break-inside: avoid;
  }
}
