/* Team sports (sports/team.js): results by month, standings, a team's season, box scores. */

.tm-tabs { display: flex; gap: 6px; margin: 0 0 12px; }
.tm-tab, .tm-month {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tm-tab:hover, .tm-month:hover { background: var(--surface); }
.tm-tab.is-on, .tm-month.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tm-months { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tm-month { font-weight: 500; font-size: 13px; padding: 4px 10px; }

.tm-day, .tm-group { margin-bottom: 12px; }
.tm-day h2, .tm-group h2 {
  margin: 0;
  padding: 10px 14px;
  font: 700 20px/1.1 var(--display);
  border-bottom: 1px solid var(--line);
}
.tm-count { margin-left: 6px; font: 500 13px var(--body); color: var(--muted); }

.tm-games { list-style: none; margin: 0; padding: 0; }
.tm-game + .tm-game { border-top: 1px solid var(--line); }
.tm-game-btn {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 8px 14px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.tm-game-btn:disabled { cursor: default; }
.tm-game-btn:not(:disabled):hover { background: var(--surface-2); }
.tm-game-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.tm-when { font-size: 13px; color: var(--muted); }
.tm-at { margin-left: 6px; }
.tm-side { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 1px 0; }
.tm-side a, .tm-side > span:not(.tm-score) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-side a { text-decoration: none; }
.tm-side a:hover { text-decoration: underline; }
.tm-side.is-win { font-weight: 700; }
.tm-score { margin-left: auto; min-width: 28px; text-align: right; font-weight: 600; }
.tm-status { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
/* A longer tag ("NBA Cup Championship", "Knockout Round Playoffs") wraps rather than widen its row's
   status column and squeeze the names. */
.tm-tag { display: block; max-width: 7.5em; margin-left: auto; font-size: 11px; font-weight: 700; line-height: 1.25; color: var(--ink); white-space: normal; }
.tm-wl { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 4px; font-weight: 700; font-size: 12px; }
.tm-wl-w { background: var(--win-bg); color: var(--win); }
.tm-wl-l { background: var(--loss-bg); color: var(--loss); }
.tm-wl-t { background: var(--tie-bg); color: var(--ink); }
.tm-logo { flex: none; object-fit: contain; vertical-align: middle; }
.tm-logo-blank { display: inline-block; border-radius: 50%; background: var(--tie-bg); }

.tm-box { padding: 4px 14px 16px; background: var(--surface-2); border-top: 1px solid var(--line); }
.tm-box .msg { padding: 14px 0; }
.tm-box-bar { float: right; margin: 6px -6px 0 8px; }
.tm-scroll { overflow-x: auto; }
.tm-box table, .tm-standings { border-collapse: collapse; font-size: 13px; }
.tm-box th, .tm-box td, .tm-standings th, .tm-standings td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tm-box thead th, .tm-standings thead th { color: var(--muted); font-weight: 700; }
.tm-line { margin-top: 10px; }
.tm-line th[scope="row"] { text-align: left; display: flex; align-items: center; gap: 6px; }
.tm-tot { font-weight: 700; }
.tm-stats { margin-top: 12px; width: 100%; max-width: 520px; }
.tm-stats th[scope="row"] { text-align: center; font-weight: 500; color: var(--muted); }
.tm-stats td:first-child { text-align: left; }
.tm-players { margin-top: 14px; }
.tm-players caption { text-align: left; font: 700 16px/1.2 var(--display); padding: 0 0 4px; }
.tm-name { text-align: left !important; font-weight: 500; }
.tm-players tfoot th, .tm-players tfoot td { font-weight: 700; }
.tm-events { list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; }
.tm-events li { display: grid; grid-template-columns: 48px 96px 1fr auto; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.tm-min { color: var(--muted); }
.tm-ev { font-weight: 600; }
.tm-evteam { color: var(--muted); }
.tm-ast { color: var(--muted); }
/* A soccer match's lineups, side by side where they fit */
.tm-lineups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 24px; }
.tm-lineup { width: 100%; }
.tm-lineup .tm-lu-n { width: 1px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tm-lineup .tm-lu-p { width: 1px; text-align: left; color: var(--muted); }
.tm-lu-f { margin-left: 6px; font: 500 13px/1 var(--body); color: var(--muted); }
.tm-lu-subs th[scope="rowgroup"] { padding-top: 10px; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.tm-groups { display: grid; gap: 12px; align-items: start; margin-bottom: 12px; }
.tm-groups .tm-group { margin: 0; min-width: 0; }
/* As many columns as the tables fit: 2 (pro) or 3 (college) at 1060 px, 1 on a phone. */
.tm-groups-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 470px), 1fr)); }
.tm-groups-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.tm-groups-3 .tm-group h2 { font-size: 18px; padding: 8px 12px; }
.tm-groups-2 .tm-standings th, .tm-groups-2 .tm-standings td,
.tm-groups-3 .tm-standings th, .tm-groups-3 .tm-standings td { padding: 4px 6px; }

.tm-standings { width: 100%; }
.tm-standings th.tm-name { display: flex; align-items: center; gap: 8px; }
.tm-standings a { text-decoration: none; }
.tm-standings a:hover { text-decoration: underline; }
.tm-rank { min-width: 18px; color: var(--muted); font-weight: 500; text-align: right; }

/* College: a team's national rank before its name (3 Ohio State), the poll it's from, and the
   poll itself in columns across the top of the standings. */
.tm-nr { display: inline-block; margin-right: 4px; font-size: .75em; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.tm-poll { margin-left: auto; align-self: center; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tm-groups .tm-top { grid-column: 1 / -1; }
.tm-top-list { list-style: none; margin: 0; padding: 0; columns: 5 180px; column-gap: 0; font-size: 13px; }
.tm-top-list li { display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-bottom: 1px solid var(--line); break-inside: avoid; }
.tm-top-list .tm-rank { flex: none; font-variant-numeric: tabular-nums; }
.tm-top-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; text-decoration: none; }
a.tm-top-nm:hover { text-decoration: underline; }
.tm-top-rec { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

.tm-team-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.tm-team-head h2 { margin: 0; font: 700 30px/1 var(--display); }
.tm-rec { font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tm-rec:empty { display: none; }
.tm-sched .tm-game-btn { grid-template-columns: 110px minmax(0, 1fr) auto; padding-top: 4px; padding-bottom: 4px; }
.tm-sched .tm-side { padding: 0; line-height: 1.3; }

/* An NBA team's current season: its roster (us-players.js, the coach heading it) above its games,
   a Live card above both; on a wide screen the games in two thirds and the roster in the third
   beside them, as an NFL team's page has them (styles.css), the page and its masthead widened. */
.tm-cols { display: flex; flex-direction: column; }
.tm-gcol { display: contents; }
.tm-cols .tm-live { order: -1; }
@media (min-width: 1200px) {
  [data-view="league"]:has(.tm-cols > .usr:not([hidden])) :is(.crumbs ol, .masthead-inner, .wrap) { max-width: 1400px; }
  .tm-cols:has(> .usr:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
  .tm-cols:has(> .usr:not([hidden])) > .tm-gcol { display: block; }
  .tm-cols > .usr.usr-nba { grid-column: 2; grid-row: 1; margin: 0; }
}

@media (max-width: 600px) {
  .tm-game-btn { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; padding: 8px 10px; }
  .tm-sched .tm-game-btn { grid-template-columns: 74px minmax(0, 1fr) auto; }
  .tm-box { padding: 4px 10px 14px; }
  .tm-events li { grid-template-columns: 40px 1fr; row-gap: 1px; }
  .tm-evwho, .tm-evteam { grid-column: 2; }
}

/* Compact games (MLB, COMPACT in team.js): one line each, away and home either side of the
   score, two to a row from 960 px. The li steps aside (display: contents) so an open box score
   spans the row below its game while the next game keeps the cell beside it (dense). */
.tm-ab { display: none; }
.tm-compact .tm-day { margin-bottom: 10px; }
.tm-compact .tm-day h2 { padding: 7px 12px; font-size: 18px; }
.tm-compact .tm-games { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-flow: row dense; margin-top: -1px; }
.tm-compact .tm-sched { margin-top: 0; }
.tm-compact .tm-game { display: contents; }
.tm-compact .tm-game-btn {
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 5px 12px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.tm-compact .tm-sched .tm-game > .tm-game-btn { grid-template-columns: 76px minmax(0, 1fr) auto; }
.tm-compact .tm-sched .tm-game:first-child > .tm-game-btn { border-top: 0; }
.tm-compact .tm-game-btn[aria-expanded="true"] { background: var(--surface-2); }
.tm-compact .tm-box { grid-column: 1 / -1; }
.tm-compact .tm-when { font-size: 12px; white-space: nowrap; }
.tm-compact .tm-sides { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.tm-compact .tm-side { gap: 6px; padding: 0; }
.tm-compact .tm-away { justify-content: flex-end; }
.tm-compact .tm-away .tm-logo, .tm-compact .tm-away .tm-score { order: 1; }
.tm-compact .tm-home .tm-score { order: -1; text-align: left; }
.tm-compact .tm-score { margin: 0; min-width: 18px; font-variant-numeric: tabular-nums; }
.tm-compact .tm-vs { font-size: 12px; color: var(--muted); }
.tm-compact .tm-status { min-width: 40px; font-size: 12px; }
.tm-compact .tm-sched .tm-status { min-width: 60px; }
.tm-compact .tm-tag { display: inline; margin-left: 6px; }
.tm-compact .tm-wl { width: 18px; height: 18px; margin-right: 5px; font-size: 11px; }

@media (min-width: 960px) {
  .tm-compact .tm-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-compact .tm-game:nth-child(odd) > .tm-game-btn { border-right: 1px solid var(--line); }
  .tm-compact .tm-sched .tm-game:nth-child(2) > .tm-game-btn { border-top: 0; }
}
@media (max-width: 600px) {
  .tm-compact .tm-game-btn { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 8px; padding: 7px 10px; }
  .tm-compact .tm-sched .tm-game > .tm-game-btn { grid-template-columns: 66px minmax(0, 1fr) auto; }
  .tm-compact .tm-nm { display: none; }
  .tm-compact .tm-ab { display: inline; }
}
