/* TMR Senior League — "Rink Night and copper"
   Brand: Rink Night #0E1A24, Slate Blue #1D3446, Copper #C2703C, Brass #E0A566, Ice #EEF3F6, Steel #7D8E9C
   Copper marks one thing at a time (live game, winning score, primary button). Team colours stay as small stripes/dots. */
:root {
  --night: #0E1A24;
  --slate: #1D3446;
  --copper: #C2703C;
  --brass: #E0A566;
  --ice: #EEF3F6;
  --steel: #7D8E9C;

  --bg: var(--ice);
  --card: #FFFFFF;
  --text: #101E29;
  --muted: #566B79;
  --line: #D8E1E7;
  --line-soft: #EAEFF2;
  --accent: #A85A2A;          /* copper darkened for small text on white */
  --head-bg: var(--slate);
  --head-text: #E3EDF2;
  --win: #2F7D55;
  --loss: #A33B3B;
  --radius: 5px;
  --shadow: 0 1px 2px rgba(14, 26, 36, .05);
  --font-display: "Archivo Black", "Arial Black", Helvetica, sans-serif;
  --font-ui: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-read: "Newsreader", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A131A; --card: #132430; --text: #E7EEF2; --muted: #93A5B1;
    --line: #24404F; --line-soft: #1B303D; --accent: var(--brass);
    --head-bg: #0E1A24; --win: #63BE8E; --loss: #E08585;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 400; margin: 0; }
h1 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 34px); line-height: 1.1; margin: 26px 0 16px; }
h3 { font-family: var(--font-ui); font-weight: 700; font-size: 15px; margin: 6px 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.c { text-align: center; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.pos { color: var(--win); }
.neg { color: var(--loss); }
p.note { font-family: var(--font-read); font-size: 16px; color: var(--muted); }

/* ---------- Top bar ---------- */
.topbar { background: var(--night); color: #fff; }
.topbar-inner { display: flex; align-items: center; gap: 26px; min-height: 70px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; }
.brand .brand-lockup { display: block; height: 46px; width: auto; }
.brand .brand-puck { display: none; }
.mainnav { display: flex; gap: 20px; flex: 1; overflow-x: auto; }
.mainnav a { color: #B9CAD6; font-size: 12.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  padding: 6px 0 4px; border-bottom: 3px solid transparent; white-space: nowrap; }
.mainnav a:hover { color: #fff; text-decoration: none; }
.mainnav a.active { color: #fff; border-bottom-color: var(--copper); }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.topbar-right .lang { color: #8FA6B5; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.topbar-right .lang b { color: #fff; }
body.admin .topbar { border-bottom: 4px solid var(--copper); }
.nav-toggle { display: none; }
.show-xs { display: none; }
@media (max-width: 760px) {
  .topbar-inner { gap: 12px; min-height: 60px; }
  .brand .brand-lockup { display: none; }
  .brand .brand-puck { display: block; width: 38px; height: 38px; }
  .topbar-right { margin-left: auto; }
  /* Phone: the menu folds behind a hamburger in the top-right corner and opens as a list */
  .nav-toggle { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0 10px; margin-right: -8px; background: none; border: 0; cursor: pointer; }
  .nav-toggle span { display: block; height: 2px; border-radius: 2px; background: #fff; transition: transform .2s, opacity .2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .mainnav { display: none; order: 3; flex-basis: 100%; flex-direction: column; gap: 0;
    margin: 0 -16px -10px; padding: 4px 16px 10px; border-top: 1px solid rgba(255,255,255,.12); }
  .topbar.nav-open .mainnav { display: flex; }
  .mainnav a { font-size: 14px; padding: 13px 0 13px 12px; border-bottom: 1px solid rgba(255,255,255,.08); border-left: 3px solid transparent; }
  .mainnav a:last-child { border-bottom: 0; }
  .mainnav a.active { border-bottom-color: rgba(255,255,255,.08); border-left-color: var(--copper); }
}

/* ---------- Footer ---------- */
.footer { background: var(--night); color: #9FB6C4; margin-top: 40px; font-size: 13px; }
.footer-inner { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px; }
.footer-puck { width: 64px; height: auto; display: block; }
.footer-lines { display: flex; flex-direction: column; gap: 3px; }
.footer b { color: #E7EFF3; font-weight: 600; }
.footer-lines a { color: #E7EFF3; text-decoration: underline; text-decoration-color: var(--copper); text-underline-offset: 3px; }
.footer-right { margin-left: auto; text-align: right; font-size: 12.5px; }

/* ---------- Layout ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 12px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) {
  .grid-main, .grid-2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
section { margin-bottom: 18px; }
.narrow { max-width: 420px; margin: 40px auto; }

/* Cards: small-caps title bar, then content */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 18px; }
.card > h2, section > h2 { font-family: var(--font-ui); font-size: 11.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.card > h2 { margin: -16px -16px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.card > h2 a { color: inherit; }
.card.table-wrap { padding: 0; }
.card.table-wrap > h2 { margin: 0; }
.card.table-wrap > p { padding: 0 16px 14px; }

/* ---------- Hero: tonight / next game ---------- */
.hero { background: var(--night); color: #EAF1F5; border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column;
  gap: 14px; margin-bottom: 18px; }
.hero:hover { text-decoration: none; }
.hero .kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); }
.matchup { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.matchup .team { display: flex; align-items: center; gap: 11px; color: #fff; }
.chip { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--copper); display: flex; align-items: center;
  justify-content: center; font-family: var(--font-display); font-size: 12px; color: #fff; background: var(--slate); flex-shrink: 0; }
.matchup .team b { font-family: var(--font-display); font-size: 22px; font-weight: 400; }
.matchup .score { font-family: var(--font-display); font-size: 26px; color: var(--brass); }
.matchup .at { color: #7E96A6; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.hero .meta { display: flex; gap: 18px; flex-wrap: wrap; color: #A9BECB; font-size: 13px; }

/* ---------- Game cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cards.single { grid-template-columns: 1fr; }
.game-card { display: block; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 4px; padding: 12px 14px; color: var(--text); }
.game-card:hover { text-decoration: none; border-color: var(--copper); }
.game-card.status-final, .game-card.status-live { border-left-color: var(--copper); }
.gc-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.status-live .gc-status { color: var(--copper); }
.gc-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-weight: 600; }
.gc-team { flex: 1; }
.gc-score { font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; min-width: 1.5em; text-align: right;
  font-variant-numeric: tabular-nums; }
.gc-row.winner .gc-score { color: var(--copper); }
.gc-foot { font-size: .8rem; color: var(--muted); margin-top: 6px; }

.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.swatch.lg { width: 18px; height: 18px; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); border: 1px solid currentColor; border-radius: 2px; padding: 1px 6px; vertical-align: middle; }

.live-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--copper); margin-right: 6px; vertical-align: middle; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.flash-update { animation: glow 1.2s ease-out; }
@keyframes glow { from { background: rgba(194, 112, 60, .12); } to { background: transparent; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table thead th { background: var(--head-bg); color: var(--head-text); text-align: left; font-size: 10.5px; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; padding: 9px 12px; white-space: nowrap; }
.table td, .table tbody th { padding: 9px 12px; border-top: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.table tbody tr:first-child td, .table tbody tr:first-child th { border-top: 0; }
.table.compact thead th, .table.compact td { padding: 6px 10px; }
.table tfoot th { border-top: 2px solid var(--line); padding: 9px 12px; text-align: left; }
.card:not(.table-wrap) > .table { margin: 0 -16px -16px; width: calc(100% + 32px); }
.card:not(.table-wrap) > h2 + .table { margin-top: -12px; }
.standings td:nth-child(n+3), .standings th:nth-child(n+3),
.stats td:nth-child(n+4), .stats th:nth-child(n+4),
.stats.noteam td:nth-child(3), .stats.noteam th:nth-child(3),
.stats.career td:nth-child(3), .stats.career th:nth-child(3),
.stats.goalie-stats td:nth-child(3), .stats.goalie-stats th:nth-child(3),
.standings.mini td:nth-child(n+2), .standings.mini th:nth-child(n+2) { text-align: right; }
.stats strong, .standings strong { color: var(--text); }
.schedule .score { font-family: var(--font-display); font-weight: 400; white-space: nowrap; }
.schedule tr.status-live td { background: rgba(194, 112, 60, .07); }
.leaders { list-style: none; margin: 0; padding: 0; counter-reset: l; }
.leaders li { display: flex; gap: 8px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line-soft); counter-increment: l; }
.leaders li:first-child { border-top: 0; }
.leaders li::before { content: counter(l); color: var(--muted); width: 1.2em; font-variant-numeric: tabular-nums; }
.leaders li a { font-weight: 600; color: var(--text); }
.leaders strong { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- Boxscore ---------- */
.scoreboard { text-align: center; background: var(--night); color: #EAF1F5; border-color: var(--night); }
.sb-status { font-weight: 700; text-transform: uppercase; font-size: 11.5px; letter-spacing: .16em; color: var(--brass); }
.sb-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 14px 0; }
.sb-team { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; }
.sb-team:hover { text-decoration: none; }
.sb-name { font-family: var(--font-display); font-size: 1.25rem; }
.sb-side { font-size: 10.5px; letter-spacing: .14em; color: #7E96A6; text-transform: uppercase; }
.sb-score { font-family: var(--font-display); font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.sb-dash { margin: 0 .25em; color: #7E96A6; }
.sb-vs { font-size: 1.1rem; color: #7E96A6; letter-spacing: .12em; text-transform: uppercase; }
.sb-meta { color: #A9BECB; font-size: 13px; }
.linescore td, .linescore th { text-align: center !important; }
.linescore tbody th { text-align: left !important; }
.events { list-style: none; margin: 0; padding: 0; }
.events-period { font-weight: 700; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 12px 0 4px; }
.event { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.ev-time { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 3.4em; font-size: .9rem; }
.ev-team { font-weight: 700; min-width: 2.8em; }
.ev-body { flex: 1; }
.ev-score { font-family: var(--font-display); font-variant-numeric: tabular-nums; }

/* Team stat line */
.statline { display: flex; flex-wrap: wrap; gap: 8px 32px; }
.statline div { display: flex; flex-direction: column; }
.statline span { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.statline strong { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; }

/* Pills / season picker */
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pills a { padding: 6px 13px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pills a:hover { text-decoration: none; border-color: var(--copper); }
.pills a.active { background: var(--slate); border-color: var(--slate); color: #fff; }
.pills.views { margin-bottom: 10px; }
.pills.views a { font-size: 12.5px; padding: 8px 16px; }
.table thead th a { color: inherit; }
.table thead th a.sorted { color: #fff; text-decoration: underline; text-decoration-color: var(--copper); text-underline-offset: 4px; }
.table thead th .th-sort { all: unset; cursor: pointer; color: inherit; }
.table thead th .th-sort:hover { color: #fff; }
.table thead th .th-sort:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; border-radius: 2px; }
.table thead th .th-sort.sorted { color: #fff; text-decoration: underline; text-decoration-color: var(--copper); text-underline-offset: 4px; }
.table thead th .th-sort::after { content: attr(data-arrow); }
h2.section-title { font-family: var(--font-ui); font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 6px 0 12px; }
p.na { font-style: italic; margin: 0; }
.season-picker label { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.season-picker select { margin-left: 8px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.crumbs { margin: 16px 0 0; font-size: 13px; }

/* ---------- Forms & buttons ---------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: 3px; padding: 7px 9px; max-width: 100%; }
input:focus, select:focus { outline: 2px solid var(--copper); outline-offset: -1px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px; flex: 1; }
.form label input, .form label select { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 15px; }
.form label.check { flex-direction: row; align-items: center; flex: 0; white-space: nowrap; color: var(--text); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > label { min-width: 120px; }
fieldset { border: 1px solid var(--line); border-radius: 4px; margin: 0 0 12px; }
legend { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
fieldset.inline { display: flex; gap: 14px; flex-wrap: wrap; }
fieldset.inline label, .checks label { flex-direction: row; align-items: center; gap: 6px; color: var(--text); flex: 0 0 auto;
  text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.checks label { display: flex; }
.btn { display: inline-block; font-family: var(--font-ui); font-size: 12.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 9px 16px; border-radius: 3px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { text-decoration: none; border-color: var(--copper); }
.btn.primary, .topbar .btn { background: var(--copper); border-color: var(--copper); color: #fff; }
.btn.primary:hover { background: #AD6231; }
.btn.ghost, .topbar .btn.ghost { background: transparent; border-color: #47606F; color: #DCE7ED; }
.btn.small { padding: 7px 12px; font-size: 11.5px; }
.btn.danger { color: var(--loss); }
.btn.icon { padding: 4px 9px; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
form.inline { display: inline; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.search { display: flex; gap: 8px; margin-bottom: 14px; }
.flash { padding: 10px 14px; border-radius: 4px; margin: 16px 0; background: #E4F1E9; color: #1E5B35; border-left: 4px solid var(--win); }
.flash-error { background: #F8E6E4; color: #8A1C1C; border-left-color: var(--loss); }

/* ---------- Scoresheet ---------- */
.sheet-head { text-align: center; }
.sheet-score { display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 700; }
.sheet-score .big { font-family: var(--font-display); font-weight: 400; font-size: 2.6rem; margin: 0 8px; font-variant-numeric: tabular-nums; }
.sheet-head .row-actions { justify-content: center; }
.big-btn { font-size: 1rem; padding: 14px 28px; }
.end-game { margin-top: 12px; text-align: left; }
.end-game summary { list-style: none; display: inline-block; }
.end-game form { margin-top: 10px; }
.team-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.team-toggle label { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; padding: 14px;
  border: 2px solid var(--line); border-radius: 4px; font-family: var(--font-display); font-weight: 400; font-size: 1.05rem;
  color: var(--text); cursor: pointer; margin: 0; letter-spacing: .02em; }
.team-toggle label:has(input:checked) { border-color: var(--copper); background: rgba(194, 112, 60, .1); }
.team-toggle input { accent-color: var(--copper); }
.lineup input[name^=num_] { width: 3.2em; padding: 4px; }
.lineup tr.muted td { opacity: .6; }
.events.editable form { margin: 0; }
@media (max-width: 860px) {
  .scoresheet select, .scoresheet input:not([type=checkbox]):not([type=radio]) { font-size: 16px; } /* no iOS zoom */
}
.sb-meta a { color: inherit; text-decoration: underline; text-decoration-color: var(--copper); text-underline-offset: 3px; }
/* "Add to my calendar" box (schedule and team pages) */
.cal-links { padding: 12px 16px; margin-bottom: 16px; }
.cal-links summary { cursor: pointer; font-weight: 700; list-style: none; }
.cal-links summary::-webkit-details-marker { display: none; }
.cal-links summary::before { content: "📅 "; }
.cal-links[open] summary { margin-bottom: 12px; }
.cal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cal-url { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.cal-url input { width: 100%; font-size: 12px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); }
/* Arena page */
.arena-info h2:not(.section-title) { margin: 2px 0 8px; font-family: var(--font-display, inherit); font-size: 24px; letter-spacing: 0; text-transform: none; color: var(--text); border: 0; padding: 0; }
.arena-info address { font-style: normal; font-size: 16px; line-height: 1.5; margin-bottom: 16px; }
.arena-map { padding: 0; overflow: hidden; }
.arena-map iframe { display: block; width: 100%; height: 420px; border: 0; }
.arena-photo { display: block; width: 100%; height: auto; border-radius: 8px; margin-bottom: 14px; }
/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery-season { grid-column: 1 / -1; margin: 10px 0 0; }
.gallery-season:first-child { margin-top: 0; }
.gallery-item { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--line); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; font-size: 12.5px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(8,14,20,.94); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 4px; }
.lightbox-cap { color: #E7EFF3; margin-top: 10px; font-size: 14px; text-align: center; min-height: 1.4em; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff; font-size: 28px; line-height: 1;
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lightbox .lb-close { top: 14px; right: 14px; }
.lightbox .lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.admin-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; }
.admin-photo { padding: 10px; }
.admin-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 8px; }
.admin-photo .form label { margin-bottom: 6px; }
.form label.grow { flex: 1; min-width: 220px; }
/* Manual scoresheet */
.manual-sheet .card { margin-bottom: 16px; }
.sheet-rows td { vertical-align: middle; }
.sheet-rows select, .sheet-rows input { font-size: 14px; padding: 5px 6px; max-width: 190px; }
.sheet-rows input[data-f="infraction"] { max-width: 220px; }
.sheet-total { font-size: 18px; margin: 14px 0; }
.lineup-confirm { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
[data-lineup-first] { padding: 14px 16px; }
.lineup-fold summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; }
.lineup-fold summary::-webkit-details-marker { display: none; }
.lineup-fold summary h2 { margin: 0; }
.lineup-fold[open] summary { margin-bottom: 12px; }
.btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.table.users input:not([type=password]), .table.users select { font-size: 14px; padding: 5px 7px; width: 100%; min-width: 120px; }
.table.users td { vertical-align: middle; }

/* Imported game: old site's totals shown next to the manual sheet */
.imported-ref summary { cursor: pointer; }
.imported-ref h3 { margin: 10px 0 4px; font-size: 15px; }

/* ---------- Phones: tighter tables so most fit the screen without sideways scrolling ---------- */
@media (max-width: 600px) {
  .hide-xs { display: none; }
  .show-xs { display: block; }
  .sched-status { font-family: var(--font-ui); font-size: 10.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
  .table { font-size: 13px; }
  .table thead th { padding: 8px 5px; font-size: 9.5px; letter-spacing: .05em; }
  .table td, .table tbody th, .table.compact thead th, .table.compact td, .table tfoot th { padding: 8px 5px; }
  .table thead th:first-child, .table td:first-child, .table tbody th:first-child { padding-left: 10px; }
  .table thead th:last-child, .table td:last-child, .table tbody th:last-child { padding-right: 10px; }
  .standings td, .stats td, .schedule td { white-space: nowrap; }
  .stats td > a { white-space: normal; }   /* long player names may wrap; numbers stay on one line */
  .table .swatch { width: 8px; height: 8px; margin-right: 1px; }
}

/* ---------- Standings last-5 form dots; » button that unfolds extra table columns on phones ---------- */
.form-dots { display: inline-flex; gap: 3px; }
.fd { display: inline-block; width: 18px; height: 18px; line-height: 18px; border-radius: 50%; text-align: center;
  font-size: 9.5px; font-weight: 700; color: #fff; background: var(--steel); }
.fd-w { background: var(--win); }
.fd-l { background: var(--loss); }
.fd-otl { background: var(--brass); }
.xtoggle { display: none; }
/* Any table in a [data-xwrap] box: on phones its .xcol columns fold behind the » button in the header.
   Expanded, the first column (.pin1) or the rank + name columns (.pin2) stay pinned while the rest scrolls. */
@media (max-width: 600px) {
  .xwrap:not(.expanded) .xcol { display: none; }
  .xwrap .xtoggle { display: table-cell; width: 34px; padding: 0 !important; text-align: center; }
  .xtoggle button { all: unset; cursor: pointer; display: block; padding: 6px 10px; font-size: 17px; line-height: 1; color: #fff; }
  .xtoggle button:focus-visible { outline: 2px solid var(--copper); outline-offset: -2px; }
  .xwrap.expanded :is(td, th):nth-child(1) { position: sticky; left: 0; z-index: 1; }
  .xwrap.expanded td:nth-child(1) { background: var(--card); }
  .xwrap.pin1.expanded :is(td, th):nth-child(1) { box-shadow: 2px 0 0 var(--line); }
  .xwrap.pin2.expanded :is(td, th):nth-child(1) { width: 32px; min-width: 32px; max-width: 32px; box-sizing: border-box; }
  .xwrap.pin2.expanded :is(td, th):nth-child(2) { position: sticky; left: 32px; z-index: 1; box-shadow: 2px 0 0 var(--line); }
  .xwrap.pin2.expanded td:nth-child(2) { background: var(--card); }
}

/* ---------- Record book (records.cfm) ---------- */
.rec-section { margin-bottom: 26px; }
.rec-sub { font-size: 13px; font-weight: 700; margin: 4px 0 10px; color: var(--text); }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-bottom: 16px; }
.rec-board h3 { margin: 0 0 6px; font-size: 15px; }
.rec-min { margin: -4px 0 6px; }
.rec-list { list-style: none; margin: 0; padding: 0; }
.rec-list li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.rec-list li:first-child { border-top: 0; }
.rec-rank { color: var(--muted); font-weight: 700; font-size: 12px; text-align: center; }
.rec-who { line-height: 1.3; }
.rec-ctx { display: block; font-size: 12px; }
.rec-ctx a { color: inherit; }
.rec-val { font-family: var(--font-display); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.rec-list li.top .rec-val { color: var(--accent); font-size: 1.45rem; }

/* ---------- Head-to-head (game page) and record vs each opponent (team page) ---------- */
.h2h h3 { font-size: 14px; margin: 14px 0 6px; }
.h2h-table td:nth-child(n+2), .h2h-table th:nth-child(n+2),
.vs-table td:nth-child(n+2), .vs-table th:nth-child(n+2) { text-align: right; }
.h2h-recent { list-style: none; margin: 0; padding: 0; }
.h2h-recent li { border-top: 1px solid var(--line-soft); }
.h2h-recent li:first-child { border-top: 0; }
.h2h-recent a { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 7px 0; color: var(--text); }
.h2h-recent a:hover { text-decoration: none; background: var(--line-soft); }
.h2h-score { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Career milestones (home, player and game pages) ---------- */
.milestones h3 { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.milestones h2 + h3 { margin-top: 0; }
.ms-list { list-style: none; margin: 0; padding: 0; }
.ms-list li { display: flex; gap: 8px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line-soft); line-height: 1.35; }
.ms-list li:first-child { border-top: 0; }
.ms-icon { flex: none; }
.ms-what { font-weight: 700; color: var(--text); }
.ms-meta { display: block; font-size: 12px; color: var(--muted); }
.ms-meta a { color: inherit; }
.ms-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.ms-badge { display: inline-block; padding: 4px 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--copper); font-size: 13px; font-weight: 600; }
.ms-more { margin: 8px 0 0; font-size: 13px; font-weight: 600; }

/* ---------- Champions (champions.cfm) ---------- */
.champ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.champ { border-top: 4px solid var(--team, var(--copper)); }
.champ-head { display: flex; gap: 12px; align-items: center; }
.champ-cup { font-size: 30px; line-height: 1; }
.champ-season { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.champ-team { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1.4rem; color: var(--text); }
.champ-team:hover { text-decoration: none; }
.champ-meta { margin: 8px 0 10px; }
.champ-meta a { color: inherit; }
.champ-roster { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line-soft); columns: 2; column-gap: 16px; font-size: 14px; }
.champ-roster li { padding: 3px 0; break-inside: avoid; }
a.ms-badge { color: var(--text); }
a.ms-badge:hover { text-decoration: none; border-color: var(--text); }
.champ-hero { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: center; }
.champ-hero img { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 10px rgba(14, 26, 36, .25)); }
.champ-hero h2 { margin-top: 0; }
.champ-hero p { font-family: var(--font-read); font-size: 17px; margin: 0 0 10px; }
.champ-hero p.small { font-family: var(--font-ui); font-size: 13px; }
@media (max-width: 600px) {
  .champ-grid { grid-template-columns: 1fr; }
  .champ-hero { grid-template-columns: 1fr; }
  .champ-hero img { max-width: 320px; margin: 0 auto; }
}
.spare-row td { border-top: 1px dashed var(--line); color: var(--muted); }
.spare-row strong { color: var(--muted); }
.schedule tr.next-game td { background: rgba(194, 112, 60, .07); }
.schedule tr.next-game td:first-child { box-shadow: inset 4px 0 0 var(--copper); }
.next-tag { margin-bottom: 3px; }
.game-scroll { max-height: 560px; overflow-y: auto; position: relative; padding: 2px 4px 2px 0; overscroll-behavior: contain; }
.game-card.is-next { border-color: var(--copper); border-left-color: var(--copper); background: rgba(194, 112, 60, .06); }
.game-card .next-tag { display: inline-block; }
