/* Shared completed-game histories for scorecards and comparison columns. */
.fo-histories-grid { container-type: inline-size; }
/* Layout containment on a subgrid prevents its rows from sharing intrinsic sizes. */
.fo-histories-grid .th-history-compact { container-type: normal; }
.th-history.th-history .th-average {
  padding: 10px 12px;
  border-radius: var(--beta-radius-sm);
}
.th-history.th-history .th-average-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 7px;
  margin: 0;
  font: 500 10px/1.35 var(--beta-font-body);
  color: var(--beta-ink);
}
.th-history .th-difficulty-value {
  font: 650 34px/1.15 var(--beta-font-display);
  letter-spacing: -.5px;
  color: var(--beta-accent);
}
.th-history .th-difficulty-label { font-size: 10px; overflow-wrap: anywhere; }
.th-history.th-history .th-average-value {
  margin: 5px 0 2px;
  font: 650 13px/1.4 var(--beta-font-body);
  letter-spacing: 0;
  color: var(--beta-ink);
}
.th-history.th-history .th-average-unit {
  font: 400 10px/1.4 var(--beta-font-body);
  color: var(--beta-muted);
  white-space: normal;
}
.th-history.th-history .th-average-note {
  font-size: 10px;
  line-height: 1.4;
}
.th-history .th-difficulty-value.th-unavailable {
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--beta-muted);
}
.th-history.th-history .th-average-value.th-unavailable {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--beta-muted);
}
.th-history.th-history .th-games {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.th-history.th-history .th-game {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: stretch;
  align-items: center;
  gap: 3px 8px;
  padding: 8px 10px;
  border-color: var(--beta-rule);
}
.th-history.th-history .th-game-context {
  grid-column: 1;
  grid-row: 1;
  justify-content: start;
  gap: 3px 10px;
  font-size: 11px;
}
.th-history.th-history .th-game-date {
  align-items: baseline;
  gap: 2px 8px;
}
.th-history.th-history .th-game-date span {
  font-size: 14px;
  font-weight: 750;
  color: var(--beta-ink);
}
.th-history.th-history .th-opponent {
  display: flex;
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  margin-block: -8px;
  padding: 8px 0 8px 8px;
  border-left: 1px solid var(--beta-rule);
}
.th-history.th-history .th-result {
  width: 48px;
  flex: none;
  font-size: 28px;
}
.th-history.th-history .th-final {
  grid-column: 1;
  grid-row: 2;
  justify-content: start;
  align-items: center;
  flex-direction: row;
  padding: 0;
  border: 0;
  gap: 4px;
}
.th-history.th-history .th-final-score {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 13px;
  line-height: 1.2;
  white-space: normal;
}
.th-history .th-score-team {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.th-history .th-score-logo {
  width: 28px;
  height: 28px;
  flex: none;
  object-fit: contain;
}
.th-history.th-history .th-result-t { background: #e2a62d; color: #30230a; }
.th-history .th-score-separator { color: var(--beta-muted); }
.th-history .th-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
html[data-theme=dark] .th-history :is(img.th-score-logo, img.th-team-logo) {
  background: #eeeee6;
  padding: 2px;
  border-radius: 4px;
}
.th-history.th-history-compact .th-team-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font: 700 17px/1.3 var(--beta-font-display);
  color: var(--beta-ink);
}
.th-history .th-team-logo { width: 64px; height: 64px; object-fit: contain; }
.th-history.th-history-compact .th-average { padding: 8px 10px; }
.th-history.th-history-compact .th-average-label { font-size: 10px; }
.th-history.th-history-compact .th-difficulty-value { font-size: 30px; }
.th-history.th-history-compact .th-difficulty-value.th-unavailable { font-size: 15px; }
.th-history.th-history-compact .th-average-value { font-size: 12px; }
.th-history.th-history-compact .th-average-unit { font-size: 9px; }
.th-history.th-history-compact .th-average-value.th-unavailable { font-size: 11px; }
.th-history.th-history-compact .th-game { padding: 6px; gap: 3px 6px; }
.th-history.th-history-compact .th-game-context { display: flex; flex-wrap: wrap; font-size: 10px; gap: 2px 6px; }
.th-history.th-history-compact .th-game-date { gap: 2px 4px; }
.th-history.th-history-compact .th-game-date span { font-size: 13px; }
.th-history.th-history-compact .th-opponent { margin-block: -6px; padding: 6px 0 6px 6px; }
.th-history.th-history-compact .th-result { width: 42px; font-size: 26px; }
.th-history.th-history-compact .th-final-score { font-size: 12px; gap: 3px; }
.th-history.th-history-compact .th-score-team { gap: 2px; }
.th-history.th-history-compact .th-score-logo { width: 24px; height: 24px; }
/* The pair contains two 230px columns and a gap of up to 16px. */
@container (max-width: 476px) {
  .fo-histories-grid .th-history-compact .th-result { width: 40px; font-size: 25px; }
  .fo-histories-grid .th-history-compact .th-team-logo { width: 52px; height: 52px; }
}
@container (max-width: 340px) {
  .fo-histories-grid .th-history-compact .th-game { gap: 3px 4px; }
  .fo-histories-grid .th-history-compact .th-opponent { padding-left: 4px; }
  .fo-histories-grid .th-history-compact .th-result { width: 36px; font-size: 23px; }
  .fo-histories-grid .th-history-compact .th-score-logo { width: 20px; height: 20px; }
  .fo-histories-grid .th-history-compact .th-final-score { gap: 2px; }
}
