/* Shared result families, reviewed 24 October 2026 before implementation.
   Figma NY8QhcuOWiEcD0pKDTsbP8: full cards 546:10300 / 546:10341;
   comparison rows 546:10309 / 546:10350. Review 97: 1QzCN4dVbqG2EGKD5doaUCQJYhEQoT6Q2.
   Native structures, source H/A score order, actions and privacy stay intact. */
:root{
  --result-score-surface:#eef6f1;
  --result-score-copy:#064526;
  --result-neutral-surface:#edf0ee;
  --result-neutral-copy:#4f5f55;
  --result-loss-surface:#fff0f0;
  --result-loss-copy:#a52626;
}
html[data-theme="dark"]{
  --result-score-surface:#183c29;
  --result-score-copy:#e8f7ed;
  --result-neutral-surface:#2b3530;
  --result-neutral-copy:#e5ece7;
  --result-loss-surface:#3a2222;
  --result-loss-copy:#ffb8b8;
}

/* Layered important declarations replace the older unlayered important
   result rules. A full result, comparison row and interactive programme cell
   retain distinct purposes instead of sharing one oversized score capsule. */
@layer club-shared {
  body:not(.auth-open) .competition-table-scroll:has(>.competition-games-table) {
    background:var(--sh-panel)!important;
    border-color:var(--sh-line)!important;
    color:var(--sh-copy)!important;
  }
  body:not(.auth-open) .competition-games-table {
    background:transparent!important;
    color:var(--sh-copy)!important;
  }
  body:not(.auth-open) .competition-games-table th {
    padding:12px 16px!important;
    background:transparent!important;
    border-color:var(--sh-line)!important;
    color:var(--sh-muted)!important;
    font:600 .6875rem/1.4 Inter,system-ui,sans-serif!important;
    letter-spacing:.06em!important;
  }
  body:not(.auth-open) .competition-games-table tbody tr>td {
    padding:12px 16px!important;
    background:transparent!important;
    border-color:var(--sh-line)!important;
    color:var(--sh-copy)!important;
    font:600 .875rem/1.4 Inter,system-ui,sans-serif!important;
  }
  body:not(.auth-open) .competition-games-table tbody tr:last-child>td {
    border-bottom:0!important;
  }
  body:not(.auth-open) .competition-games-table .competition-game-link {
    min-height:44px!important;
    padding:8px 0!important;
    color:var(--sh-copy)!important;
    font:600 .875rem/1.4 Inter,system-ui,sans-serif!important;
    overflow-wrap:anywhere;
  }
  body:not(.auth-open) .competition-games-table .competition-game-link:hover {
    text-decoration:underline;
    text-underline-offset:3px;
  }
  body:not(.auth-open) .competition-games-table .cup-round {
    color:var(--sh-muted)!important;
    font:400 .75rem/1.4 Inter,system-ui,sans-serif!important;
  }
  body:not(.auth-open) .competition-games-table td.table-empty {
    color:var(--sh-muted)!important;
    padding:20px 16px!important;
    font-weight:400!important;
  }

  /* 546:10309/10350: comparison scores are raw 14px Inter text. Outcome
     letters and their existing meaningful colours remain; no extra score box. */
  body:not(.auth-open) .competition-games-table .competition-result-pill {
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex-shrink:0!important;
    min-width:0!important;
    min-height:0!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    color:var(--result-neutral-copy)!important;
    box-shadow:none!important;
    font:600 .875rem/1.4 Inter,system-ui,sans-serif!important;
    font-variant-numeric:tabular-nums;
    white-space:nowrap!important;
  }
  body:not(.auth-open) .competition-games-table .competition-result-pill.W {
    color:var(--result-score-copy)!important;
  }
  body:not(.auth-open) .competition-games-table .competition-result-pill.L {
    color:var(--result-loss-copy)!important;
  }
  /* Postponed/abandoned/scheduled are statuses, not numeric score capsules. */
  body:not(.auth-open) .competition-games-table .competition-result-pill:is(.PST,.ABD,.SCH) {
    min-height:36px!important;
    padding:4px 8px!important;
    border-radius:10px!important;
    color:#fff!important;
  }
  body:not(.auth-open) .competition-games-table .competition-result-pill.PST { background:#8a6a22!important; }
  body:not(.auth-open) .competition-games-table .competition-result-pill.ABD { background:#9b5429!important; }
  body:not(.auth-open) .competition-games-table .competition-result-pill.SCH { background:#66727a!important; }

  /* 546:10300/10341: full cards keep each source-ordered score beside its
     team, in plain 30px Barlow rather than the comparison-row treatment. */
  body:not(.auth-open) :is(.club-result-card,.club-result-summary) {
    padding:16px!important;
    gap:10px!important;
    border:1px solid var(--sh-line)!important;
    border-radius:16px!important;
    background:var(--sh-panel)!important;
    color:var(--sh-copy)!important;
    box-shadow:var(--sh-shadow)!important;
  }
  body:not(.auth-open) :is(.club-result-card,.club-result-summary) .club-match-card-team {
    gap:12px!important;
    min-height:44px!important;
  }
  body:not(.auth-open) :is(.club-result-card,.club-result-summary) .club-match-card-team strong {
    color:var(--sh-copy)!important;
    font:600 .875rem/1.4 Inter,system-ui,sans-serif!important;
  }
  body:not(.auth-open) :is(.club-result-card,.club-result-summary) .club-match-card-team+.club-match-card-team strong {
    font-weight:400!important;
  }
  body:not(.auth-open) :is(.club-result-card,.club-result-summary) .club-card-score {
    display:block!important;
    flex:none!important;
    min-width:30px!important;
    min-height:0!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    color:var(--sh-copy)!important;
    box-shadow:none!important;
    font:700 1.875rem/1.4 var(--sh-display)!important;
    font-variant-numeric:tabular-nums;
    text-align:right!important;
  }
  body:not(.auth-open) .club-result-card :is(.club-match-card-meta,.club-match-card-footer) {
    color:var(--sh-muted)!important;
    font:400 .75rem/1.4 Inter,system-ui,sans-serif!important;
  }
  body:not(.auth-open) :is(.club-result-card,.club-result-summary) .club-match-card-meta {
    font:600 .6875rem/1.4 Inter,system-ui,sans-serif!important;
  }
  body:not(.auth-open) .club-result-card .club-match-card-footer {
    margin-top:0!important;
    border-top:0!important;
    padding-top:0!important;
  }
  body:not(.auth-open) .club-result-card .club-card-link {
    color:var(--sh-copy)!important;
    min-height:44px!important;
    font:600 .75rem/1.4 Inter,system-ui,sans-serif!important;
  }
  body:not(.auth-open) .club-results-day-heading {
    margin:12px 0 0!important;
    color:var(--sh-copy)!important;
    font:600 .875rem/1.4 Inter,system-ui,sans-serif!important;
  }

  /* The interactive Home/Away programme is a miniature matrix. Preserve its
     separate 44px button targets, legible display scores and status materials. */
  body:not(.auth-open) .division-matrix-head {
    padding-bottom:12px!important;
    border-color:var(--sh-line)!important;
    color:var(--sh-muted)!important;
    font:600 .6875rem/1.4 Inter,system-ui,sans-serif!important;
  }
  body:not(.auth-open) .division-matrix-row {
    padding:12px 0!important;
    border-color:var(--sh-line)!important;
  }
  body:not(.auth-open) :is(.division-team-link,.division-team-label) {
    color:var(--sh-copy)!important;
    font:600 .875rem/1.4 Inter,system-ui,sans-serif!important;
  }
  body:not(.auth-open) .division-result-cell {
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    min-height:44px!important;
    padding:6px!important;
    border:1px solid var(--sh-line)!important;
    border-radius:10px!important;
    background:var(--result-neutral-surface)!important;
    color:var(--result-neutral-copy)!important;
    box-shadow:inset 0 1px 1px rgba(255,255,255,.08)!important;
    font:700 1.5rem/1 var(--sh-display)!important;
    font-variant-numeric:tabular-nums;
    white-space:nowrap!important;
  }
  body:not(.auth-open) .division-result-cell.W {
    background:var(--result-score-surface)!important;
    color:var(--result-score-copy)!important;
  }
  body:not(.auth-open) .division-result-cell.L {
    background:var(--result-loss-surface)!important;
    color:var(--result-loss-copy)!important;
  }
  body:not(.auth-open) .division-result-cell.status-abandoned {
    background:var(--result-loss-surface)!important;
    color:var(--result-loss-copy)!important;
    font:600 .75rem/1.4 Inter,system-ui,sans-serif!important;
    white-space:normal!important;
  }
  body:not(.auth-open) .programme-status {
    min-height:44px!important;
    border-color:var(--sh-line)!important;
    border-radius:10px!important;
    background:var(--result-neutral-surface)!important;
    color:var(--sh-muted)!important;
    font:500 .75rem/1.4 Inter,system-ui,sans-serif!important;
  }
  body:not(.auth-open) .programme-status.postponed {
    background:var(--result-loss-surface)!important;
    color:var(--result-loss-copy)!important;
  }

  /* Read-only archive scores reuse the comparison typography, without new
     actions or changing the native historical columns and responsive mapping. */
  body:not(.auth-open) .archive-match-list { gap:0!important; }
  body:not(.auth-open) .archive-match-row {
    grid-template-columns:86px minmax(0,1fr) minmax(90px,.7fr) max-content!important;
    padding:12px 0!important;
    border-color:var(--sh-line)!important;
    color:var(--sh-copy)!important;
    font:600 .875rem/1.4 Inter,system-ui,sans-serif!important;
  }
  body:not(.auth-open) .archive-match-row>span {
    color:var(--sh-muted)!important;
    font:400 .75rem/1.4 Inter,system-ui,sans-serif!important;
  }
  body:not(.auth-open) .archive-match-row>strong {
    font-weight:600!important;
    overflow-wrap:anywhere;
  }
  body:not(.auth-open) .archive-match-row>b {
    justify-self:end!important;
    min-width:0!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    color:var(--sh-copy)!important;
    box-shadow:none!important;
    font:600 .875rem/1.4 Inter,system-ui,sans-serif!important;
    font-variant-numeric:tabular-nums;
    text-align:right!important;
  }
  @media(max-width:720px) {
    body:not(.auth-open) .archive-match-row {
      grid-template-columns:72px minmax(0,1fr) max-content!important;
    }
  }
  @media(max-width:560px) {
    /* Retain the existing two-line Cup/group grid areas and wide-table columns. */
    body:not(.auth-open) .competition-games-table tbody tr:not(.match-result-actions)>td {
      border:0!important;
      padding:12px 0 2px 8px!important;
      font-size:.875rem!important;
    }
    body:not(.auth-open) .competition-games-table tbody tr:not(.match-result-actions)>td:nth-child(1) {
      padding-left:16px!important;
      color:var(--sh-muted)!important;
    }
    body:not(.auth-open) .competition-games-table tbody tr:not(.match-result-actions)>td:nth-child(2) {
      font-size:.75rem!important;
    }
    body:not(.auth-open) .competition-games-table tbody tr:not(.match-result-actions)>td:nth-child(3) {
      padding:4px 12px 12px 16px!important;
    }
    body:not(.auth-open) .competition-games-table tbody tr:not(.match-result-actions)>td:nth-child(5) {
      padding:12px 16px 12px 8px!important;
    }
    body:not(.auth-open) .competition-games-table tbody tr+tr:not(.match-result-actions) {
      border-color:var(--sh-line)!important;
    }
    body:not(.auth-open) .grouped-results-table .competition-games-table tbody tr:not(.match-result-actions)>td:nth-child(2) {
      padding:4px 12px 12px 16px!important;
      font-size:.875rem!important;
    }
    body:not(.auth-open) .grouped-results-table .competition-games-table tbody tr:not(.match-result-actions)>td:nth-child(3) {
      padding:12px 0 2px 8px!important;
      color:var(--sh-muted)!important;
    }
    body:not(.auth-open) .grouped-results-table .competition-games-table tbody tr:not(.match-result-actions)>td:nth-child(4) {
      padding:12px 16px 12px 8px!important;
    }
    body:not(.auth-open) .competition-games-table td.table-empty {
      display:block!important;
      padding:20px 16px!important;
      font-size:.875rem!important;
    }
  }
}
