/* Theme surfaces share the club's fixed yellow and black brand colors. */
:root {
  color-scheme: light;
  --ink: #121212;
  --monochrome-logo-invert: 0;
  --pending-opponent-background: #121212;
  --pending-opponent-foreground: #fff;
  --surface-soft: #eeede7;
  --hover: #e6e5df;
  --accent-soft: #fff8e7;
  --accent-ink: #8c6100;
  --success-bg: #edf1e4;
  --success-ink: #435629;
  --danger-bg: #fcefe9;
  --danger-ink: #a53825;
  --result-red: #FFC7CE;
  --result-yellow: #FFEB9C;
  --result-green: #C6EFCE;
}

.meet-zujalice-button{background:var(--black);color:#fff;border-color:var(--black)}
.meet-zujalice-button:hover:where(:not([data-hover-released], [data-hover-disabled] *)),.meet-zujalice-button:focus-visible{background:var(--yellow);color:var(--black);border-color:var(--yellow)}
:root[data-theme="dark"] .meet-zujalice-button{background:var(--yellow);color:var(--black);border-color:var(--yellow)}
:root[data-theme="dark"] .meet-zujalice-button:hover:where(:not([data-hover-released], [data-hover-disabled] *)),:root[data-theme="dark"] .meet-zujalice-button:focus-visible{background:#fff;color:var(--black);border-color:#fff}
.value small{color:var(--yellow)}

:root[data-theme="dark"] {
  color-scheme: dark;
  --cream: #101112;
  --white: #1a1b1d;
  --ink: #f3f2ec;
  --monochrome-logo-invert: 1;
  --pending-opponent-background: #fff;
  --pending-opponent-foreground: #121212;
  --muted: #aaa9a3;
  --line: #353639;
  --surface-soft: #232427;
  --hover: #2d2e30;
  --accent-soft: #302919;
  --accent-ink: #efb721;
  --success-bg: #263225;
  --success-ink: #b6d397;
  --danger-bg: #38231f;
  --danger-ink: #f0ab98;
}

body, dialog { color: var(--ink); }
:root[data-theme="dark"] .site-footer { border-top: 1px solid var(--line); }
.player-card, .empty-state, .field-control select, .search-field input,
.fixture-note, .fixture-row, .table-wrap, .stat-box, .quarter-table {
  background: var(--white);
}
.player-card-stats b, .fixture-note b, .strip-team-row.is-winner,
.strip-game-next .strip-meta > span:first-child, .strip-team-mark,
.field-control select, .search-field input { color: var(--ink); }
.field-control select, .search-field input { border-color: var(--line); }
.search-field svg { color: var(--muted); }
.main-nav a:hover:where(:not([data-hover-released], [data-hover-disabled] *)) { background: var(--hover); }
.text-link { border-color: var(--ink); }
.text-link:hover:where(:not([data-hover-released], [data-hover-disabled] *)) { color: var(--accent-ink); border-color: var(--accent-ink); }
.language-switch, .tab-list, .stats-table th, .quarter-table th,
.number-chip { background: var(--surface-soft); }
.language-switch button:hover:where(:not([data-hover-released], [data-hover-disabled] *)):not([aria-pressed="true"]),
.tab-list :is(button,:where(a[data-game-tab])):hover:where(:not([data-hover-released], [data-hover-disabled] *)):not([aria-pressed="true"]) { background: var(--hover); }
/* Selected tabs and navigation links use the same club colors. */
.tab-list :is(button,:where(a[data-game-tab]))[aria-pressed="true"],
.language-switch button[aria-pressed="true"],
.main-nav a[aria-current="page"],
.admin-sidebar nav a[aria-current="page"] {
  background: var(--yellow);
  color: var(--black);
}
.fixture-row:not(.bye-row) { border: 1px solid var(--line); margin-bottom: 16px; }
.fixture-row .fixture-report { padding: 10px 12px; justify-content: center; text-align: center; transition: background .18s, color .18s; }
.fixture-row .fixture-report:hover:where(:not([data-hover-released], [data-hover-disabled] *)), .fixture-row .fixture-report:focus-visible {
  background: var(--black);
  color: #fff;
}
.language-switch button:focus-visible { outline-color: var(--ink); }
.game-card-footer:hover:where(:not([data-hover-released], [data-hover-disabled] *)), .strip-game:hover:where(:not([data-hover-released], [data-hover-disabled] *)), .stats-table tbody tr:hover:where(:not([data-hover-released], [data-hover-disabled] *)),
.highlight-cell, .quarter-table td:last-child { background: var(--accent-soft); }
.strip-game-next { background: var(--surface-soft); }
:root[data-theme="dark"] .strip-watch-link:not(.is-live) { background: #fff; color: var(--black); }
:root[data-theme="dark"] .strip-watch-link:not(.is-live):hover:where(:not([data-hover-released], [data-hover-disabled] *)),
:root[data-theme="dark"] .strip-watch-link:not(.is-live):focus-visible { background: #eee; color: var(--black); }
.strip-watch-link:disabled,.strip-watch-link:disabled:hover:where(:not([data-hover-released], [data-hover-disabled] *)){background:#FF0033;color:#fff;opacity:.5;border:0;cursor:not-allowed}
.stats-table td { border-color: var(--line); }
.stats-table th[aria-sort="descending"] button,
.stats-table th[aria-sort="ascending"] button { color: var(--accent-ink); }
.number-chip { color: var(--muted); }
.win-label { background: var(--success-bg); color: var(--success-ink); }
.loss-label, .strip-loss-label { background: var(--danger-bg); color: var(--danger-ink); }
.match-strip { scrollbar-color: var(--muted) var(--cream); }
.match-strip::-webkit-scrollbar-thumb { background: var(--muted); transition: none; }
.match-strip::-webkit-scrollbar-thumb:hover,
.match-strip::-webkit-scrollbar-thumb:active { background: var(--yellow); }
/* Keep native dragging, with exact thumb colors instead of platform tints. */
@supports selector(::-webkit-scrollbar) {
  .match-ticker .match-strip { scrollbar-color: auto; scrollbar-width: auto; }
  @media(min-width:681px) {
    .site-chrome.is-compact .match-ticker .match-strip { scrollbar-color: auto; scrollbar-width: auto; }
  }
}
.match-ticker-controls button:not(:disabled):active { color: var(--black); }
.btn-dark { border-color: var(--line); }
.club-story, .club-facts, .stat-box.accent, .profile-number,
.skip-link, .noscript-note { color: var(--black); }
.stat-box.accent { background: var(--yellow); }

/* Pending crests contrast with the inverted upcoming-game panels. */
.game-card.upcoming, .upcoming-banner {
  --pending-opponent-background: #fff;
  --pending-opponent-foreground: #121212;
}

/* Upcoming games use a light accent panel against the dark page. */
:root[data-theme="dark"] .game-card.upcoming,
:root[data-theme="dark"] .upcoming-banner {
  color-scheme: light;
  --monochrome-logo-invert: 0;
  --pending-opponent-background: #121212;
  --pending-opponent-foreground: #fff;
  --white: #fff;
  --ink: #121212;
  --muted: #65655f;
  --line: #dcdcd4;
  --accent-soft: #fff8e7;
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
}
:root[data-theme="dark"] .game-card.upcoming .game-card-top,
:root[data-theme="dark"] .game-card.upcoming p,
:root[data-theme="dark"] .upcoming-banner p,
:root[data-theme="dark"] .upcoming-banner .upcoming-fixture .vs,
:root[data-theme="dark"] .upcoming-banner .unknown-mark {
  color: var(--muted);
}
:root[data-theme="dark"] .game-card.upcoming .game-team-name { color: var(--ink); }
:root[data-theme="dark"] .game-card.upcoming .game-card-top,
:root[data-theme="dark"] .game-card.upcoming .game-card-footer,
:root[data-theme="dark"] .upcoming-banner .upcoming-fixture,
:root[data-theme="dark"] .upcoming-banner .unknown-mark {
  border-color: var(--line);
}
:root[data-theme="dark"] .game-card.upcoming .game-card-footer:hover:where(:not([data-hover-released], [data-hover-disabled] *)) {
  background: var(--accent-soft);
}

/* Unconfirmed opponent marks inherit contrasting colors from their surface. */
.pending-opponent-mark{background:transparent;clip-path:none;border:0}
.pending-opponent-mark svg{display:block;width:100%;height:100%;overflow:visible}
.pending-opponent-mark polygon{fill:var(--pending-opponent-background);stroke:none}
.pending-opponent-mark text,.pending-opponent-mark .pending-question-mark{fill:var(--pending-opponent-foreground);stroke:none}
.pending-opponent-mark text{font-size:30px;font-weight:600}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-soft);
  color: var(--ink);
}
.theme-toggle:hover:where(:not([data-hover-released], [data-hover-disabled] *)) { background: var(--hover); }
.theme-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .theme-sun { display: none; }
[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
[data-theme="dark"] .theme-toggle .theme-moon { display: none; }

/* The owner panel follows the same preference as the public website. */
.admin-page, #admin-editor { background: var(--cream); color: var(--ink); }
.admin-sidebar { background: var(--surface-soft); border-color: var(--line); }
.admin-savebar, .admin-stat, .admin-panel, .admin-button, .admin-stats-scroll {
  background: var(--white); border-color: var(--line);
}
.admin-header-actions { display: flex; align-items: center; gap: 18px; }
.admin-header .theme-toggle { background: #242424; color: #f3f2ec; border-color: #4a4a46; }
.admin-header .theme-toggle:hover:where(:not([data-hover-released], [data-hover-disabled] *)) { background: #35352e; }
.admin-sidebar > .eyebrow, .admin-sidebar nav a span, .admin-account small,
.admin-savebar span, .admin-title-row p, .admin-stat small, .admin-help,
.admin-table th, .admin-table td small, .admin-empty, .admin-field small,
.admin-check small, .admin-media-card p, .admin-copy-row .copy-label,
.admin-backup-note, .admin-access p, .admin-loading, .admin-form-section > p,
.admin-history-time { color: var(--muted); }
.admin-help strong { color: var(--ink); }
.admin-sidebar nav a:hover:where(:not([data-hover-released], [data-hover-disabled] *)) { background: var(--hover); }
.admin-sidebar nav a[aria-current="page"] span { color: #493600; }
.admin-sidebar nav a[aria-current="page"]:hover:where(:not([data-hover-released], [data-hover-disabled] *)) { background: var(--yellow); }
.admin-account, .admin-panel-heading, .admin-table td, .admin-filter-row,
.admin-media-card, .admin-copy-row, .admin-dialog-actions, .admin-form-section,
.admin-stats-table td { border-color: var(--line); }
.admin-button.primary, .admin-stat.accent, .admin-number {
  background: var(--yellow); color: var(--black); border-color: var(--yellow);
}
.admin-stat.accent small { color: #493600; }
.admin-button.primary:hover:where(:not([data-hover-released], [data-hover-disabled] *)) { background: #ffc034; }
.admin-button.dark { background: var(--black); color: #fff; border-color: var(--line); }
.admin-button.ghost { background: transparent; }
.admin-button.link { background: none; }
.admin-button.danger { color: var(--danger-ink); border-color: var(--danger-ink); }
.admin-table th, .admin-pill, .admin-stats-table th,
.admin-media-card img { background: var(--surface-soft); }
.admin-pill.active, .admin-alert.success { background: var(--success-bg); color: var(--success-ink); }
.admin-pill.draft, .admin-alert, .admin-hint { background: var(--accent-soft); color: var(--ink); }
.admin-pill.draft { color: var(--accent-ink); }
.admin-alert.error, .form-error { background: var(--danger-bg); color: var(--danger-ink); border-color: var(--danger-ink); }
.admin-field input, .admin-field textarea, .admin-field select,
.admin-filter-row input, .admin-filter-row select, .admin-quarter-grid input,
.admin-stats-table input, .admin-stats-table select {
  background: var(--white); color: var(--ink); border-color: var(--line);
}
.admin-check input { accent-color: var(--yellow); }
.admin-stats-table .remove-row { color: var(--danger-ink); }

@media (max-width: 680px) {
  .header-actions { gap: 7px; }
  .theme-toggle { width: 40px; height: 40px; }
}
@media (max-width: 420px) {
  .header-inner { gap: 8px; }
  .header-inner .brand { gap: 6px; }
  .header-inner .brand img { width: 28px; height: 32px; }
  .header-inner .brand span { font-size: 7.5px; }
  .header-inner .brand strong { font-size: 17px; }
  .header-actions { gap: 5px; }
  .header-actions .theme-toggle, .header-actions .menu-toggle { width: 34px; height: 34px; }
  .language-switch button { min-width: 28px; min-height: 34px; padding-inline: 4px; }
}
@media (max-width: 520px) {
  .admin-header { height: auto; min-height: 75px; flex-wrap: wrap; gap: 14px; padding-block: 16px; }
  .admin-header-actions { margin-left: auto; gap: 12px; }
}

/* Language, theme and menu controls share one square size. */
.site-header .header-actions{--header-control-size:44px}
.site-header .language-switch{padding:0;border:0;background:transparent;gap:4px}
.site-header .language-switch button,.site-header .theme-toggle,.site-header .menu-toggle{
  width:var(--header-control-size);height:var(--header-control-size);
  min-width:var(--header-control-size);min-height:var(--header-control-size);
  flex:0 0 var(--header-control-size);padding:0;border-radius:3px;
}
.site-header .language-switch button{
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--line);background:var(--surface-soft);
}
.site-header .language-switch button[aria-pressed="true"]{
  background:var(--yellow);color:var(--black);border-color:var(--yellow);
}
.site-header .language-switch button:hover:where(:not([data-hover-released], [data-hover-disabled] *)){background:var(--yellow);border-color:var(--yellow)}
:root[data-theme="dark"] .site-header .language-switch button:hover:where(:not([data-hover-released], [data-hover-disabled] *)){color:var(--black)}
.site-header .menu-toggle{border:1px solid var(--line)}
.site-header .language-switch button,.site-header .header-search-toggle,.site-header .theme-toggle,.site-header .menu-toggle,.site-header .main-nav a{border-radius:0}
@media(max-width:680px){.site-header .header-actions{--header-control-size:40px}}
@media(max-width:420px){.site-header .header-actions{--header-control-size:34px}}
@media(max-width:360px){
  .site-header .header-actions{--header-control-size:30px;gap:3px}
  .site-header .league-logo{width:28px}
}


.win-label{background:var(--result-green);color:#006100}
.bye-label{background:#DDEBF7;color:#005595}
.tba-label{background:var(--result-yellow);color:#9C5700;border-color:var(--result-yellow)}
.loss-label,.strip-loss-label{background:var(--result-red);color:#9C0006}

.tab-list :is(button,:where(a[data-game-tab]))[data-filter]{text-transform:uppercase}

:root[data-theme="dark"] .fixture-row .fixture-report:hover:where(:not([data-hover-released], [data-hover-disabled] *)),
:root[data-theme="dark"] .fixture-row .fixture-report:focus-visible{background:#fff;color:var(--black)}

/* Games list and upcoming bye actions share the same box and spacing. */
.games-page .games-results .bye-row{--fixture-action-width:160px}
.games-page .games-results .fixture-report{
 width:100%;min-height:54px;display:flex;align-items:center;
 justify-content:space-between;gap:6px;padding:10px 12px;border:0;
 background:#121212;color:#fff;line-height:1.3;text-align:left;
 transition:background .18s,color .18s;
}
:root[data-theme="dark"] .games-page .games-results .fixture-report{background:#fff;color:#121212}
.games-page .games-results .fixture-report>span{flex:1;min-width:0;line-height:1.3;white-space:nowrap}
.games-page .games-results .fixture-report .arrow-icon{width:18px;height:18px;flex-shrink:0}
.games-page .games-results .fixture-report:hover:where(:not([data-hover-released], [data-hover-disabled] *)),
.games-page .games-results .fixture-report:focus-visible,
:root[data-theme="dark"] .games-page .games-results .fixture-report:hover:where(:not([data-hover-released], [data-hover-disabled] *)),
:root[data-theme="dark"] .games-page .games-results .fixture-report:focus-visible{
 background:#eeae0e;color:#121212;
}

/* White leader cards use the club's yellow figures against black text. */
:root[data-theme="dark"] .leader-card{background:#fff;color:var(--black)}
:root[data-theme="dark"] .leader-card:hover:where(:not([data-hover-released], [data-hover-disabled] *)),
:root[data-theme="dark"] .leader-card:focus-visible{background:#fff;box-shadow:inset 0 0 0 2px var(--yellow)}
:root[data-theme="dark"] .leader-card .eyebrow,
:root[data-theme="dark"] .leader-card h3,
:root[data-theme="dark"] .leader-card p{color:var(--black)}
:root[data-theme="dark"] .leader-card strong{color:var(--yellow)}
.profile-number,.number-chip{background:var(--yellow);color:var(--black)}
:root[data-theme="dark"] .profile-number{color:#121212}
:root[data-theme="dark"] .number-chip{color:#fff}

.back-season-button{background:#121212;color:#fff;border-color:#121212}
.back-season-button:hover:where(:not([data-hover-released], [data-hover-disabled] *)),.back-season-button:focus-visible{background:#303030;color:#fff}
:root[data-theme="dark"] .back-season-button{background:#fff;color:#121212;border-color:#fff}
:root[data-theme="dark"] .back-season-button:hover:where(:not([data-hover-released], [data-hover-disabled] *)),:root[data-theme="dark"] .back-season-button:focus-visible{background:#eee;color:#121212}

:root[data-theme="dark"] .stats-band{background:var(--yellow);color:#121212}
:root[data-theme="dark"] .stats-band-title,:root[data-theme="dark"] .band-stat strong{color:#121212}
:root[data-theme="dark"] .stats-band-title small,:root[data-theme="dark"] .band-stat span{color:#333}
:root[data-theme="dark"] .band-stat{border-color:#12121240}

/* Phone and tablet navigation share the yellow surface in both themes. */
@media(max-width:1240px){
 .site-header .menu-toggle{background:var(--yellow);border-color:var(--yellow);color:var(--black)}
 .site-header .menu-toggle span{background:var(--black)}
 .site-header .main-nav{background:var(--yellow);color:var(--black);border-bottom-color:#12121233}
 .site-header .main-nav a{color:var(--black)}
 .site-header .main-nav a:hover:where(:not([data-hover-released], [data-hover-disabled] *)){background:#12121212;color:var(--black)}
 .site-header .main-nav a[aria-current="page"],.site-header .main-nav a[aria-current="page"]:hover:where(:not([data-hover-released], [data-hover-disabled] *)),.site-header .main-nav a[aria-current="page"]:focus-visible{background:var(--black);color:#fff;box-shadow:none}
 .site-header .main-nav a:focus-visible{outline-color:var(--black);outline-offset:-2px}
 .site-header .main-nav a[aria-current="page"]:focus-visible{outline-color:#fff}
 .site-header .menu-toggle:focus-visible{outline:2px solid var(--black);outline-offset:-4px}
}

/* The control previews the opposite theme with fixed contrasting colors. */
:root .theme-toggle,:root .theme-toggle:hover:where(:not([data-hover-released], [data-hover-disabled] *)),:root .theme-toggle:focus-visible{background:var(--black);color:#fff;border-color:var(--black)}
:root[data-theme="dark"] .theme-toggle,:root[data-theme="dark"] .theme-toggle:hover:where(:not([data-hover-released], [data-hover-disabled] *)),:root[data-theme="dark"] .theme-toggle:focus-visible{background:#fff;color:var(--black);border-color:#fff}
.theme-toggle:is(:hover:where(:not([data-hover-released], [data-hover-disabled] *)),:focus-visible) .theme-moon path{fill:#fff}
.theme-toggle:is(:hover:where(:not([data-hover-released], [data-hover-disabled] *)),:focus-visible) .theme-sun circle{fill:var(--black)}

/* Statistics and report number hexagons keep legible black digits in dark mode. */
:root[data-theme="dark"] :is(.game-report-body,#stats-results,#season-stats-results,#main .match-performers,#main .profile-award-card) .number-chip{background:var(--yellow);color:var(--black)}

.stats-band-title small{font-weight:600}

/* Return actions invert with the theme and share a yellow interaction state. */
.page-return-button{background:#121212;border-color:#121212;color:#fff}
:root[data-theme="dark"] .page-return-button{background:#fff;border-color:#fff;color:#121212}
.page-return-button:hover:where(:not([data-hover-released], [data-hover-disabled] *)),.page-return-button:focus-visible,
:root[data-theme="dark"] .page-return-button:hover:where(:not([data-hover-released], [data-hover-disabled] *)),:root[data-theme="dark"] .page-return-button:focus-visible{background:var(--yellow);border-color:var(--yellow);color:#121212}

/* Ribbon arrows use a transient yellow pointer hover in both themes. */
@media(hover:hover) and (pointer:fine){
 :root .match-ticker .match-ticker-controls button:not(:disabled):hover:where(:not([data-hover-released], [data-hover-disabled] *)){background:var(--yellow);border-color:var(--yellow);color:var(--black)}
}

/* Navigation controls, form actions and ribbon arrows use square corners. */
button,[role="button"],input:is([type="button"],[type="submit"],[type="reset"]),.btn,.admin-button,.language-switch,.jersey-zoom{border-radius:0!important}

/* Native pickers retain their normal border without an accent focus outline. */
:root select{border-radius:0}
:root select:focus{outline:none;box-shadow:none}

/* Upcoming-match actions invert their hover surface with the current theme. */
:root #main a[data-game^="fixture:"]:is(.btn,.game-card-footer,.season-report-button,.fixture-report):not(.season-game-step):not(.season-page a):is(:hover:where(:not([data-hover-released], [data-hover-disabled] *)),:focus-visible){background:#fff;border-color:#fff;color:#121212}
:root[data-theme="dark"] #main a[data-game^="fixture:"]:is(.btn,.game-card-footer,.season-report-button,.fixture-report):not(.season-game-step):not(.season-page a):is(:hover:where(:not([data-hover-released], [data-hover-disabled] *)),:focus-visible){background:#121212;border-color:#121212;color:#fff}

/* A white jersey hexagon stays visible on the yellow game-leader card. */
:root[data-theme="dark"] :is(#main,#details-dialog) .match-performer-winner .number-chip{background:#fff;color:#121212}

/* Player, round and season navigation share the club action colors. */
:root :is(.pg-player-navigation button,.season-report-navigation>.season-game-step){background:#121212;border-color:#121212;color:#fff}
:root[data-theme="dark"] :is(.pg-player-navigation button,.season-report-navigation>.season-game-step){background:#fff;border-color:#fff;color:#121212}
:root :is(.pg-player-navigation button,.season-report-navigation>.season-game-step):not(:disabled):is(:hover:where(:not([data-hover-released], [data-hover-disabled] *)),:focus-visible){background:#eeae0e;border-color:#eeae0e;color:#121212;outline:0}

/* Season actions and completed-game grids share the round-review colors. */
:root :is(#main .season-page:not(.legacy-team-page),#details-dialog .season-dialog-body,#main :where(.games-page #past-games-results,.home-page .match-centre-grid)) :is(.season-match-action>.season-report-button,.game-card>.game-card-footer){background:#121212;border-color:#121212;color:#fff}
:root[data-theme="dark"] :is(#main .season-page:not(.legacy-team-page),#details-dialog .season-dialog-body,#main :where(.games-page #past-games-results,.home-page .match-centre-grid)) :is(.season-match-action>.season-report-button,.game-card>.game-card-footer){background:#fff;border-color:#fff;color:#121212}
:root :is(#main .season-page:not(.legacy-team-page),#details-dialog .season-dialog-body,#main :where(.games-page #past-games-results,.home-page .match-centre-grid)) :is(.season-match-action>.season-report-button,.game-card>.game-card-footer):is(:hover:where(:not([data-hover-released], [data-hover-disabled] *)),:focus-visible){background:#eeae0e;border-color:#eeae0e;color:#121212}
