:root {
  --lb-ink: var(--luv-grey-dark, #23262b);
  --lb-muted: var(--text-muted, #6b6f76);
  --lb-line: #e3e5e8;
  --lb-soft: #f5f6f7;
  --lb-red: var(--luv-red, #c8102e);
  --lb-under: #c8102e;
  --lb-over: #1f4e8c;
  --lb-green: #1e7a46;
  --lb-head-font: var(
    --font-display,
    "Barlow Condensed",
    "Arial Narrow",
    sans-serif
  );
}

/* Tournament / season selector bar */
.lb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.lb-toolbar .form-group {
  margin: 0;
  min-width: 260px;
}

.lb-toolbar select {
  width: 100%;
}

/* Event header strip (name, course, date, status) */
.lb-event {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 20px 24px;
  margin-bottom: 24px;
  background: var(--lb-ink);
  color: #fff;
  border-left: 5px solid var(--lb-red);
}

.lb-event h2 {
  margin: 0 0 4px;
  color: #fff;
  font-family: var(--lb-head-font);
  font-size: 2rem;
  line-height: 1.05;
}

.lb-event-meta {
  margin: 0;
  color: #c9ccd1;
  font-size: 0.92rem;
}

.lb-event-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}

.lb-fact {
  display: flex;
  flex-direction: column;
}

.lb-fact strong {
  font-family: var(--lb-head-font);
  font-size: 1.6rem;
  line-height: 1;
}

.lb-fact span {
  margin-top: 4px;
  color: #c9ccd1;
  font-size: 0.8rem;
}

/* Live badge */
.lb-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--lb-red);
  color: #fff;
  font-family: var(--lb-head-font);
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.lb-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  animation: lb-pulse 1.6s ease-in-out infinite;
}

@keyframes lb-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.25;
  }
}

/* Live status line */
.lb-live-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-bottom: 16px;
  color: var(--lb-muted);
  font-size: 0.9rem;
}

/* Hidden text for screen readers only */
.lb-table .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Main table */
.lb-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--lb-line);
  background: #fff;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.lb-table th {
  padding: 12px 14px;
  background: var(--lb-soft);
  border-bottom: 2px solid var(--lb-ink);
  color: var(--lb-ink);
  font-family: var(--lb-head-font);
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.lb-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--lb-line);
  vertical-align: middle;
}

.lb-table .lb-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.lb-table tbody tr.lb-row:hover {
  background: #fafbfc;
}

.lb-pos {
  width: 60px;
  font-family: var(--lb-head-font);
  font-size: 1.2rem;
  font-weight: 700;
}

.lb-player {
  font-weight: 600;
  color: var(--lb-ink);
}

.lb-player small {
  display: block;
  margin-top: 2px;
  color: var(--lb-muted);
  font-weight: 400;
  font-size: 0.8rem;
}

/* styles.css turns the first cell of the first row red - keep player names and the scorecard label normal */
.lb-table tbody tr:nth-child(1) td.lb-player,
.lb-card tbody tr:nth-child(1) td:first-child {
  color: var(--lb-ink);
  font-weight: 600;
}

/* Professionals' names are shown in red */
.lb-name.is-pro {
  color: var(--lb-red);
}

/* Leader row gets a red marker on the left */
.lb-table tr.lb-leader td:first-child {
  box-shadow: inset 4px 0 0 var(--lb-red);
}

/* Net score compared to par (finished rounds only) */
.lb-under {
  color: var(--lb-under);
  font-weight: 700;
}

.lb-even {
  color: var(--lb-ink);
  font-weight: 700;
}

.lb-over {
  color: var(--lb-over);
  font-weight: 700;
}

/* Score to par next to the net score (live page) */
.lb-to-par {
  margin-left: 4px;
  color: var(--lb-muted);
  font-size: 0.8rem;
}

/* Amateur / Professional tag */
.lb-tag {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--lb-line);
  color: var(--lb-muted);
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
}

.lb-tag.pro {
  border-color: var(--lb-ink);
  color: var(--lb-ink);
}

/* Bonus prize notes like HIO / NTP */
.lb-note {
  display: inline-block;
  margin-right: 4px;
  padding: 2px 8px;
  background: var(--lb-ink);
  color: #fff;
  font-family: var(--lb-head-font);
  font-size: 0.85rem;
}

.lb-note.hio {
  background: var(--lb-red);
}

/* Player currently on the course */
.lb-oncourse {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--lb-green);
  vertical-align: middle;
}

/* Expand / collapse scorecard button */
.lb-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--lb-line);
  background: #fff;
  color: var(--lb-ink);
  cursor: pointer;
}

.lb-toggle:hover {
  border-color: var(--lb-ink);
}

.lb-toggle:focus-visible {
  outline: 2px solid var(--lb-red);
  outline-offset: 2px;
}

.lb-toggle svg {
  transition: transform 0.2s ease;
}

.lb-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Hole-by-hole scorecard (hidden until opened) */
.lb-card-row td {
  padding: 0;
  background: var(--lb-soft);
}

.lb-card-row[hidden] {
  display: none;
}

.lb-card {
  padding: 16px 14px 20px;
  overflow-x: auto;
}

.lb-card table {
  min-width: 680px;
  width: 100%;
  table-layout: fixed; /* use the widths below instead of sizing columns by their content */
  border-collapse: collapse;
  background: #fff;
  font-size: 0.88rem;
}

