/* Tournament statistics (js/stats.js). Square corners, black/yellow, tabular numbers. */
.ts { --ts-line: #E2E2E2; }
.ts-champs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: clamp(28px, 4vw, 44px); }
.ts-champs li { background: var(--black); color: var(--white); padding: 18px 18px 16px; border-top: 5px solid var(--yellow); display: grid; gap: 4px; }
.ts-champ-div { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--yellow); }
.ts-champs b { font-size: clamp(20px, 2vw, 24px); line-height: 1.15; }
.ts-champ-score { font-size: 14px; color: var(--ice); font-variant-numeric: tabular-nums; }

.ts-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: end; border-bottom: 2px solid var(--black); margin-bottom: clamp(20px, 3vw, 32px); }
.ts-divs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; }
.ts-divs button { font: inherit; font-weight: 700; font-size: 14px; padding: 9px 16px; border: 1px solid var(--black); background: var(--white); color: var(--black); cursor: pointer; transition: background-color 160ms ease, transform 160ms var(--ease-out); }
.ts-divs button[aria-pressed="true"] { background: var(--black); color: var(--yellow); }
.ts-divs button:active { transform: scale(0.97); }
.ts-views { display: flex; flex-wrap: wrap; gap: 2px; }
.ts-views button { font: inherit; font-weight: 700; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; padding: 12px 14px 12px; border: 0; background: none; color: var(--grey-d); cursor: pointer; white-space: nowrap; position: relative; }
.ts-views button[aria-selected="true"] { color: var(--black); }
.ts-views button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -2px; height: 5px; background: var(--yellow); }
@media (hover: hover) and (pointer: fine) {
  .ts-views button:hover { color: var(--black); }
  .ts-divs button[aria-pressed="false"]:hover { background: var(--wash); }
}

.ts-body { min-height: 320px; }
.ts-empty { color: var(--grey-d); padding: 24px 0; }
.ts-note { font-size: 14px; color: var(--grey-d); margin-top: 12px; max-width: 80ch; }
.ts-h3 { font-size: 20px; margin: clamp(26px, 3vw, 36px) 0 14px; }
.ts-body > .ts-h3:first-child { margin-top: 0; }

