/* The interactive parts of the football entry. Everything is scoped under .fb-widget.
   The field keeps its own colours in both themes: grass is green whatever the page is doing. */
.fb-widget {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 14px;
    margin: 1.5rem 0;
    background: color-mix(in srgb, var(--color-bg), var(--color-text) 3%);
    font-size: 0.9rem;
    line-height: 1.5;
    min-height: 120px;
}
.fb-widget > * + * { margin-top: 12px; }
.fb-widget h4.fb-h { margin: 0 0 4px; font-size: 1.05rem; line-height: 1.3; }
.fb-widget p { margin: 0; }
.fb-widget p + p { margin-top: 6px; }
.fb-caption, .fb-hint { color: var(--color-muted); font-size: 0.8rem; }
.fb-caption { font-style: italic; text-align: center; }
.fb-said { font-size: 0.88rem; min-height: 1.5em; }
.fb-big { font-size: 1.05rem; font-weight: 600; }
.fb-muted { color: var(--color-muted); }
.fb-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.fb-split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fb-split-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fb-stack { display: grid; gap: 10px; align-content: start; min-width: 0; }
.fb-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); }

.fb-button, .fb-seg-b { font: inherit; font-size: 0.82rem; padding: 4px 11px; border-radius: 6px; border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-text); cursor: pointer; }
.fb-button:hover, .fb-seg-b:hover { border-color: var(--color-accent); }
.fb-button:disabled { opacity: 0.45; cursor: default; }
.fb-button-main { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); font-weight: 600; }
.fb-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.fb-seg-b.on { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.fb-check { display: inline-flex; align-items: center; gap: 5px; font-size: 0.84rem; cursor: pointer; white-space: nowrap; }
.fb-button:focus-visible, .fb-seg-b:focus-visible, .fb-range:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.fb-sliders { display: grid; gap: 8px; }
.fb-slider { display: grid; grid-template-columns: 9.5em minmax(0, 1fr) 6.5em; gap: 10px; align-items: center; font-size: 0.84rem; }
.fb-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--color-muted); font-size: 0.82rem; }
.fb-range { width: 100%; margin: 0; accent-color: var(--color-accent); cursor: pointer; }
.fb-transport { display: grid; grid-template-columns: auto minmax(0, 1fr) 3.2em auto; gap: 10px; align-items: center; }
.fb-go { min-width: 5.2em; }

