/* ==========================================================================
   PlayerMeter - shared stylesheet
   Single file, no build step (matches the plain HTML/CSS/JS stack) served
   as a static asset. Loaded by every page, dynamic or pre-generated.
   ========================================================================== */

/*
 * Theme system: CSS custom properties, re-defined per data-theme value on
 * <html>. Dark is the default/fallback (matches the site's original look
 * and covers the instant before the anti-flash script in header.php runs
 * on a freshly-loaded static page). --color-fresh/mixed/rotten/unrated
 * are the vibrant "signal" colors used for solid badge/chip backgrounds
 * (readable with white text in either theme); the matching -ink tokens
 * are for using that same signal as TEXT color directly on the page
 * background, which needs a darker variant in light mode to stay legible.
 */

:root {
    color-scheme: dark;

    --color-bg: #0f1115;
    --color-surface: #171a21;
    --color-surface-alt: #1f232c;
    --color-border: #2a2f3a;
    --color-text: #e8eaf0;
    --color-text-muted: #9aa1b1;
    --color-primary: #29c46f;
    --color-primary-rgb: 41, 196, 111;
    --color-primary-dark: #209a58;
    --color-primary-alt: #ff5252;
    --color-primary-alt-dark: #e33e3e;

    --color-fresh: #29c46f;
    --color-mixed: #f2b134;
    --color-rotten: #ef4444;
    --color-unrated: #6b7180;

    --color-fresh-ink: #34d17c;
    --color-mixed-ink: #f2b134;
    --color-rotten-ink: #ff6b6b;
    --color-unrated-ink: #9aa1b1;
    --color-star: #f2b134;

    --radius: 10px;
    --radius-sm: 6px;
    --wrap-width: 1180px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] {
    color-scheme: light;

    --color-bg: #f6f7f9;
    --color-surface: #ffffff;
    --color-surface-alt: #eef0f4;
    --color-border: #dde1e8;
    --color-text: #171a21;
    --color-text-muted: #5b6272;
    --color-primary: #29c46f;
    --color-primary-rgb: 41, 196, 111;
    --color-primary-dark: #209a58;
    --color-primary-alt: #e0342f;
    --color-primary-alt-dark: #b91f1f;

    --color-fresh: #29c46f;
    --color-mixed: #f2b134;
    --color-rotten: #ef4444;
    --color-unrated: #6b7180;

    --color-fresh-ink: #1f9d57;
    --color-mixed-ink: #a3720a;
    --color-rotten-ink: #d92b2b;
    --color-unrated-ink: #5b6272;
    --color-star: #dc9a12;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color .18s ease, color .18s ease;
}

.site-header, .site-footer, .player-card, .report-card, .report-form,
.admin-panel, .admin-sidebar, .stat-card, .league-chip, .team-chip,
.auth-form, .admin-login__box, input, textarea, select, .btn, .breadcrumbs,
.meter, .empty-state, .callout {
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-primary); }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 1em; color: var(--color-text-muted); }

img { max-width: 100%; display: block; }

