/* Cricket scoring modules — the shared NON-SHEET styles (Explore stage, umpire panel and figure, Learn scenarios
   and signal exercises, quiz umpire visual, corrections). The sheet itself is sheet.css (loaded after this file);
   the page layout is ../_module-template/template.css. A module's own module.css holds only its overrides. */
.mt-boot { max-width: 40rem; margin: 3rem auto; padding: 0 16px; display: grid; gap: 0.8rem; font-family: system-ui, sans-serif; color: var(--text, #222); }
.mt-explore { background: var(--bg); }
:root { --cs-hand: 'Patrick Hand', 'Bradley Hand', 'Segoe Print', 'Comic Sans MS', cursive; --cs-ink: #1b2a6b; --cs-paper: #fdfcf7; --cs-line: #8d8f99; --cs-head: #5d5f69; --cs-headtxt: #fff; --cs-cell: 22px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cs-paper: #f3f1ea; } }
:root[data-theme="dark"] { --cs-paper: #f3f1ea; }

/* highlights (sheet cells, any host) */
.cs-region.is-focus { z-index: 2; }   /* yellow wash only (below) — no coloured outline */
.cs-cell.is-lit { background: #fff4bf; z-index: 2; }
.cs-cell.is-said { background: #ffe066; }
.cs-cell[data-check="right"] { background: #d7f5dd; box-shadow: inset 0 0 0 2px #3b9555; }
.cs-cell[data-check="wrong"] { background: #ffd9d6; box-shadow: inset 0 0 0 2px #da534f; }
.cs-cell[data-check="missing"] { background: #fff3c4; box-shadow: inset 0 0 0 2px #e2a000; }
.cs-cell[data-check="stray"] { background: #ffe3f2; box-shadow: inset 0 0 0 2px #c53a9a; }
.cs-cell[data-check="shown"] { background: #dce9ff; box-shadow: inset 0 0 0 2px #3a6fd8; }

/* palette */
.cs-pal { position: absolute; z-index: 20; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-menu); padding: 10px; font: 14px var(--font-ui); user-select: text; }
.cs-pal-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.cs-pal-l { font-weight: 600; font-size: 13px; }
.cs-pal-v { font: 600 22px/1 var(--cs-hand); color: var(--cs-ink); background: var(--cs-paper); border: 1px solid var(--cs-line); border-radius: 6px; min-width: 40px; text-align: center; padding: 2px 8px; }
.cs-pal-marks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cs-pal-m { min-width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); color: var(--ink); font: 600 18px/1 var(--cs-hand); cursor: pointer; }
.cs-pal-m:hover { background: var(--accent-soft); border-color: var(--accent); }
.cs-pal-row { display: flex; gap: 6px; align-items: center; }
.cs-pal-in { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; font: 500 16px var(--font-ui); background: var(--surface); color: var(--ink); }
.cs-pal .mt-btn { padding: 8px 12px; }
.cs-hint { margin: 4px 0 0; font-size: 12px; color: var(--ink-dim); }

/* ---------------------------------------------------------------- Explore stage */
.cs-stage { position: absolute; inset: 0; overflow: hidden; }
/* the sheet's viewport (adapter.mjs apply(): the room left by the controls, dock, card and umpire panel) and the
   zoomed wrapper inside it — the WRAPPER is transformed (translate + scale), never the cells, so rings stay crisp */
.cs-viewport { position: absolute; overflow: hidden; border-radius: 10px; }
.cs-stagewrap { position: absolute; left: 0; top: 0; transform-origin: top left; }
.cs-stagewrap.is-ready { transition: transform .4s cubic-bezier(.22, .61, .36, 1); }
@media (prefers-reduced-motion: reduce) { .cs-stagewrap, .cs-stagewrap.is-ready { transition: none; } }
.cs-controls { display: inline-flex; align-items: center; gap: 8px; }
/* "Download blank sheet" beside Example / Blank (adapter.mjs dlLink → the A3 PDF, or blank-sheet.html); icon-only on phones */
.cs-dlchip { text-decoration: none; margin-left: 4px; }
.cs-dlchip .cs-dl-ico { font-size: 19px; line-height: 1; }
.cs-dlchip:hover, .cs-dlchip:focus-visible { background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 699.98px) {
  .cs-dlchip { padding: 0 13px; }
  .cs-dlchip .cs-dl-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* umpire panel: a column left of the sheet (wide) or a strip above it (narrow); the figure is scenario-viewer.mjs umpireFigure */
.cs-umpire-panel { position: absolute; z-index: 5; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 12px 10px; background: var(--glass); backdrop-filter: blur(12px); border-radius: 16px; box-shadow: var(--shadow); color: var(--ink); overflow: hidden; }
.cs-ump-fig { flex: 1 1 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.cs-ump-fig svg, .mt-stage .cs-ump-fig svg { position: static; inset: auto; display: block; width: 100%; height: 100%; }   /* not the template's .mt-stage svg (absolute, inset 0): the figure stays in its own box, beside the text on phones */
.cs-ump-text { flex: none; display: grid; gap: 2px; text-align: center; }
.cs-ump-l { font: 400 11px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.cs-ump-sig { font: 700 15px/1.2 var(--font-ui); color: var(--accent-ink); }
.cs-ump-say { font-size: 12px; line-height: 1.3; color: var(--ink-dim); }
.cs-umpire-panel[data-layout="row"] { flex-direction: row; align-items: center; gap: 12px; padding: 6px 14px 6px 8px; }
.cs-umpire-panel[data-layout="row"] .cs-ump-fig { flex: none; height: 100%; aspect-ratio: 240 / 270; }
.cs-umpire-panel[data-layout="column"] .cs-ump-text { padding-top: 2px; }
.cs-stage[data-labels="off"] .cs-ump-l { visibility: hidden; }
.cs-umpire-panel[data-layout="row"] .cs-ump-text { text-align: left; flex: 1 1 auto; min-width: 0; }
.cs-umpire-panel[data-layout="row"] .cs-ump-l { display: none; }
.cs-umpire-panel[data-layout="row"] .cs-ump-sig { font-size: 14px; }
.cs-umpire-panel[data-layout="row"] .cs-ump-say { font-size: 11px; }
.cs-umpire-panel.is-change .cs-ump-fig { animation: cs-ump-pop .45s ease-out; }
@keyframes cs-ump-pop { 0% { transform: scale(.94); opacity: .5; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cs-umpire-panel.is-change .cs-ump-fig { animation: none; } }
/* the figure (everywhere it appears): hat, skin, shirt and sleeves in the module's accent, dark trousers */
.cs-uf-shadow { fill: var(--ink); opacity: .12; }
.cs-uf-leg { fill: none; stroke: light-dark(#3a3b43, #d8d6cf); stroke-width: 17; stroke-linecap: round; stroke-linejoin: round; }
.cs-uf-shoe { fill: light-dark(#23242a, #f1efe8); }
.cs-uf-shirt { fill: var(--accent-fill); }
.cs-uf-collar { fill: none; stroke: light-dark(#fff, #1d1a15); stroke-width: 3; stroke-linejoin: round; opacity: .9; }
.cs-uf-arm { fill: none; stroke: var(--accent-fill); stroke-width: 15; stroke-linecap: round; stroke-linejoin: round; }
.cs-uf-hand, .cs-uf-head { fill: #d9a47f; }
.cs-uf-neck, .cs-uf-finger { fill: none; stroke: #d9a47f; stroke-linecap: round; }
.cs-uf-neck { stroke-width: 10; }
.cs-uf-finger { stroke-width: 5; }
.cs-uf-hat { fill: light-dark(#fbfaf6, #f4f1ea); stroke: light-dark(#b9b6ad, #8a867e); stroke-width: 1.5; }
.cs-uf-wave { fill: none; stroke: var(--accent-ink); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 5 4; opacity: .9; }
.cs-uf-wave2 { opacity: .5; }
.cs-cb-l { font: 600 14px var(--font-ui); color: var(--ink); background: var(--glass); backdrop-filter: blur(12px); border-radius: 999px; padding: 14px 16px; box-shadow: var(--shadow); }
.cs-exbtn[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); }
.cs-stage[data-labels="off"] .cs-rh, .cs-stage[data-labels="off"] .cs-fl, .cs-stage[data-labels="off"] .cs-table th { visibility: hidden; }
.mt-card { max-height: calc(100% - 108px - 140px); }
@media (max-width: 1099.98px) { .cs-stage { position: absolute; } }

/* ---------------------------------------------------------------- Learn */
.mt-diagram.is-cs { background: transparent; display: block; overflow: visible; min-height: 0; flex: none; height: auto; }
.cs-learn { display: grid; gap: 14px; }
.cs-learn-top { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 16px; align-items: start; }
.cs-learn-text { display: grid; gap: 6px; }
.cs-focus { margin: 0; color: var(--ink-body); }
.cs-status { margin: 0; font-weight: 600; color: var(--accent-ink); min-height: 1.2em; }
.cs-learn-sheet { overflow: auto; border-radius: 10px; padding: 6px; background: var(--surface-2); max-width: 100%; position: relative; }
.cs-learn-scale { transform-origin: top left; }
.cs-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-feedback .mt-fb { margin-top: 0; }
.cs-fb-list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.cs-fb-cell { border: 0; background: var(--accent-soft); color: var(--accent-ink); font: 600 13px var(--font-ui); padding: 2px 8px; border-radius: 999px; cursor: pointer; }
.cs-fb-list li.wrong .cs-fb-cell { background: var(--wrong-soft); color: var(--wrong-ink); }
.cs-fb-list li.missing .cs-fb-cell { background: #fff3c4; color: #7a5200; }
@media (max-width: 760px) { .cs-learn-top { grid-template-columns: 1fr; } }

/* ScenarioViewer: the same umpire figure as Explore, on a neutral card */
.cs-viewer { margin: 0; aspect-ratio: 16 / 9; width: 100%; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); position: relative; }
.cs-frame { width: 100%; height: 100%; border: 0; display: block; }
.cs-viewer-fallback { position: absolute; bottom: 6px; right: 10px; margin: 0; font-size: 12px; }
.cs-viewer-fallback a { color: var(--accent-ink); }
.cs-ph { display: grid; grid-template-columns: 40% 1fr; height: 100%; align-items: center; padding: 8px 14px; gap: 10px; }
.cs-ph-umpire { height: 100%; display: grid; place-items: center; }
.cs-ph-umpire svg { height: 100%; max-height: 220px; width: auto; display: block; }
.cs-ph-text { display: grid; gap: 4px; font-size: 13px; }
.cs-ph-label { font: 600 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }
.cs-ph-signal { font-size: 17px; color: var(--accent-ink); }
.cs-ph-say { color: var(--ink-body); }
.cs-ph-cam { font-size: 11px; color: var(--ink-dim); }

/* umpire-signal exercise (adapter.mjs renderSignalExercise) */
.cs-sig-top { grid-template-columns: minmax(220px, 300px) 1fr; }
.cs-sig-fig { aspect-ratio: 240 / 270; max-width: 300px; width: 100%; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; padding: 8px; }
.cs-sig-fig svg { width: 100%; height: 100%; display: block; }
.cs-sig-step { display: grid; gap: 8px; }
.cs-sig-q { margin: 0; font: 600 17px/1.3 var(--font-ui); color: var(--ink); display: flex; align-items: center; gap: 10px; }
.cs-sig-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-fill); color: var(--on-accent); font: 700 14px/26px var(--font-ui); text-align: center; }
.cs-sig-opts { display: grid; gap: 6px; }
.cs-sig-opt { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: 500 15px/1.3 var(--font-ui); cursor: pointer; }
.cs-sig-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.cs-sig-opt[aria-pressed="true"] { border-color: var(--accent-fill); box-shadow: inset 0 0 0 1px var(--accent-fill); background: var(--accent-soft); }
.cs-sig-opt[data-check="right"] { background: #d7f5dd; border-color: #3b9555; }
.cs-sig-opt[data-check="wrong"] { background: #ffd9d6; border-color: #da534f; }
.cs-sig-letter { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font: 700 12px/24px var(--font-ui); text-align: center; color: var(--ink-dim); }
.cs-sig-placerow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.cs-sig-place { margin: 0; color: var(--ink-body); }
.cs-sig-none[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); }
.cs-signal .cs-sheet .cs-cell { cursor: pointer; }
@media (max-width: 760px) { .cs-sig-top { grid-template-columns: 1fr; } .cs-sig-fig { max-width: 200px; } }

/* quiz: the umpire above a question (adapter.mjs renderVisual) */
.cs-qump { display: grid; justify-items: center; gap: 4px; }
.cs-qump-fig { width: min(220px, 60vw); aspect-ratio: 240 / 270; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 6px; }
.cs-qump-fig svg { width: 100%; height: 100%; display: block; }
.cs-qump-l { font: 600 12px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }

/* quiz corrections (template summary with know.showScore) */
.mt-corrections { margin-top: 10px; }
.mt-corr-list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.mt-corr-q { margin: 0; font-weight: 600; color: var(--ink); }
.mt-corr-a { margin: 2px 0; display: grid; gap: 2px; font-size: 14px; }
.mt-corr-you { color: var(--wrong-ink); } .mt-corr-right { color: var(--right-ink); }
.mt-corr-why { margin: 0; color: var(--ink-body); font-size: 14px; }

/* Corner umpire (Cricket Caddy player): shown only while the umpire is signalling. */
.cs-stage[data-corner="on"] .cs-umpire-panel { transition: opacity .3s, transform .3s; padding: 8px 8px 6px; gap: 4px; }
.cs-stage[data-corner="on"] .cs-umpire-panel[data-signal="none"] { opacity: 0; transform: scale(.9); pointer-events: none; }
.cs-stage[data-corner="on"] .cs-ump-say, .cs-stage[data-corner="on"] .cs-ump-l { display: none; }
.cs-stage[data-corner="on"] .cs-ump-sig { font-size: 13px; }

/* The section being talked about: a soft 10% pink wash and outline, so the eye goes straight to it. */
.cs-sheet [data-region].is-focus { position: relative; }
.cs-sheet [data-region].is-focus::after { content: ""; position: absolute; inset: -3px; border-radius: 6px; background: rgba(255, 214, 0, .18); pointer-events: none; z-index: 3; animation: cs-focus-in .35s ease-out; }
@keyframes cs-focus-in { from { opacity: 0; } to { opacity: 1; } }

/* The pink pointer: an animated arrow at whatever the narrator is talking about right now. */
.cs-pointer { position: absolute; z-index: 20; width: 54px; height: 54px; pointer-events: none; transition: left .45s cubic-bezier(.22,.61,.36,1), top .45s cubic-bezier(.22,.61,.36,1); filter: drop-shadow(0 3px 6px rgba(42,10,28,.35)); }
.cs-pointer[hidden] { display: none; }
.cs-pointer svg { width: 100%; height: 100%; animation: cs-poke 1s ease-in-out infinite; }
.cs-pointer[data-dir="left"] svg { transform: scaleX(-1); animation-name: cs-poke-l; }
@keyframes cs-poke { 0%, 100% { translate: 0 0; } 50% { translate: 7px 7px; } }
@keyframes cs-poke-l { 0%, 100% { translate: 0 0; } 50% { translate: -7px 7px; } }
@media (prefers-reduced-motion: reduce) { .cs-pointer svg { animation: none; } }
