/* Player + team pages (templates/player.html, templates/team.html).
   Carries the homepage visual language (home_hero.css cards/titles, home_now.css event rows and
   stat strips) onto the profile pages. Linked last in <head>, scoped to body.nh-profile, so it
   wins over the templates' legacy inline <style> blocks without touching other pages. */

body.nh-profile {
    --pf-accent: #ea580c;
    --pf-ink: #0b1220;
    --pf-muted: #64748b;
    --pf-faint: #94a3b8;
    --pf-rule: #f1f5f9;
    --pf-line: #dfe5ec;
    --pf-link: #2563eb;
    --pf-made: #15803d;
    background: #f4f6f8;
    color: #0f172a;
    font-family: var(--font-sans);
    line-height: 1.5;
}

.nh-profile .container { padding-top: 4px; padding-bottom: 24px; }

/* Cards: same surface as .home-latest-card */
.nh-profile .section,
.nh-profile .pf-hero,
.nh-profile .player-heave-mix-card {
    background: #fff;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
    padding: 18px 20px 16px;
    margin: 0 0 16px;
}
.nh-profile .player-heave-mix-section { padding: 0 !important; }
.nh-profile .player-heave-mix-video-wrap { border-radius: 12px; }

/* Card titles: display face + short accent rule (.home-latest-title) */
.nh-profile .pf-title,
.nh-profile .section h2.pf-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--pf-ink);
    text-align: left;
    white-space: normal;
}
.nh-profile .pf-title::after {
    content: "";
    display: block;
    width: 3.25rem;
    height: 3px;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--pf-accent);
}
.nh-profile .pf-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 0 0 12px;
}
.nh-profile .pf-head__aside { padding-top: 6px; font-size: 0.9rem; color: var(--pf-muted); font-variant-numeric: tabular-nums; }
.nh-profile .pf-note { margin: 10px 0 0; font-size: 0.8rem; line-height: 1.4; color: var(--pf-faint); }

/* ---------- Identity hero ---------- */
/* Team color cap on the header card (data/team_colors_hex.json); none when no team is on file */
.nh-profile .pf-hero { padding: 20px 22px 16px; box-shadow: inset 0 3px 0 var(--team-accent, transparent), 0 8px 28px rgba(15, 23, 42, 0.06); }
.nh-profile .pf-hero .identity-strip { margin: 0; padding: 0; gap: 16px; flex-wrap: nowrap; align-items: center; }
.nh-profile .pf-hero .identity-avatar {
    width: 64px; height: 64px; margin: 0;
    border: 1px solid #e2e8f0; background: #f8fafc;
}
.nh-profile .pf-hero .identity-avatar.pf-logo { object-fit: contain; padding: 6px; background: #fff; }
.nh-profile .pf-hero h1,
.nh-profile .pf-hero .identity-main-title,
.nh-profile .pf-hero .player-report-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.6vw, 2.6rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--pf-ink);
}
.nh-profile .pf-hero .player-name { font: inherit; color: inherit; }
/* JS badge ("4-Point Specialist", "Heave Hero") under the name */
.nh-profile .pf-hero .identity-report-label,
.nh-profile .pf-hero .identity-subtitle {
    display: block;
    margin: 6px 0 0;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0;
    color: #334155;
    opacity: 1;
}
.nh-profile .pf-hero .identity-report-label:empty { display: none; }
.nh-profile .pf-hero .identity-report-label::before,
.nh-profile .pf-hero .identity-subtitle::before {
    content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px;
    background: var(--pf-accent); margin: 0 8px 2px 0;
}

/* Name row: current team logo beside the name (team of the latest heave, recent players only) */
.nh-profile .pf-name-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nh-profile .pf-team-mark { flex-shrink: 0; display: inline-flex; border-radius: 6px; opacity: 0.92; }
.nh-profile .pf-team-mark:hover { opacity: 1; }
.nh-profile .pf-team-mark img { width: 30px; height: 30px; object-fit: contain; }