.wrap {
    max-width: var(--wrap-width);
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary:disabled:hover { background: var(--color-primary); }
.btn--ghost { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn--ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn--small { padding: 6px 12px; font-size: 13px; }
.btn--full { width: 100%; }

.empty-state, .callout {
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    color: var(--color-text-muted);
}

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
}
.badge--featured { background: var(--color-primary); color: #fff; }
.badge--published, .badge--done { background: rgba(41,196,111,0.15); color: var(--color-fresh-ink); }
.badge--removed, .badge--failed { background: rgba(239,68,68,0.15); color: var(--color-rotten-ink); }
.badge--pending, .badge--flagged { background: rgba(242,177,52,0.15); color: var(--color-mixed-ink); }
/* Auto vs. manual approval indicator (admin reviews table) - deliberately
   muted/secondary next to the status badge above, since the status is
   the primary signal and this is supporting detail. */
.badge--auto { background: var(--color-surface-alt); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.badge--manual { background: rgba(96,165,250,0.15); color: #60a5fa; }

/* Transient "Link copied!" confirmation after a Share button falls back
   to clipboard copy (see main.js's initShareButtons()/showToast()). */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 12px);
    background: var(--color-text);
    color: var(--color-bg);
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
    pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------------- */
/* Header / nav                                                            */
/* ---------------------------------------------------------------------- */

.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-top: 14px;
    padding-bottom: 14px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
}
.brand__mark {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.brand__logo {
    display: block;
    width: 30px;
    height: 30px;
    object-fit: contain;
}
.brand__logo--light { display: none; }
html[data-theme="light"] .brand__logo--dark { display: none; }
html[data-theme="light"] .brand__logo--light { display: block; }

.site-search {
    position: relative;
    flex: 1 1 260px;
    max-width: 420px;
    display: flex;
}
.site-search input {
    flex: 1;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--color-text);
    padding: 8px 12px;
    font-size: 14px;
}
.site-search button {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--color-text-muted);
    padding: 0 12px;
    cursor: pointer;
}
.site-search__results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    max-height: 320px;
    overflow-y: auto;
    z-index: 30;
}
.site-search__results a {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--color-border);
}
.site-search__results a:last-child { border-bottom: none; }
.site-search__results a:hover { background: var(--color-surface); }
.site-search__results small { color: var(--color-text-muted); }

.site-nav { display: flex; gap: 16px; font-weight: 600; font-size: 14px; }
.site-nav a { color: var(--color-text-muted); }
.site-nav a:hover { color: var(--color-text); }

.site-header__controls { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.site-header__account { }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-text-muted);
    cursor: pointer;
}
.theme-toggle:hover { border-color: var(--color-primary); color: var(--color-primary); }
.theme-toggle svg { width: 17px; height: 17px; display: block; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.account-menu { position: relative; }
.account-menu__trigger {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.account-menu__dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    min-width: 170px;
    padding: 6px;
}
.account-menu__dropdown a, .account-menu__dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--color-text);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
}
.account-menu__dropdown a:hover, .account-menu__dropdown button:hover { background: var(--color-surface); color: var(--color-primary); }

/* ---------------------------------------------------------------------- */
/* Hero / homepage                                                         */
/* ---------------------------------------------------------------------- */

.hero {
    background: radial-gradient(circle at top left, rgba(var(--color-primary-rgb), 0.18), transparent 60%), var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 64px 0;
    text-align: center;
}
/* Homepage HTML is static, so authentication is resolved client-side. Keep
   the hero paint-suppressed while preserving its layout until that check
   completes, preventing a flash for signed-in visitors. */
html.js body.page-home .hero { visibility: hidden; }
html.js body.page-home.is-session-resolved .hero { visibility: visible; }
body.page-home.is-logged-in .hero { display: none; }
.hero h1 { font-size: 32px; max-width: 720px; margin: 0 auto 16px; }
.hero p { max-width: 560px; margin: 0 auto; font-size: 17px; }
.leagues-strip {
    display: flex;
    gap: 12px;
    padding: 24px 20px;
    overflow-x: auto;
}
.league-chip {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 20px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}
.league-chip span { display: block; font-weight: 400; font-size: 12px; color: var(--color-text-muted); }
.league-chip:hover { border-color: var(--color-primary); }

/* Single scrollable row (like .leagues-strip) instead of wrapping - with
   ~30 teams per league, flex-wrap turned this into 5-6+ rows before you
   even reached the curated player sections below. */
.teams-strip { display: flex; gap: 10px; padding: 20px; overflow-x: auto; }
.team-chip {
    display: inline-block;
    width: 85px;
    box-sizing: border-box;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 10px 0;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    flex: none;
}
/* Abbreviations are always short (2-4 chars) so never need truncating;
   nicknames vary a lot ("SF" / "49ers" vs "MIN" / "Timberwolves"), so only
   this line ellipsizes - keeps every chip exactly the same size. */
