/* APT Leaderboard — the plugin's own styling (Matt, 2026-11-07: "from a design perspective i don't
   necessarily need it to be an element to style once we get the design right"). Colours and sizes
   read the site's design tokens, with fallbacks so it also renders off the site. */
.apt-lb { --lb-navy: var(--apt-navy, #001F4D); --lb-red: var(--apt-red, #e8000b); --lb-blue: var(--apt-blue, #3c99dc);
  --lb-grey: var(--apt-grey, #d9dde2); --lb-light: var(--apt-grey-light, #f4f5f6); --lb-text: var(--apt-text, #1a1a1a);
  --lb-muted: var(--apt-text-muted, #5b6573); --lb-under: #c8102e;
  color: var(--lb-text); font-size: var(--apt-text-s, 15px); line-height: 1.35; width: 100%; }
.apt-lb *, .apt-lb *::before, .apt-lb *::after { box-sizing: border-box; }
.apt-lb button { font: inherit; cursor: pointer; }

.apt-lb-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.apt-lb-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.apt-lb-title h3, .apt-lb-compact h3 { margin: 0; width: 100%; color: var(--lb-navy); font-size: var(--apt-text-xl, 24px); line-height: 1.15; }
.apt-lb-upd { color: var(--lb-muted); font-size: var(--apt-text-xs, 13px); }
.apt-lb-pill { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--lb-light); color: var(--lb-navy);
  font-size: var(--apt-text-xs, 12px); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.apt-lb-pill.live { background: var(--lb-red); color: #fff; }
.apt-lb-pill.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #fff; margin-right: 6px; vertical-align: 1px; animation: apt-lb-pulse 1.4s infinite; }
.apt-lb-pill.final { background: var(--lb-navy); color: #fff; }
.apt-lb-round { font-weight: 700; color: var(--lb-navy); font-size: var(--apt-text-xs, 12px); background: #ffd400; padding: 2px 6px; border-radius: 3px; }
@keyframes apt-lb-pulse { 50% { opacity: .3; } }

.apt-lb-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: thin; }
/* 0.6.1: with the Par 3 / Par 5 tabs a major has nine — wrap them on wider screens so none is hidden off the edge; phones keep one row that scrolls sideways. */
@media (min-width: 768px) { .apt-lb-tabs { flex-wrap: wrap; overflow-x: visible; } }
.apt-lb-tab { flex: 0 0 auto; border: 1.5px solid var(--lb-grey); background: #fff; color: var(--lb-navy); border-radius: 999px;
  padding: 7px 14px; font-weight: 600; white-space: nowrap; }
.apt-lb-tab.on { background: var(--lb-navy); border-color: var(--lb-navy); color: #fff; }

.apt-lb-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.apt-lb-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.apt-lb-table thead th { text-align: center; font-size: var(--apt-text-xs, 12px); font-weight: 700; color: var(--lb-muted);
  text-transform: uppercase; letter-spacing: .05em; padding: 8px 6px; border-bottom: 2px solid var(--lb-navy); white-space: nowrap; }
.apt-lb-table thead th.name { text-align: left; }
.apt-lb-table td { text-align: center; padding: 11px 6px; border-bottom: 1px solid var(--lb-grey); white-space: nowrap; }
.apt-lb-table td.pos { font-weight: 700; color: var(--lb-navy); width: 3.2em; text-align: left; }
.apt-lb-table td.name { text-align: left; white-space: normal; min-width: 11em; }
.apt-lb-row { cursor: pointer; }
/* 0.6.0: a division section inside the Par 3 / Par 5 Challenge board */
.apt-lb-grp td { background: var(--lb-light); color: var(--apt-navy, #001F4D); font-weight: 700; font-size: .8em; letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: 8px 10px; }
.apt-lb-row:hover td, .apt-lb-row:focus td { background: var(--lb-light); outline: none; }
.apt-lb-row.open td { background: var(--lb-light); border-bottom-color: transparent; }
.apt-lb-nm { font-weight: 600; color: var(--lb-navy); }
.apt-lb-sub { display: block; color: var(--lb-muted); font-size: var(--apt-text-xs, 12px); margin-top: 1px; }
.apt-lb-hcp { color: var(--lb-muted); font-size: var(--apt-text-xs, 12px); }
.apt-lb-po { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: var(--lb-blue); border-radius: 3px; padding: 1px 5px; vertical-align: 1px; }
.apt-lb-table td.tp, .apt-lb-table td.tot { font-weight: 700; }
.apt-lb .under { color: var(--lb-under); }
.apt-lb .even, .apt-lb .over { color: var(--lb-navy); }
.apt-lb-tee { color: var(--lb-muted); }
.apt-lb-out { color: var(--lb-muted); font-weight: 700; }
.apt-lb-table td.r { color: var(--lb-muted); }
.apt-lb-ad td { padding: 14px 0; text-align: center; background: #fff; }
.apt-lb-foot { color: var(--lb-muted); font-size: var(--apt-text-xs, 12px); margin-top: 8px; }
.apt-lb-empty { padding: 24px; text-align: center; color: var(--lb-muted); background: var(--lb-light); border-radius: 8px; }

/* scorecard */
.apt-lb-cardrow td { background: var(--lb-light); padding: 4px 8px 16px; white-space: normal; text-align: left; }
.apt-lb-card-head { color: var(--lb-muted); font-size: var(--apt-text-xs, 13px); margin: 6px 0 8px; }
.apt-lb-card-msg { color: var(--lb-muted); padding: 10px 0; }
.apt-lb-rtabs { display: flex; gap: 6px; margin: 6px 0; }
.apt-lb-rtab { border: 1px solid var(--lb-grey); background: #fff; color: var(--lb-navy); border-radius: 4px; padding: 4px 10px; font-weight: 600; font-size: 13px; }
.apt-lb-rtab.on { background: var(--lb-navy); color: #fff; border-color: var(--lb-navy); }
.apt-lb-sc-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; overflow-x: auto; }
.apt-lb-sc { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.apt-lb-sc th, .apt-lb-sc td { padding: 5px 2px; text-align: center; border-bottom: 1px solid var(--lb-grey); min-width: 1.9em; }
.apt-lb-sc thead th { color: var(--lb-muted); font-weight: 700; font-size: 11px; }
.apt-lb-sc tbody th { text-align: left; color: var(--lb-muted); font-weight: 600; font-size: 11px; padding-left: 6px; }
.apt-lb-sc tr.par td { color: var(--lb-muted); }
.apt-lb-h { display: inline-flex; align-items: center; justify-content: center; width: 1.75em; height: 1.75em; line-height: 1; font-weight: 600; }
.apt-lb-h.birdie { border: 1.5px solid var(--lb-under); border-radius: 50%; color: var(--lb-under); }
.apt-lb-h.eagle { border: 1.5px solid var(--lb-under); border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--lb-under); color: var(--lb-under); }
.apt-lb-h.bogey { border: 1.5px solid var(--lb-navy); }
.apt-lb-h.dbl { border: 1.5px solid var(--lb-navy); box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--lb-navy); }
.apt-lb-legend { color: var(--lb-muted); font-size: 11px; margin-top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.apt-lb-legend .apt-lb-h { width: 1.6em; height: 1.6em; margin-left: 6px; }

/* compact card */
.apt-lb-compact { background: #fff; border: 1px solid var(--lb-grey); border-radius: 10px; padding: 18px; }
.apt-lb-compact .apt-lb-cname { font-weight: 700; color: var(--lb-navy); font-size: var(--apt-text-xs, 12px); text-transform: uppercase; letter-spacing: .05em; }
.apt-lb-compact h3 { margin: 8px 0 10px; font-size: var(--apt-text-l, 20px); }
.apt-lb-compact ol { list-style: none; margin: 0; padding: 0; }
.apt-lb-compact li { display: grid; grid-template-columns: 2.6em 1fr auto; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--lb-grey); }
.apt-lb-compact li .pos { font-weight: 700; color: var(--lb-navy); }
.apt-lb-compact li .who b { display: block; color: var(--lb-navy); }
.apt-lb-compact li .who small { color: var(--lb-muted); }
.apt-lb-compact li .sc { font-weight: 700; font-size: var(--apt-text-l, 20px); }
.apt-lb-more { width: 100%; margin-top: 14px; padding: 11px; border: 2px solid var(--lb-navy); border-radius: 999px; background: #fff; color: var(--lb-navy); font-weight: 700; }
.apt-lb-more:hover { background: var(--lb-navy); color: #fff; }

/* pop-out */
.apt-lb-modal { position: fixed; inset: 0; background: rgba(0, 20, 50, .6); z-index: 100000; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow-y: auto; }
.apt-lb-modal-box { position: relative; background: #fff; border-radius: 12px; width: min(1100px, 100%); padding: 22px; }
.apt-lb-x { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 30px; line-height: 1; color: var(--apt-navy, #001F4D); }
body.apt-lb-lock { overflow: hidden; }

@media (max-width: 767px) {
  .apt-lb-table th.today, .apt-lb-table td.today, .apt-lb-table th.r, .apt-lb-table td.r { display: none; }
  .apt-lb-sc-wrap { grid-template-columns: 1fr; }
  .apt-lb-table td { padding: 10px 4px; }
}

/* 0.3.0 — chapter page: board 2/3, event card 1/3 (stacks on phones) */
.apt-lb-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--apt-space-l, 32px); align-items: start; }
.apt-lb-main { min-width: 0; }
.apt-lb-side-card { background: var(--lb-light); border-radius: 10px; padding: 20px; }
.apt-lb-side-name { margin: 10px 0 4px; color: var(--lb-navy); font-size: var(--apt-text-l, 20px); line-height: 1.2; }
.apt-lb-side-meta { margin: 0 0 14px; color: var(--lb-muted); font-size: var(--apt-text-xs, 13px); }
.apt-lb-side-label { margin: 0 0 6px; color: var(--lb-muted); font-size: var(--apt-text-xs, 12px); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.apt-lb-side-list { list-style: none; margin: 0; padding: 0; }
.apt-lb-side-list li { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--lb-grey); }
.apt-lb-side-div { grid-column: 1 / -1; color: var(--lb-muted); font-size: var(--apt-text-xs, 12px); }
.apt-lb-side-list b { color: var(--lb-navy); }
.apt-lb-side-sc { font-weight: 700; }
.apt-lb-side-link { display: inline-block; margin-top: 14px; color: var(--lb-navy); font-size: var(--apt-text-s, 15px); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.apt-lb-side-link:hover { color: var(--lb-blue); }

/* 0.3.0 — homepage: switch between today's events */
.apt-lb-evs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.apt-lb-ev { border: 1.5px solid var(--lb-navy); background: #fff; color: var(--lb-navy); border-radius: 6px; padding: 8px 12px; font-weight: 700;
  font-size: var(--apt-text-xs, 13px); text-align: left; max-width: 100%; }
.apt-lb-ev.on { background: var(--lb-navy); color: #fff; }
.apt-lb-evlink { display: inline-block; margin-top: 10px; font-weight: 700; color: var(--lb-navy); font-size: var(--apt-text-s, 15px); }
@media (max-width: 767px) {
  .apt-lb-split { grid-template-columns: minmax(0, 1fr); }
}

/* 0.9.2: the full board shows 8 players; the rest scroll inside it with the headings pinned. fitBoard sets the exact
   height from the rows as drawn; this is the fallback until it runs. */
.apt-lb-tablewrap.apt-lb-scroll { max-height: 470px; overflow-y: auto; overscroll-behavior: contain; border-bottom: 1px solid var(--lb-grey); }
.apt-lb-scroll .apt-lb-table thead th { position: sticky; top: 0; z-index: 2; background: #fff; }
.apt-lb-scrollnote { margin-top: 6px; color: var(--lb-muted); font-size: var(--apt-text-xs, 12px); }