/* ---- the field */
.fb-stage { min-width: 0; }
.fb-field { display: block; width: 100%; height: auto; border-radius: 6px; user-select: none; -webkit-user-select: none; }
.fb-field text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; text-anchor: middle; }
.fb-apron { fill: #1f4d2c; }
.fb-turf-a { fill: #3a8046; }
.fb-turf-b { fill: #347540; }
.fb-endzone-a { fill: #1e3a8a; }
.fb-endzone-b { fill: #9a3412; }
.fb-yardline { stroke: #fff; stroke-width: 1.2; opacity: 0.7; }
.fb-goalline { stroke: #fff; stroke-width: 3; }
.fb-sideline { stroke: #fff; stroke-width: 3.5; }
.fb-border { fill: none; stroke: #fff; stroke-width: 1.5; }
.fb-hash { stroke: #fff; stroke-width: 1; opacity: 0.6; }
.fb-post { stroke: #fde047; stroke-width: 4; stroke-linecap: round; }
.fb-fieldnum { fill: #fff; opacity: 0.42; font-weight: 700; dominant-baseline: central; }
.fb-endtext { fill: #fff; opacity: 0.8; font-weight: 800; letter-spacing: 0.12em; dominant-baseline: central; }
.fb-los { stroke: #60a5fa; stroke-width: 2.5; }
.fb-togo { stroke: #fde047; stroke-width: 2.5; }

/* players */
.fb-tok circle, .fb-tok rect { stroke-width: 1.6; transition: stroke 0.15s, opacity 0.15s; }
.fb-tok-o circle, .fb-tok-o rect { fill: #f8fafc; stroke: #0f172a; }
.fb-tok-d circle, .fb-tok-d rect { fill: #111827; stroke: #f8fafc; }
.fb-tok-t { font-weight: 700; pointer-events: none; }
.fb-tok-o .fb-tok-t { fill: #0f172a; }
.fb-tok-d .fb-tok-t { fill: #f8fafc; }
.fb-tok.hi circle, .fb-tok.hi rect { stroke: #fbbf24; stroke-width: 4; }
.fb-tok.key circle, .fb-tok.key rect { fill: #fb923c; stroke: #0f172a; }
.fb-tok.key .fb-tok-t { fill: #0f172a; }
.fb-tok.open circle, .fb-tok.open rect { stroke: #4ade80; stroke-width: 4.5; }
.fb-tok.tight circle, .fb-tok.tight rect { stroke: #fde047; stroke-width: 4.5; }
.fb-tok.shut circle, .fb-tok.shut rect { stroke: #f87171; stroke-width: 4.5; }
.fb-tok.read circle, .fb-tok.read rect { fill: #c4b5fd; stroke: #f8fafc; stroke-width: 3; }
.fb-tok.read .fb-tok-t { fill: #0f172a; }
.fb-tok.dim { opacity: 0.28; }
.fb-tok.pick { cursor: pointer; }
.fb-ball ellipse { fill: #8a4b1f; stroke: #2b1505; stroke-width: 1; }
.fb-ball line { stroke: #fff; stroke-width: 1.3; }

/* lines */
.fb-lines { transition: opacity 0.25s; }
.fb-trace path { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.fb-trace-route path, .fb-trace-block path, .fb-trace-plain path { stroke: #f8fafc; }
.fb-trace-route polygon { fill: #f8fafc; }
.fb-trace .fb-bar { stroke: #f8fafc; stroke-width: 3.2; stroke-linecap: round; }
.fb-trace-run path { stroke: #fde047; stroke-width: 4; }
.fb-trace-run polygon { fill: #fde047; }
.fb-trace-pull path { stroke: #fb923c; stroke-width: 3.4; }
.fb-trace-pull .fb-bar { stroke: #fb923c; stroke-width: 4; }
.fb-trace-def path, .fb-trace-rush path { stroke: #0b1220; stroke-width: 2; stroke-dasharray: 5 4; }
.fb-trace-def polygon, .fb-trace-rush polygon { fill: #0b1220; }
.fb-trace-rush path { stroke: #7f1d1d; stroke-dasharray: none; }
.fb-trace-rush polygon { fill: #7f1d1d; }
.fb-trace-throw path { stroke: #fde047; stroke-width: 2; stroke-dasharray: 3 5; }
.fb-trace-throw polygon { fill: #fde047; }
.fb-trace-motion path { stroke: #f8fafc; stroke-dasharray: 2 4; }
.fb-trace-motion polygon { fill: #f8fafc; }
.fb-trace-man path { stroke: #fca5a5; stroke-width: 1.6; stroke-dasharray: 2 4; }
.fb-trace.hot path { stroke: #4ade80; stroke-width: 4; }
.fb-trace.hot polygon { fill: #4ade80; }
.fb-trace.faint { opacity: 0.4; }

/* zones of a coverage, and the holes in it */
.fb-zone { stroke-width: 1.5; }
.fb-zone-deep { fill: rgba(96, 165, 250, 0.3); stroke: rgba(191, 219, 254, 0.75); }
.fb-zone-under { fill: rgba(253, 224, 71, 0.24); stroke: rgba(254, 240, 138, 0.7); }
.fb-zone-hole { fill: rgba(248, 113, 113, 0.28); stroke: #fecaca; stroke-dasharray: 5 4; }
.fb-zone-label { fill: #fff; font-weight: 700; opacity: 0.9; paint-order: stroke; stroke: rgba(0, 0, 0, 0.45); stroke-width: 2.5px; }
.fb-note { fill: #fff; font-weight: 700; paint-order: stroke; stroke: rgba(0, 0, 0, 0.55); stroke-width: 3px; }

/* cards of facts beside a diagram */
.fb-card { border: 1px solid var(--color-border); border-radius: 8px; padding: 10px 12px; background: var(--color-bg); }
.fb-card > * + * { margin-top: 6px; }
.fb-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; font-size: 0.84rem; }
.fb-kv dt { color: var(--color-muted); }
.fb-kv dd { margin: 0; }
.fb-good { color: #15803d; }
.fb-bad { color: #b91c1c; }
html.dark-theme .fb-good { color: #4ade80; }
html.dark-theme .fb-bad { color: #f87171; }
.fb-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.78rem; color: var(--color-muted); }
.fb-legend span { display: inline-flex; align-items: center; gap: 5px; }
.fb-legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid; }
.fb-legend i.dot { width: 11px; height: 11px; border: 2px solid; border-radius: 50%; }

@media (max-width: 720px) {
    .fb-stage-wide .fb-tok circle, .fb-stage-wide .fb-tok rect, .fb-stage-wide .fb-tok text, .fb-stage-wide .fb-ball { transform: scale(1.4); }
    .fb-stage-wide .fb-ball { transform-box: fill-box; transform-origin: center; }
    .fb-split, .fb-split-even { grid-template-columns: minmax(0, 1fr); }
    .fb-slider { grid-template-columns: minmax(0, 1fr) 6.5em; }
    .fb-slider-label { grid-column: 1 / -1; margin-bottom: -6px; }
    .fb-seg-b, .fb-button { padding: 4px 8px; }
    .fb-transport { grid-template-columns: auto minmax(0, 1fr) auto; }
    .fb-transport .fb-num { display: none; }
}

/* ---- the second half: gaps, the matchup grid, the quiz */
.fb-note.fb-gap { fill: #fde047; font-size: 22px; }
.fb-note.fb-dimnote { opacity: 0.55; }
.fb-matrix { display: grid; gap: 3px; font-size: 0.74rem; align-items: stretch; }
.fb-matrix-h, .fb-matrix-r { color: var(--color-muted); display: flex; align-items: center; min-width: 0; }
.fb-matrix-h { justify-content: center; text-align: center; line-height: 1.15; }
.fb-cell { font: inherit; font-variant-numeric: tabular-nums; border: 1px solid transparent; border-radius: 5px; padding: 5px 0; cursor: pointer; color: #0f172a; min-width: 0; }
.fb-cell-big { background: #4ade80; }
.fb-cell-ok { background: #bbf7d0; }
.fb-cell-small { background: #e2e8f0; }
.fb-cell-none { background: #cbd5e1; color: #475569; }
.fb-cell-bad { background: #fca5a5; }
.fb-cell.on { outline: 3px solid var(--color-text); outline-offset: 1px; }
.fb-cell:hover { border-color: var(--color-text); }
.fb-seg-b.fb-right { background: #16a34a; border-color: #16a34a; color: #fff; }
.fb-seg-b.fb-wrong { background: #dc2626; border-color: #dc2626; color: #fff; }
.fb-seg-b:disabled { cursor: default; opacity: 0.75; }
.fb-seg-b.fb-right:disabled, .fb-seg-b.fb-wrong:disabled { opacity: 1; }
@media (max-width: 720px) {
    .fb-matrix { font-size: 0.62rem; gap: 2px; }
    .fb-cell { padding: 4px 0; }
}
.fb-note.fb-routenum { font-size: 19px; }

/* ---- the game */
.fb-gameboard { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding: 8px 12px; border-radius: 8px; background: #0f172a; color: #f8fafc; font-variant-numeric: tabular-nums; }
.fb-gameboard strong { font-size: 1.1rem; }
.fb-gameboard span { font-size: 0.82rem; opacity: 0.85; }
.fb-drivebar { display: block; width: 100%; height: auto; }
.fb-drivebar text { text-anchor: middle; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.fb-bardot { fill: #8a4b1f; stroke: #fff; stroke-width: 1.5; }
.fb-book { display: grid; gap: 6px; }
.fb-book-row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 10px; align-items: center; }
.fb-seg-b:disabled { opacity: 0.4; cursor: default; }
@media (max-width: 720px) { .fb-book-row { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* ---- the full game (fb-match.js) */
.fbm-board { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.fbm-team, .fbm-clock { display: grid; justify-items: center; align-content: center; padding: 6px 10px; border-radius: 8px; background: #0f172a; color: #f8fafc; border: 2px solid transparent; font-variant-numeric: tabular-nums; }
.fbm-team.on { border-color: #fbbf24; }
.fbm-team span, .fbm-clock span { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.8; }
.fbm-team b { font-size: 2rem; line-height: 1.1; }
.fbm-team i { font-style: normal; font-size: 0.6rem; letter-spacing: 0.2em; color: #fbbf24; }
.fbm-clock b { font-size: 1.5rem; line-height: 1.2; min-height: 1.2em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.fbm-told { font-size: 0.92rem; min-height: 3em; }
.fbm-controls { display: grid; gap: 10px; }
.fbm-arrow { fill: var(--color-text); font-weight: 700; text-anchor: middle; }
.fbm-throw .fb-seg-b { min-width: 3.4em; padding: 10px 14px; font-weight: 700; font-size: 1rem; }
.fb-tok.fbm-target circle { stroke: #fde047; stroke-width: 3.5; }
.fbm-box { border-collapse: collapse; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.fbm-box th, .fbm-box td { padding: 3px 14px 3px 0; text-align: right; border-bottom: 1px solid var(--color-border); }
.fbm-box th:first-child, .fbm-box td:first-child { text-align: left; color: var(--color-muted); }
#fb-match-page { max-width: 860px; margin: 0 auto; }
.fb-tok.fbm-target.fbm-ready circle { stroke: #4ade80; stroke-width: 4.5; }
.fbm-throw .fb-seg-b.fbm-ready { border-color: #16a34a; box-shadow: inset 0 0 0 2px #16a34a; }
.fbm-upright { fill: #fde047; stroke: #713f12; stroke-width: 1.5; }
.fb-note.fbm-good { fill: #4ade80; }
.fb-note.fbm-miss { fill: #f87171; }