.team-chip span { display: block; font-weight: 400; font-size: 12px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; }
.team-chip:hover { border-color: var(--color-primary); }
/* Per-team accent: a colored left edge instead of a dot (which ate into
   horizontal space that matters more now each row is a fixed-width chip
   in a scrolling strip) plus the same subtle team-color background wash
   used on .player-card--accented .player-card__photo, just flat instead
   of a gradient since a chip has no photo to fade into. --team-accent/
   --team-accent-rgb are set inline per chip from the team's brand color. */
.team-chip--accented {
    border-left: 3px solid var(--team-accent, var(--color-border));
    background: rgba(var(--team-accent-rgb), 0.1);
}
.team-chip--accented:hover { border-color: var(--team-accent, var(--color-primary)); }
.team-chip__dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 8px;
    background: var(--team-accent, var(--team-primary, currentColor));
    box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 3px var(--color-border);
    flex: none;
}

.section { padding: 32px 20px; }
.team-position-group + .team-position-group { padding-top: 8px; }
.section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section__head h2 { margin: 0; }

.section__recent-report {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

/* ---------------------------------------------------------------------- */
/* Top Scouts leaderboard                                                  */
/* ---------------------------------------------------------------------- */

.leaderboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.leaderboard__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}
.leaderboard__row:first-child { padding-top: 0; }
.leaderboard__row:last-child { border-bottom: none; }
.leaderboard__rank { width: 40px; flex-shrink: 0; font-weight: 700; color: var(--color-text-muted); }
.leaderboard__name { font-weight: 600; }
.leaderboard__publication { font-size: 13px; color: var(--color-text-muted); }
.leaderboard__count { margin-left: auto; font-size: 13px; color: var(--color-text-muted); }

.breadcrumbs {
    padding: 16px 20px 0;
    font-size: 13px;
    color: var(--color-text-muted);
}
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }

.league-hero { padding: 28px 20px 8px; }
.league-hero h1 { margin-bottom: 4px; }
.league-hero p { margin: 0; color: var(--color-text-muted); }

/* ---------------------------------------------------------------------- */
/* Team page hero accent                                                   */
/* No team logos ship with the site - color_primary/secondary/tertiary,   */
/* set per team in the database, drive a small swatch + soft background   */
/* wash here instead so each team page still feels distinct.              */
/* ---------------------------------------------------------------------- */

.team-hero {
    display: flex;
    align-items: center;
    gap: 20px;
}
.team-hero--accented {
    position: relative;
    padding-top: 24px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(var(--team-primary-rgb), 0.14), rgba(var(--team-primary-rgb), 0) 65%);
}
.team-hero--accented::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--team-primary), var(--team-secondary));
}
.team-hero__swatch {
    flex: none;
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: var(--team-primary);
    color: var(--team-on-primary);
    border: 3px solid var(--team-secondary);
    box-shadow: 0 0 0 2px var(--team-tertiary, transparent) inset;
}
.team-hero__info { min-width: 0; }
.team-hero__info h1 { margin-bottom: 4px; }
.team-hero__info p { margin: 0; color: var(--color-text-muted); }

/* ---------------------------------------------------------------------- */
/* Player / team / league cards + grid                                     */
/* ---------------------------------------------------------------------- */

.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
}

.player-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: block;
    position: relative;
}
.player-card:hover { border-color: var(--color-primary); }
/* No player photos ship with the site - when we know the player's team,
   --team-accent (set inline from teams.color_primary) tints the card edge
   and the initials placeholder so cards read as "belonging" to a team
   without needing a logo image. */
.player-card--accented { border-left: 3px solid var(--team-accent); }
.player-card--accented:hover { border-left-color: var(--team-accent); }
.player-card__photo {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--color-surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
}
.player-card--accented .player-card__photo {
    background: linear-gradient(160deg, rgba(var(--team-accent-rgb), 0.22), var(--color-surface-alt) 70%);
}
.player-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.player-card__initials { font-size: 32px; font-weight: 800; color: var(--color-text-muted); }
.player-card__meter-chip {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    color: #fff;
}
.meter-chip--positive { background: var(--color-fresh); }
.meter-chip--certified { background: var(--color-star); }
.meter-chip--negative { background: var(--color-rotten); }
.meter-chip--unrated { background: var(--color-unrated); }

