/* ================================================================
   NEXT PLAYER UP (games) — matchup/includes/bet-next-player-up.php,
   filled by scripts/matchup-npu.js. Loaded on /matchup/, admin/bet
   and, through the widget catalog's assets, on /my-dashboards/.
   Colours are tokens (styles/tokens.css); the head mirrors the
   On/Off block's (onoff-minutes.css) so the two read as a pair.
   ================================================================ */
.tmb-npu { container-type: inline-size; }
.tmb-npu-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    margin-bottom: 6px;
}
.tmb-npu-head h7 { margin: 0; }
.tmb-npu-unit {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 1px 7px;
    border-radius: 3px;
    background: var(--tmb-purple-bg);
    color: var(--tmb-purple);
    border: 1px solid color-mix(in srgb, var(--tmb-purple) 35%, transparent);
}
.tmb-npu-q {
    flex-basis: 100%;
    font-size: 0.74rem;
    color: var(--tmb-gray-600);
}
.tmb-npu-ctl {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 6px;
    font-size: 0.78rem;
}
.tmb-npu-ctl label { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: 500; color: var(--tmb-gray-700); }
.tmb-npu-ctl input { margin: 0; }
.tmb-npu-ctl select { font-size: 0.78rem; padding: 2px 6px; border: 1px solid var(--tmb-gray-400); border-radius: 4px; background: var(--tmb-white, #fff); color: var(--tmb-gray-900); }
/* The block's own pill strip (the sports whose card has no Adjust for
   Injuries): the pills are .injury-pill from player-injury-common.css; a
   pill the report lists carries its status tint until it is picked. */
.tmb-npu .injury-pill-strip { padding: 2px 0 2px; }
.tmb-npu .injury-pill-strip .team-pills-row { margin-bottom: 6px; }
.tmb-npu .injury-pill .pill-mpg { margin-left: 2px; }
.tmb-npu-teams { display: grid; grid-template-columns: 1fr; gap: 14px; }
.tmb-npu-team { min-width: 0; }
.tmb-npu-team-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0 0 4px;
    color: var(--tmb-gray-900);
}
.tmb-npu-sel {
    font-size: 0.74rem;
    color: var(--tmb-gray-700);
    margin: 0 0 4px;
}
.tmb-npu-sel b { color: var(--tmb-gray-900); }
.tmb-npu table { font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.tmb-npu table th, .tmb-npu table td { white-space: nowrap; text-align: right; vertical-align: middle; }
.tmb-npu table th:first-child, .tmb-npu table td:first-child { text-align: left; }
.tmb-npu td.npu-name { font-weight: 600; }
.tmb-npu td.npu-name .npu-pos { font-weight: 400; color: var(--tmb-gray-600); font-size: 0.72rem; margin-left: 4px; }
.tmb-npu td.npu-name .npu-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0 4px;
    border-radius: 3px;
    margin-left: 5px;
    color: var(--tmb-white, #fff);
    vertical-align: middle;
}
.tmb-npu .npu-badge-out { background: var(--tmb-out); }
.tmb-npu .npu-badge-in { background: var(--tmb-in); }
.tmb-npu .npu-badge-inj { background: var(--tmb-red); opacity: 0.45; }
.tmb-npu tr.npu-out td { color: var(--tmb-gray-500); }
.tmb-npu tr.npu-out td.npu-name { color: var(--tmb-gray-500); }
/* A cell under a selection: the base figure small and struck, the new
   figure, and the change under it. */
.tmb-npu td.npu-cell { line-height: 1.1; padding-top: 3px; padding-bottom: 3px; }
.tmb-npu .npu-base { display: block; font-size: 0.66rem; color: var(--tmb-gray-500); text-decoration: line-through; }
.tmb-npu .npu-new { display: block; font-weight: 700; }
.tmb-npu .npu-delta { display: block; font-size: 0.64rem; }
.tmb-npu .npu-delta.npu-up { color: var(--tmb-success-text); }
.tmb-npu .npu-delta.npu-down { color: var(--tmb-danger-text); }
.tmb-npu .npu-delta.npu-flat { color: var(--tmb-gray-500); }
.tmb-npu td.npu-pos { background: var(--tmb-good-7); }
.tmb-npu td.npu-pos.s2 { background: var(--tmb-good-4); }
.tmb-npu td.npu-pos.s3 { background: var(--tmb-good-1); }
.tmb-npu td.npu-neg { background: var(--tmb-bad-1); }
.tmb-npu td.npu-neg.s2 { background: var(--tmb-bad-3); }
.tmb-npu td.npu-neg.s3 { background: var(--tmb-bad-5); }
/* The Player Stats link at a stat cell's right edge (matchup-npu.js psLink():
   that player and that stat, in a new tab): faint until its row is hovered. */
.tmb-npu td.npu-has-ps { position: relative; padding-right: 17px; }
.tmb-npu .npu-ps-link {
    position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
    font-size: 0.6rem; line-height: 1; color: var(--tmb-gray-500); opacity: 0.45; text-decoration: none;
}
.tmb-npu tr:hover .npu-ps-link { opacity: 0.8; }
.tmb-npu .npu-ps-link:hover, .tmb-npu .npu-ps-link:focus { opacity: 1; color: var(--tmb-blue); }
@media (hover: none) { .tmb-npu .npu-ps-link { opacity: 0.7; } }
.tmb-npu td.npu-thin, .tmb-npu tr.npu-thin td { color: var(--tmb-gray-600); font-style: italic; }
.tmb-npu .tmb-npu-note { font-size: 0.72rem; color: var(--tmb-gray-600); margin: -4px 0 6px; }
.tmb-npu .tmb-npu-empty { font-size: 0.8rem; color: var(--tmb-gray-600); padding: 6px 0; }
/* Twelve columns: in a narrow container the table scrolls sideways inside
   its wrapper (table-responsive-wrapper), the player column held. */
.tmb-npu .table-responsive-wrapper { overflow-x: auto; }
.tmb-npu table th:first-child, .tmb-npu table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--tmb-white, #fff);
}
.tmb-npu table thead th:first-child { background: inherit; }
@container (max-width: 560px) {
    .tmb-npu table th, .tmb-npu table td { padding-left: 4px; padding-right: 4px; font-size: 0.75rem; }
    .tmb-npu .npu-base { font-size: 0.6rem; }
    .tmb-npu .npu-delta { font-size: 0.6rem; }
}

/* ================================================================
   PLAYER IMPACT (feature player_impact): the frame round the On/Off
   and Next Player Up blocks, matchup/includes/bet-player-impact.php.
   One pane at a time.
   ================================================================ */
.tmb-pi { min-width: 0; }
.tmb-pi-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0 12px; }
.tmb-pi-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-left: auto; }
.tmb-pi-seg {
    display: inline-flex;
    padding: 3px;
    border-radius: 8px;
    background: var(--tmb-gray-100);
    border: 1px solid var(--tmb-gray-300);
}
.tmb-pi .tmb-pi-seg button {
    border: 0;
    background-color: transparent !important;   /* front.css fills every button, !important */
    margin: 0 !important;                       /* and gives each 3px under it */
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--tmb-gray-600);
    cursor: pointer;
    white-space: nowrap;
}
.tmb-pi .tmb-pi-seg button:hover { color: var(--tmb-gray-900); }
.tmb-pi .tmb-pi-seg button.active {
    background-color: var(--tmb-surface) !important;
    color: var(--tmb-gray-900);
    box-shadow: 0 1px 2px var(--tmb-black-15);
}
.tmb-pi-metric { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 0.8rem; font-weight: 500; color: var(--tmb-gray-700); }
.tmb-pi-metric select {
    font-size: 0.8rem;
    padding: 4px 8px;
    border: 1px solid var(--tmb-gray-400);
    border-radius: 6px;
    background: var(--tmb-surface);
    color: var(--tmb-gray-900);
}
/* One pane. */
.tmb-pi[data-mode="onoff"] [data-pi-pane="npu"],
.tmb-pi[data-mode="npu"] [data-pi-pane="onoff"],
.tmb-pi[data-mode="npu"] .tmb-pi-metric { display: none; }
/* Next Player Up: ONE team (the block prints the road team first, then the
   home team), chosen by the team switch. On / off court shows BOTH teams side
   by side under their names, as the block lays them out, and has no team
   switch (Zach, 2026-11-30). */