/* Headline: career heaves and makes, directly under the name */
.nh-profile .pf-headline {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin: 10px 0 0;
    font-size: 0.95rem; font-weight: 600; color: #475569;
}
.nh-profile .pf-headline b {
    margin-right: 5px; font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em;
    color: var(--pf-ink); font-variant-numeric: lining-nums tabular-nums;
}
.nh-profile .pf-headline .is-made b { color: var(--pf-made); }
.nh-profile .pf-headline em { font-style: normal; color: var(--pf-faint); }

/* Facts row: one line of secondary numbers */
.nh-profile .pf-facts {
    list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px;
    margin: 16px 0 0; padding: 12px 0 0; border-top: 1px solid #eef2f6; font-size: 0.92rem;
}
.nh-profile .pf-facts li { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.nh-profile .pf-facts span { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--pf-muted); }
.nh-profile .pf-facts b { font-weight: 800; color: var(--pf-ink); font-variant-numeric: tabular-nums; }
.nh-profile .pf-facts em { font-style: normal; color: var(--pf-faint); }
.nh-profile .pf-facts a { color: var(--pf-link); font-weight: 700; text-decoration: none; }
.nh-profile .pf-facts a:hover { text-decoration: underline; }
.nh-profile .pf-headline__scope { font-size: 0.78rem; font-weight: 500; color: var(--pf-faint); }