.player-card__body { padding: 12px; }
.player-card__body h3 { font-size: 15px; margin-bottom: 2px; }
.player-card__report-status {
    display: none;
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 1;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: var(--color-surface);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}
body.is-logged-in .player-card__report-status.is-known { display: inline-flex; }
.player-card__report-status.has-report { color: var(--color-fresh-ink); }
.player-card__report-status.has-skipped { color: var(--color-text-muted); }
.player-card__report-status.has-skipped > span { font-size: 8px; letter-spacing: -2px; }
.player-card__report-status.has-no-report { color: var(--color-rotten-ink); }
.player-card__report-status.has-no-report > span { transform: translateY(-1px); }
.player-card__body p { margin: 0; font-size: 12px; color: var(--color-text-muted); }
.player-card__league { text-transform: uppercase; font-weight: 700; letter-spacing: 0.03em; }

/* ---------------------------------------------------------------------- */
/* Player hero + meter badge                                               */
/* ---------------------------------------------------------------------- */

.player-hero {
    display: grid;
    grid-template-columns: 160px 1fr auto;
    gap: 28px;
    align-items: center;
    padding: 28px 20px;
}
.player-hero__photo {
    width: 160px;
    height: 160px;
    border-radius: var(--radius);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
/* No player photos ship with the site - tint the placeholder box and its
   border with the player's team color (set inline as --team-primary) so
   the page still carries a bit of that team's identity. */
.player-hero--accented .player-hero__photo {
    background: linear-gradient(160deg, rgba(var(--team-primary-rgb), 0.28), var(--color-surface) 75%);
    border-color: rgba(var(--team-primary-rgb), 0.45);
}
.player-hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.player-hero__initials { font-size: 44px; font-weight: 800; color: var(--color-text-muted); }
.player-hero__league { display: flex; align-items: center; text-transform: uppercase; font-weight: 700; font-size: 13px; color: var(--color-text-muted); margin-bottom: 4px; }
.player-hero__league .team-chip__dot { margin-left: 2px; }
.player-hero__info h1 { font-size: 32px; margin-bottom: 4px; }
.player-hero__meta { margin-bottom: 8px; font-size: 14px; }
.player-hero__bio { max-width: 520px; }
.player-hero__awards { max-width: 520px; margin-top: 6px; font-size: 14px; }
.player-hero__info .share-btn { margin-top: 12px; }
.player-hero__meter { display: flex; flex-direction: column; gap: 18px; }
.meter-slot__label { margin: 0 0 6px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); }
.meter-slot--primary .meter-slot__label { color: var(--color-text); }
.meter-slot--primary .meter__gauge { width: 92px; }
.meter-slot--primary .meter__score { font-size: 32px; }

.player-hero__score-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}
.score-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.score-stat__label { color: var(--color-text-muted); }
.score-stat__value { font-weight: 700; }
.score-stat--unrated .score-stat__value { font-weight: 400; color: var(--color-text-muted); }

.player-hero__ranks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}
.rank-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.rank-stat__label { color: var(--color-text-muted); }
.rank-stat__value { font-weight: 700; }
.rank-stat__total { font-weight: 400; color: var(--color-text-muted); }
.rank-stat--unranked .rank-stat__value { font-weight: 400; color: var(--color-text-muted); font-size: 12px; }

.meter { display: flex; align-items: center; gap: 12px; }
.meter__gauge {
    width: 82px;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 9px 8px 5px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-alt);
    color: var(--color-unrated);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.meter__gauge svg { display: block; width: 100%; height: auto; overflow: visible; }