/* tables */
.ts-scroll { overflow-x: auto; }
.ts-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; background: var(--white); }
.ts-table caption { text-align: left; font-weight: 700; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--grey-d); padding-bottom: 10px; }
.ts-table th, .ts-table td { padding: 10px 10px; text-align: center; border-bottom: 1px solid var(--ts-line); white-space: nowrap; }
.ts-table thead th { background: var(--black); color: var(--white); font-size: 12px; letter-spacing: 0.12em; font-weight: 700; border: 0; }
.ts-table tbody th { font-weight: 700; }
.ts-table .ts-l { text-align: left; }
.ts-table td.ts-key { font-weight: 700; background: rgba(253, 214, 0, 0.22); }
.ts-table thead .ts-key { background: var(--yellow); color: var(--black); }
.ts-table tbody tr:first-child td:first-child { font-weight: 700; }
.ts-top td:first-child { font-weight: 700; }
.ts-who { display: flex; align-items: center; gap: 12px; }
.ts-who > span { display: grid; }
.ts-thumb { width: 48px; height: 48px; min-width: 48px; max-width: none; object-fit: cover; object-position: 50% 50%; background: var(--tint); flex: none; }
.ts-face.ts-noface, .ts-big.ts-noface { object-fit: contain; padding: 14%; background: var(--black); }
.ts-thumb.ts-noface { object-fit: contain; padding: 6px; background: var(--black); }
.ts-show { display: none; font-weight: 500; font-size: 13px; color: var(--grey-d); }
.ts-name { font: inherit; font-weight: 700; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .ts-name:hover { text-decoration-color: currentColor; } .ts-table tbody tr:hover td, .ts-table tbody tr:hover th { background-color: #FAFAFA; } .ts-table tbody tr:hover td.ts-key { background: rgba(253, 214, 0, 0.32); } }
.ts-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; background: var(--wash); padding: 2px 6px; vertical-align: 2px; }
@media (max-width: 700px) {
  .ts-hide { display: none; }
  .ts-show { display: block; }
  .ts-table th, .ts-table td { padding: 9px 6px; font-size: 14px; }
  .ts-people .ts-l { white-space: normal; min-width: 0; }
  .ts-thumb { width: 40px; height: 40px; min-width: 40px; }
  .ts-who { gap: 8px; }
}

/* games */
.ts-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.ts-game { background: var(--white); border: 1px solid var(--ts-line); border-top: 4px solid var(--black); padding: 14px 16px 6px; }
.ts-game-meta { font-size: 13px; color: var(--grey-d); margin-bottom: 8px; }
.ts-game-meta span { font-weight: 700; color: var(--black); margin-right: 8px; }
.ts-game-meta abbr { text-decoration: none; font-weight: 700; color: var(--black); background: var(--yellow); padding: 0 5px; }
.ts-side { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; gap: 12px; align-items: center; padding: 6px 0; color: var(--grey-d); }
.ts-team { font-weight: 600; font-size: 17px; }
.ts-sog { font-size: 12px; color: var(--grey); font-variant-numeric: tabular-nums; }
.ts-score { font-size: 26px; text-align: right; font-variant-numeric: tabular-nums; line-height: 1; }
.ts-side { margin-inline: -16px; padding: 7px 16px; }
.ts-win { color: var(--black); background: var(--yellow); }
.ts-win .ts-team, .ts-win .ts-score { font-weight: 800; }
.ts-win .ts-sog { color: #3a3a3a; }
.ts-more { border-top: 1px solid var(--ts-line); margin-top: 8px; }
.ts-more summary { cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; padding: 10px 0; list-style: none; display: flex; justify-content: space-between; }
.ts-more summary::-webkit-details-marker { display: none; }
.ts-more summary::after { content: "+"; font-size: 18px; line-height: 1; transition: transform 200ms var(--ease-out); }
.ts-more[open] summary::after { transform: rotate(45deg); }
.ts-more-in { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-bottom: 12px; font-size: 14px; }
.ts-more-h { font-weight: 700; margin-bottom: 4px; }
.ts-pts { display: grid; gap: 4px; }
.ts-more .ts-name { font-weight: 600; }
.ts-ast { color: var(--grey-d); }
.ts-ast .ts-name { font-weight: 500; }
.ts-none { color: var(--grey); }
.ts-gk { margin-top: 8px; color: var(--grey-d); font-size: 13px; }
.ts-wide { grid-column: 1 / -1; margin-top: 0; }
@media (max-width: 480px) { .ts-more-in { grid-template-columns: 1fr; } }

/* player directory */
.ts-search { display: grid; gap: 6px; max-width: 420px; margin-bottom: 20px; }
.ts-search span { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--grey-d); }
.ts-search input { font: inherit; font-size: 16px; padding: 12px 14px; border: 2px solid var(--black); border-radius: 0; background: var(--white); color: var(--ink); }
.ts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.ts-card { display: block; width: 100%; padding: 0; border: 0; background: var(--white); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ts-face { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 20%; background: var(--tint); transition: transform 300ms var(--ease-out); }
.ts-card > .ts-face { display: block; }
.ts-card { overflow: hidden; }
.ts-card-text { display: grid; gap: 2px; padding: 10px 2px 4px; }
.ts-card-text b { font-size: 15px; line-height: 1.25; }
.ts-card-text span { font-size: 13px; color: var(--grey-d); }
.ts-card-line { font-variant-numeric: tabular-nums; }
.ts-card:active .ts-face { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .ts-card:hover .ts-face { transform: scale(1.03); } }

/* player dialog */
dialog.ts-player { border: 0; padding: 0; border-radius: 0; background: var(--white); color: var(--ink); width: min(820px, calc(100vw - 24px)); max-height: min(88vh, 920px); overflow: auto;
  opacity: 1; transform: scale(1); transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
@starting-style { dialog.ts-player[open] { opacity: 0; transform: scale(0.96); } }
dialog.ts-player::backdrop { background: rgba(0, 0, 0, 0.75); }
.ts-close { position: sticky; top: 0; float: right; margin: 10px 10px 0 0; z-index: 2; width: 40px; height: 40px; border: 0; background: var(--black); color: var(--white); font-size: 26px; line-height: 1; cursor: pointer; }
.ts-player-in { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(18px, 3vw, 32px); padding: clamp(18px, 3.5vw, 34px); }
.ts-big { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 20%; background: var(--tint); }
.ts-player-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--grey-d); padding-right: 44px; }
.ts-player-name { font-size: clamp(24px, 3vw, 32px); margin-top: 6px; }
.ts-line { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; }
.ts-line li { background: var(--black); color: var(--white); padding: 10px 14px 8px; min-width: 64px; display: grid; }
.ts-line b { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.ts-line span { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; color: var(--yellow); margin-top: 4px; }
.ts-log td small { display: block; font-size: 12px; color: var(--grey); }
.ts-log td.ts-l { white-space: normal; }
@media (max-width: 640px) {
  .ts-player-in { grid-template-columns: 1fr; }
  .ts-player-photo { max-width: 150px; }
  .ts-line li { min-width: 54px; padding: 8px 10px 6px; }
  .ts-line b { font-size: 22px; }
}
@media (max-width: 900px) { .ts-champs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .ts-face, dialog.ts-player { transition: none; } }
@media (max-width: 520px) { .ts-views button { padding: 10px 8px; font-size: 12px; letter-spacing: 0.08em; } }

/* game sheet: every goal in order */
.ts-sheet { display: grid; gap: 0; counter-reset: none; }
.ts-sheet li { display: grid; grid-template-columns: 22px 46px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--ts-line); }
.ts-sheet li:last-child { border-bottom: 0; }
.ts-n { font-size: 12px; color: var(--grey); font-variant-numeric: tabular-nums; }
.ts-run { font-variant-numeric: tabular-nums; color: var(--grey-d); font-size: 14px; }
.ts-run b { color: var(--black); }
.ts-goal .ts-name { font-weight: 700; }
.ts-goal small { display: block; font-size: 13px; color: var(--grey-d); margin-top: 1px; }
.ts-goal small .ts-name { font-weight: 500; }
.ts-gks { border-top: 2px solid var(--black); padding-top: 8px; }
.ts-gks .ts-gk { margin-top: 2px; }
.ts-more-in { grid-template-columns: 1fr; gap: 10px; }
.ts-asof, .ts-rule { display: block; text-transform: none; letter-spacing: 0; font-size: 14px; }
.ts-asof { color: var(--black); font-weight: 700; margin-top: 6px; }
.ts-rule { font-weight: 500; color: var(--grey-d); }
.ts-about-old { background: var(--wash); border-left: 5px solid var(--yellow); padding: 14px 18px; margin-bottom: 20px; display: grid; gap: 6px; font-size: 15px; color: var(--ink); max-width: 900px; }
.ts-about b { font-weight: 700; }
.ts-games { align-items: start; }

/* live events (data-live): status line, live games, upcoming games, jersey numbers */
.ts-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; color: var(--grey-d); margin: 0 0 18px; min-height: 22px; }
.ts-status b { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--black); background: var(--wash); padding: 3px 8px; }
.ts-status-live b { background: var(--black); color: var(--yellow); display: inline-flex; align-items: center; gap: 6px; }
.ts-status-live b::before { content: ""; width: 7px; height: 7px; background: #E5322D; border-radius: 50%; animation: ts-pulse 1.6s ease-in-out infinite; }
.ts-status-off b { background: var(--yellow); }
@keyframes ts-pulse { 50% { opacity: 0.25; } }
.ts-game-meta .ts-live-tag { background: var(--black); color: var(--yellow); }
.ts-playing { border-top-color: var(--yellow); }
.ts-upcoming { border-top-color: var(--ts-line); }
.ts-upcoming .ts-side { color: var(--grey-d); }
.ts-soon { font-size: 13px; padding: 8px 0 10px; }
.ts-live-note { font-weight: 500; color: var(--grey-d); }
.ts-num { font-weight: 500; color: var(--grey-d); font-variant-numeric: tabular-nums; }
.ts-unknown { font-weight: 600; color: var(--grey-d); }
.ts-thumb.ts-crop { object-position: 50% 15%; }
.ts-champs:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .ts-status-live b::before { animation: none; } }
