/* League Hub styles: pages.css. Shared states and notices, touch targets, operator pages and the home dashboard.
   Files load in this order: tokens.css, base.css, components.css, layout.css, pages.css, admin.css, refinements.css (App.razor). Later files override earlier ones; see docs/DESIGN-SYSTEM.md. */

/* ---- Shared states and notices (UX consistency pass) ---- */
.data-caption { margin: var(--sp-2) 0 var(--sp-3); color: var(--t-muted); font-size: var(--fs-md); }
/* Support form layout; fields and actions retain their shared appearance. */
.problem-report-form { display: grid; justify-items: start; gap: var(--sp-3); max-width: var(--w-standard); }
.problem-report-form > .form-field { width: 100%; }
.problem-report-form > p { margin: 0; }
.problem-report-form textarea { resize: vertical; }
.player-profile-context { position: sticky; inset-block-start: 0; z-index: 4; padding-bottom: var(--sp-2); margin-bottom: var(--sp-2); background: var(--t-page); }
.section-shortcuts { display: flex; flex-wrap: wrap; gap: 0 var(--sp-3); padding-block: var(--sp-1); }
.section-shortcuts a { display: inline-flex; align-items: center; min-height: 32px; color: var(--t-foreground); text-decoration: underline; text-underline-offset: 3px; font-size: var(--fs-md); }
.section-anchor { scroll-margin-top: 12rem; }
.player-match-feed { align-items:start; }
.player-match-feed a.is-mine:not(.btn) { color:var(--t-link); }
.standings-select { max-width: 32rem; margin-bottom: var(--sp-3); }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; }
.loading-spinner { width: 16px; height: 16px; flex: none; border: 2px solid var(--t-border); border-top-color: var(--t-accent); border-radius: 50%; animation: loading-spin .8s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-spinner { animation: none; } }
.data-note.notice-success { border-color: var(--t-good); border-inline-start-width: 4px; }
.data-note.notice-error, .data-note[role="alert"] { border-color: var(--t-danger); border-inline-start-width: 4px; }
.data-note.notice-success::before { content: "Saved: "; font-weight: 750; color: var(--t-good); }
.data-note.notice-error::before { content: "Problem: "; font-weight: 750; color: var(--t-danger); }
/* Touch targets: at least 44px where a finger is the pointer. */
@media (pointer: coarse) {
  .help-tip { position: relative; }
  .help-tip::after { content: ""; position: absolute; inset: -12px; }
  .favorite-pin { min-width: 44px; min-height: 44px; }
}
.report-picker { margin: 8px 0 14px; }
.report-choice-list { list-style: none; margin: 10px 0 0; padding: 6px 12px; max-height: 340px; overflow: auto; border: 1px solid var(--t-border); border-radius: var(--radius-md); }
.report-choice-list li { padding: 5px 0; }
.report-choice-list label { display: flex; gap: 10px; align-items: baseline; }
.report-picker .picker-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-top: 10px; }
.operator-list { display: grid; gap: 6px; padding: 10px 12px; margin: 8px 0; border: 1px solid var(--t-border); border-radius: var(--radius-md); }
.operator-list > strong { font-size: var(--fs-md); }
/* A ticked group's scope menu sits under that group, indented past its checkbox with a line down the side, so it reads as belonging to it. */
.operator-list .group-scope { display: grid; gap: 4px; margin: -2px 0 6px 8px; padding: 2px 0 2px 18px; border-left: 2px solid var(--t-border); }
.feed-status { margin: 6px 0 0; padding-left: 18px; }
.import-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.import-section { display: grid; gap: 10px; min-width: 0; align-content: start; }
.import-section > h3 { margin: 0; font-size: var(--fs-md); }
.calendar-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.calendar-view-switch { display: inline-flex; }
.calendar-view-switch .btn[aria-pressed="true"] { background: var(--t-accent); border-color: var(--t-accent); color: var(--t-accent-text); }
.calendar-period { display: grid; gap: 10px; padding: 0 14px 14px; touch-action: pan-y pinch-zoom; }
.calendar-period-day { border: 1px solid var(--t-border); border-radius: var(--radius-md); padding: 12px; }
.calendar-period-today { border-color: var(--t-accent); }
.calendar-startup { min-height: 24rem; }
.search-result-group { margin-block: var(--sp-6); }
.search-group-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.search-group-heading h2 { margin: 0; }
.search-result-group > .btn { margin-top: var(--sp-3); }
.dashboard-heading-context { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-2); }
.dashboard-heading-context .eyebrow { margin: 0; }
/* Reserve the space of the next-match card while the browser-stored player is looked up, so the page does not jump. */
.next-match-slot { min-height: 11rem; display: grid; }
@media (min-width: 641px) { .next-match-slot { min-height: 7.5rem; } }
.next-match-slot > .favorite-prompt { align-content: center; align-items: center; }
.next-match-skeleton { display: grid; gap: 10px; align-content: center; min-height: 100%; }
.next-match-skeleton > span { display: block; height: .9rem; border-radius: 999px; background: var(--t-muted); opacity: .3; animation: next-match-pulse 1.4s ease-in-out infinite; }
.next-match-skeleton > span:nth-child(1) { width: 35%; }
.next-match-skeleton > span:nth-child(2) { width: 70%; }
.next-match-skeleton > span:nth-child(3) { width: 50%; }
@keyframes next-match-pulse { 50% { opacity: .12; } }
@media (prefers-reduced-motion: reduce) { .next-match-skeleton > span { animation: none; } }
.source-grid { margin: 12px 0 20px; }
.source-grid > summary { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 40px 10px 12px; border: 1px solid var(--t-border); border-radius: var(--radius-lg); font-weight: 650; list-style: none; cursor: pointer; }
.source-grid > summary::-webkit-details-marker { display: none; }
/* The same chevron as the Filters bar: down when closed, up when open. */
.source-grid > summary::after { content: ""; position: absolute; inset-inline-end: var(--sp-4); top: 50%; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); }
.source-grid[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.source-grid[open] > summary { margin-bottom: 8px; }
.calendar-week-grid { grid-auto-rows: minmax(9rem, auto); }
/* Phone/tablet week cells show dates and counts; their event cards live in the agenda. */
@media (max-width: 800px) { .calendar-week-grid { grid-auto-rows: minmax(4rem, auto); } }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { margin-left: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.freshness.freshness-note { border: 0; background: transparent; padding: 0; margin: 14px 2px 4px; font-size: var(--fs-sm); color: var(--t-muted); }
.operator-row { cursor: pointer; }
.operator-row .row-actions { cursor: default; }
/* Operator dialog: one rhythm. Each label sits tight above its control (6px); controls and groups are 18px apart. */
.operator-dialog { width: min(760px, calc(100vw - 28px)); }
.operator-dialog-body { padding: 18px 20px 20px; display: grid; gap: 18px; min-width: 0; }
.operator-dialog .field { display: grid; gap: 6px; min-width: 0; }
.operator-dialog .field > label { display: flex; align-items: center; gap: 8px; margin: 0; }
.operator-dialog .feed-block { display: grid; gap: 18px; min-width: 0; padding-top: 18px; border-top: 1px solid var(--t-border); }
.operator-dialog .report-picker { display: grid; gap: 10px; margin: 0; }
.operator-dialog .operator-list { margin: 0; }
.operator-dialog .picker-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.operator-dialog p { margin: 0; }
.operator-dialog .actions { margin: 0; padding-top: 4px; }
.connection-form select { width: 100%; min-width: 0; padding: 0 10px; border: 1px solid var(--t-border); border-radius: var(--radius-md); background: var(--t-panel-raised); color: var(--t-foreground); font: inherit; }
.operator-dialog .discard-warning { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--t-danger); border-radius: var(--radius-md); }
.explore-results { grid-auto-rows: 1fr; }
.search-record .explore-result { flex: 1 1 auto; box-sizing: border-box; }
/* Link beside a league name that opens the original report. */
/* One card per player, listing every league and team the name was found in. */
.player-record-card .explore-result { padding-inline-end: 60px; }
.player-record-name { color: inherit; text-decoration: none; }
.player-record-leagues { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.player-record-leagues a { color: var(--t-muted); text-decoration: none; overflow-wrap:break-word; }
.player-record-leagues a:hover { color: var(--t-link); text-decoration: underline; }
.player-record-card .favorite-pin { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; }
/* Operator page: weekday start times and the per-league table. */
.operator-page fieldset { margin-block: 16px; }
.weekday-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 20px; }
.weekday-times label { display: flex; align-items: center; justify-content: space-between; gap: 8px; white-space: nowrap; }
.weekday-times input[type="time"], .league-settings-table input[type="time"] { width: 9.5rem; }
.suggestion-league-row th { text-align: left; }
.suggestion-table .row-actions { white-space: nowrap; text-align: right; }
.missing-leagues input[type="search"] { width: 100%; max-width: 32rem; box-sizing: border-box; }
.missing-leagues summary { cursor: pointer; }
.missing-leagues summary h2 { display: inline; }
.league-settings-table td:nth-child(2), .league-settings-table th:nth-child(2) { text-align: center; }
.league-weekday-row th { text-align: left; }
.source-table .num { white-space: nowrap; }
.source-table .rank { width: 1%; text-align: center; }
.team-toggle { display: block; margin-top: 6px; }
/* A fieldset sizes to its content by default; let wide tables scroll inside it instead of widening the page on phones. */
.operator-page fieldset, .missing-leagues { min-width: 0; max-width: 100%; box-sizing: border-box; }
.operator-page .source-table-wrap { max-width: 100%; overflow-x: auto; }
@media (max-width: 640px) { .suggestion-table .row-actions { white-space: normal; } }
.connection-form fieldset { grid-template-columns: minmax(0, 1fr); }
/* Operator page: the same rhythm as the dialog. A label sits 6px above its control and its help icon shares the label's row;
   controls, buttons and groups are 18px apart; text blocks carry no margin of their own. */
.operator-page fieldset { gap: 18px; padding: var(--adm-pad, 16px 18px); }
.operator-page .field { display: grid; gap: 6px; min-width: 0; }
.operator-page .field > label { display: flex; align-items: center; gap: 8px; margin: 0; }
.operator-page .feed-block { display: grid; gap: 18px; min-width: 0; }
.operator-page .feed-block + .feed-block { padding-top: 18px; border-top: 1px solid var(--t-border); }
.operator-page .report-picker { display: grid; gap: 10px; margin: 0; }
.operator-page .operator-list { margin: 0; }
.operator-page .picker-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.operator-page fieldset p { margin: 0; }
.operator-page .source-table-wrap { margin-top: 0; }
.operator-page .help-tip { flex: 0 0 auto; margin-block: 0; }
.operator-page .check-label { align-items: center; margin: 0; }
.operator-tabs { display:flex; gap:6px; flex-wrap:wrap; border-bottom:1px solid var(--t-border); margin-bottom:14px; }
.operator-tab { flex:0 1 auto; white-space:nowrap; background:transparent; border:0; border-bottom:3px solid transparent; color:inherit; font:inherit; font-weight:600; padding:10px 14px; cursor:pointer; }
.operator-tab[aria-selected="true"] { border-bottom-color:var(--t-accent); }
/* The operator page's save bar stays in view however long the tab is. */
.operator-page > .actions { position:sticky; bottom:0; z-index:5; display:flex; gap:.75rem; flex-wrap:wrap; padding:12px 0; background:var(--t-page); border-top:1px solid var(--t-border); }
/* On phones each suggestion reads as a small card, so its buttons are not pushed off-screen. */
@media (max-width: 640px) {
  .suggestion-table, .suggestion-table tbody, .suggestion-table tr, .suggestion-table td, .suggestion-table th { display:block; width:auto; }
  .suggestion-table thead { display:none; }
  .suggestion-table td { border:0; padding:2px 12px; }
  .suggestion-table tr:not(.suggestion-league-row) { padding:8px 0; border-top:1px solid var(--t-border); }
  .suggestion-table .row-actions { text-align:left; padding-bottom:8px; }
  .suggestion-table .row-actions > * { margin:0 6px 0 0; }
}
@media (max-width: 640px) { .suggestion-table { min-width:0; width:100%; } .suggestion-table td { white-space:normal; overflow-wrap:break-word; } }
@media (max-width: 800px) { .operator-page > .actions { bottom:calc(62px + env(safe-area-inset-bottom, 0px)); } }
/* Home dashboard */
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 18px; align-items: stretch; }
.dash-card { min-width: 0; padding: 16px 18px; border: 1px solid var(--t-border); border-top: 3px solid var(--t-accent); border-radius: var(--radius-lg); background: var(--t-panel); color: var(--t-foreground); }
.dash-wide { grid-column: 1 / -1; }
.dash-card .metric-card > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-2); }
.dash-card .metric-card .favorite-record-link { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.dash-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin: 0 0 10px; }
.dash-card-head h2 { margin: 0; font-size: var(--fs-lg); }
.dash-card-head a { font-size: var(--fs-md); white-space: nowrap; }
/* Content links stay neutral so the brand red is reserved for navigation and the user's own highlights. */
.dash-card a:not(.btn) { color: var(--t-foreground); text-underline-offset: .15em; }
.dash-card-head a:not(.btn), .dash-more a:not(.btn) { color: var(--t-link, var(--t-accent)); }
.dash-list small a:not(.btn) { text-decoration-color: var(--t-muted); }
.dash-card a.is-mine:not(.btn) { color: var(--t-link, var(--t-accent)); }
.dash-vs { color: var(--t-muted); font-weight: 500; }
.dash-card a:not(.btn):hover, .dash-card a:not(.btn):focus-visible, .dash-card a:not(.btn):active { color: var(--t-link, var(--t-accent)); }
.dash-subhead { margin: 12px 0 4px; font-size: var(--fs-md); color: var(--t-muted); text-transform: uppercase; letter-spacing: .06em; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list > li { display: grid; gap: 2px; padding: 9px 0; border-top: 1px solid var(--t-border); }
.dash-list > li:first-child { border-top: 0; }
.dash-list time { font-size: var(--fs-sm); font-weight: 700; color: var(--t-muted); font-variant-numeric: tabular-nums; }
.dash-list small { color: var(--t-muted); font-size: var(--fs-sm); }
.dash-line { font-weight: 650; overflow-wrap: anywhere; }
.dash-empty { margin: 4px 0; color: var(--t-muted); }
/* Favorite players: one tile each, two or three across on a PC and one on a phone. */
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 12px; }
.dash-tiles > li, .dash-tiles > li:first-child { align-content: start; gap: 4px; padding: 12px 14px; border: 1px solid var(--t-border); border-radius: var(--radius-md); background: var(--t-panel-raised, var(--t-soft)); }
.dash-tiles .dash-line { font-size: var(--fs-lg); }
.dash-tiles .dash-tile-team { margin-bottom: 4px; overflow-wrap: anywhere; }
.dash-tiles .dash-tile-solo, .dash-tiles .dash-tile-record { display: grid; gap: 4px; }
.dash-tiles .dash-tile-record { padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--t-border); }
.dash-summary { margin: 0 0 4px; }
.dash-more { margin: 8px 0 0; font-size: var(--fs-md); }
.dash-nudge { margin-bottom: 16px; }
/* The "Dashboard" label and the account link share one line in the header: Dashboard · My Dashboard →. */
.eyebrow-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 4px; }
.eyebrow-row .eyebrow { margin: 0; }
.eyebrow-row .eyebrow-dot { color: var(--t-muted); }
.eyebrow-row a { font-size: var(--fs-md); white-space: nowrap; color: var(--t-link, var(--t-accent)); }
/* The heading waits for the saved player so it does not change text after first paint; it keeps its height. */
/* The hidden placeholder is never shown; the greeting fades in once it is ready instead of swapping text. */
@keyframes greeting-fade { from { opacity: 0; } to { opacity: 1; } }
.greeting-title:not(.title-pending) { animation: greeting-fade .25s ease-out; }
@media (prefers-reduced-motion: reduce) { .greeting-title:not(.title-pending) { animation: none; } }
.dashboard-grid > .dash-nudge { margin: 0; min-height: 8rem; align-content: center; }
.player-stat-cards:has(> .dash-stat-team:only-child) { grid-template-columns: minmax(0, 1fr); }
.dash-stat-team { align-content: start; }
.dash-stat-team h3 { margin: 0; font-size: var(--fs-base); }
.dash-stat-team .history-games { grid-template-columns: repeat(auto-fit,minmax(min(100%,var(--card-min)),1fr)); }
.dash-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; border-bottom: 1px solid var(--t-border); scrollbar-width: thin; }
.dash-tab { flex: 0 0 auto; padding: 9px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius-md) var(--radius-md) 0 0; background: transparent; color: var(--t-muted); font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap; }
.dash-tab:hover { color: var(--t-foreground); background: var(--t-accent-soft, var(--t-soft)); }
.dash-tab.active { color: var(--t-foreground); background: var(--t-panel-raised, var(--t-panel)); border-color: var(--t-border); box-shadow: inset 0 3px 0 var(--t-accent); }
.dash-tab:focus-visible { outline: 2px solid var(--t-accent); outline-offset: -2px; }
.dash-tabpanel { padding-top: 10px; }
.dash-tabpanel:focus-visible { outline: 2px solid var(--t-accent); outline-offset: 2px; }
.dash-tab-heading { margin: 0 0 4px; font-weight: 700; }
.dash-division { margin: 12px 0 0; font-size: var(--fs-md); color: var(--t-muted); }
.dash-tabpanel .source-table-wrap { margin-top: 8px; }
.my-team-row td, .team-standing-card.my-team-row { background: var(--t-accent-soft, var(--t-soft)); }
.my-team-row td:first-child { box-shadow: inset 4px 0 0 var(--t-accent); }
.team-standing-card.my-team-row { border-inline-start: 4px solid var(--t-accent); }
.my-team-tag { padding: 1px 8px; border: 1px solid var(--t-accent); border-radius: 999px; font-size: var(--fs-xs); font-weight: 750; white-space: nowrap; }
.dashboard-grid .next-match-skeleton { padding: 18px 22px; min-height: 8rem; }
@media (max-width: 800px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .dash-card { padding: 14px; }
}