.tmb-pi .tmb-npu-teams { grid-template-columns: 1fr; }
.tmb-pi[data-team="away"] .tmb-npu-team:nth-child(2),
.tmb-pi[data-team="home"] .tmb-npu-team:nth-child(1) { display: none; }
.tmb-pi[data-mode="onoff"] .tmb-pi-teams { display: none; }
/* What the frame says already: the picked team's name, the block's title and unit, the metric radios. */
.tmb-pi :is(.tmb-npu-team-name, .tmb-onoff-unit, .tmb-npu-unit, .tmb-onoff-view),
.tmb-pi .tmb-onoff-head h7 { display: none; }
/* A player's face (NBA / WNBA) in the frame's tables and pills; a name that is a pick. */
.tmb-pi-face {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    background: var(--tmb-gray-100);
    margin-right: 6px;
    vertical-align: middle;
    flex: 0 0 auto;
}
.tmb-pi .injury-pill .tmb-pi-face { width: 18px; height: 18px; margin-right: 4px; }
.tmb-npu td.npu-pick { cursor: pointer; }
.tmb-npu td.npu-pick:hover { text-decoration: underline; text-decoration-style: dotted; }
/* Next Player Up inside the frame (Zach, 2026-11-30): no pill strip (a player
   is marked by his name in the table); the season figure, struck through and
   a shade darker, sits BEFORE the new one on one line with the change under
   it, so a row is two lines tall, not three; and the Player Stats link has
   room of its own at the cell's right. */
