/* NBA AI content pages: How it works, Glossary, Season record. Loaded after nba.css (its .nba-card / .nba-btn and tokens).
   Traps handled here: button 100% (tabs width auto, own :hover), numeric cells right-aligned on tabular numerals. */

/* Stat accents (three scopes): the tab dot / border, the totals stripe and tint. */
:root {
    --nba-stat-pts:      #5b3fd0;
    --nba-stat-pts-soft: #f0ecfd;
    --nba-stat-reb:      #0b7a6c;
    --nba-stat-reb-soft: #e3f5f2;
    --nba-stat-ast:      #b0306e;
    --nba-stat-ast-soft: #fbe9f2;
}
:root[data-theme="dark"] {
    --nba-stat-pts:      #b3a2ff;
    --nba-stat-pts-soft: #2a2347;
    --nba-stat-reb:      #5fd3c2;
    --nba-stat-reb-soft: #15322f;
    --nba-stat-ast:      #f28bbd;
    --nba-stat-ast-soft: #3a1e2d;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --nba-stat-pts:      #b3a2ff;
        --nba-stat-pts-soft: #2a2347;
        --nba-stat-reb:      #5fd3c2;
        --nba-stat-reb-soft: #15322f;
        --nba-stat-ast:      #f28bbd;
        --nba-stat-ast-soft: #3a1e2d;
    }
}

.nba-pages { --nbp-stat: var(--nba-stat-pts); --nbp-stat-soft: var(--nba-stat-pts-soft); }
.nba-pages[data-nbp-stat="REB"] { --nbp-stat: var(--nba-stat-reb); --nbp-stat-soft: var(--nba-stat-reb-soft); }
.nba-pages[data-nbp-stat="AST"] { --nbp-stat: var(--nba-stat-ast); --nbp-stat-soft: var(--nba-stat-ast-soft); }

.nbp-ico { flex: none; display: block; }
.nba-pages .nba-btn .nbp-ico { width: 15px; height: 15px; }
.nba-pages .nba-card { padding: 16px 20px; }

/* ── Header band ──────────────────────────────────────────────────────────────────── */

.nbp-band {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    border-left: 4px solid var(--color-primary);
    background: linear-gradient(100deg, var(--color-primary-soft), var(--bg-surface) 65%);
}
.nba-pages .nbp-band { padding: 20px 24px; }
.nbp-band-ico,
.nbp-step-ico {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: var(--color-primary);
    color: var(--text-inverse);
}
.nbp-band-ico .nbp-ico { width: 22px; height: 22px; }
.nbp-band-body { min-width: 0; }
.nbp-h1 { margin: 2px 0 6px; font-size: 1.6rem; line-height: 1.2; color: var(--text-primary); }
.nbp-lead { margin: 0 0 14px; max-width: 72ch; color: var(--text-secondary); line-height: 1.55; }
.nbp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nbp-end { justify-content: center; margin: 4px 0 24px; }

/* ── Cards, headings, notes ───────────────────────────────────────────────────────── */