/* Holes 1-18 all get the same width (18 x 4% = 72%) */
.lb-card thead th {
  width: 4%;
}

/* Hole, Out, In and Tot all get the same, wider width (4 x 7% = 28%) */
.lb-card thead th.lb-card-label,
.lb-card thead th.lb-card-total {
  width: 7%;
}

.lb-card th,
.lb-card td {
  padding: 8px 4px;
  border: 1px solid var(--lb-line);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.lb-card th {
  background: var(--lb-ink);
  color: #fff;
  font-weight: 600;
}

/* "Hole" and "Score" labels, centred in their block like the numbers */
.lb-card .lb-card-label {
  text-align: center;
  font-weight: 600;
}

.lb-card .lb-card-total {
  background: #eceef0;
  font-weight: 700;
}

.lb-card th.lb-card-total {
  background: #3a3e45;
}

/* Order of Merit: bonus prize progress bar */
.lb-progress {
  min-width: 150px;
}

.lb-progress-bar {
  height: 6px;
  margin-bottom: 5px;
  background: var(--lb-line);
}

.lb-progress-bar span {
  display: block;
  height: 100%;
  background: var(--lb-ink);
}

.lb-progress.done .lb-progress-bar span {
  background: var(--lb-green);
}

.lb-progress small {
  color: var(--lb-muted);
  font-size: 0.8rem;
}

.lb-progress.done small {
  color: var(--lb-green);
  font-weight: 600;
}

.lb-points {
  font-family: var(--lb-head-font);
  font-size: 1.2rem;
  font-weight: 700;
}

/* Ratings page */
.lb-dnp {
  color: #b3b6bb;
  font-size: 0.85rem;
}

.lb-best {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--lb-red);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.lb-rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 4px 8px;
  background: var(--lb-ink);
  color: #fff;
  font-family: var(--lb-head-font);
  font-size: 1.2rem;
  font-weight: 700;
}

.lb-rating.provisional {
  background: #fff;
  border: 1px dashed var(--lb-ink);
  color: var(--lb-ink);
}

.lb-info {
  margin-top: 32px;
  padding: 20px 24px;
  background: var(--lb-soft);
  border-left: 4px solid var(--lb-ink);
  max-width: 760px;
}

.lb-info h3 {
  margin-top: 0;
}

.lb-info p:last-child {
  margin-bottom: 0;
}

/* Tee sheet */
.lb-tee-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lb-group {
  display: grid;
  grid-template-columns: 150px 1fr;
  border: 1px solid var(--lb-line);
  background: #fff;
}

.lb-group-time {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 20px;
  background: var(--lb-ink);
  color: #fff;
}

.lb-group-time strong {
  font-family: var(--lb-head-font);
  font-size: 2.2rem;
  line-height: 1;
}

.lb-group-time span {
  margin-top: 6px;
  color: #c9ccd1;
  font-size: 0.85rem;
}

.lb-group-players {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.lb-slot {
  padding: 16px;
  border-left: 1px solid var(--lb-line);
}

.lb-slot:first-child {
  border-left: 0;
}

.lb-slot .lb-player {
  display: block;
  margin-bottom: 6px;
}

.lb-slot.open {
  display: flex;
  align-items: center;
  color: #b3b6bb;
  font-size: 0.88rem;
  background: repeating-linear-gradient(
    -45deg,
    #fff,
    #fff 8px,
    var(--lb-soft) 8px,
    var(--lb-soft) 16px
  );
}

.lb-partner {
  display: block;
  margin-top: 6px;
  color: var(--lb-muted);
  font-size: 0.8rem;
}

/* Tablet */
@media (max-width: 900px) {
  .lb-group {
    grid-template-columns: 1fr;
  }

  .lb-group-time {
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
  }

  .lb-group-players {
    grid-template-columns: repeat(2, 1fr);
  }

  .lb-slot:nth-child(3) {
    border-left: 0;
  }

  .lb-slot:nth-child(n + 3) {
    border-top: 1px solid var(--lb-line);
  }
}

/* Mobile: hide the less important columns */
@media (max-width: 640px) {
  .lb-hide-sm {
    display: none;
  }

  .lb-table th,
  .lb-table td {
    padding: 10px 8px;
  }

  .lb-pos {
    width: 40px;
  }

  .lb-event {
    padding: 16px;
  }

  .lb-event h2 {
    font-size: 1.6rem;
  }

  .lb-toolbar .form-group {
    min-width: 0;
    width: 100%;
  }

  .lb-group-players {
    grid-template-columns: 1fr;
  }

  .lb-slot {
    border-left: 0;
    border-top: 1px solid var(--lb-line);
  }

  .lb-slot:first-child {
    border-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lb-live-dot {
    animation: none;
  }

  .lb-toggle svg {
    transition: none;
  }
}

/* Printing the tee sheet */
@media print {
  .topbar,
  .site-header,
  .site-footer,
  .page-banner,
  .lb-toolbar,
  .lb-no-print {
    display: none !important;
  }

  .lb-event {
    background: #fff;
    color: #000;
    border: 1px solid #000;
  }

  .lb-event h2,
  .lb-event-meta,
  .lb-fact span {
    color: #000;
  }

  .lb-group {
    break-inside: avoid;
  }

  .lb-group-time {
    background: #fff;
    color: #000;
    border-right: 1px solid #000;
  }

  .lb-group-time span {
    color: #000;
  }
}