.meter__gauge-track,
.meter__gauge-fill { fill: none; stroke-width: 10; stroke-linecap: round; }
.meter__gauge-track { stroke: var(--color-surface-alt); }
.meter__gauge-fill { stroke: currentColor; stroke-dasharray: 100; transition: stroke-dashoffset 0.35s ease; }
.meter__gauge-needle { stroke: var(--color-text); stroke-width: 4; stroke-linecap: round; }
.meter__gauge-pin { fill: var(--color-text); }
.meter__gauge-empty { fill: var(--color-text-muted); font-size: 24px; font-weight: 800; }
.meter--positive .meter__gauge { color: var(--color-fresh); background: rgba(41, 196, 111, 0.1); border-color: rgba(41, 196, 111, 0.3); }
.meter--certified .meter__gauge { color: var(--color-star); background: rgba(242, 177, 52, 0.12); border-color: rgba(242, 177, 52, 0.35); }
.meter--negative .meter__gauge { color: var(--color-rotten); background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
.meter--unrated .meter__gauge { color: var(--color-unrated); }
.meter__score { font-size: 28px; font-weight: 800; line-height: 1; }
.meter__label { font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: 0.04em; }
.meter--positive .meter__label { color: var(--color-fresh-ink); }
.meter--certified .meter__label { color: var(--color-star); }
.meter--negative .meter__label { color: var(--color-rotten-ink); }
.meter--unrated .meter__label { color: var(--color-unrated-ink); }
.meter__sub { font-size: 12px; color: var(--color-text-muted); }
.meter--sm .meter__gauge { width: 52px; }
.meter--sm .meter__score { font-size: 18px; }

.player-rate, .player-reports { padding: 20px; }

/* Auth-gated rating form vs. sign-in callout - see templates/player.php.
   Default assumption (matches pre-generated static pages) is signed-out;
   main.js flips <body class="is-logged-in"> once it knows the real
   session state, and the dynamic preview controller's inline
   is-visible/is-hidden classes make it render correctly server-side too. */
.auth-only { display: none; }
.guest-only { display: block; }
.auth-only.is-visible { display: block; }
.guest-only.is-hidden { display: none; }
body.is-logged-in .auth-only { display: block; }
body.is-logged-in .guest-only { display: none; }
/* ---------------------------------------------------------------------- */
/* Score history chart                                                     */
/* ---------------------------------------------------------------------- */

.player-history { padding: 20px; }
.score-chart { width: 100%; max-width: 640px; height: auto; display: block; }
.score-chart__grid { stroke: var(--color-border); stroke-width: 1; }
.score-chart__line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.score-chart__dot { stroke: var(--color-surface); stroke-width: 2; }
.player-history__range { margin-top: 8px; font-size: 12px; color: var(--color-text-muted); }

.profile-badges__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}
.profile-badge {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 150px;
    padding: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.profile-badge__display {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 62px;
    padding: 10px;
    color: var(--color-primary-dark);
    background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface-alt));
    border: 1px solid color-mix(in srgb, var(--color-primary) 26%, var(--color-border));
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 15px;
    font-weight: 800;
}
.profile-badge__display img { display: block; width: 64px; height: 64px; object-fit: contain; }
.profile-badge p { flex: 1; margin: 0; color: var(--color-text-muted); font-size: 12px; line-height: 1.4; }
.profile-badge time { color: var(--color-text-muted); font-size: 11px; font-weight: 600; }

/* Consensus terms extracted from published player scouting reports. */
.player-word-bubble { margin-top: 28px; }
.word-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.word-bubble__term {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    color: var(--color-text);
    background: color-mix(in srgb, var(--color-primary) 9%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-primary) 24%, var(--color-border));
    border-radius: 999px;
    font-weight: 650;
    line-height: 1.1;
}
.word-bubble__term--1 { font-size: 12px; opacity: .78; }
.word-bubble__term--2 { font-size: 14px; }
.word-bubble__term--3 { font-size: 17px; }
.word-bubble__term--4 { font-size: 21px; color: var(--color-primary-dark); }
.word-bubble__term--5 { font-size: 26px; color: var(--color-primary-dark); font-weight: 750; }
.word-bubble__term--featured {
    color: #fff;
    background: var(--color-star);
    border-color: var(--color-star);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-star) 22%, transparent);
}

@media (max-width: 560px) {
    .word-bubble { gap: 7px; padding: 16px; }
    .word-bubble__term { padding: 5px 10px; }
    .word-bubble__term--5 { font-size: 22px; }
}

/* ---------------------------------------------------------------------- */
/* Star rating input + review form                                         */
/* ---------------------------------------------------------------------- */