.nbp-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.nbp-grid2 > .nba-card,
.nbp-stack > .nba-card { margin: 0; }
.nbp-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.nbp-card { display: flex; flex-direction: column; min-width: 0; }
.nbp-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 8px; }
.nbp-card-ico {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md);
    background: var(--color-primary-soft);
    color: var(--text-link);
}
.nbp-h2 { margin: 0; font-size: 1.05rem; line-height: 1.3; color: var(--text-primary); }
.nbp-aside { margin-left: auto; font-size: var(--font-size-xs); color: var(--text-muted); }
.nbp-note { margin: 0; font-size: var(--font-size-sm); color: var(--text-secondary); }
.nbp-foot { margin: auto 0 0; padding-top: 12px; font-size: var(--font-size-xs); line-height: 1.5; color: var(--text-muted); }
.nbp-gloss-lead { margin: 0 0 6px; padding-top: 0; font-size: var(--font-size-sm); }
.nbp-loading { margin: 0; padding: 14px 0; font-size: var(--font-size-sm); color: var(--text-muted); }
.nbp-kicker {
    display: block;
    margin: 0 0 2px;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.nbp-card-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.nbp-more { margin-top: 10px; align-self: flex-start; }

/* ── Season totals band + stat tab buttons ────────────────────────────────────────── */

.nbp-totals { border-left: 4px solid var(--nbp-stat); background: linear-gradient(100deg, var(--nbp-stat-soft), var(--bg-surface) 70%); }
.nbp-totals-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.nbp-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.nbp-tab {
    --tab: var(--nba-stat-pts);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    height: 30px;
    margin: 0;
    padding: 0 12px;
    border: 1.5px solid var(--tab);
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    color: var(--tab);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}
.nbp-tab-reb { --tab: var(--nba-stat-reb); }
.nbp-tab-ast { --tab: var(--nba-stat-ast); }
.nbp-tab:hover,
.nbp-tab:focus-visible { background: var(--bg-surface-alt); color: var(--tab); }
.nbp-tab[aria-pressed="true"],
.nbp-tab[aria-pressed="true"]:hover,
.nbp-tab[aria-pressed="true"]:focus-visible { background: var(--tab); color: var(--bg-surface); }
.nbp-tab-word { font-weight: 600; }
.nbp-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.nbp-figs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.9fr); gap: 16px 28px; align-items: end; }
.nbp-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 8px; color: var(--text-primary); }
.nbp-big > span { font-size: 2.1rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.nbp-big small { font-size: var(--font-size-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.nbp-facts { margin: 0; padding: 0; list-style: none; font-size: var(--font-size-sm); line-height: 1.65; color: var(--text-secondary); }
.nbp-facts b { color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* Meters: lean hit = hit share green over the miss red with a 50 % tick; within 10 % = green on the track. */
.nbp-meter { position: relative; display: block; height: 7px; border-radius: var(--radius-pill); background: var(--border-soft); overflow: hidden; }
.nbp-meter > i { display: block; height: 100%; background: var(--color-success); }
.nbp-meter-hm { background: var(--color-danger-border); }
.nbp-meter-hm::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 1px); width: 2px; background: var(--bg-surface); }
@media (prefers-reduced-motion: no-preference) {
    .nbp-meter > i { transition: width 0.3s ease; }
}

/* ── Tables: numbers right-aligned under right-aligned headers ────────────────────── */

.nbp-scroll { overflow-x: auto; }
.nbp-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.nbp-table th,
.nbp-table td { box-sizing: border-box; padding: 8px 8px; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: middle; }
.nbp-table thead th {
    padding-top: 4px;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom-color: var(--border);
    white-space: nowrap;
}
.nbp-table tbody th { font-weight: 700; color: var(--text-primary); }
.nbp-table .nbp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nbp-table tfoot th,
.nbp-table tfoot td { border-top: 2px solid var(--border); border-bottom: 0; font-weight: 700; }
.nbp-pct { display: block; color: var(--text-primary); }
.nbp-pct.is-bold { font-weight: 700; }
.nbp-cnt { display: block; font-size: var(--font-size-xs); font-weight: 400; color: var(--text-muted); }
.nbp-col-meter { width: 72px; }
.nbp-table-date .nbp-col-meter { width: 24%; }
.nbp-table td.nbp-col-meter { padding-left: 4px; }
.nbp-table-rule .nbp-rule { font-weight: 500; }
.nbp-rule-t { display: block; }

.nbp-pl-in { display: flex; align-items: center; gap: 8px; }
.nbp-rank { flex: none; }
.nbp-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-primary-soft);
    color: var(--text-link);
    font-size: var(--font-size-xs);
    font-weight: 700;
}
.nbp-logo { flex: none; width: 24px; height: 24px; padding: 2px; box-sizing: border-box; border-radius: 50%; }
.nbp-logo { background: var(--nba-logo-plate); }
.nbp-who { min-width: 0; }
.nbp-name { display: block; font-weight: 700; }

