/* Pitch strike-zone — shared styling for the pitch tracker's location picker,
   live at-bat map, and per-at-bat history minis. Ported from the baseball
   scorekeeper's .bsb-pitch-loc-* / .bsb-ploc-pt rules. Self-contained dark-on-any
   modal; the map SVGs follow the host theme. */

/* ---- picker modal ---- */
.psz-backdrop {
    position: fixed; inset: 0; z-index: 100000;
    background: rgba(5, 5, 12, .82);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; overflow-y: auto;
}
.psz-backdrop[hidden] { display: none; }
.psz-modal {
    background: var(--bg-primary, #fff); color: var(--text-primary, #1a1a1a);
    border-radius: 1rem; padding: 1.25rem 1.15rem; width: 100%; max-width: 380px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
    max-height: 92vh; max-height: calc(100dvh - 2rem);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.psz-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.psz-modal-head h3 { margin: 0; font-size: 1.05rem; font-weight: 800; line-height: 1.3; }
.psz-close { flex: 0 0 auto; background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--text-secondary, #888); padding: 0 .25rem; }
.psz-deck { margin: .4rem 0 .8rem; font-size: .85rem; color: var(--text-secondary, #666); }
.psz-pill {
    display: inline-flex; align-items: center; padding: .2rem .55rem; border-radius: 999px;
    font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
    background: #eee; color: #333;
}
.psz-pill.is-ball { background: #dcfce7; color: #166534; }
.psz-pill.is-strike { background: #fee2e2; color: #991b1b; }
.psz-pill.is-foul { background: #fef3c7; color: #92400e; }

/* zone area: SVG frame + absolutely-positioned tap cells over it */
.psz-wrap { position: relative; width: 100%; max-width: 300px; margin: 0 auto; aspect-ratio: 134 / 140; }
.psz-map-svg { width: 100%; height: 100%; display: block; }
.psz-cell {
    position: absolute; transform: translate(-50%, -50%);
    width: 22%; height: 22%; padding: 0;
    border: 2px solid transparent; border-radius: 8px;
    background: rgba(255, 255, 255, 0); cursor: pointer;
    transition: background .12s, border-color .12s;
}
.psz-cell:hover, .psz-cell:focus-visible { background: rgba(37, 99, 235, .18); border-color: rgba(37, 99, 235, .5); outline: none; }
.psz-cell.is-out { width: 18%; height: 18%; }

/* plotted dots (picker preview + live map + history minis) */
.psz-pt { stroke: rgba(255, 255, 255, .85); stroke-width: 1.2; }
.psz-pt.is-ball { fill: #16a34a; }
.psz-pt.is-strike { fill: #dc2626; }
.psz-pt.is-foul { fill: #d97706; }
.psz-pt-num { fill: #fff; font-size: 7px; font-weight: 700; text-anchor: middle; pointer-events: none; }

/* ---- live "this at-bat" map (in the counter body) ---- */
.psz-map { margin: .35rem auto .1rem; text-align: center; }
.psz-map[hidden] { display: none; }
.psz-map-title { font-size: .65rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-secondary, #888); margin-bottom: .15rem; }
.psz-map-wrap { width: 132px; max-width: 55%; margin: 0 auto; aspect-ratio: 134 / 140; }
.psz-map-wrap svg { width: 100%; height: 100%; display: block; }
.psz-map-legend { display: flex; justify-content: center; gap: .7rem; font-size: .65rem; color: var(--text-secondary, #888); margin-top: .2rem; }
.psz-map-legend span { display: inline-flex; align-items: center; gap: .25rem; }
.psz-map-legend .dot { width: .55rem; height: .55rem; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); }
.psz-map-legend .dot.is-ball { background: #16a34a; }
.psz-map-legend .dot.is-strike { background: #dc2626; }
.psz-map-legend .dot.is-foul { background: #d97706; }

/* ---- per-at-bat history mini map (inside a log row) ---- */
.psz-mini { width: 34px; flex: 0 0 auto; aspect-ratio: 134 / 140; }
.psz-mini svg { width: 100%; height: 100%; display: block; }
.psz-mini .psz-pt-num { display: none; } /* too small to read at mini size */

/* ---- settings toggle row (Pro pitch-location switch) ---- */
.psz-toggle-row {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem .1rem; margin: .1rem 0 .4rem;
    border-bottom: 1px solid var(--border-color, rgba(128, 128, 128, .2));
    cursor: pointer;
}
.psz-toggle-text { flex: 1; min-width: 0; }
.psz-toggle-title { display: block; font-weight: 700; font-size: .9rem; color: var(--text-primary, inherit); }
.psz-toggle-sub { display: block; font-size: .74rem; color: var(--text-secondary, #888); margin-top: .1rem; line-height: 1.35; }
.psz-lock { font-size: .72rem; color: #c0392b; margin-left: .15rem; }
.psz-switch { position: relative; flex: 0 0 auto; width: 2.6rem; height: 1.5rem; }
.psz-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.psz-slider { position: absolute; inset: 0; border-radius: 999px; background: var(--border-color, #ccc); transition: background .15s; }
.psz-slider::before { content: ""; position: absolute; top: 2px; left: 2px; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s; }
.psz-switch input:checked + .psz-slider { background: #16a34a; }
.psz-switch input:checked + .psz-slider::before { transform: translateX(1.1rem); }
.psz-switch input:focus-visible + .psz-slider { outline: 2px solid #16a34a; outline-offset: 2px; }

/* ---- upsell feature card (Day Pass / Pro), modelled on the penalty .pku-card ---- */
.psz-up-card {
    position: relative;
    background: var(--bg-primary, #fff); color: var(--text-primary, #1b2431);
    border: 1px solid var(--border-color, #e8e0d2); border-radius: 20px;
    padding: 1.6rem 1.4rem; width: 100%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .4);
    max-height: 92vh; max-height: calc(100dvh - 2rem); overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.psz-up-close { position: absolute; top: .5rem; right: .65rem; color: var(--text-secondary, #888); }
.psz-up-eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #2ba8ff; margin: 0 0 .4rem; }
.psz-up-eyebrow i { margin-right: .3rem; }
/* head: a little strike-zone SVG preview beside the title */
.psz-up-head { display: flex; align-items: center; gap: .9rem; margin-bottom: .7rem; }
.psz-up-preview { flex: 0 0 auto; width: 58px; aspect-ratio: 134 / 140; }
.psz-up-preview svg { width: 100%; height: 100%; display: block; }
.psz-up-preview .psz-pt-num { display: none; } /* dots only at preview size */
.psz-up-head-text { flex: 1; min-width: 0; }
.psz-up-head .psz-up-eyebrow { margin-bottom: .25rem; }
.psz-up-title { font-family: 'Fraunces', Georgia, serif; font-size: 1.5rem; line-height: 1.12; margin: 0; color: var(--text-primary, #1b2431); }
.psz-up-deck { color: var(--text-secondary, #4b5563); font-size: .92rem; line-height: 1.5; margin: 0 0 1.1rem; }
.psz-up-options { display: grid; grid-template-columns: 1fr; gap: .7rem; margin-bottom: 1rem; }
.psz-up-opt { text-align: left; border-radius: 14px; padding: .85rem 1rem; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: .25rem; transition: transform .12s, box-shadow .12s; }
.psz-up-opt:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 23, 42, .18); }
.psz-up-opt-day { background: var(--bg-primary, #fff); border: 2px dashed #2ba8ff; color: var(--text-primary, #1b2431); }
.psz-up-opt-pro { background: #1b2431; border: 2px solid #1b2431; color: #fff; }
/* Season Pass — the featured, tool-specific offer; solid orange (pitch accent). */
.psz-up-opt-season { background: var(--bg-primary, #fff); border: 2px solid #f97316; color: var(--text-primary, #1b2431); }
.psz-up-opt-season .psz-up-opt-name i { color: #f97316; }
.psz-up-opt-name { font-weight: 800; font-size: .98rem; display: flex; align-items: center; gap: .45rem; }
.psz-up-opt-day .psz-up-opt-name i, .psz-up-opt-pro .psz-up-opt-name i { color: #2ba8ff; }
.psz-up-opt-price { font-family: 'Fraunces', Georgia, serif; font-size: 1.35rem; font-weight: 700; line-height: 1; }
.psz-up-opt-price:empty { display: none; }
.psz-up-opt-price em { font-style: normal; font-size: .72rem; font-weight: 600; opacity: .7; }
.psz-up-opt-desc { font-size: .82rem; line-height: 1.4; opacity: .85; }
.psz-up-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.psz-up-perks li { font-size: .84rem; display: flex; align-items: baseline; gap: .5rem; color: var(--text-secondary, #374151); }
.psz-up-perks i { color: #16a34a; font-size: .75rem; }
