/* Sports (templates/sports/): a sport's page and the body game's stage.
   Page colours are the site's tokens; the target face is a picture of World
   Archery's face, whose colours are its own in both themes. */
.sp { --face-gold: oklch(0.86 0.17 92); --face-red: oklch(0.6 0.22 27); --face-blue: oklch(0.6 0.13 240);
  --face-black: oklch(0.22 0 0); --face-white: oklch(0.98 0 0); --face-line: oklch(0.3 0 0); }
.sp-hero { padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) 0.5rem; }
.sp-crumbs { margin: 0 0 0.25rem; font-size: var(--step--1); }
/* Links in running text are underlined, not told apart by colour alone (WCAG 1.4.1). */
.sp-crumbs a, .sp-note a, .sp-claims a, .sp-source-list a, .sp-steps a, .sp-pending a, .sp-games a, .sp-events a, .sp-terms a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 0.15em; }
.sp a.sp-cite { text-decoration: none; }
.sp-lead { max-width: 62ch; color: var(--text-muted); margin: 0.25rem 0 0.75rem; font-size: var(--step-0); }
.sp-parts ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; list-style: none; margin: 0; padding: 0; }
.sp-parts a { color: var(--accent-text); font-weight: 600; }
.sp-section { padding: 1rem var(--gutter) 1.5rem; max-width: 80rem; }
.sp-section h3 { margin: 1rem 0 0.5rem; font-size: var(--step-0); }
.sp-note { max-width: 70ch; color: var(--text-muted); font-size: var(--step--1); }
/* Room for the visitor's own zone, which the script names once it runs (CLS 0). */
.sp-zone { min-height: calc(2 * 1.5em); line-height: 1.5; margin-top: 0; }
.sp-steps { max-width: 70ch; padding-left: 1.4rem; line-height: 1.6; }
.sp-steps li { margin: 0.25rem 0; }
.sp-level { max-width: 75ch; border: 1px solid var(--hairline); border-radius: var(--radius); padding: 0.4rem 0.9rem; margin: 0 0 0.75rem; background: var(--bg-raised); }
.sp-level > summary { cursor: pointer; font-weight: 700; padding: 0.35rem 0; min-height: 2.75rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.sp-level > summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-level-time { font-weight: 400; color: var(--text-dim); font-size: var(--step--1); }
.sp-guide h3 { margin-top: 0.75rem; }
.sp-claims { margin: 0 0 0.5rem; padding-left: 1.2rem; line-height: 1.55; }
.sp-claims li { margin: 0.3rem 0; }
.sp-cites { white-space: nowrap; }
.sp-cite { display: inline-block; min-width: 1.5rem; margin-left: 0.2rem; padding: 0 0.25rem; border-radius: 0.3rem; background: var(--tint); color: var(--accent-text); font-size: var(--step--2); font-weight: 600; text-align: center; text-decoration: none; vertical-align: 0.15em; line-height: 1.5; }
.sp-cite:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.sp-terms { max-width: 75ch; display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: 0.35rem 1rem; margin: 0.5rem 0; }
.sp-terms dt { font-weight: 600; }
.sp-terms dd { margin: 0; color: var(--text); }
@media (max-width: 30rem) { .sp-terms { grid-template-columns: 1fr; } .sp-terms dd { margin-bottom: 0.4rem; } }
.sp-sources h3 { font-size: var(--step--1); }
.sp-source-list { max-width: 75ch; font-size: var(--step--1); color: var(--text-muted); padding-left: 1.6rem; overflow-wrap: anywhere; }
.sp-pending { max-width: 70ch; padding: 0.6rem 0.9rem 0.6rem 1.8rem; border-radius: var(--radius); background: var(--tint-strong); border: 1px solid var(--hairline); }
.sp-live h3 { margin-top: 0.5rem; }
.sp-games, .sp-events { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; gap: 0.6rem; max-width: 70ch; }
.sp-game, .sp-event { display: grid; gap: 0.1rem; padding: 0.6rem 0.8rem; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--bg-raised); }
.sp-game-title, .sp-event-name { font-weight: 600; }
.sp-game-meta, .sp-event-where, .sp-event-when { color: var(--text-muted); font-size: var(--step--1); }
.sp-game-source, .sp-event-links { font-size: var(--step--1); }
.sp-index { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
.sp-index-card { display: grid; gap: 0.35rem; padding: 1rem; border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid var(--hairline); color: var(--text); text-decoration: none; min-height: 100%; }
.sp-index-card:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.sp-index-name { font-weight: 800; font-size: var(--step-1); }
.sp-index-lead { color: var(--text-muted); }
.sp-index-parts { color: var(--text-dim); font-size: var(--step--1); }

/* The body game. The stage keeps its box from the first paint (CLS 0):
   the face's picture, then the canvas in the same place. */
.bg { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 60rem) { .bg { grid-template-columns: minmax(0, 36rem) minmax(16rem, 1fr); } .bg-setup { grid-column: 1 / -1; } }
.bg-setup { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin: 0; }
.bg-setup fieldset { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 0.4rem 0.8rem 0.6rem; margin: 0; display: grid; gap: 0.2rem; }
.bg-setup legend { font-weight: 600; padding: 0 0.3rem; }
.bg-setup label { display: flex; align-items: center; gap: 0.45rem; min-height: 2.25rem; }
.bg-stage { position: relative; width: min(100%, 36rem); aspect-ratio: 1 / 1; border-radius: var(--radius-lg); overflow: hidden; background: oklch(0.42 0.06 145); contain: layout paint; }
.bg-face { position: absolute; inset: 9%; width: 82%; height: 82%; }
.bg-ring { stroke: var(--face-line); stroke-width: 0.4; }
.bg-white { fill: var(--face-white); } .bg-black { fill: var(--face-black); stroke: var(--face-white); }
.bg-blue { fill: var(--face-blue); } .bg-red { fill: var(--face-red); } .bg-gold { fill: var(--face-gold); }
.bg-x { fill: none; }
.bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.bg-canvas[hidden] { display: none; }
.bg-canvas:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; }
.bg-panel { display: grid; gap: 0.6rem; align-content: start; }
.bg-status { margin: 0; font-weight: 600; min-height: 3em; }
.bg-readout { margin: 0; font-variant-numeric: tabular-nums; color: var(--text-muted); min-height: 3em; }
.bg-readout[hidden] { display: block; visibility: hidden; }
.bg-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bg-actions [hidden] { display: none; }
.bg-how summary { cursor: pointer; font-weight: 600; min-height: 2.5rem; display: flex; align-items: center; }
.bg-how ul { padding-left: 1.2rem; margin: 0.3rem 0; line-height: 1.5; }
.bg-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html[data-tv] .bg-stage { width: min(100%, 44rem); }