/* ── How it works: steps, word list, grading badges, check lists ──────────────────── */

.nbp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 12px; padding: 0; list-style: none; }
.nba-pages .nbp-step { margin: 0; }
.nbp-step-head { display: flex; align-items: center; gap: 10px; }
.nbp-step-ico { width: 34px; height: 34px; border-radius: var(--radius-md); }
.nbp-step-head .nbp-kicker { margin: 0; }
.nbp-step p { margin: 10px 0 0; font-size: var(--font-size-sm); line-height: 1.6; color: var(--text-secondary); }

.nbp-dl { margin: 0; }
.nbp-dl > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 16px; padding: 9px 0; }
.nbp-dl > div { border-bottom: 1px solid var(--border-soft); }
.nbp-dl > div:last-child { border-bottom: 0; }
.nbp-gloss .nbp-dl > div { grid-template-columns: 220px minmax(0, 1fr); }
.nbp-dl dt { font-size: var(--font-size-sm); font-weight: 700; color: var(--text-primary); }
.nbp-dl dd { margin: 0; font-size: var(--font-size-sm); line-height: 1.55; color: var(--text-secondary); }
.nbp-gloss { scroll-margin-top: calc(var(--site-header-h) + 12px); }

.nbp-badges { margin: 0; }
.nbp-badges > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 0;
    border-bottom: 1px solid var(--border-soft); }
.nbp-badges > div:last-child { border-bottom: 0; }
.nbp-badges dd { margin: 0; font-size: var(--font-size-sm); line-height: 1.5; color: var(--text-secondary); }
.nbp-badge {
    display: block;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--bg-surface-alt);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-align: center;
}
.nbp-badge-hit { background: var(--color-success-soft); border-color: var(--color-success-border); color: var(--color-success-strong); }
.nbp-badge-miss { background: var(--color-danger-soft); border-color: var(--color-danger-border); color: var(--color-danger-strong); }
.nbp-badge-brown { background: var(--nba-unconfirmed-soft); border-color: var(--nba-unconfirmed-border); color: var(--nba-unconfirmed); }

.nbp-checks { margin: 0; padding: 0; list-style: none; }
.nbp-checks li { display: flex; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: var(--font-size-sm);
    line-height: 1.55; color: var(--text-secondary); }
.nbp-checks li:last-child { border-bottom: 0; }
.nbp-checks .nbp-ico { width: 16px; height: 16px; margin-top: 2px; color: var(--text-link); }
.nbp-checks-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.nbp-checks-2 li:nth-last-child(2) { border-bottom: 0; }

/* ── Phone ─────────────────────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
    .content.nba-pages { padding: 0 16px; }
    .nba-pages .nba-card { padding: 14px 14px; }
    .nba-pages .nbp-band { padding: 16px 14px; }
    .nbp-band { flex-direction: column; gap: 10px; }
    .nbp-band-ico { width: 38px; height: 38px; }
    .nbp-h1 { font-size: 1.35rem; }
    .nbp-grid2,
    .nbp-steps,
    .nbp-figs,
    .nbp-checks-2 { grid-template-columns: minmax(0, 1fr); }
    .nbp-checks-2 li:nth-last-child(2) { border-bottom: 1px solid var(--border-soft); }
    .nbp-tab-word,
    .nbp-col-graded,
    .nbp-col-meter { display: none; }
    .nbp-aside { margin-left: 0; flex-basis: 100%; }
    .nbp-big > span { font-size: 1.8rem; }
    .nbp-table th,
    .nbp-table td { padding: 8px 4px; }
    .nbp-dl > div,
    .nbp-gloss .nbp-dl > div { grid-template-columns: minmax(0, 1fr); }
    .nbp-logo { display: none; }
}