.report-form {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.report-form__rating-group { display: flex; flex-direction: column; gap: 4px; }
.report-form__rating-control { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.report-form__label { font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.report-form__label small { font-weight: 400; text-transform: none; }
#additional-report-heading small { color: var(--color-text-muted); font-size: 12px; font-weight: 400; }
.report-form__stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 2px;
    font-size: clamp(22px, 6vw, 30px);
}
.report-form__stars input { position: absolute; opacity: 0; pointer-events: none; }
.report-form__stars label.star,
.report-form__stars a.star { display: flex; flex-direction: column; align-items: center; min-width: 22px; cursor: pointer; color: var(--color-border); text-decoration: none; transition: color .1s ease; }
.report-form__stars .star__icon { line-height: 1; }
.report-form__stars .star__number { margin-top: 3px; color: var(--color-text-muted); font-size: 11px; font-weight: 700; line-height: 1; }
.report-form__stars label.star:hover,
.report-form__stars label.star:hover ~ label.star,
.report-form__stars input:checked ~ label.star { color: var(--color-star); }
.guest-rating-preview { margin-bottom: 12px; }
.guest-only.report-form > p a { font-weight: 700; }
.report-form__stars a.star:hover,
.report-form__stars a.star:hover ~ a.star,
.report-form__stars a.star:focus-visible,
.report-form__stars a.star:focus-visible ~ a.star { color: var(--color-star); }
.report-form__field { display: flex; flex-direction: column; gap: 4px; }
.report-form__details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
html.js .report-form__details {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transform: translateY(-8px);
    transition: max-height .35s ease, opacity .25s ease, transform .35s ease, visibility 0s linear .35s;
}
html.js .report-form__details.is-visible {
    max-height: 900px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}
.report-form textarea {
    width: 100%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    padding: 10px 12px;
    font: inherit;
    resize: vertical;
}
.report-form__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.report-form__status { font-size: 13px; color: var(--color-text-muted); }
.report-form__status--autosave { white-space: nowrap; }
.report-form__rating-nav {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    color: var(--color-primary-dark);
    background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-primary) 28%, var(--color-border));
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}
.report-form__rating-nav:hover { color: #fff; background: var(--color-primary); border-color: var(--color-primary); }
.report-form__skip-player {
    color: var(--color-rotten-ink);
    background: color-mix(in srgb, var(--color-rotten) 10%, var(--color-surface));
    border-color: color-mix(in srgb, var(--color-rotten) 32%, var(--color-border));
}
.report-form__skip-player:hover { color: #fff; background: var(--color-rotten); border-color: var(--color-rotten); }
.report-form__rating-nav:disabled { opacity: .55; cursor: wait; }
.report-form__rating-nav[hidden] { display: none; }
.report-form__status.is-success { color: var(--color-fresh-ink); }
.report-form__status.is-error { color: var(--color-rotten-ink); }
.report-form__status.is-pending { color: var(--color-mixed-ink); }
@media (prefers-reduced-motion: reduce) {
    html.js .report-form__details { transition: none; transform: none; }
}
.report-form__hint { margin: 0; font-size: 12px; color: var(--color-text-muted); }

/* ---------------------------------------------------------------------- */
/* Review cards                                                            */
/* ---------------------------------------------------------------------- */

.report-list { display: flex; flex-direction: column; gap: 14px; }
.report-pagination { display: flex; align-items: center; gap: 4px; margin-top: 18px; font-size: 13px; }
.report-pagination button, .report-pagination__current, .report-pagination__disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font: inherit;
    cursor: pointer;
}
.report-pagination button:hover { color: var(--color-text); border-color: var(--color-primary); }
.report-pagination__current { background: var(--color-primary); border-color: var(--color-primary); color: #fff; font-weight: 700; }
.report-pagination__disabled { opacity: 0.4; cursor: default; }
.report-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    /* So a #review-{id} deep link (see the review card's Share button)
       doesn't land the card right under the sticky site header. */
    scroll-margin-top: 90px;
}
.report-card:target { border-color: var(--color-primary); }
.report-card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.report-card__stars .star { color: var(--color-border); }
.report-card__stars .star--filled { color: var(--color-star); }
.report-card__author { font-weight: 700; font-size: 13px; }
.report-card__publication { font-size: 12px; color: var(--color-text-muted); }
.report-card__date { font-size: 12px; color: var(--color-text-muted); margin-left: auto; }
.report-card__title { margin-bottom: 4px; font-size: 15px; }
.report-card__sub-ratings { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; color: var(--color-text-muted); }
.report-card__sub-rating { display: inline-flex; align-items: center; gap: 4px; }
.report-card__sub-rating .report-card__stars { font-size: 13px; }
.report-card__body { margin-bottom: 8px; font-size: 14px; }
.report-card__votes { display: flex; gap: 10px; }
.vote-btn {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
}
.vote-btn:hover, .vote-btn.is-active { color: var(--color-text); border-color: var(--color-primary); }

.recent-report { margin-bottom: 4px; }
.recent-report__player { font-weight: 700; font-size: 16px; display: inline-block; margin-bottom: 4px; }
.recent-report__player-team { font-weight: 400; color: var(--color-text-muted); margin-left: 6px; }

.profile-hero { padding: 32px 20px 8px; }
.profile-hero h1 { display: flex; align-items: center; gap: 10px; }
.profile-hero__meta { color: var(--color-text-muted); font-size: 14px; margin-top: 4px; }

/* ---------------------------------------------------------------------- */
/* Auth forms                                                              */
/* ---------------------------------------------------------------------- */

.auth-form {
    max-width: 400px;
    margin: 48px auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 28px;
}
.auth-form form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { font-size: 13px; font-weight: 600; color: var(--color-text-muted); display: flex; flex-direction: column; gap: 6px; }
.auth-form label.checkbox { flex-direction: row; align-items: center; gap: 8px; }
.auth-form label.checkbox input { width: auto; background: none; border: none; padding: 0; }
.auth-form input {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    padding: 10px 12px;
    font: inherit;
}
.auth-form small { color: var(--color-text-muted); font-weight: 400; }
.auth-form__alt { text-align: center; margin-top: 16px; font-size: 13px; }
.auth-form__divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: var(--color-text-muted);
    font-size: 12px;
    text-transform: uppercase;
}
.auth-form__divider::before, .auth-form__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}
.form-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.form-error {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.35);
    color: var(--color-rotten-ink);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.form-success {
    background: rgba(41,196,111,0.12);
    border: 1px solid rgba(41,196,111,0.35);
    color: var(--color-fresh-ink);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

/* ---------------------------------------------------------------------- */
/* Search page                                                             */
/* ---------------------------------------------------------------------- */

.search-page__form input {
    width: 100%;
    max-width: 480px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 15px;
}
.search-page__results { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.search-page__results a {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}
.search-page__results a:hover { border-color: var(--color-primary); }
.search-page__results small { color: var(--color-text-muted); }

/* ---------------------------------------------------------------------- */
/* Footer                                                                   */
/* ---------------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--color-border); background: var(--color-surface); margin-top: 40px; padding: 40px 0 0; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.site-footer__brand p { /* max-width: 260px; */ font-size: 13px; }
.site-footer__cols { display: flex; gap: 48px; flex-wrap: wrap; }
.site-footer__cols h4 { font-size: 13px; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 10px; }
.site-footer__cols a { display: inline-block; font-size: 14px; margin-bottom: 8px; margin-right: 8px; color: var(--color-text-muted); }
.site-footer__cols a:last-of-type { margin-right: 0;  }
.site-footer__cols a:hover { color: var(--color-primary); }
.site-footer__legal { padding: 20px; margin-top: 20px; border-top: 1px solid var(--color-border); font-size: 12px; color: var(--color-text-muted); }

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */

@media (max-width: 760px) {
    .player-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
    .site-header__inner { justify-content: center; }
    .site-nav { order: 3; width: 100%; justify-content: center; }
    .hero h1 { font-size: 28px; }
    .team-hero { flex-direction: column; text-align: center; }
    .team-hero__info p { justify-content: center; }
}