/* Account record lists (My Player Records, My Favorite Players): one record per row with its buttons at the right. */
.record-list { list-style: none; margin: 10px 0 0; padding: 0; }
.record-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--t-border); }
.record-list > li:first-child { border-top: 0; }
.record-list > li > :is(.row-note, .reasons, .row-more) { flex: 1 1 100%; margin: 0; }
.record-card { display: grid; gap: 3px; flex: 1 1 16rem; min-width: 0; }
.record-name { font-weight: 700; color: var(--t-foreground); overflow-wrap: anywhere; }
.record-meta { color: var(--t-muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.row-actions form { margin: 0; }
.record-badge { justify-self: start; padding: 1px 9px; border: 1px solid var(--t-border); border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; color: var(--t-muted); white-space: nowrap; }
.record-badge-good { border-color: var(--t-good); color: var(--t-good); }
.record-badge-warn { white-space: normal; border-color: var(--t-accent); color: var(--t-foreground); }
.record-list .reasons { padding-inline-start: 1.1rem; list-style: disc; color: var(--t-muted); font-size: var(--fs-sm); }
.notification-item-link { padding: 0; border: 0; background: none; color: var(--t-link); font: inherit; text-align: start; text-decoration: underline; cursor: pointer; }
.row-more > summary { width: fit-content; cursor: pointer; color: var(--t-link, var(--t-accent)); font-size: var(--fs-md); }
.row-more > .action-strip { margin: 8px 0 0; }
.row-note { color: var(--t-muted); font-size: var(--fs-sm); }
#status .action-strip { margin: 8px 0 0; }
#status > p { margin: 0; }

/* Start page choice: a two-way pill switch built on real radio buttons (keyboard and screen readers work as for any radio group). */
/* Home greeting: a little air between the heading, the date and the dashboard switch. */
.page-title-row h1.greeting-title { margin-bottom: 12px; }
.schedule-title-kicker { display:flex; align-items:center; flex-wrap:wrap; gap:var(--sp-2); }
.schedule-title-kicker .eyebrow { margin:0; }
.schedule-header-links { display:flex; flex-wrap:wrap; gap:var(--sp-2) var(--sp-1); }
.schedule-header-links a.btn.secondary:not(:hover) { color:var(--t-link); background:var(--t-panel-raised); }

.page-title-row:has(.start-choice) .sub { margin-bottom: 8px; }
.start-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 4px 0 14px; }
.start-choice-label { font-size: var(--fs-md); color: var(--t-muted); }
.start-choice-options { display: inline-flex; min-height: var(--control-h); padding: calc(var(--sp-1) / 2); gap: calc(var(--sp-1) / 2); border: 1px solid var(--t-border); border-radius: var(--radius-lg); background: var(--t-panel-raised, var(--t-panel)); }
.start-option { position: relative; display: inline-flex; cursor: pointer; }
.start-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.start-option span { display: inline-flex; align-items: center; min-height: calc(var(--control-h) - 2 * var(--sp-1)); padding: 0 var(--sp-2); border-radius: var(--radius-md); font-size: var(--fs-sm); color: var(--t-muted); font-weight: 650; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.start-option:hover span { color: var(--t-foreground); }
.start-option input:checked + span { background: var(--t-accent-soft, var(--t-soft)); color: var(--t-foreground); box-shadow: inset 0 0 0 1px var(--t-accent); }
.start-option input:focus-visible + span { outline: 2px solid var(--t-accent); outline-offset: 2px; }
.start-choice-error { color: var(--t-danger, inherit); }
@media (max-width: 600px) {
  .start-choice-options { display: inline-flex; max-width: 100%; }
  .start-option span { justify-content: center; padding: 0 var(--sp-2); white-space: nowrap; text-align: center; line-height: 1.2; min-height: calc(var(--control-h) - 2 * var(--sp-1)); }
}
@media (min-width: 801px) and (pointer: fine) {
  .start-choice-options { min-height: var(--control-h-compact); }
  .start-option span { min-height: calc(var(--control-h-compact) - var(--sp-1) - 2px); }
  .start-option input { inset-block: calc(-1.5 * var(--sp-1)) auto; height: calc(100% + 3 * var(--sp-1)); }
}
@media (prefers-reduced-motion: reduce) { .start-option span { transition: none; } }

/* Matchup page: a player compared with another team or the league. Blue is the player, amber everyone else (STYLE-GUIDE 8: never red, never color alone). */
/* Plain flow, not flex: the long sentence would otherwise drop below the count on a phone instead of wrapping after it. */
.matchup-source { margin-block: var(--sp-3); display: block; }
.matchup-source > strong { margin-inline-end: 0.4rem; }
.matchup-heading { margin: var(--sp-6) 0 var(--sp-1); }
.matchup-list { list-style: none; margin: var(--sp-3) 0; padding: 0; display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.matchup-row { min-width: 0; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--t-border); border-radius: var(--radius-lg); background: var(--t-panel); }
.matchup-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); }
.matchup-label { font-weight: 650; }
.matchup-you { font-size: var(--fs-lg); font-weight: 700; color: var(--data-1); font-variant-numeric: tabular-nums; }
.matchup-track { position: relative; height: 28px; margin: var(--sp-2) 6px; }
.matchup-track::before { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 2px; transform: translateY(-50%); background: var(--t-border); border-radius: 1px; }
.matchup-dot, .matchup-avg { position: absolute; top: 50%; left: var(--x); transform: translate(-50%, -50%); }
.matchup-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--data-2); opacity: .75; }
.matchup-you-dot { width: 18px; height: 18px; background: var(--data-1); opacity: 1; border: 2px solid var(--t-panel); box-shadow: 0 0 0 2px var(--data-1); z-index: 2; }
.matchup-avg { width: 2px; height: 22px; background: var(--t-foreground); z-index: 1; }
.matchup-note { margin: 0; font-size: var(--fs-sm); color: var(--t-muted); }
.matchup-table .matchup-me { background: var(--t-accent-soft); font-weight: 650; }
.source-table.matchup-table :is(th, td):first-child { min-width: 0; }
.matchup-team { display: inline-flex; align-items: center; gap: var(--sp-2); }
.matchup-team-mark { flex: 0 0 auto; width: 10px; height: 10px; }
.matchup-team-mark.mine { border-radius: 50%; background: var(--data-1); }
.matchup-team-mark.theirs { background: var(--data-2); transform: rotate(45deg); }
.matchup-tiles { margin-top: var(--sp-3); }
.matchup-vs, .filter-static { display: inline-flex; align-items: center; min-height: var(--control-h); font-weight: 700; overflow-wrap: break-word; }
.matchup-team-title { margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-lg); }
/* The lineup is one column per player on wide screens and one table per team on narrow ones. */
.matchup-pivot { display: none; }
.matchup-team-row :is(th, td) { border-top: 2px solid var(--t-border); color: var(--t-muted); font-weight: 650; }
.matchup-pivot-table { font-size: var(--fs-sm); }
.matchup-pivot-table :is(th, td) { text-align: center; padding-inline: var(--sp-2); }
.matchup-pivot-table :is(thead .matchup-team-head, tbody th[scope="row"], thead tr:nth-child(2) th:first-child) { text-align: start; }
.matchup-pivot-table tbody th[scope="row"] { white-space: nowrap; }
.matchup-pivot-table .matchup-team-col { border-inline-end: 2px solid var(--t-border); color: var(--t-muted); }
.matchup-pivot-table .matchup-team-col:last-child { border-inline-end: 0; }
/* Sized by the room the lineup has, not the screen, so the sidebar does not matter. Two teams of five need about 900px. */
.matchup-lineup { container-type: inline-size; }
@container (min-width: 900px) {
  .matchup-pivot { display: block; }
  .matchup-stacked { display: none; }
}
@media (max-width: 640px) {
  .matchup-stacked .source-table :is(th, td) { padding-inline: var(--sp-2); }
}
/* Matchup dots are buttons so keyboards and touch can reach them; a larger invisible hit area makes the small dots easy to tap. */
.matchup-dot { padding: 0; border: 0; cursor: pointer; font: inherit; }
.matchup-dot::before { content: ""; position: absolute; inset: -9px; }
.matchup-you-dot { border: 2px solid var(--t-panel); }
.matchup-dot:focus-visible { outline: 2px solid var(--t-accent); outline-offset: 3px; z-index: 3; }
.matchup-dot[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--t-foreground); z-index: 3; opacity: 1; }
.matchup-you-dot[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--data-1), 0 0 0 5px var(--t-foreground); }
.matchup-picked { margin: var(--sp-1) 0 0; font-size: var(--fs-sm); font-weight: 650; overflow-wrap: break-word; }
@media (hover: hover) {
  .matchup-dot[data-tip]:is(:hover, :focus-visible)::after, .matchup-avg[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    width: max-content; max-width: 240px; padding: var(--sp-1) var(--sp-2); border-radius: var(--radius-sm);
    background: var(--t-foreground); color: var(--t-page); font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; white-space: normal; pointer-events: none; z-index: 5;
  }
  .matchup-avg[data-tip] { cursor: help; }
  .matchup-avg[data-tip]::before { content: ""; position: absolute; inset: 0 -7px; }
}
@media (hover: hover) {
  .matchup-dot[data-tip][data-side="start"]:is(:hover, :focus-visible)::after, .matchup-avg[data-tip][data-side="start"]:hover::after { left: -6px; transform: none; }
  .matchup-dot[data-tip][data-side="end"]:is(:hover, :focus-visible)::after, .matchup-avg[data-tip][data-side="end"]:hover::after { left: auto; right: -6px; transform: none; }
}
