/* The game and team kernels (docs/REDESIGN.md, "Game and team kernels (Dec 1)"): why a game went the way it did,
   the schedule effect game by game, down and distance in a sentence, offense against defense on National, the pass map.
   One slice of the page's stylesheet; loads after 15-model.css. */

/* ---------- the game page: why it went this way ---------- */
.gm-why { padding: 14px 0 4px; border-bottom: 1px solid var(--line); }
.gm-why h2 { margin: 0 0 6px; font-family: var(--f-display); font-size: 0.96rem; text-transform: uppercase; letter-spacing: 0.03em; text-align: center; }
.wy-p { margin: 0 auto 10px; font-size: 0.95rem; line-height: 1.45; max-width: 68ch; }
.wy-ax { position: relative; display: grid; grid-template-columns: 1fr 1fr; font-size: 0.75rem; color: var(--muted); margin: 0 74px 0 var(--wy-l, 0); }
.wy-ax-r { text-align: right; }
.wy-ax-t { grid-column: 1 / -1; position: relative; height: 14px; font-variant-numeric: tabular-nums; }
.wy-ax-t span { position: absolute; transform: translateX(-50%); }
.wy-ax-t span:first-child { transform: none; } .wy-ax-t span:last-child { transform: translateX(-100%); }
.wy-rs { list-style: none; margin: 0; padding: 0; }
.wy-r { display: grid; grid-template-columns: minmax(0, 1fr) 64px; grid-template-areas: "l v" "t v" "w w"; gap: 2px 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.wy-v { grid-area: v; align-self: center; text-align: right; font-variant-numeric: tabular-nums; line-height: 1.1; }
.wy-v b { display: block; font-size: 1.05rem; } .wy-v small { color: var(--muted); font-size: 0.72rem; }
.wy-r.minor .wy-v b { font-weight: 400; color: var(--muted); }
.wy-l { grid-area: l; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.wy-l b { font-weight: 600; }
.wy-l small { color: var(--muted); font-size: 0.78rem; }
.wy-t { grid-area: t; position: relative; height: 18px; }
.wy-t i { position: absolute; }
.wy-t i.g { top: 0; bottom: 0; width: 1px; background: var(--line); }
.wy-t i.z { top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.wy-t i.wy-b { top: 4px; height: 10px; border-radius: 2px; background: var(--ink); opacity: 0.72; }
.wy-r.minor .wy-t i.wy-b { opacity: 0.35; }
.wy-w { grid-area: w; font-size: 0.82rem; color: var(--muted); line-height: 1.35; }
.wy-r.minor .wy-l b { font-weight: 400; color: var(--muted); }
.tm-key i.wy-sw { width: 14px; height: 8px; border-radius: 2px; background: var(--ink); opacity: 0.72; }
.wy-ck { margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); }
@media (min-width: 720px) {
  .wy-r { grid-template-columns: 34% minmax(0, 1fr) 64px; grid-template-areas: "l t v" ". w w"; column-gap: 14px; align-items: center; }
  .gm-why { --wy-l: calc(34% + 14px); }
  .wy-l { display: block; } .wy-l small { display: block; }
}

/* ---------- the team page: down and distance in a sentence a side (Offense and defense) ---------- */
.tm-grp.dd { margin-top: 16px; }
.dd .tm-top-p { margin-top: 2px; }
.dd .dd-s { margin-top: 12px; }
@media (max-width: 639px) { .dd .tm-top-p + .tm-top-p { margin-top: 8px; } }

/* ---------- National, Rankings: offense against defense ---------- */
.qd-pk { margin: 4px 0 6px; }
.qd-w { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: start; margin-top: 8px; }
.qd-svg { width: 100%; max-width: 560px; height: auto; display: block; touch-action: manipulation; }
.qd-svg:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.qd-svg .gr { stroke: var(--line); stroke-width: 1; }
.qd-svg .z { stroke: var(--line-strong); stroke-width: 1.2; }
.qd-svg .ax { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.qd-svg .axl { fill: var(--muted); font-size: 10px; font-weight: 600; }
.qd-svg .qn { fill: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; opacity: 0.85; }
/* Coin flip (Dec 2): the diamond of teams within one score of an average team, almost white, under the grid and the dots */
.qd-svg .qd-even { fill: color-mix(in srgb, var(--ink) 6%, transparent); stroke: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .qd-svg .qd-even { fill: color-mix(in srgb, var(--ink) 8%, transparent); } }
:root[data-theme="dark"] .qd-svg .qd-even { fill: color-mix(in srgb, var(--ink) 8%, transparent); }
.qd-svg .qd-en { opacity: 1; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.qd-svg .qd-d { fill: var(--line-strong); fill-opacity: 0.55; stroke: var(--surface); stroke-width: 0.6; }
.qd-svg .qd-d.cf { fill: var(--ink); fill-opacity: 0.85; }
.qd-svg .qd-d.me { fill: var(--ink); fill-opacity: 1; stroke: var(--bg); stroke-width: 2; }
.qd-svg .qd-d.act { stroke: var(--ink); stroke-width: 2; fill-opacity: 1; }
.qd-svg .qd-l { fill: var(--ink); font-size: 12px; font-weight: 700; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.qd-card { min-height: 64px; font-size: 0.9rem; }
.qd-hint { color: var(--muted); font-size: 0.85rem; margin: 0; }
.qd-c-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.qd-c-h a { font-weight: 700; color: var(--ink); }
.qd-c-h small { color: var(--muted); }
.qd-q { flex-basis: 100%; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.qd-c-v { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.qd-c-v small { color: var(--muted); }
.tm-key i.qd-sw { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); opacity: 0.7; }
.tm-key i.qd-sw.cf { background: var(--ink); opacity: 0.85; } .tm-key i.qd-sw.me { width: 11px; height: 11px; background: var(--ink); opacity: 1; }
@media (min-width: 860px) { .qd-w { grid-template-columns: minmax(0, 560px) minmax(200px, 1fr); } .qd-card { padding-top: 12px; } .qd-c-v { flex-direction: column; } }

/* ---------- the team page: the pass map (a field grid of depth by direction, team_pass.js) ---------- */
.pm-side .tm-top-p { margin: 2px 0 8px; }
/* the two maps side by side on a wide screen, their headings, sentences, fields and notes on shared rows so the
   fields' rows and columns line up */
@media (min-width: 640px) {
  .pm-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: repeat(4, auto); grid-auto-flow: column; gap: 0 28px; }
  .pm-two > .pm-side { display: contents; }
}
@media (max-width: 639px) { .pm-side + .pm-side { margin-top: 18px; } }
.pm-field { display: grid; gap: 2px; max-width: 440px; padding: 2px; border-radius: 6px; background: var(--line); align-self: start; }
.pm-row { display: grid; grid-template-columns: 46px repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(62px, auto); gap: 2px; }
.pm-rl { display: flex; align-items: center; padding: 0 5px; font-size: 0.75rem; font-weight: 600; line-height: 1.15; color: var(--muted); background: var(--bg); font-variant-numeric: tabular-nums; }
.pm-c { --pm-p: 0%; display: flex; flex-direction: column; justify-content: center; padding: 5px 3px 4px; text-align: center;
  background: var(--surface); font-variant-numeric: tabular-nums; line-height: 1.2; }
.pm-c b { font-size: 1.02rem; }
.pm-c span, .pm-c small { font-size: 0.72rem; color: var(--ink); white-space: nowrap; }
.pm-c small { color: var(--muted); }
.pm-c.up { background: color-mix(in srgb, var(--score) var(--pm-p), var(--surface)); }
.pm-c.dn { background: color-mix(in srgb, var(--turn) var(--pm-p), var(--surface)); }
.pm-c.up small, .pm-c.dn small { color: var(--ink); }
.pm-c.few { background: var(--bg); color: var(--muted); outline: 1px dashed var(--line-strong); outline-offset: -4px; }
.pm-c.few b { font-weight: 400; } .pm-c.few span { color: var(--muted); }
.pm-los { grid-auto-rows: auto; border-top: 3px solid var(--ink); }
.pm-los > span { padding: 4px 0 3px; font-size: 0.72rem; text-align: center; color: var(--muted); background: var(--bg); }
.pm-tot { margin-top: 3px; }
.pm-tot .pm-rl { color: var(--ink); }
.pm-note { margin: 6px 0 0; font-size: 0.78rem; color: var(--muted); max-width: 62ch; }
.tm-key i.pm-sw { width: 14px; height: 10px; border-radius: 2px; }
.tm-key i.pm-sw.up { background: color-mix(in srgb, var(--score) 40%, var(--surface)); }
.tm-key i.pm-sw.dn { background: color-mix(in srgb, var(--turn) 40%, var(--surface)); }
.tm-key i.pm-sw.few { background: var(--bg); outline: 1px dashed var(--line-strong); outline-offset: -1px; }
