/* The team page (team.html). The roster cards, chips and social icons are the Teams page's (styles/teams.css, loaded first); this
   file is the page around them. */

.tp-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px var(--pad) 96px;
}

.tp-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

/* "Stats from" above the charts */
.tp-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; }
.tp-filter[hidden] { display: none; }
.tp-filter label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.tp-filter-hint { font-size: 12px; }

/* "That team was not found" (a stale link): the page loads no other sheet that styles a notice, so it was bare text */
.tp-page .notice { margin: 0 0 16px; }
.tp-page .notice[hidden] { display: none; }
.tp-page .notice--error { padding: 12px 16px; background: rgba(255, 122, 122, 0.08); border: 1px solid rgba(255, 122, 122, 0.35); border-radius: var(--radius-sm); color: #ff7a7a; font-size: 14px; font-weight: 600; }

.tp-back { font-size: 14px; font-weight: 700; color: var(--text-dim); }
.tp-back:hover { color: var(--primary); }
.tp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tp-actions [hidden] { display: none; }

.tp-card {
    margin-bottom: 16px;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

/* who the team is, and how it is doing */
.tp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; }
.tp-id { display: flex; align-items: center; gap: 20px; min-width: 0; }
.tp-logo { flex-shrink: 0; width: 104px; height: 104px; object-fit: contain; }
.tp-title { min-width: 0; }
.tp-name { margin: 0; font-family: var(--font-display); font-size: clamp(32px, 5vw, 52px); font-weight: 400; line-height: 1.05; overflow-wrap: anywhere; }
.tp-tiles { display: flex; flex-wrap: wrap; gap: 12px; }
.tp-tile { display: flex; flex-direction: column; flex: 1 1 150px; min-width: 140px; padding: 10px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tp-tile strong { font-family: var(--font-display); font-size: 34px; font-weight: 400; line-height: 1; color: var(--primary); }
.tp-tile--good strong { color: var(--primary); }
.tp-tile--mid strong { color: #e0c53f; }
.tp-tile--bad strong { color: #ff7a7a; }
.tp-tile--none strong { color: var(--text-muted); }
.tp-rec i { font-style: normal; }
.tp-rec .tp-w { color: var(--primary); }
.tp-rec .tp-l { color: #ff7a7a; }
.tp-rec .tp-d { color: #e0c53f; }
.tp-rec .tp-dash { color: var(--text-muted); }
.tp-tile > span { margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.tp-tile small { font-size: 12px; color: var(--text-dim); }

.tp-card .team-body { padding: 0; --card-w: 150px; }

/* section headings inside a card */
.tp-h { margin: 0 0 4px; font-family: var(--font-display); font-size: 20px; font-weight: 400; letter-spacing: 0.02em; text-transform: uppercase; }
.tp-sub { margin: 0 0 12px; font-size: 12.5px; }
/* a section's heading with its button at the right end */
.tp-h-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.tp-h-row .tp-h { margin: 0; }
.tp-none { margin: 10px 0; font-size: 13px; }

/* charts, in the style of Daily Scrims */
.tp-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.tp-charts .tp-card { margin: 0; min-width: 0; }
.tp-chart--wide { grid-column: 1 / -1; }
.tp-chart svg { display: block; max-width: 100%; }

.tp-donut { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.tp-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.tp-legend li { display: flex; align-items: center; gap: 8px; }
.tp-legend i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.tp-legend span { color: var(--text-dim); min-width: 52px; }
.tp-formrow { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.tp-formrow .tp-sub { margin: 0; }
.tp-form { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-chip { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; font-size: 13px; font-weight: 800; cursor: default; }
.tp-chip--W { background: rgba(174, 232, 117, 0.18); color: var(--primary); }
.tp-chip--L { background: rgba(255, 122, 122, 0.16); color: #ff7a7a; }
.tp-chip--D { background: rgba(142, 151, 168, 0.2); color: var(--text-dim); }

.tp-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.tp-bars li { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 42px 56px; align-items: center; gap: 10px; font-size: 13px; }
.tp-bar-name { display: flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tp-bar-name i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-muted); }
.tp-bar-track { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.tp-bar-fill { display: block; height: 100%; border-radius: 99px; }
.tp-bar-fill.is-good { background: var(--primary); }
.tp-bar-fill.is-mid { background: #e0c53f; }
.tp-bar-fill.is-bad { background: #ff7a7a; }
.tp-bars b { text-align: right; font-family: var(--font-display); font-weight: 400; font-size: 15px; }
.tp-bars small { color: var(--text-muted); font-size: 11.5px; }

/* the latest results: a scrim or a tournament match each, with its sets under it */
.tp-results { display: flex; flex-direction: column; gap: 8px; }
.tp-result { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tp-result > summary { display: grid; grid-template-columns: 32px 70px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 9px 12px; list-style: none; cursor: pointer; }
.tp-result > summary::-webkit-details-marker { display: none; }
.tp-result > summary:hover { background: var(--surface-3); border-radius: var(--radius-sm); }
.tp-res { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; font-size: 13px; font-weight: 800; }
.tp-result--W .tp-res { background: rgba(174, 232, 117, 0.18); color: var(--primary); }
.tp-result--L .tp-res { background: rgba(255, 122, 122, 0.16); color: #ff7a7a; }
.tp-result--D .tp-res { background: rgba(142, 151, 168, 0.2); color: var(--text-dim); }
.tp-score { font-family: var(--font-display); font-size: 21px; }
.tp-opp { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; }
.tp-opp a:hover { color: var(--primary); }
.tp-opp-logo { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; }
.tp-type { padding: 2px 10px; border-radius: 99px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; background: var(--surface-3); color: var(--text-dim); }
.tp-type--tournament { background: rgba(77, 142, 224, 0.18); color: #6aa8ee; }
.tp-when { font-size: 12px; white-space: nowrap; }
.tp-sets { list-style: none; margin: 0; padding: 4px 12px 10px 56px; display: flex; flex-direction: column; gap: 4px; }
.tp-sets li { display: grid; grid-template-columns: 54px minmax(0, 1fr) 56px 44px; align-items: center; gap: 10px; font-size: 13px; }
.tp-sets img, .tp-set-noimg { width: 54px; height: 26px; border-radius: 5px; object-fit: cover; background: var(--surface-3); }
.tp-set-map { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-sets b { font-family: var(--font-display); font-weight: 400; font-size: 15px; text-align: center; }
.tp-sets i { font-style: normal; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.tp-sets .is-won i { color: var(--primary); }
.tp-sets .is-lost i { color: #ff7a7a; }

/* who it has played the most */
.tp-opps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 10px; }
.tp-opp-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: inherit; text-decoration: none; }
.tp-opp-card:hover { border-color: var(--primary); }
.tp-opp-card img, .tp-opp-noimg { grid-row: 1 / 3; width: 34px; height: 34px; object-fit: contain; }
.tp-opp-name { min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.tp-opp-card img, .tp-opp-noimg { grid-column: 1; }
.tp-opp-name { grid-column: 2; grid-row: 1; }
.tp-opp-card small { grid-column: 2; grid-row: 2; color: var(--text-muted); font-size: 11.5px; }
.tp-opp-card b { grid-column: 3; grid-row: 1 / 3; font-family: var(--font-display); font-weight: 400; font-size: 20px; white-space: nowrap; }
.tp-opp-card b.is-good { color: var(--primary); }
.tp-opp-card b.is-mid { color: #e0c53f; }
.tp-opp-card b.is-bad { color: #ff7a7a; }

/* a rank on a roster card, in the ladder step's colour */
.tp-rank { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; max-width: 100%; margin-top: 4px; padding: 2px 9px 2px 4px; border-radius: 99px; font-size: 11.5px; font-weight: 800; color: var(--text-dim); border: 1px solid var(--border); white-space: nowrap; }
.tp-rank:hover { filter: brightness(1.3); }
.tp-rank img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.tp-rank span { overflow: hidden; text-overflow: ellipsis; }

/* the rating's move over 30 days, under the rating tile */
.tp-trend { margin-top: 4px; font-style: normal; font-size: 12px; font-weight: 800; }
.tp-trend--up { color: var(--primary); }
.tp-trend--down { color: #ff7a7a; }
.tp-trend--flat { color: var(--text-muted); }

.tp-followers { font-size: 13px; font-weight: 700; }

/* the rating chart: hover card and its high / low points */
.tp-chart { position: relative; }
.tp-chart svg { touch-action: pan-y; }
.tp-tip { position: absolute; z-index: 5; min-width: 170px; max-width: 280px; padding: 8px 10px; background: var(--surface-3, #232a3a); border: 1px solid var(--border-strong, var(--border)); border-radius: var(--radius-sm); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45); font-size: 12.5px; pointer-events: none; }
.tp-tip[hidden] { display: none; }
.tp-tip-head { display: flex; align-items: baseline; gap: 8px; }
.tp-tip-head span { font-family: var(--font-display); font-size: 18px; color: var(--primary); }
.tp-tip-head em { font-style: normal; font-weight: 800; font-size: 12px; color: var(--text-muted); }
.tp-tip-head em.is-up { color: var(--primary); }
.tp-tip-head em.is-down { color: #ff7a7a; }
.tp-tip-row { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.tp-tip-row i { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 5px; font-style: normal; font-size: 10.5px; font-weight: 800; flex-shrink: 0; }
.tp-tip-row--W i { background: rgba(174, 232, 117, 0.18); color: var(--primary); }
.tp-tip-row--L i { background: rgba(255, 122, 122, 0.16); color: #ff7a7a; }
.tp-tip-row--D i { background: rgba(142, 151, 168, 0.2); color: var(--text-dim); }
.tp-tip-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-tip-row small { margin-left: auto; color: var(--text-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; }
.tp-miles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tp-mile { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; font-size: 12.5px; color: var(--text-dim); }
.tp-mile i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tp-mile b { font-family: var(--font-display); font-weight: 400; font-size: 15px; color: var(--text); }
.tp-mile--jump b { color: var(--primary); }
.tp-mile--drop b { color: #ff7a7a; }
.tp-mile--peak b { color: #e0c53f; }

/* strongest and weakest maps */
.tp-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tp-pick-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tp-pick-col h3 { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.tp-pick { position: relative; display: flex; align-items: stretch; min-height: 64px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tp-pick-img { flex: 0 0 96px; background: var(--surface-3) var(--map, none) center / cover no-repeat; }
.tp-pick-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 8px 14px; flex: 1; min-width: 0; }
/* (a long map name goes onto a second line: "…" does not work on a flex box, so on a phone it was cut to its first four letters) */
.tp-pick-name { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.tp-pick-name i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-muted); }
.tp-pick-body b { grid-row: 1 / 3; grid-column: 2; font-family: var(--font-display); font-weight: 400; font-size: 24px; }
.tp-pick-body small { color: var(--text-muted); font-size: 12px; }
.is-good { color: var(--primary); }
.is-mid { color: #e0c53f; }
.is-bad { color: #ff7a7a; }

/* compare with another team */
.tp-compare-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 20px; margin-bottom: 8px; }
.tp-compare-head .tp-sub { margin-bottom: 0; }
.tp-select { min-width: 220px; max-width: 100%; padding: 8px 12px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong, var(--border)); border-radius: var(--radius-sm); font: inherit; font-weight: 600; }
.tp-vs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 280px) minmax(0, 1fr); align-items: center; gap: 16px; margin: 10px 0 18px; }
.tp-vs-side { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tp-vs-side--b { justify-content: flex-end; }
.tp-vs-side strong { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1; color: var(--primary); }
.tp-vs-side a { min-width: 0; color: inherit; text-decoration: none; }
.tp-vs-side a:hover { color: var(--primary); }
.tp-vs-team { display: inline-flex; align-items: center; gap: 9px; min-width: 0; font-weight: 800; font-size: 17px; }
.tp-vs-team img, .tp-vs-team .tp-opp-noimg { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; }
.tp-vs-team span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-vs-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.tp-odds { display: flex; width: 100%; height: 26px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.tp-odds i { display: flex; align-items: center; justify-content: center; min-width: 38px; font-style: normal; font-size: 12px; font-weight: 800; color: #0f1218; }
.tp-odds-a { background: var(--primary); }
.tp-odds-b { background: #6aa8ee; }
.tp-vs-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.tp-vs-cols h3, .tp-common h3 { margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.tp-stat { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.tp-stat span { color: var(--text-muted); font-size: 12px; text-align: center; }
.tp-stat b { font-family: var(--font-display); font-weight: 400; font-size: 18px; color: var(--text-dim); }
.tp-stat b:last-child { text-align: right; }
.tp-stat b.is-best { color: var(--primary); }
.tp-meet-big { display: flex; align-items: baseline; gap: 12px; }
.tp-meet-big b { font-family: var(--font-display); font-weight: 400; font-size: 38px; line-height: 1; }
.tp-meet-big span { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.tp-meet .tp-sub { margin: 6px 0 8px; }
.tp-meet-list > div { display: grid; grid-template-columns: 60px minmax(0, 1fr) 56px 40px; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.tp-meet-list b { font-family: var(--font-display); font-weight: 400; text-align: center; }
.tp-meet-list i { font-style: normal; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.tp-meet-list .is-won i { color: var(--primary); }
.tp-meet-list .is-lost i { color: #ff7a7a; }
.tp-common { margin-top: 18px; }
.tp-common-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 130px; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; }
.tp-common-row .tp-vs-team { font-size: 14px; }
.tp-common-row .tp-vs-team img, .tp-common-row .tp-opp-noimg { width: 26px; height: 26px; }
.tp-vs-open { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--primary); }

/* tournaments */
.tp-tourneys { display: flex; flex-direction: column; gap: 8px; }
.tp-tourney { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: inherit; text-decoration: none; }
.tp-tourney:hover { border-color: var(--primary); }
.tp-tourney img, .tp-tourney-noimg { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface-3); }
.tp-tourney-body { display: flex; flex-direction: column; min-width: 0; }
.tp-tourney-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-place { display: inline-flex; flex-direction: column; align-items: center; min-width: 58px; padding: 4px 10px; border-radius: 10px; background: var(--surface-3); color: var(--text-dim); }
.tp-place b { font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1.1; }
.tp-place small { font-size: 10.5px; color: inherit; opacity: 0.85; } /* (the chip's own tone: the grey it had was 2.2-3:1 on the tinted chips) */
.tp-place--1 { background: rgba(255, 210, 63, 0.16); color: #ffd23f; }
.tp-place--2 { background: rgba(200, 208, 222, 0.15); color: #d3d9e6; }
.tp-place--3 { background: rgba(221, 138, 58, 0.17); color: #e8995a; }
.tp-place--half { background: rgba(174, 232, 117, 0.12); color: var(--primary); }
/* the official events' chips hold a word ("Champions", "Through") or a record rather than a place */
#bscList .tp-place { min-width: 84px; }
#bscList .tp-place b { font-size: 16px; }
.tp-more { align-self: flex-start; }

/* the season's player changes: a timeline, a day's "out -> in" swaps beside its date */
.tp-changes { display: flex; flex-direction: column; }
.tp-change-day { position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 18px; padding: 14px 0 14px 0; border-bottom: 1px solid var(--border); }
.tp-change-date { display: flex; flex-direction: column; align-items: center; justify-content: center; align-self: start; padding: 8px 6px; border-radius: 12px; background: var(--surface-3); line-height: 1.15; }
.tp-change-date b { font-family: var(--font-display); font-size: 26px; font-weight: 400; }
.tp-change-date span { font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); text-align: center; }
.tp-swaps { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; align-content: flex-start; }
.tp-swap { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); min-width: 0; }
.tp-swap.is-swap { background: linear-gradient(90deg, rgba(255, 92, 104, 0.07), rgba(174, 232, 117, 0.08)); }
.tp-sw-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tp-sw-photo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: top center; flex: none; background: var(--surface-3); box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--ring, var(--border)); }
.tp-sw-person.is-out { --ring: rgba(255, 92, 104, 0.75); }
.tp-sw-person.is-in { --ring: rgba(174, 232, 117, 0.85); }
.tp-sw-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tp-sw-tag { align-self: flex-start; padding: 0 7px; border-radius: 99px; font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.is-out .tp-sw-tag { background: rgba(255, 92, 104, 0.16); color: #ff8a80; }
.is-in .tp-sw-tag { background: rgba(174, 232, 117, 0.16); color: var(--primary); }
.tp-sw-name { font-size: 15px; font-weight: 800; color: var(--text); overflow-wrap: anywhere; }
a.tp-sw-name:hover { color: var(--primary); }
.tp-sw-text small { font-size: 11.5px; font-weight: 600; }
.tp-sw-arrow { flex: none; font-size: 22px; font-weight: 800; color: var(--text-muted); }
.tp-swap.is-move { background: linear-gradient(90deg, rgba(224, 160, 63, 0.10), rgba(224, 160, 63, 0.03)); border-color: rgba(224, 160, 63, 0.35); }
.tp-sw-stack { display: flex; flex: none; }
.tp-sw-stack .tp-sw-photo { --ring: rgba(224, 160, 63, 0.8); width: 40px; height: 40px; margin-left: -10px; }
.tp-sw-stack .tp-sw-photo:first-child { margin-left: 0; }
.tp-sw-tag--move { background: rgba(224, 160, 63, 0.16); color: #e0a03f; }
@media (max-width: 560px) {
    .tp-change-day { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .tp-change-date { flex-direction: row; gap: 8px; justify-self: start; padding: 4px 10px; }
    .tp-swap { flex-wrap: wrap; width: 100%; }
}

/* everyone who has played for the team */
.tp-history { display: flex; flex-direction: column; }
/* (fixed columns, so every row's bar sits on the same time axis) */
.tp-hist-row { display: grid; grid-template-columns: 46px minmax(130px, 1fr) minmax(160px, 2fr) 170px 150px; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.tp-hist-photo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: top center; background: var(--surface-3); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--border); }
.is-current .tp-hist-photo { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(174, 232, 117, 0.7); }
.tp-hist-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tp-hist-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.tp-hist-name { font-size: 16px; font-weight: 800; color: var(--text); overflow-wrap: anywhere; }
a.tp-hist-name:hover { color: var(--primary); }
.tp-hist-who em { padding: 1px 8px; border-radius: 99px; font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.tp-hist-who em.is-now { background: rgba(174, 232, 117, 0.16); color: var(--primary); }
.tp-hist-who em.is-left { background: var(--surface-3); color: var(--text-muted); }
.tp-hist-who small { font-weight: 600; color: var(--text-muted); font-size: 12px; }
.tp-hist-who small a { color: var(--text-dim); text-decoration: underline; }
.tp-hist-track { position: relative; height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.tp-hist-track b { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-strong, rgba(255, 255, 255, 0.14)); }
.tp-hist-track i { position: absolute; top: 1px; bottom: 1px; border-radius: 99px; background: var(--text-muted); }
.is-current .tp-hist-track i { background: var(--primary); }
.tp-hist-dates { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.tp-hist-rank { display: flex; justify-content: flex-end; min-height: 1px; }
.tp-hist-row .tp-rank { margin-top: 0; }

/* its nemesis and favourite opponent, above the list */
.tp-rivals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; margin-bottom: 14px; }
.tp-rival { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto; column-gap: 12px; row-gap: 4px; padding: 12px 16px; background: var(--surface-2); border: 1px solid var(--border); border-left-width: 3px; border-radius: var(--radius-sm); }
.tp-rival--nemesis { border-left-color: #ff7a7a; }
.tp-rival--favourite { border-left-color: var(--primary); }
.tp-rival-label { grid-column: 1 / -1; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.tp-rival-team { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 17px; font-weight: 800; color: inherit; text-decoration: none; }
.tp-rival-team:hover { color: var(--primary); }
.tp-rival-team img, .tp-rival-team .tp-opp-noimg { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
/* A long name goes onto a second line rather than being cut off - or, in the downloaded picture (which cannot draw "…"), running into the record. */
.tp-rival-team span:last-child { min-width: 0; line-height: 1.2; overflow-wrap: anywhere; }
.tp-rival b { grid-row: 2; grid-column: 2; font-family: var(--font-display); font-weight: 400; font-size: 26px; text-align: right; white-space: nowrap; }
.tp-rival small { grid-column: 1; color: var(--text-muted); font-size: 12px; }
.tp-rival .btn { grid-column: 2; justify-self: end; }

@media (max-width: 800px) {
    .tp-vs { grid-template-columns: minmax(0, 1fr); }
    .tp-vs-side, .tp-vs-side--b { justify-content: space-between; }
    .tp-vs-cols, .tp-picks { grid-template-columns: minmax(0, 1fr); }
    .tp-common-row { grid-template-columns: minmax(0, 1fr) 96px 96px; }
    .tp-charts { grid-template-columns: minmax(0, 1fr); }
    .tp-result > summary { grid-template-columns: 28px 56px minmax(0, 1fr); }
    .tp-type, .tp-when { grid-column: 2 / -1; justify-self: start; }
    .tp-sets { padding-left: 16px; }
    .tp-bars li { grid-template-columns: minmax(90px, 130px) minmax(0, 1fr) 40px; }
    .tp-bars small { display: none; }
}

/* the roster history's five columns need about 710px (the bar is a fixed 130-160px so every row shares one time axis): below 900px the bar goes
   under the name, as it did below 800 - between 800 and 860 the rows ran a few pixels past their card */
@media (max-width: 900px) {
    .tp-hist-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
    .tp-hist-track { grid-column: 1 / -1; grid-row: 2; }
    .tp-hist-dates { grid-column: 2; grid-row: 3; }
    .tp-hist-rank { grid-column: 3; grid-row: 3; }
}

@media (max-width: 700px) {
    .tp-page { padding-top: 18px; }
    .tp-card { padding: 16px; }
    .tp-id { gap: 14px; }
    .tp-logo { width: 72px; height: 72px; }
}

/* a phone: the dates and the rank pill no longer fit side by side (the pill sat on top of the dates) - the dates take the full width, the pill
   goes under them (and is not there at all for somebody who has no rank) */
@media (max-width: 560px) {
    .tp-hist-row { grid-template-columns: 46px minmax(0, 1fr); }
    .tp-hist-dates { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 10px; white-space: normal; }
    .tp-hist-rank { grid-column: 1 / -1; grid-row: 4; justify-content: flex-start; }
    .tp-hist-rank:empty { display: none; }
}

/* a phone: the action buttons share rows (two to a row, filling it) instead of each wrapping onto a line of its own, and the team's four or five
   number tiles sit two by two - one per row they took more than a screen */
@media (max-width: 560px) {
    .tp-actions { width: 100%; gap: 8px; }
    .tp-actions .btn { flex: 1 1 calc(50% - 4px); justify-content: center; text-align: center; }
    .tp-actions #followSlot { flex: 1 1 calc(50% - 4px); display: flex; }
    .tp-actions #followSlot > * { flex: 1; justify-content: center; }
    .tp-actions .tp-followers { flex: 1 1 calc(50% - 4px); text-align: center; }
    .tp-tiles { gap: 8px; }
    .tp-tile { flex: 1 1 calc(50% - 4px); min-width: 0; padding: 10px 12px; }
    .tp-tile strong { font-size: 27px; }
    .tp-tile .tp-rec, .tp-tile strong.tp-rec { white-space: nowrap; }
}

@media (max-width: 480px) {
    .tp-pick-img { flex-basis: 64px; }
    .tp-pick-body { padding: 8px 10px; column-gap: 8px; }
    .tp-pick-body b { font-size: 20px; }
    .tp-tourney { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 8px 10px; }
    .tp-tourney img, .tp-tourney-noimg { width: 40px; height: 40px; }
    /* (the name wraps - two lines at most - instead of being cut in half beside the result badge) */
    .tp-tourney-body b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; overflow-wrap: anywhere; }
    #bscList .tp-place { min-width: 64px; }
}

/* the narrowest phones: the result badge of a tournament goes under its name instead of squeezing the name to a few letters */
@media (max-width: 360px) {
    .tp-tourney { grid-template-columns: 40px minmax(0, 1fr); row-gap: 6px; }
    .tp-tourney .tp-place { grid-column: 2; flex-direction: row; gap: 6px; justify-self: start; }
}

/* a result's sets on a phone: a smaller picture and tighter columns so the map's name has room (it was left 32px - "Cry..." - at 320px) and wraps */
@media (max-width: 420px) {
    .tp-sets { padding-inline: 10px; }
    .tp-sets li { grid-template-columns: 40px minmax(0, 1fr) 44px 36px; gap: 6px; }
    .tp-sets img, .tp-set-noimg { width: 40px; height: 22px; }
    .tp-set-map { white-space: normal; line-height: 1.2; }
}

/* ... and the nemesis / favourite opponent card: its record goes under the team name (beside it, the name was left 27px on a 280px screen) */
@media (max-width: 320px) {
    .tp-rival { grid-template-columns: minmax(0, 1fr); }
    .tp-rival b { grid-row: auto; grid-column: 1; text-align: left; }
    .tp-rival .btn { grid-column: 1; justify-self: start; }
}
