/* Baseball Advance Editor — the modal where the operator repositions the
   batter and every runner after a play (first consumer: a defensive error).

   Deliberately thin: the modal shell (.bsb-modal-backdrop / .bsb-modal /
   .bsb-modal-head / .bsb-modal-body / .bsb-modal-actions) and the chip look
   (.bsb-home-reason-grid / .bsb-home-reason-btn) already exist on the
   baseball scoreboard page, so only the editor-specific bits live here. */

.bsb-adv-modal { max-width: 520px; }

/* --- The diamond ------------------------------------------------------- */
.bsb-adv-field {
    display: flex;
    justify-content: center;
    padding: .25rem 0 .5rem;
}
.bsb-adv-svg {
    width: 240px;
    height: 240px;
    max-width: 100%;
    touch-action: manipulation;
}
@media (max-width: 480px) {
    .bsb-adv-svg { width: 100%; height: auto; aspect-ratio: 1 / 1; }
}

/* Bases. `is-target` is applied to every legal destination while a runner is
   selected, so the operator can see where the selected runner may go. */
.bsb-adv-base {
    fill: var(--bsb-base-empty, #d1d5db);
    stroke: var(--text-primary, #222);
    stroke-width: 2;
    cursor: pointer;
    transition: fill 160ms, stroke-width 160ms;
}
.bsb-adv-base.is-target { fill: #fde68a; stroke-width: 3; }
.bsb-adv-base.is-blocked { cursor: not-allowed; opacity: .45; }
.bsb-adv-base-label {
    font-size: 11px;
    font-weight: 600;
    fill: var(--text-secondary, #555);
    pointer-events: none;
}

/* Ghost arcs — the proposed play, drawn before it is committed. */
.bsb-adv-arc {
    fill: none;
    stroke: var(--bsb-accent, #c0392b);
    stroke-width: 2.5;
    stroke-dasharray: 5 4;
    opacity: .65;
    pointer-events: none;
}
.bsb-adv-arc.is-scored { stroke: var(--bsb-runner, #22c55e); opacity: .9; }

/* Runner tokens. The batter is outlined so it reads differently from the
   runners who were already on base. */
.bsb-adv-token { cursor: pointer; }
/* Set while another runner is held, so the base under this token stays
   tappable (see renderDiamond). */
.bsb-adv-token.is-passthrough { pointer-events: none; }
.bsb-adv-token-dot {
    fill: var(--bsb-runner, #22c55e);
    stroke: #fff;
    stroke-width: 2;
}
.bsb-adv-token.is-batter .bsb-adv-token-dot {
    fill: var(--bsb-accent, #c0392b);
}
.bsb-adv-token.is-selected .bsb-adv-token-dot {
    stroke: var(--bsb-accent, #c0392b);
    stroke-width: 3.5;
}
.bsb-adv-token-initials {
    font-size: 10px;
    font-weight: 700;
    fill: #fff;
    text-anchor: middle;
    pointer-events: none;
}

/* --- Scored / Out trays ------------------------------------------------ */
.bsb-adv-trays {
    display: flex;
    gap: .5rem;
    margin-top: .25rem;
}
.bsb-adv-tray {
    flex: 1;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    min-height: 3.25rem;
    padding: .5rem;
    border: 1px dashed var(--border-color, #ddd);
    border-radius: 10px;
    background: var(--bg-primary, #fff);
    color: var(--text-secondary, #555);
    cursor: pointer;
    text-align: center;
}
.bsb-adv-tray.is-target { border-style: solid; border-color: #c0392b; background: #fef2f2; }
.bsb-adv-tray.is-filled { border-style: solid; color: var(--text-primary, #222); }
.bsb-adv-tray-home.is-filled { border-color: #22c55e; background: #f0fdf4; }
.bsb-adv-tray-out.is-filled { border-color: #c0392b; background: #fef2f2; }
.bsb-adv-tray-title { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }
.bsb-adv-tray-names { display: block; margin-top: .15rem; }

/* --- Summary + validation --------------------------------------------- */
.bsb-adv-hint {
    font-size: .8rem;
    color: var(--text-secondary, #555);
    text-align: center;
    margin-bottom: .35rem;
}
.bsb-adv-summary {
    font-size: .85rem;
    line-height: 1.5;
    color: var(--text-primary, #222);
    background: var(--bg-secondary, #f7f7f7);
    border-radius: 8px;
    padding: .5rem .65rem;
    margin-top: .5rem;
}
/* Each row is also a selector for that runner — a much bigger tap target
   than the token on the diamond. */
.bsb-adv-summary-row {
    display: block;
    width: 100%;
    min-height: 2rem;
    text-align: left;
    font: inherit;
    font-size: .85rem;
    padding: .2rem .35rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: none;
    color: inherit;
    cursor: pointer;
}
.bsb-adv-summary-row:hover { background: var(--bg-primary, #fff); }
.bsb-adv-summary-row.is-selected {
    border-color: var(--bsb-accent, #c0392b);
    background: var(--bg-primary, #fff);
    font-weight: 700;
}
.bsb-adv-summary-row.is-locked { cursor: default; opacity: .75; }
.bsb-adv-summary-row.is-locked:hover { background: none; }
.bsb-adv-summary-row.is-scored { color: #15803d; font-weight: 600; }
.bsb-adv-summary-row.is-out { color: #b91c1c; font-weight: 600; }
.bsb-adv-problem {
    margin-top: .5rem;
    font-size: .85rem;
    font-weight: 600;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: .5rem .65rem;
}

/* --- Third-out timing question + RBI override ------------------------- */
.bsb-adv-question {
    border: 1px solid #fcd34d;
    background: #fffbeb;
    border-radius: 10px;
    padding: .65rem .75rem;
}
.bsb-adv-question-text { font-size: .85rem; font-weight: 600; margin-bottom: .5rem; }

/* Free-preview / locked note. Matches the pitch-location note treatment. */
.bsb-adv-note {
    font-size: .78rem;
    color: var(--text-secondary, #555);
    margin-top: .75rem;
    text-align: center;
}
.bsb-adv-note a { color: var(--bsb-accent, #c0392b); font-weight: 600; }

.bsb-modal-done:disabled { opacity: .5; cursor: not-allowed; }