/* Heaves per season (season high in brick) */
.nh-profile .pf-spark { margin: 16px 0 0; }
.nh-profile .pf-spark__bars { display: flex; align-items: flex-end; gap: 3px; height: 44px; }
.nh-profile .pf-spark__bar { flex: 1 1 0; min-width: 0; border-radius: 2px 2px 0 0; background: #cbd5e1; }
.nh-profile .pf-spark__bar.is-best { background: #c2410c; }
.nh-profile .pf-spark__axis { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 0.72rem; color: var(--pf-faint); font-variant-numeric: tabular-nums; }

/* Team line under the name (team of the latest heave, recent players only) */
.nh-profile .pf-meta { margin: 6px 0 0; font-size: 0.92rem; }
.nh-profile .pf-meta a { display: inline-flex; align-items: center; gap: 7px; color: #334155; font-weight: 600; text-decoration: none; }
.nh-profile .pf-meta a:hover { color: var(--pf-link); }
.nh-profile .pf-meta img { width: 18px; height: 18px; object-fit: contain; }

/* Heave Map key + jump to history */
.nh-profile .pf-map-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0 0; font-size: 0.82rem; color: var(--pf-muted); }
.nh-profile .pf-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; }
.nh-profile .pf-legend li { display: inline-flex; align-items: center; gap: 6px; }
.nh-profile .pf-legend__brick {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: center / contain no-repeat url('/static/brand/bricky-mark.png');
}
.nh-profile .pf-legend__dot { display: inline-block; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(15, 23, 42, 0.08); }
.nh-profile .pf-legend__line { width: 16px; border-top: 2px dashed #64748b; }
.nh-profile .pf-map-foot__link { color: var(--pf-link); font-weight: 600; text-decoration: none; }
.nh-profile .pf-map-foot__link:hover { text-decoration: underline; }
.nh-profile .pf-map-coord-notice,
.pf-map-coord-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    padding: 3px 8px 3px 4px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1.2;
    width: fit-content;
    max-width: 100%;
}
.pf-map-coord-notice[hidden] { display: none !important; }
.pf-map-coord-notice__icon {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 700;
    font-style: normal;
    font-family: var(--font-sans, system-ui, sans-serif);
    flex-shrink: 0;
    cursor: help;
}
.pf-map-coord-notice__text { font-weight: 600; color: #475569; }
.pf-map-coord-notice__why {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #2563eb;
    font: inherit;
    font-weight: 600;
    cursor: help;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Stat strip (matches home_now .hn-stats) */
.nh-profile .pf-stats {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: 16px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid #eef2f6;
    row-gap: 12px;
}
.nh-profile .pf-stats li {
    display: flex; flex-direction: column; gap: 3px; min-width: 0;
    padding: 0 22px; border-left: 1px solid #e2e8f0;
}
.nh-profile .pf-stats li:first-child { padding-left: 0; border-left: 0; }
.nh-profile .pf-stats b {
    font-weight: 800; font-size: 1.7rem; line-height: 1; color: var(--pf-ink);
    font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.02em;
}
.nh-profile .pf-stats b small { font-size: 0.55em; font-weight: 700; letter-spacing: 0; margin-left: 2px; color: #334155; }
.nh-profile .pf-stats span { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pf-muted); white-space: nowrap; }
.nh-profile .pf-stats em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--pf-faint); }
.nh-profile .pf-stats .is-made b { color: var(--pf-made); }
.nh-profile .pf-stats a { color: inherit; text-decoration: none; }
.nh-profile .pf-stats a:hover b { text-decoration: underline; }
.nh-profile .pf-hero__foot {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
    margin: 12px 0 0; font-size: 0.86rem; color: var(--pf-muted);
}
.nh-profile .pf-hero__foot a { color: var(--pf-link); font-weight: 600; text-decoration: none; }
.nh-profile .pf-hero__foot a:hover { text-decoration: underline; }
/* In-page jump links: only rendered on long pages */
.nh-profile .pf-jump { display: inline-flex; gap: 14px; }
.nh-profile .pf-hero__tools { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.nh-profile .pf-hero--team .pf-hero__foot { align-items: flex-end; }
.nh-profile .pf-hero--team .team-header-dropdown { height: 32px !important; max-width: 190px; min-width: 0 !important; width: auto !important; padding: 0 28px 0 10px !important; font-size: 0.84rem !important; }
.nh-profile .pf-jump a { color: var(--pf-muted); font-weight: 600; }
.nh-profile .pf-jump a:hover { color: var(--pf-link); }
.nh-profile #map, .nh-profile #charts, .nh-profile #heroes, .nh-profile #history { scroll-margin-top: 12px; }

/* Team switcher in the header foot row */
.nh-profile .pf-hero--team .team-header-dropdown {
    border: 1px solid var(--pf-line); border-radius: 8px; background-color: #fff;
    font-family: var(--font-sans); font-weight: 600; color: #0f172a; box-shadow: none;
}

/* Header + reel grid (desktop) */
.nh-profile .pf-top > * { min-width: 0; }
@media (min-width: 768px) {
    /* Equal-height row: header card and reel card stretch to the taller of the two */
    .nh-profile .pf-top--reel { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: 20px; align-items: stretch; margin-bottom: 16px; }
    .nh-profile .pf-top--reel > .pf-hero,
    .nh-profile .pf-top--reel .player-heave-mix-card { margin: 0; box-sizing: border-box; height: 100%; }
    .nh-profile .pf-top--reel .player-heave-mix-section { display: block; height: 100%; }
    .nh-profile .pf-top--reel .player-heave-mix-card { padding: 14px; display: flex; flex-direction: column; justify-content: center; }
    .nh-profile .pf-top--reel > .pf-hero { display: flex; flex-direction: column; justify-content: space-between; }
    .nh-profile .pf-top--reel > .pf-hero .pf-stats { margin-top: 14px; }
    .nh-profile .pf-top--reel .player-heave-mix-video-wrap { margin-bottom: 10px; }
    .nh-profile .pf-top--reel .heave-reel-bar-row { margin-bottom: 0; }
    .nh-profile .pf-top--reel .pf-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
    .nh-profile .pf-top--reel .pf-stats li { padding: 0 10px; }
    .nh-profile .pf-top--reel .pf-stats b { font-size: 1.8rem; }
    .nh-profile .pf-top--reel .pf-stats span { white-space: normal; line-height: 1.25; }
}

/* Tablet: header and reel share the row at equal width; tighter strip */
@media (min-width: 768px) and (max-width: 1023px) {
    .nh-profile .pf-top--reel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
    .nh-profile .pf-top--reel .pf-hero { padding: 16px 16px 14px; }
    .nh-profile .pf-top--reel .pf-hero h1 { font-size: 1.9rem; }
    .nh-profile .pf-top--reel .pf-stats li { padding: 0 6px; }
    .nh-profile .pf-top--reel .pf-stats b { font-size: 1.2rem; }
    .nh-profile .pf-top--reel .pf-stats span { font-size: 0.6rem; }
}


/* Team header: logo, leaders line, switcher */
.nh-profile .pf-hero--team .identity-avatar { object-fit: contain; padding: 7px; background: #fff; border-radius: 14px; }
.nh-profile #teamSelectDropdown.team-header-dropdown { position: static !important; right: auto; margin: 0; }
.nh-profile .pf-leaders { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.nh-profile .pf-leader { white-space: nowrap; color: #334155; }
.nh-profile .pf-leader__k { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pf-faint); margin-right: 2px; }
.nh-profile .pf-leader a { color: #0f172a; font-weight: 700; }
.nh-profile .pf-leader__n { color: var(--pf-muted); font-variant-numeric: tabular-nums; }

/* ---------- Controls (map + history) ---------- */
.nh-profile .pf-map-controls { display: flex; flex-wrap: wrap !important; align-items: center; gap: 10px 14px !important; margin: 0 0 12px; width: auto !important; }
.nh-profile .pf-map-controls .heatmap-makes-checkbox,
.nh-profile .pf-map-controls .heatmap-makes-checkbox span { margin: 0 !important; font-size: 0.88rem !important; gap: 6px !important; }
.nh-profile .pf-map-controls .heatmap-distance-filter { margin: 0 !important; padding: 0 0 0 14px !important; border-left: 1px solid #e2e8f0; }
.nh-profile .pf-head .season-stats-container { display: block !important; }
.nh-profile #season-select { max-width: none !important; min-width: 0 !important; height: 34px; padding: 0 28px 0 10px !important; font-size: 0.88rem !important; }
.nh-profile select,
.nh-profile .pf-btn,
.nh-profile #evolutionBtn {
    font-family: var(--font-sans);
}
.nh-profile #season-select,
.nh-profile .season-control select,
.nh-profile #distance-chart-season-select {
    height: 34px; padding: 0 28px 0 10px !important; border: 1px solid var(--pf-line) !important;
    border-radius: 8px !important; background-color: #fff; font-size: 0.88rem !important; font-weight: 600; color: #0f172a;
    box-shadow: none !important; width: auto;
}
.nh-profile #evolutionBtn {
    height: 34px; padding: 0 14px !important; border: 1px solid var(--pf-line) !important; border-radius: 8px !important;
    background: #fff !important; color: #0f172a !important; font-size: 0.88rem !important; font-weight: 700 !important;
    margin-left: 0 !important;
}
.nh-profile #evolutionBtn:hover { border-color: #94a3b8 !important; }
.nh-profile #evolutionBtn.evolution-btn--active { border-color: var(--pf-accent) !important; color: var(--pf-accent) !important; }
.nh-profile .heatmap-makes-checkbox { font-size: 0.88rem; font-weight: 600; color: #334155; display: inline-flex; align-items: center; gap: 6px; }
.nh-profile .heatmap-distance-filter { border-left-color: #e2e8f0 !important; }
.nh-profile .heatmap-distance-filter label { font-size: 0.88rem !important; }
.nh-profile input[type="range"] { accent-color: #0f172a; }
.nh-profile input[type="checkbox"], .nh-profile input[type="radio"] { accent-color: #0f172a; }
.nh-profile .season-stats-container {
    background: transparent !important; border: 0 !important; box-shadow: none !important;
    padding: 0 !important; font-size: 0.86rem !important; color: var(--pf-muted) !important; font-weight: 500 !important;
}
.nh-profile #heaveHeatMap { border-radius: 12px !important; background: transparent !important; }

/* ---------- Charts (two-up on desktop) ---------- */
.nh-profile .charts-row {
    display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 16px !important;
    margin: 0 0 16px !important;
}
.nh-profile .charts-row > .section { margin: 0; min-width: 0; }
.nh-profile .charts-row .pf-chart { position: relative; height: 260px !important; margin-top: 4px; }
.nh-profile .charts-row .pf-chart--bars { height: 300px !important; }
.nh-profile .heaves-type-info {
    display: flex !important; flex-wrap: wrap;
    background: transparent !important; border: 0 !important; padding: 0 !important; margin-top: 10px !important;
    font-size: 0.78rem !important; color: var(--pf-faint) !important; gap: 4px 14px !important;
}
.nh-profile .heaves-type-info strong { color: var(--pf-muted) !important; font-weight: 600; }
@media (min-width: 900px) {
    .nh-profile .charts-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 20px !important; }
    .nh-profile .charts-row--single { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Court map: box sized to the court SVG */
@media (min-width: 769px) {
    .nh-profile #heaveHeatMap::before { display: none !important; }
    .nh-profile #heaveHeatMap svg { position: static !important; transform: none !important; display: block; width: 100% !important; height: auto !important; max-height: none !important; }
}

/* ---------- Heave history ---------- */
.nh-profile .pf-filters {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
    margin: 0 0 4px; padding: 0 0 12px; border-bottom: 1px solid #eef2f6;
}
.nh-profile .pf-seg { display: inline-flex; align-items: center; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.nh-profile .pf-seg[hidden] { display: none !important; }
.nh-profile .pf-seg legend,
.nh-profile .pf-seg__k,
.nh-profile .pf-range__k {
    float: left; padding: 0; margin: 0;
    font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pf-faint);
}
.nh-profile .pf-seg__opts { display: inline-flex; border: 1px solid var(--pf-line); border-radius: 8px; overflow: hidden; }
.nh-profile .pf-seg label { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.nh-profile .pf-seg label + label { border-left: 1px solid var(--pf-line); }
.nh-profile .pf-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nh-profile .pf-seg label span {
    display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px;
    font-size: 0.84rem; font-weight: 600; color: var(--pf-muted); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.nh-profile .pf-seg label:hover span { color: #0f172a; }
.nh-profile .pf-seg input:checked + span { background: #0f172a; color: #fff; }
.nh-profile .pf-seg input:focus-visible + span { outline: 2px solid var(--pf-link); outline-offset: -2px; }
.nh-profile .pf-range { display: inline-flex; align-items: center; gap: 8px; }
.nh-profile .pf-range output,
.nh-profile .pf-range .pf-range__v { min-width: 3.2em; font-size: 0.84rem; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.nh-profile .pf-range input[type="range"] { width: 120px; }
.nh-profile .pf-reset {
    margin-left: auto; padding: 0; border: 0; background: none; cursor: pointer;
    font: 600 0.84rem var(--font-sans); color: var(--pf-link);
}
.nh-profile .pf-reset:hover { text-decoration: underline; }
.nh-profile .pf-filters--inline { margin: 0; padding: 0; border: 0; gap: 8px 14px; }
.nh-profile .pf-filters select { height: 32px; padding: 0 28px 0 10px !important; border: 1px solid var(--pf-line) !important; border-radius: 8px !important; background-color: #fff; font-size: 0.84rem !important; font-weight: 600; color: #0f172a; min-width: 0 !important; }
.nh-profile .pf-summary { margin: 10px 0 2px; font-size: 0.88rem; color: #475569; font-variant-numeric: tabular-nums; }
.nh-profile .pf-summary b { color: var(--pf-ink); font-weight: 700; }

/* Event rows: team logo | game (opponent logo, date, optional ×N) | clock + distance | play */
.nh-profile .pf-rows { list-style: none; margin: 4px 0 0; padding: 0; }
.nh-profile .pf-row {
    display: grid; grid-template-columns: 30px minmax(0, 1fr) 32px; gap: 10px; align-items: center;
    padding: 8px 0; border-top: 1px solid #f1f5f9;
}
.nh-profile .pf-row:first-child { border-top: 0; }
.nh-profile .pf-row--noteam { grid-template-columns: minmax(0, 1fr) 32px; }
.nh-profile .pf-row--made { background: #f0fdf4; box-shadow: inset 3px 0 0 #16a34a; padding-left: 9px; margin-left: -9px; border-radius: 0 6px 6px 0; }
.nh-profile .pf-logo { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.nh-profile .pf-row__team { display: grid; place-items: center; width: 30px; font-size: 0.66rem; font-weight: 700; color: #334155; }
.nh-profile .pf-row__team .pf-logo { width: 26px; height: 26px; }
.nh-profile .pf-row__main {
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "line" "meta";
    align-items: center; row-gap: 1px; min-width: 0;
}
.nh-profile .pf-row__line { grid-area: line; display: flex; align-items: center; gap: 8px; min-width: 0; color: #0f172a; }
.nh-profile .pf-row__name { flex-shrink: 0; font-weight: 700; color: #0f172a; text-decoration: none; }
.nh-profile .pf-row__name:hover { text-decoration: underline; }
.nh-profile .pf-row__game { display: inline-flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; overflow: hidden; color: #334155; }
.nh-profile .pf-row__game b { font-weight: 700; color: #0f172a; }
.nh-profile .pf-row__vs { font-size: 0.82em; color: var(--pf-muted); }
.nh-profile .pf-row__x { font-size: 0.82rem; font-weight: 700; color: #64748b; flex-shrink: 0; }
.nh-profile .pf-row__date { margin-left: 4px; font-weight: 500; color: #64748b; }
.nh-profile .pf-row__tag { flex-shrink: 0; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--pf-muted); }
.nh-profile .pf-row__meta { grid-area: meta; font-size: 0.84rem; color: var(--pf-muted); }
.nh-profile .pf-row__heave { color: #475569; text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nh-profile .pf-row__heave:hover { color: var(--pf-link); }
.nh-profile .pf-row__when + .pf-row__dist::before { content: " · "; }
.nh-profile .pf-row__dist { font-weight: 700; color: #0f172a; }
.nh-profile .pf-row--made .pf-row__dist { color: #15803d; }
/* Desktop: everything on one line, numbers in fixed columns */
@media (min-width: 1024px) {
    .nh-profile .pf-row { padding: 6px 0; }
    .nh-profile .pf-row--made { padding-left: 9px; }
    .nh-profile .pf-row:not(.pf-row--made):hover { background: #f8fafc; }
    .nh-profile .pf-row__main { grid-template-columns: minmax(0, 1fr) 150px; grid-template-areas: "line meta"; column-gap: 18px; }
    .nh-profile .pf-row__heave { display: grid; grid-template-columns: 1fr 64px; align-items: baseline; }
    .nh-profile .pf-row__when + .pf-row__dist::before { content: none; }
    .nh-profile .pf-row__dist { text-align: right; }
    .nh-profile .pf-row .pf-play { width: 30px; height: 30px; }
}
.nh-profile .pf-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.94em; }
.nh-profile .pf-play {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--pf-line); display: grid; place-items: center;
    color: #0f172a; text-decoration: none; font-size: 11px; padding-left: 2px; box-sizing: border-box; background: #fff;
}
.nh-profile .pf-play:hover { border-color: #94a3b8; }
.nh-profile .pf-empty { padding: 18px 0 8px; font-size: 0.92rem; color: var(--pf-muted); }
.nh-profile .pf-more-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 0; padding-top: 10px; border-top: 1px solid #eef2f6; }
.nh-profile .pf-more-row[hidden] { display: none; }
.nh-profile .pf-more-row__count { font-size: 0.84rem; color: var(--pf-muted); font-variant-numeric: tabular-nums; }
.nh-profile .pf-more {
    min-height: 36px; padding: 0 16px; border: 1px solid var(--pf-line); border-radius: 999px; background: #fff; cursor: pointer;
    font: 700 0.86rem var(--font-sans); color: #0f172a;
}
.nh-profile .pf-more:hover { border-color: #94a3b8; }

/* Team-page tables (Heave Heroes, league rankings) */
.nh-profile .pf-table-wrap { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; }
.nh-profile .pf-table-wrap table { font-variant-numeric: tabular-nums; }
.nh-profile .pf-table-wrap thead th { background: #fff !important; color: var(--pf-faint) !important; font-size: 0.68rem !important; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700 !important; border-color: #eef2f6 !important; }
.nh-profile .pf-table-wrap tbody td { border-color: var(--pf-rule) !important; background: #fff !important; }
.nh-profile .pf-table-wrap tbody tr:nth-child(even) td { background: #fcfdfe !important; }

.nh-profile .pf-table-wrap thead th[class*="heroic-heavers-group"],
body.nh-profile .pf-table-wrap #teamHeaveHeroesTable thead tr th,
body.nh-profile .pf-table-wrap #teamRankingsTable thead tr th { background: #fff !important; }
.nh-profile .pf-table-wrap thead tr:first-child th[colspan] { color: #334155 !important; letter-spacing: 0.04em; }
.nh-profile .pf-table-wrap a { color: var(--pf-link); font-weight: 600; text-decoration: none; }
.nh-profile .pf-table-wrap a:hover { text-decoration: underline; }
.nh-profile .charts-row .pf-chart canvas { max-width: 100% !important; }

/* Heave Heroes: top 10 until expanded (desktop); Lite columns hidden */
@media (min-width: 769px) {
    .nh-profile #teamHeaveHeroesTable:not(.is-expanded) tbody tr:nth-child(n+11) { display: none; }
}
.nh-profile #teamHeaveHeroesTable th.heroic-heavers-group-lite,
.nh-profile #teamHeaveHeroesTable td:nth-child(9),
.nh-profile #teamHeaveHeroesTable td:nth-child(10),
.nh-profile #teamHeaveHeroesTable td:nth-child(11) { display: none !important; }

/* History filters: a single "Filter" row on phones, always open on desktop */
.nh-profile .pf-filters-wrap > summary { list-style: none; }
.nh-profile .pf-filters-wrap > summary::-webkit-details-marker { display: none; }
.nh-profile .pf-filters-toggle {
    display: none; align-items: center; gap: 8px; min-height: 40px; margin: 0 0 4px; cursor: pointer;
    font: 700 0.9rem var(--font-sans); color: #0f172a;
}
.nh-profile .pf-filters-toggle::after { content: ""; width: 7px; height: 7px; margin-left: 2px; border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8; transform: rotate(45deg) translateY(-2px); }
.nh-profile .pf-filters-wrap[open] .pf-filters-toggle::after { transform: rotate(-135deg) translateY(-1px); }
.nh-profile .pf-filters-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #0f172a; color: #fff; font-size: 0.72rem; line-height: 18px; text-align: center; }
@media (max-width: 767px) {
    .nh-profile .pf-filters-toggle { display: inline-flex; }
    /* Heave Heroes on phones: rank, player and the Heaves group only (no sideways scroll) */
    .nh-profile #teamHeaveHeroesTable th.heroic-heavers-group-halfcourt,
    .nh-profile #teamHeaveHeroesTable th.heroic-heavers-group-fullcourt,
    .nh-profile #teamHeaveHeroesTable td:nth-child(n+6) { display: none !important; }
    .nh-profile #teamHeaveHeroesTable { width: 100% !important; min-width: 0 !important; table-layout: auto; }
    .nh-profile #teamHeaveHeroesTable td:nth-child(2) { white-space: nowrap; }
}

/* Reel attribution: a caption on the clip, not its own row */
.nh-profile .pf-reel-source {
    position: absolute; left: 8px; top: 8px; z-index: 3;
    padding: 2px 8px; border-radius: 999px; background: rgba(15, 23, 42, 0.62);
    font-size: 11px; font-weight: 600; line-height: 1.5; color: #e2e8f0; text-decoration: none;
}
.nh-profile .pf-reel-source:hover { background: rgba(15, 23, 42, 0.85); color: #fff; }

/* League rankings: collapsed by default */
.nh-profile .pf-league { padding: 0; }
.nh-profile .pf-league > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px;
    list-style: none; cursor: pointer; font-weight: 700; color: #0f172a;
}
.nh-profile .pf-league > summary::-webkit-details-marker { display: none; }
.nh-profile .pf-league > summary::after { content: "Show"; font-size: 0.84rem; font-weight: 600; color: var(--pf-link); }
.nh-profile .pf-league[open] > summary::after { content: "Hide"; }
.nh-profile .pf-league__k { display: block; font-size: 0.72rem; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pf-faint); }
.nh-profile .pf-league__body { padding: 0 20px 16px; }

.nh-profile .player-shots-table-section { padding-bottom: 14px; }

/* ---------- Phones ---------- */
@media (max-width: 767px) {
    .nh-profile .section,
    .nh-profile .pf-hero,
    .nh-profile .player-heave-mix-card { padding: 14px 14px 12px; margin-bottom: 12px; border-radius: 16px; }
    .nh-profile .pf-title, .nh-profile .section h2.pf-title { font-size: 1.4rem; }
    .nh-profile .pf-hero .identity-avatar { width: 52px; height: 52px; }
    .nh-profile .pf-hero .identity-strip { gap: 12px; }
    .nh-profile .pf-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-top: 12px; padding-top: 10px; }
    .nh-profile .pf-stats li { padding: 0 6px; }
    .nh-profile .pf-stats b { font-size: 1.2rem; }
    .nh-profile .pf-stats b small { font-size: 0.6em; }
    .nh-profile .pf-stats span { font-size: 0.58rem; letter-spacing: 0.04em; white-space: normal; line-height: 1.25; }
    .nh-profile .pf-stats em { display: block; margin-top: 1px; }
    .nh-profile .pf-head .season-stats-container { display: none !important; }
    .nh-profile .pf-map-controls { gap: 8px 10px; }
    .nh-profile #evolutionBtn { padding: 0 10px !important; }
    .nh-profile .charts-row { gap: 12px !important; margin-bottom: 12px !important; }
    .nh-profile .charts-row .pf-chart { height: 220px !important; }
    .nh-profile .charts-row .pf-chart--bars { height: 260px !important; }
    .nh-profile .charts-row .distance-bins-chart-container { height: 200px !important; }
    .nh-profile #season-stats-mobile:empty { display: none !important; }
    .nh-profile .pf-filters { gap: 10px 12px; }
    .nh-profile .pf-seg legend, .nh-profile .pf-seg__k, .nh-profile .pf-range__k { min-width: 3.6em; }
    .nh-profile .pf-range { flex: 1 1 auto; }
    .nh-profile .pf-range input[type="range"] { flex: 1 1 auto; width: auto; min-width: 0; }
    .nh-profile .pf-reset { margin-left: 0; }
    .nh-profile .pf-row { gap: 8px; }
    .nh-profile .pf-league > summary { padding: 14px; }
    .nh-profile .pf-league__body { padding: 0 14px 14px; }
}
/* Coordinate explanation is a single keyboard/touch disclosure. */
.nh-profile details.pf-map-coord-notice { display: block; border-radius: 8px; padding: 8px 10px; max-width: 480px; }
.pf-map-coord-notice summary { cursor: pointer; color: #475569; font-weight: 600; }
.pf-map-coord-notice p { margin: 8px 0 0; line-height: 1.5; }

.pf-map-coord-notice { position: relative; width: max-content; }
.pf-map-coord-notice summary { cursor: pointer; list-style: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #64748b; background: #f1f5f9; }
.pf-map-coord-notice summary::-webkit-details-marker { display: none; }
.pf-map-coord-notice p { max-width: 260px; font-size: 12px; }
@media (max-width: 600px) {
 .nh-profile .pf-map-controls { display: grid !important; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px !important; }
 .nh-profile .pf-map-controls > * { min-width: 0; margin: 0 !important; }
 .nh-profile .pf-map-controls .heatmap-makes-checkbox, .nh-profile .pf-map-controls .heatmap-makes-checkbox span { font-size: 11px !important; white-space: nowrap; }
}

.nh-profile details.pf-map-coord-notice { padding: 0; border: 0; background: transparent; }
