/* Score-first Games notebook, using the workspace's existing typography/tokens. */
body:has(#page-games.has-game-history:not([hidden])) .workspace-data-notice { display: none; }
#page-games.has-game-history > .workspace-heading,
#page-games.has-game-history > .workspace-intro,
#page-games.has-game-history > #gameOutlook { display: none; }
.games-history { display: grid; grid-template-columns: 204px minmax(0,1fr); gap: 32px; margin-top: 10px; }
.games-history[hidden] { display: none; }
.history-rounds { border-right: 1px solid var(--line); padding-right: 16px; }
.history-season { margin: 20px 0 18px; padding: 0 12px 20px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 650; color: var(--muted); }
.history-round-list { display: grid; gap: 6px; }
.team-workspace .history-round-button { display: flex; gap: 16px; align-items: center; min-height: 68px; padding: 12px; width: 100%; text-align: left; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 15px; }
.history-round-button > span { display: grid; gap: 5px; }
.history-round-button small { font-size: 12px; font-weight: 450; }
.team-workspace .history-round-button[aria-pressed="true"] { color: var(--accent); background: #231b1a; box-shadow: inset 4px 0 var(--accent); }
.history-round-button:hover { background: var(--panel); }
.history-content { min-width: 0; }
.history-heading { display: flex; gap: 22px; align-items: baseline; flex-wrap: wrap; margin: 12px 0 24px; }
.history-heading .workspace-heading { margin: 0; font-size: 40px; }
.history-heading p { color: var(--muted); font-size: 18px; margin: 0; }
.history-round-heading { display: flex; gap: 24px; align-items: baseline; }
.history-round-heading h3 { margin: 0; font-size: 24px; font-weight: 750; }
.history-tally { margin: 0; color: var(--muted); font-size: 16px; }
.history-freshness { display: flex; gap: 12px 24px; justify-content: space-between; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: 12px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.history-freshness p { margin: 0; }
.history-freshness .history-estimate { font-size: 12px; }
.history-day > h4 { margin: 28px 0 10px; font-size: 21px; }
.team-workspace .history-match { border: 0; border-bottom: 1px solid var(--line); background: transparent; border-radius: 0; }
.team-workspace .history-scoreboard { display: grid; grid-template-columns: minmax(0,1fr) 260px 20px; gap: 22px; align-items: center; min-height: 102px; padding: 20px 0; cursor: pointer; list-style: none; font-weight: 400; background: transparent; }
.history-scoreboard::-webkit-details-marker { display: none; }
.history-scoreboard > .workspace-icon { width: 18px; height: 18px; color: var(--muted); }
.history-match[open] > .history-scoreboard > .workspace-icon { transform: rotate(180deg); }
.history-matchup { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 16px; align-items: center; min-width: 0; }
.history-club { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 15px; font-weight: 700; }
.history-club-away { text-align: left; }
.history-club-name { overflow-wrap: anywhere; }
.history-crest { width: 44px; height: 44px; object-fit: contain; flex: 0 0 44px; }
.history-crest[src*="club-ASV."] { filter: brightness(0) invert(1); }
.history-score { display: flex; gap: 20px; align-items: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-score strong { font-size: 32px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.history-result-state { color: var(--muted); font-size: 13px; font-weight: 500; }
.history-scheduled { grid-column: 1 / -1; display: flex; gap: 12px; margin: 0; color: var(--muted); font-size: 12px; }
.history-chance { border-left: 1px solid var(--line); padding-left: 26px; min-width: 0; }
.history-chance-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 7px; }
.history-chance-label { display: block; color: var(--muted); font-size: 14px; }
.history-outcome-marker { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; line-height: 1.3; }
.history-outcome-marker .workspace-icon { width: 18px; height: 18px; flex: 0 0 18px; }
.history-outcome-marker.is-success { color: #69d39a; }
.history-outcome-marker.is-upset { color: #f58a8a; }
.history-chance-values { display: flex; justify-content: space-between; gap: 14px; font-size: 17px; font-variant-numeric: tabular-nums; }
.history-chance .is-favored { color: var(--accent); }
.history-probability-bar { display: flex; overflow: hidden; height: 6px; border-radius: 10px; background: var(--line); margin-top: 8px; }
.history-probability-bar > span { flex-basis: 0; background: var(--accent); }
.history-probability-bar > span + span { background: #a1b0d5; }
.history-no-prediction { font-size: 12px; color: var(--muted); }
.history-match-details { padding: 0 12px 22px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.history-match-details p { margin: 7px 0; }
.history-outcome { color: var(--text); }
.history-provenance { margin-top: 24px; padding-bottom: 20px; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.history-provenance summary { min-height: 44px; display: list-item; cursor: pointer; color: var(--text); font-weight: 650; }
.history-round-mobile { display: none; }
.history-loading,.history-stale { font-size: 13px; color: var(--muted); }
.history-stale { padding: 12px 0; color: var(--accent); }
.history-scoreboard:focus-visible,.history-round-button:focus-visible,.history-provenance summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (min-width: 1400px) { .team-workspace .history-scoreboard { grid-template-columns: minmax(0,1fr) 350px 20px; } }
@media (max-width: 1150px) {
  .games-history { grid-template-columns: 155px minmax(0,1fr); gap: 22px; }
  .team-workspace .history-scoreboard { grid-template-columns: minmax(0,1fr) 210px 18px; gap: 14px; }
  .history-chance { padding-left: 18px; }
  .history-matchup { gap: 10px; }
  .history-score { gap: 10px; }
  .history-club { gap: 8px; font-size: 13px; }
  .history-crest { width: 34px; height: 34px; flex-basis: 34px; }
  .history-score strong { font-size: 26px; }
}
@media (max-width: 900px) {
  .games-history { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .history-rounds { border: 0; padding: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .history-season { border: 0; margin: 0; padding: 10px 0; }
  .history-round-list { display: none; }
  .history-round-mobile { display: flex; gap: 10px; align-items: center; font-size: 13px; }
  .history-round-mobile > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .history-round-mobile select { min-height: 44px; max-width: 160px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: #111b2b; color: var(--text); font: inherit; color-scheme: dark; }
  .history-heading { margin-top: 8px; }
}
@media (max-width: 600px) {
  .history-heading { gap: 4px; display: block; margin-bottom: 20px; }
  .history-heading .workspace-heading { font-size: 30px; margin-bottom: 8px; }
  .history-heading p { font-size: 15px; }
  .history-round-heading h3 { font-size: 22px; }
  .history-freshness { font-size: 12px; padding-bottom: 16px; gap: 8px; }
  .history-day > h4 { font-size: 18px; margin-top: 22px; }
  .team-workspace .history-scoreboard { grid-template-columns: minmax(0,1fr) 18px; gap: 12px; padding: 18px 0; }
  .history-matchup { grid-column: 1; grid-row: 1; gap: 8px; }
  .history-scoreboard > .workspace-icon { grid-column: 2; grid-row: 1 / 3; }
  .history-chance { grid-column: 1; grid-row: 2; border-left: 0; padding-left: 0; }
  .history-club { flex-direction: column; gap: 8px; font-size: 13px; text-align: center; }
  .history-crest { width: 36px; height: 36px; flex-basis: 36px; }
  .history-score { gap: 10px; }
  .history-score strong { font-size: 26px; }
  .history-result-state { font-size: 11px; }
  .history-chance-values { font-size: 15px; }
  .history-chance-label { font-size: 12px; }
  .history-scheduled { justify-content: center; flex-wrap: wrap; }
}
