/* My Baller: a number-only chip beside the ? button, same 40px footprint and cut-corner shape. */
.header-tools .nav-baller {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 40px; margin: 0; padding: 0;
  border: 1px solid #c6df5b80; border-radius: 8px 2px; color: #e5ff58; background: #15201bcc; text-decoration: none;
  font: 800 1.05rem/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.header-tools .nav-baller:hover, .header-tools .nav-baller:focus-visible, .header-tools .nav-baller.active { color: #162015; background: #d7f44c; border-color: #e5ff58; }
.header-tools .nav-baller:focus-visible { outline: 2px solid #a7ddff; outline-offset: 1px; }
.header-tools .nav-baller .nav-icon { display: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* Until a save exists the chip shows the ball instead of an empty box. */
.header-tools .nav-baller:has(.nav-baller-level[hidden]) .nav-icon { display: block; }
.nav-baller-level[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .header-tools .nav-baller { transition: none; } }

.baller-page { --baller-accent: #f97316; --baller-ink: #f5f8ff; --baller-muted: #9eafc0; --baller-line: #2a3545; --baller-panel: #0f1621; display: grid; gap: 22px; color: var(--baller-ink); }
.baller-page .card { background: var(--baller-panel); border: 1px solid var(--baller-line); border-radius: 10px; padding: 22px; }
.baller-page .card::before { display: none; }
.baller-page h1 { margin: 6px 0 10px; font: 800 clamp(2rem, 5vw, 3rem)/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.baller-page h2 { margin: 0 0 6px; font: 800 1.5rem/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.baller-page h3 { margin: 6px 0; font: 800 2rem/1 var(--display); text-transform: uppercase; }
.baller-page .eyebrow { color: var(--baller-accent); }
.baller-hero { display: grid; gap: 4px; }
.baller-lead { max-width: 620px; margin: 0; color: var(--baller-muted); font-size: 1rem; line-height: 1.6; }
.baller-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 22px; border: 0; border-radius: 6px; background: var(--baller-accent); color: #111b2b; font: 800 1rem/1 var(--display); text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
.baller-primary:hover { background: #fb923c; }
.baller-primary:disabled { opacity: .5; cursor: default; }
.baller-page .btn { cursor: pointer; }
.baller-page .btn.secondary { background: transparent; }
.baller-danger { color: #fca5a5; border-color: #7f1d1d; }
.baller-page :focus-visible { outline: 2px solid #65caff; outline-offset: 3px; }

/* creation */
.baller-create-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.baller-preview { position: sticky; top: calc(var(--site-header-height, 70px) + 16px); display: grid; place-items: center; padding: 18px 10px; border: 1px solid var(--baller-line); border-radius: 10px; background: radial-gradient(circle at 50% 28%, #1f2b3c, #0b111b 70%); }
.baller-figure { width: 100%; max-width: 170px; height: auto; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .55)); }
.baller-fields { display: grid; gap: 16px; }
.baller-field-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 12px; }
.baller-field { display: grid; gap: 6px; font-weight: 600; }
.baller-field span { font-size: .85rem; color: var(--baller-muted); }
.baller-field input[type="text"], .baller-field input:not([type]), .baller-field input[type="number"] { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid #47505d; border-radius: 6px; background: #111720; color: #f1eee8; font: 600 1rem/1.3 var(--font); }
.baller-height input { width: 100%; accent-color: var(--baller-accent); }
.baller-height b { color: var(--baller-ink); margin-left: 6px; font: 800 1rem/1 var(--mono); }
.baller-form-note { margin: -8px 0 0; color: var(--baller-muted); font-size: .8rem; }
.baller-choice, .baller-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.baller-choice legend, .baller-swatches legend { display: block; width: 100%; margin-bottom: 8px; padding: 0; color: var(--baller-muted); font-size: .85rem; font-weight: 600; }
.baller-choice button { display: grid; gap: 2px; min-width: 64px; padding: 10px 12px; border: 1px solid #3b4756; border-radius: 6px; background: #111720; color: #d7e0ea; text-align: left; font: 600 .9rem/1.3 var(--font); cursor: pointer; }
.baller-choice button b { font: 800 1.05rem/1.1 var(--display); text-transform: uppercase; color: #fff; }
.baller-choice button span { font-size: .78rem; color: var(--baller-muted); }
.baller-choice button small { font-size: .7rem; color: #cbd5e1; }
.baller-choice button[aria-pressed="true"] { border-color: var(--baller-accent); background: #2a1c12; box-shadow: inset 0 0 0 1px var(--baller-accent); }
.baller-styles button { flex: 1 1 170px; }
.baller-hair button { min-width: 0; }
.baller-swatches button { width: 34px; height: 34px; padding: 0; border: 2px solid transparent; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px #0008 inset; cursor: pointer; }
.baller-swatches button[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px var(--baller-accent); }
.baller-form-error { min-height: 1.2em; margin: 0; color: #fca5a5; font-weight: 600; }
.baller-form-error:empty { display: none; }
.baller-import-note { margin: 0; color: var(--baller-muted); font-size: .85rem; }
.baller-import-link, .baller-import-button { cursor: pointer; }
.baller-import-link { color: #7dd3fc; font-weight: 600; text-decoration: underline; }

/* profile card */
.baller-card { display: grid; gap: 20px; background: linear-gradient(135deg, #1a2436, #0f1621 55%) !important; }
.baller-card-top { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; align-items: center; }
.baller-avatar { display: grid; place-items: center; padding: 10px 6px; border-radius: 10px; background: radial-gradient(circle at 50% 30%, #243244, #0b111b 72%); }
.baller-card-id h1 { margin: 2px 0 4px; }
.baller-card-meta { margin: 0 0 12px; color: var(--baller-muted); font: 600 .85rem/1.4 var(--font); }
.baller-level { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; max-width: 420px; }
.baller-level b { font: 800 1.2rem/1 var(--display); text-transform: uppercase; color: #fff; }
.baller-level small { grid-column: 2; color: var(--baller-muted); font-size: .72rem; }
.baller-xp { height: 10px; border-radius: 999px; background: #1f2a3a; overflow: hidden; }
.baller-xp span { display: block; height: 100%; background: linear-gradient(90deg, #fb923c, var(--baller-accent)); border-radius: 999px; transition: width .4s ease; }
.baller-identity-blurb { margin: 10px 0 0; color: #cbd5e1; font-size: .9rem; }
.baller-card-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; padding-top: 18px; border-top: 1px solid var(--baller-line); }
.baller-radar-wrap { display: grid; place-items: center; }
.baller-radar { width: 100%; max-width: 340px; height: auto; }
.baller-radar-grid polygon, .baller-radar-grid line { fill: none; stroke: #33425a; stroke-width: 1; }
.baller-radar-shape { fill: rgba(249, 115, 22, .3); stroke: var(--baller-accent); stroke-width: 2; stroke-linejoin: round; }
.baller-radar-labels text { fill: #cbd5e1; font: 600 9px var(--font); }
.baller-radar-labels tspan { fill: #fff; font-weight: 800; }
.baller-attributes ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.baller-attributes li { display: grid; grid-template-columns: 110px minmax(0, 1fr) 36px 44px; grid-template-areas: "name bar value button" "note note note note"; gap: 4px 12px; align-items: center; }
.baller-attr-name { grid-area: name; font-weight: 600; font-size: .9rem; }
.baller-attr-bar { grid-area: bar; height: 8px; border-radius: 999px; background: #1f2a3a; overflow: hidden; }
.baller-attr-bar i { display: block; height: 100%; background: linear-gradient(90deg, #65caff, #a37cff); border-radius: 999px; transition: width .35s ease; }
.baller-attributes li > b { grid-area: value; text-align: right; font: 800 1.05rem/1 var(--mono); }
.baller-attributes li > small { grid-area: note; color: var(--baller-muted); font-size: .72rem; }
.baller-develop { grid-area: button; min-height: 32px; border: 1px solid var(--baller-accent); border-radius: 6px; background: #2a1c12; color: #ffd4b3; font: 800 .85rem/1 var(--mono); cursor: pointer; }
.baller-develop:hover:not(:disabled) { background: var(--baller-accent); color: #111b2b; }
.baller-develop:disabled { opacity: .35; cursor: default; }
.baller-points { margin: 0 0 12px; color: #cbd5e1; font-size: .9rem; }
.baller-points b { color: var(--baller-accent); font: 800 1.1rem/1 var(--mono); }

/* gym */
.baller-gym-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 20px; margin-bottom: 14px; }
.baller-gym-head p { margin: 0; color: var(--baller-muted); font-size: .85rem; }
.baller-court { position: relative; width: 100%; aspect-ratio: 16 / 10; max-height: 580px; border-radius: 10px; overflow: hidden; background: #0a1020; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.baller-court-canvas { position: absolute; inset: 0; }
.baller-canvas { display: block; width: 100% !important; height: 100% !important; }
.baller-hud { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none; }
.baller-hud > div { display: grid; gap: 1px; min-width: 64px; padding: 6px 10px; border-radius: 6px; background: rgba(8, 12, 22, .72); backdrop-filter: blur(6px); }
.baller-hud small { color: var(--baller-muted); font: 700 .62rem/1 var(--font); text-transform: uppercase; letter-spacing: .08em; }
.baller-hud b { font: 800 1.35rem/1 var(--mono); color: #fff; }
.baller-hud-time b { color: var(--baller-accent); }
.baller-hud-spot { align-self: center; margin-left: auto; padding: 8px 12px; color: #fff; font: 700 .85rem/1 var(--font); }
.baller-hud[hidden] { display: none; }
.baller-flash { position: absolute; left: 50%; top: 22%; transform: translate(-50%, 0) scale(.9); padding: 8px 18px; border-radius: 999px; background: rgba(8, 12, 22, .78); color: #fff; font: 800 1.3rem/1 var(--display); text-transform: uppercase; letter-spacing: .06em; opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; }
.baller-flash.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.baller-flash[data-tone="made"], .baller-flash[data-tone="perfect"] { color: #2ee88a; }
.baller-flash[data-tone="miss"], .baller-flash[data-tone="off"] { color: #fca5a5; }
.baller-flash[data-tone="good"] { color: #fde68a; }
.baller-meter { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: grid; justify-items: center; gap: 6px; pointer-events: none; }
.baller-meter[hidden] { display: none; }
.baller-meter span { color: #fff; font: 700 .62rem/1 var(--font); text-transform: uppercase; letter-spacing: .08em; }
.baller-meter-track { position: relative; width: 18px; height: min(52vh, 300px); border-radius: 999px; background: rgba(8, 12, 22, .78); border: 1px solid rgba(255, 255, 255, .25); overflow: hidden; }
.baller-meter-zone { position: absolute; left: 0; right: 0; background: rgba(46, 232, 138, .65); }
.baller-meter-marker { position: absolute; left: -2px; right: -2px; bottom: 0; height: 5px; background: #fff; box-shadow: 0 0 8px #fff; border-radius: 2px; transform: translateY(50%); }
.baller-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 24px; text-align: center; background: linear-gradient(180deg, rgba(10, 16, 32, .55), rgba(10, 16, 32, .85)); }
.baller-overlay[hidden] { display: none; }
.baller-overlay p { max-width: 420px; margin: 0; color: #d7e0ea; font-size: .95rem; }
.baller-overlay .baller-primary { margin-top: 12px; }
.baller-overlay-note { min-height: 1.2em; color: var(--baller-muted); font-size: .8rem; }
.baller-xp-gain { color: #fff; font-size: 1rem; }
.baller-xp-gain b { color: var(--baller-accent); font: 800 1.4rem/1 var(--display); }
.baller-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 14px; }
.baller-shoot { min-width: 180px; touch-action: none; user-select: none; -webkit-user-select: none; }
.baller-hint { margin: 0; color: var(--baller-muted); font-size: .8rem; }

/* career and save */
.baller-career-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0 18px; }
.baller-career-stats div { padding: 12px 14px; border-radius: 8px; background: #111923; border-bottom: 1px solid #34404d; }
.baller-career-stats dt { color: var(--baller-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.baller-career-stats dd { margin: 6px 0 0; font: 800 1.6rem/1 var(--display); color: #fff; }
.baller-history { width: 100%; border-collapse: collapse; font: 500 .85rem/1.5 var(--font); font-variant-numeric: tabular-nums; }
.baller-history th, .baller-history td { padding: 8px 10px; border-bottom: 1px solid #293542; text-align: right; }
.baller-history th:first-child, .baller-history td:first-child { text-align: left; }
.baller-history thead { color: var(--baller-muted); }
.baller-manage p { color: var(--baller-muted); font-size: .9rem; }
.baller-manage-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.baller-manage-status { min-height: 1.2em; margin: 10px 0 0; color: #c0eaff; font-size: .85rem; }

@media (max-width: 820px) {
  .baller-create-grid { grid-template-columns: minmax(0, 1fr); }
  .baller-preview { position: static; max-width: 220px; justify-self: center; }
  .baller-card-top { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; }
  .baller-card-body { grid-template-columns: minmax(0, 1fr); }
  .baller-radar { max-width: 240px; }
  .baller-career-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .baller-page .card { padding: 16px; }
  .baller-court { aspect-ratio: 4 / 5; max-height: none; }
  .baller-hud > div { min-width: 54px; padding: 5px 8px; }
  .baller-hud b { font-size: 1.1rem; }
  .baller-hud-spot { flex-basis: 100%; margin-left: 0; padding: 4px 0 0; font-size: .78rem; }
  .baller-meter-track { height: 36vh; }
  .baller-attributes li { grid-template-columns: 90px minmax(0, 1fr) 32px 40px; }
  .baller-field-row { grid-template-columns: minmax(0, 1fr) 90px; }
}
@media (prefers-reduced-motion: reduce) {
  .baller-xp span, .baller-attr-bar i, .baller-flash { transition: none; }
}