/* A question about the sport (templates/sports/sport.html's Get it, and
   templates/sports/ask.html): a text field and a button; the answer is the
   page's own claims, word for word, with their numbered sources. */
.sp-ask-form { max-width: 48rem; margin: 0 0 1rem; display: grid; gap: 0.35rem; }
.sp-ask-label { font-weight: 700; }
.sp-ask-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sp-ask-input { flex: 1 1 14rem; min-width: 0; min-height: 48px; padding: 0.6rem 1rem; font: inherit; color: var(--text); background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--field-radius); }
.sp-ask-input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.sp-ask-input::placeholder { color: var(--text-dim); }
.sp-ask-row .btn { min-height: 48px; }
.sp-ask-form .sp-note { margin: 0; }
.sp-why { max-width: 70ch; font-weight: 600; }
.sp-answer-claims { max-width: 75ch; }
.sp-claim-where { display: block; color: var(--text-dim); font-size: var(--step--1); }
.sp-badge { display: inline-block; margin-left: 0.4rem; padding: 0 0.4rem; border-radius: 0.3rem; background: var(--tint-strong); color: var(--text); font-size: var(--step--1); font-weight: 700; }
.sp-event--cancelled .sp-event-name { text-decoration: line-through; text-decoration-thickness: 1px; }
.sp-casts { margin: 0.25rem 0; padding-left: 1.2rem; font-size: var(--step--1); color: var(--text-muted); line-height: 1.5; }
.sp-cast-at { font-variant-numeric: tabular-nums; color: var(--text); }

/* The model's arrangement of an answer: a room of fixed size kept from the
   first paint, labelled before it fills; its parts are added inside and it
   scrolls in itself, so nothing on the page moves as they arrive (CLS 0). */
.sp-composed { margin: 0.5rem var(--gutter) 1rem; padding: 1rem; max-width: 78rem; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--bg-raised); }
.sp-composed > .section-title { margin-top: 0; }
.sp-composed[hidden] { display: none; }
.sp-composed-label { margin: 0 0 0.6rem; max-width: 70ch; font-size: var(--step--1); line-height: 1.45; color: var(--text-muted); }
.sp-composed-label a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 0.15em; }
.sp-composed-body { height: 22rem; overflow-y: auto; contain: layout paint; display: flex; flex-direction: column; gap: 0.5rem; }
.sp-composed-body:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-composed-body > * { flex: 0 0 auto; margin: 0; }
.sp-composed-note { max-width: 70ch; line-height: 1.5; font-style: italic; }
.sp-composed-body .ask-composed-wait, .sp-composed-body .ask-composed-none { color: var(--text-muted); line-height: 1.5rem; }
@media (max-width: 40rem) { .sp-composed-body { height: 30rem; } }
html[data-tv] .sp-composed-body { height: 26rem; }
html[data-tv] .sp-ask-input, html[data-tv] .sp-ask-row .btn { min-height: 64px; font-size: 1.3rem; }
