/**
 * Baseball Duel — two-player pitcher-vs-hitter game.
 */
.bd {
    --bd-zone: #16a34a;
    --bd-pitch: #ef4444;
    max-width: 560px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

/* The `hidden` attribute must win over the component display rules below
   — .bd-join / .bd-stage set display:flex, which otherwise leaves the
   join card and stage visible even when the JS sets hidden=true. */
.bd [hidden] { display: none !important; }

/* ── Scoreboard ──────────────────────────────────────────────── */
.bd-scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
}
.bd-team { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.bd-away { justify-content: flex-start; }
.bd-home { justify-content: flex-end; }
.bd-team-name {
    font-weight: 600; font-size: 0.9375rem; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 8rem;
}
.bd-team-score {
    font-family: 'Fraunces', Georgia, serif; font-size: 1.9rem; font-weight: 800;
    color: var(--text-primary); line-height: 1; font-variant-numeric: tabular-nums;
}
.bd-center { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.bd-inning { font-size: 0.8125rem; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.bd-bso { display: flex; flex-direction: column; gap: 2px; }
.bd-bso-row { display: flex; align-items: center; gap: 3px; }
.bd-bso-label { font-size: 0.5625rem; font-weight: 700; color: var(--text-tertiary); width: 0.7rem; }
.bd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bg-primary); border: 1px solid var(--border-color); }
.bd-dot.on { background: var(--bd-pitch); border-color: var(--bd-pitch); }
.bd-bases { width: 42px; height: 42px; }
.bd-base { fill: var(--bg-primary); stroke: var(--border-color); stroke-width: 1.5; }
.bd-base.occupied { fill: #facc15; stroke: #ca8a04; }
.bd-base-home { fill: var(--text-tertiary); stroke: var(--text-tertiary); }

.bd-message {
    text-align: center; font-size: 0.9375rem; font-weight: 600;
    color: var(--text-primary); margin: 0.9rem 0 0.5rem; min-height: 1.4rem;
}

/* ── Invite + join ───────────────────────────────────────────── */
.bd-invite, .bd-join-card {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 1rem; padding: 1.1rem 1.25rem; margin: 0 auto; max-width: 420px;
}
.bd-invite-label { font-weight: 600; color: var(--text-primary); margin: 0 0 0.6rem; font-size: 0.9rem; }
.bd-invite-label i { color: var(--bd-zone); }
.bd-invite-row { display: flex; gap: 0.4rem; }
.bd-invite-row input {
    flex: 1; min-width: 0; padding: 0.5rem 0.6rem; font-size: 0.8125rem;
    color: var(--text-secondary); background: var(--bg-primary);
    border: 1px solid var(--border-color); border-radius: 0.5rem;
}
.bd-copy-btn {
    flex-shrink: 0; padding: 0.5rem 0.75rem; font-size: 0.8125rem; font-weight: 600;
    color: #fff; background: var(--bd-zone); border: none; border-radius: 0.5rem; cursor: pointer;
}
.bd-invite-wait { font-size: 0.8125rem; color: var(--text-tertiary); margin: 0.7rem 0 0; }

.bd-join { display: flex; justify-content: center; padding: 0.5rem 0; }
.bd-join-card { text-align: center; }
.bd-join-card h2 { font-family: 'Fraunces', Georgia, serif; font-size: 1.4rem; margin: 0 0 0.4rem; color: var(--text-primary); }
.bd-join-card p { font-size: 0.9rem; color: var(--text-secondary); margin: 0 0 1rem; line-height: 1.5; }
.bd-field { display: flex; flex-direction: column; gap: 0.35rem; text-align: left; font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.9rem; }
.bd-field input[type="text"] {
    padding: 0.6rem 0.75rem; font-size: 1rem; color: var(--text-primary);
    background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 0.6rem;
}
.bd-field input:focus { outline: none; border-color: var(--bd-zone); }

.bd-hand-toggle, .bd-innings-toggle { display: flex; gap: 0.4rem; }
.bd-hand-opt, .bd-innings-opt {
    flex: 1; padding: 0.5rem; font-size: 0.8125rem; font-weight: 600;
    color: var(--text-secondary); background: var(--bg-primary);
    border: 1px solid var(--border-color); border-radius: 0.5rem; cursor: pointer;
}
.bd-hand-opt.is-active, .bd-innings-opt.is-active { color: #fff; background: var(--bd-zone); border-color: var(--bd-zone); }

/* ── Stage / grid ────────────────────────────────────────────── */
.bd-stage { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; margin-top: 0.5rem; }
.bd-role { display: flex; align-items: center; gap: 0.75rem; min-height: 2rem; }
.bd-role-tag { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.bd-role-lock { font-size: 0.8125rem; color: var(--text-tertiary); }
.bd-clock {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2.4rem; padding: 0.15rem 0.5rem; font-weight: 800;
    font-variant-numeric: tabular-nums; color: #fff; background: var(--text-secondary);
    border-radius: 999px; font-size: 0.875rem;
}
.bd-clock.low { background: var(--bd-pitch); animation: bd-pulse 0.7s ease-in-out infinite; }
@keyframes bd-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

.bd-grid-wrap { position: relative; }
.bd-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    width: min(86vw, 340px);
    aspect-ratio: 1;
    padding: 10px;
    background: #6b4423;
    border-radius: 12px;
}
.bd-cell {
    position: relative;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    transition: background 0.1s, box-shadow 0.1s;
}
.bd-cell.bd-zone { background: rgba(22,163,74,0.18); border-color: rgba(22,163,74,0.5); }
.bd-cell:not(.bd-zone) { cursor: default; }
.bd-cell.bd-zone:hover { background: rgba(22,163,74,0.32); }
.bd-cell.bd-sel { background: var(--bd-zone) !important; box-shadow: 0 0 0 2px #fff inset; }
.bd-cell.bd-sel-bad { background: #f97316 !important; }
.bd-cell.bd-swing { box-shadow: 0 0 0 3px var(--bd-zone) inset; background: rgba(22,163,74,0.3); }
.bd-cell.bd-pitch::after {
    content: ''; position: absolute; inset: 0; margin: auto;
    width: 46%; height: 46%; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff, #ef4444 60%);
    box-shadow: 0 0 8px rgba(239,68,68,0.8);
}

.bd-result-banner {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 0.15rem;
    padding: 0.7rem 1.5rem; border-radius: 12px;
    background: #0f172a; box-shadow: 0 6px 18px rgba(15,23,42,0.25);
}
.bd-result-banner.pop { animation: bd-pop 0.35s ease; }
@keyframes bd-pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.bd-r-big { font-family: 'Fraunces', Georgia, serif; font-size: 2rem; font-weight: 900; color: #fff; letter-spacing: 0.02em; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.bd-r-sub { font-size: 0.8125rem; color: rgba(255,255,255,0.85); }
.bd-r-ball .bd-r-big { color: #fde047; }
.bd-r-strike .bd-r-big, .bd-r-out .bd-r-big { color: #f87171; }
.bd-r-foul .bd-r-big { color: #fb923c; }
.bd-r-hit .bd-r-big { color: #4ade80; }
.bd-r-hr .bd-r-big { color: #fbbf24; font-size: 2.3rem; }

.bd-controls { display: flex; gap: 0.6rem; align-items: center; min-height: 3rem; }
.bd-btn {
    padding: 0.7rem 1.4rem; font-size: 1rem; font-weight: 700; border: none;
    border-radius: 2rem; cursor: pointer; transition: filter 0.15s, transform 0.15s;
}
.bd-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.bd-btn-primary { color: #fff; background: var(--bd-zone); }
.bd-btn-primary:not(:disabled):hover { filter: brightness(1.08); transform: translateY(-1px); }
.bd-btn-ghost { color: var(--text-primary); background: var(--bg-secondary); border: 1px solid var(--border-color); }
.bd-waiting { font-size: 0.9rem; color: var(--text-tertiary); }
.bd-hint { font-size: 0.8125rem; color: var(--text-tertiary); text-align: center; margin: 0; max-width: 22rem; }

/* ── Log ─────────────────────────────────────────────────────── */
.bd-log-wrap { margin-top: 1.75rem; }
.bd-log-title { font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin: 0 0 0.5rem; }
.bd-log { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.bd-log li { font-size: 0.8125rem; color: var(--text-secondary); padding: 0.3rem 0.5rem; background: var(--bg-secondary); border-radius: 0.4rem; }
.bd-log-half { display: inline-block; min-width: 2rem; font-weight: 700; color: var(--text-tertiary); }
.bd-footer { text-align: center; margin-top: 1.5rem; }
.bd-link { font-size: 0.875rem; font-weight: 600; color: var(--bd-zone); text-decoration: none; }

/* ── Landing ─────────────────────────────────────────────────── */
.bd-landing { max-width: 620px; }
.bd-hero { text-align: center; padding: 1rem 0 0.5rem; }
.bd-eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; color: var(--bd-zone); text-transform: uppercase; }
.bd-eyebrow i { margin-right: 0.3rem; }
.bd-hero h1 { font-family: 'Fraunces', Georgia, serif; font-size: clamp(2rem, 6vw, 2.75rem); font-weight: 800; margin: 0.5rem 0; color: var(--text-primary); }
.bd-hero-deck { font-size: 1rem; line-height: 1.55; color: var(--text-secondary); max-width: 30rem; margin: 0 auto 1.5rem; }
.bd-create-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 1.25rem; padding: 1.5rem; max-width: 400px; margin: 0 auto; text-align: left; }
.bd-create-card .bd-btn-primary { width: 100%; margin-top: 0.5rem; }
.bd-create-error { color: var(--bd-pitch); font-size: 0.8125rem; margin: 0.6rem 0 0; }
.bd-how { max-width: 520px; margin: 2.5rem auto 0; }
.bd-how h2 { font-family: 'Fraunces', Georgia, serif; font-size: 1.4rem; text-align: center; color: var(--text-primary); margin-bottom: 1rem; }
.bd-how-steps { padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.85rem; }
.bd-how-steps li { font-size: 0.9375rem; line-height: 1.55; color: var(--text-secondary); }
.bd-how-steps strong { color: var(--text-primary); }

@media (max-width: 420px) {
    .bd-team-name { max-width: 5.5rem; }
    .bd-r-big { font-size: 1.7rem; }
}

/* Create-card "or Play the computer" */
.bd-or { display: flex; align-items: center; gap: 0.6rem; margin: 0.85rem 0; color: var(--text-tertiary); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.bd-or::before, .bd-or::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.bd-btn-wide { width: 100%; }
.bd-btn-wide i { margin-right: 0.4rem; }

/* ── v2 selection UX: instructions, brighter zone, guided availability ── */
.bd-instruct {
    min-height: 1.4rem;
    max-width: 24rem;
    margin: -0.2rem 0 0.1rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
}
.bd-instruct-hit   { color: #16a34a; }
.bd-instruct-pitch { color: #2563eb; }
.bd-instruct-wait  { color: var(--text-tertiary); font-weight: 600; }

/* Clearer cells: lit strike zone vs dark "ball" territory */
.bd-cell { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); }
.bd-cell.bd-zone { background: rgba(255,255,255,0.17); border-color: rgba(255,255,255,0.42); }

/* Hitter's turn — only the strike zone is live; the rest fades back */
.bd-grid.bd-turn-hitter .bd-cell:not(.bd-zone) { opacity: 0.28; cursor: default; }
.bd-grid.bd-turn-hitter .bd-cell.bd-zone { cursor: pointer; }

/* The valid next squares: dashed, glowing, obviously tappable */
.bd-grid.bd-turn-hitter .bd-cell.bd-avail {
    cursor: pointer;
    background: rgba(34,197,94,0.20);
    border: 2px dashed #22c55e;
    animation: bd-avail-pulse 1.2s ease-in-out infinite;
}
.bd-grid.bd-turn-hitter .bd-cell.bd-avail:hover { background: rgba(34,197,94,0.34); }
@keyframes bd-avail-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.45); }
    50%      { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

/* Chosen squares: solid green fill */
.bd-cell.bd-sel { background: #16a34a !important; border-color: #16a34a !important; box-shadow: 0 0 0 2px #fff inset; cursor: pointer; }

/* Pitcher's turn — every square is live (in or off the zone) */
.bd-grid.bd-turn-pitcher .bd-cell { cursor: pointer; }
.bd-grid.bd-turn-pitcher .bd-cell:hover { background: rgba(59,130,246,0.30); border-color: #3b82f6; }
.bd-grid.bd-turn-pitcher .bd-cell.bd-sel { background: #2563eb !important; border-color: #2563eb !important; }

/* Idle / reveal — nothing is tappable */
.bd-grid.bd-turn-idle .bd-cell { cursor: default; }

/* Make the reveal banner translucent enough to see the pitch + zone behind */
.bd-result-banner { background: rgba(15,23,42,0.5); }

/* ── Linescore (classic baseball scoreboard) ─────────────────── */
.bd-linescore { overflow-x: auto; margin: 0.6rem 0 0; }
.bd-linescore-table {
    border-collapse: collapse; margin: 0 auto;
    font-size: 0.8125rem; font-variant-numeric: tabular-nums;
}
.bd-linescore-table th, .bd-linescore-table td {
    min-width: 1.5rem; padding: 0.25rem 0.45rem; text-align: center;
    border: 1px solid var(--border-color); color: var(--text-secondary);
}
.bd-linescore-table th { font-weight: 700; color: var(--text-tertiary); background: var(--bg-secondary); }
.bd-linescore-table tbody td { background: var(--bg-primary); }
.bd-linescore-table .bd-ls-team { text-align: left; font-weight: 600; color: var(--text-primary); min-width: 5rem; }
.bd-linescore-table .bd-ls-tot { font-weight: 800; color: var(--text-primary); background: var(--bg-secondary); }
.bd-linescore-table th.bd-ls-now { color: #16a34a; }

/* ── Result banner moved ABOVE the grid (never covers the strike zone) ── */
.bd-result-banner {
    position: static; inset: auto;
    display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 0.5rem;
    width: min(86vw, 340px); margin: 0.1rem auto 0.1rem; min-height: 2.2rem;
    padding: 0.3rem 0.8rem; border-radius: 10px;
    background: var(--bg-secondary); border: 1.5px solid var(--border-color);
    backdrop-filter: none;
}
.bd-result-banner[hidden] { display: none; }
.bd-r-big { font-size: 1.4rem; text-shadow: none; }
.bd-r-sub { color: var(--text-tertiary); }
.bd-r-ball   .bd-r-big { color: #d97706; }
.bd-r-strike .bd-r-big, .bd-r-out .bd-r-big { color: #dc2626; }
.bd-r-foul   .bd-r-big { color: #ea580c; }
.bd-r-hit    .bd-r-big { color: #16a34a; }
.bd-r-hr     .bd-r-big { color: #ca8a04; font-size: 1.55rem; }
.bd-r-ball   { border-color: #f59e0b; }
.bd-r-strike, .bd-r-out { border-color: #ef4444; }
.bd-r-foul   { border-color: #fb923c; }
.bd-r-hit    { border-color: #22c55e; }
.bd-r-hr     { border-color: #eab308; background: rgba(234,179,8,0.12); }
@keyframes bd-pop { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ── Box score ───────────────────────────────────────────────── */
.bd-scorekeeper { margin-top: 1.75rem; }
.bd-sk-title { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin: 0 0 0.6rem; }
.bd-sk-title i { color: #16a34a; }
.bd-boxscore { display: flex; flex-direction: column; gap: 1rem; }
.bd-bx-cap { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin-bottom: 0.3rem; }
.bd-bx-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.bd-bx-table th, .bd-bx-table td { padding: 0.3rem 0.4rem; text-align: center; border-bottom: 1px solid var(--border-color); color: var(--text-secondary); }
.bd-bx-table th { font-weight: 700; color: var(--text-tertiary); font-size: 0.6875rem; }
.bd-bx-table .bd-bx-name { text-align: left; font-weight: 600; color: var(--text-primary); white-space: nowrap; }

/* ── Desktop: two-column "play + scorekeeper" so everything's on screen ──
   Mobile stays a single column. On wide viewports the interactive grid sits
   on the left (pinned), the full pro scorekeeper on the right; only the
   collapsibles further down the board column (heat map, linescore,
   play-by-play) require scrolling. */
@media (min-width: 960px) {
    .bd {
        max-width: 1200px;
        display: grid;
        grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
        grid-template-areas:
            "msg    msg"
            "play   score"
            "foot   foot";
        column-gap: 2rem;
        row-gap: 1rem;
        align-items: start;
        padding-bottom: 2rem;
    }
    .bd > .bd-message { grid-area: msg; text-align: center; }
    .bd > .bsp-page   { grid-area: score; min-width: 0; }
    .bd > .bd-stage,
    .bd > .bd-invite,
    .bd > .bd-join    { grid-area: play; }
    .bd > .bd-footer  { grid-area: foot; text-align: center; }

    /* Keep the at-bat controls pinned while you scroll the board column
       down to the play-by-play. */
    .bd > .bd-stage {
        position: sticky;
        top: 1.5rem;
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: 1rem;
        padding: 1.25rem 1rem;
    }
    /* A little more presence for the grid now that there's room. */
    .bd-grid { width: min(30vw, 380px); }

    .bsp-page.bsp-embedded .bsp-wrap { max-width: none; }
    /* Summary + live card read fine in the narrower right column. */
    .bsp-page.bsp-embedded .bsp-summary,
    .bsp-page.bsp-embedded .bsp-live-card { margin-left: 0; margin-right: 0; }

    /* Show the linescore inline on desktop (core scorekeeping); the
       play-by-play stays collapsed as the one scroll target. */
    .bsp-page.bsp-embedded #bsp-collapse-linescore .bsp-collapse-body { display: block !important; }
    .bsp-page.bsp-embedded #bsp-collapse-linescore .bsp-collapse-arrow { display: none; }
    .bsp-page.bsp-embedded #bsp-collapse-linescore .bsp-collapse-head { cursor: default; }
}

/* ── Count readout under the role line (balls / strikes / outs) ── */
.bd-count {
    display: flex; align-items: center; justify-content: center;
    gap: 0.8rem; flex-wrap: wrap;
    margin-top: -0.3rem;
}
.bd-count-grp { display: inline-flex; align-items: center; gap: 0.3rem; }
.bd-count-lbl { font-size: 0.72rem; font-weight: 800; color: var(--text-tertiary); letter-spacing: 0.04em; }
.bd-pip {
    width: 0.6rem; height: 0.6rem; border-radius: 50%;
    background: var(--border-color); border: 1px solid var(--border-color);
    display: inline-block;
}
.bd-pip.on.b { background: #16a34a; border-color: #15803d; }
.bd-pip.on.s { background: #ef4444; border-color: #b91c1c; }
.bd-pip.on.o { background: #f59e0b; border-color: #b45309; }
.bd-count-num {
    font-size: 0.8125rem; font-weight: 800; color: var(--text-secondary);
    font-variant-numeric: tabular-nums; margin-left: 0.15rem;
    padding-left: 0.6rem; border-left: 1px solid var(--border-color);
}

/* ── Ball-flight field — always shown ABOVE the strike zone, fixed height so
      it never reflows. The static diagram is always visible; the trajectory is
      drawn on contact. ── */
.bd-shotfield {
    height: 168px; width: min(86vw, 340px); margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: #14361f; border-radius: 12px; overflow: hidden;
}
.bd-shotfield-svg { height: 100%; width: auto; display: block; }
@media (min-width: 960px) { .bd-shotfield { width: 100%; height: 190px; } }
.bd-shotfield-ft {
    fill: #fff; font-size: 11px; font-weight: 800;
    paint-order: stroke; stroke: rgba(15,23,42,0.85); stroke-width: 3px; stroke-linejoin: round;
    font-family: 'Inter', system-ui, sans-serif;
}

/* ── Stable feedback slot: the instruction (selecting) and result banner
      (reveal) share one fixed-height row, so swapping between them — and the
      instruction text changing length — never reflows the board. ── */
.bd-feedback {
    width: 100%; min-height: 3rem;
    display: flex; align-items: center; justify-content: center;
}
.bd-feedback .bd-instruct { margin: 0; }
.bd-feedback .bd-result-banner { margin: 0; }

/* Aim marker (where the pitcher aimed) when fatigue leaks the pitch off-spot. */
.bd-cell.bd-aim { box-shadow: 0 0 0 2px #fff inset; border: 1px dashed #fff; opacity: 0.9; }
.bd-cell.bd-aim::before {
    content: ''; position: absolute; inset: 0; margin: auto;
    width: 30%; height: 30%; border-radius: 50%;
    border: 1.5px dashed rgba(255,255,255,0.9);
}
/* Pitcher fatigue tag on the role line. */
.bd-tired { font-size: 0.8125rem; font-weight: 700; color: #d97706; }
.bd-tired.gassed { color: #dc2626; }

/* ── Pro "fresh arm" button (relief pitcher — resets fatigue) ── */
.bd-newpitcher {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0.8rem; font: inherit; font-size: 0.8125rem; font-weight: 700;
    border-radius: 999px; cursor: pointer;
    border: 1px solid var(--border-color); background: var(--bg-secondary);
    color: var(--text-secondary);
}
.bd-newpitcher:hover { border-color: var(--bd-zone); color: var(--text-primary); }
.bd-newpitcher.is-hot { border-color: #f59e0b; color: #d97706; }
.bd-newpitcher .bd-np-pro {
    font-size: 0.625rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
    padding: 0.05rem 0.35rem; border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff;
}
.bd-newpitcher:disabled { opacity: 0.6; cursor: default; }

/* ── Pro upsell modal (fresh-arm gate for free users) ── */
.bd-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.bd-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.55); backdrop-filter: blur(2px); }
.bd-modal-card {
    position: relative; z-index: 1; width: min(92vw, 380px);
    background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: 18px; padding: 1.6rem 1.4rem 1.3rem; text-align: center;
    box-shadow: 0 20px 60px rgba(15,23,42,0.35);
    animation: bd-modal-in 0.2s ease-out;
}
@keyframes bd-modal-in { from { transform: translateY(10px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.bd-modal-x {
    position: absolute; top: 0.6rem; right: 0.6rem; width: 2rem; height: 2rem;
    border: none; background: transparent; color: var(--text-tertiary);
    font-size: 1.1rem; cursor: pointer; border-radius: 50%;
}
.bd-modal-x:hover { background: var(--bg-secondary); color: var(--text-primary); }
.bd-modal-icon {
    width: 3.2rem; height: 3.2rem; margin: 0 auto 0.8rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 1.4rem; color: #fff;
    background: linear-gradient(135deg, #f59e0b, #d97706);
}
.bd-modal-title { font-family: 'Fraunces', Georgia, serif; font-size: 1.4rem; font-weight: 800; color: var(--text-primary); margin: 0 0 0.5rem; }
.bd-modal-body { font-size: 0.9375rem; line-height: 1.55; color: var(--text-secondary); margin: 0 0 1.2rem; }
.bd-modal-cta {
    display: inline-flex; align-items: center; gap: 0.5rem; width: 100%;
    justify-content: center; padding: 0.75rem 1rem; box-sizing: border-box;
    font-weight: 800; font-size: 0.9375rem; color: #fff; text-decoration: none;
    background: linear-gradient(135deg, #f59e0b, #d97706); border-radius: 999px;
}
.bd-modal-cta:hover { filter: brightness(1.05); }
.bd-modal-dismiss {
    display: block; margin: 0.7rem auto 0; padding: 0.3rem 0.6rem;
    background: none; border: none; color: var(--text-tertiary);
    font: inherit; font-size: 0.8125rem; cursor: pointer;
}
.bd-modal-dismiss:hover { color: var(--text-secondary); text-decoration: underline; }