.tmb-pi .tmb-npu .injury-pill-strip { display: none; }
.tmb-pi .tmb-npu .npu-base { display: inline; margin-right: 6px; font-size: 0.72rem; color: var(--tmb-gray-600); }
.tmb-pi .tmb-npu .npu-new { display: inline; }
/* matchup-tables.css sets every cell's padding !important, four classes deep: this must outrank it. */
.tmb-pi.tmb-cq-root .tmb-npu table.table > tbody > tr > td.npu-has-ps { padding-right: 26px !important; }
/* The link is the struck figure's colour (Zach), at full strength; blue on hover as elsewhere. */
.tmb-pi .tmb-npu .npu-ps-link { right: 7px; font-size: 0.68rem; opacity: 1; color: var(--tmb-gray-600); }
.tmb-pi .tmb-npu .npu-ps-link:hover, .tmb-pi .tmb-npu .npu-ps-link:focus { color: var(--tmb-blue); }
/* The frame's bar: Recency weighted at the right in Next Player Up, where the
   Metric menu is in On / off court. The blocks' own heads keep the info icon
   alone, at the right of the first line; their one-line question is the
   tooltip's already. */
.tmb-pi-recency { display: none; align-items: center; gap: 6px; margin: 0; font-size: 0.8rem; font-weight: 500; color: var(--tmb-gray-700); }
.tmb-pi-recency input { margin: 0; }
.tmb-pi[data-mode="npu"] .tmb-pi-recency { display: inline-flex; }
.tmb-pi :is(.tmb-npu-q, .tmb-onoff-q) { display: none; }
.tmb-pi :is(.tmb-npu-head, .tmb-onoff-head) { float: right; margin: 0 0 0 8px; }
.tmb-pi .tmb-pi-legend s { color: var(--tmb-gray-600); }
