/* Section-specific pieces: signals, arrow, foul tracker, divisions, quiz, sources. */
.sig-group { margin-bottom: 22px; }
.sig-group h3 { font-size: 1rem; color: var(--ink-2); margin-bottom: 10px; }
.sig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.sig-card { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-rows: auto 1fr; overflow: hidden; box-shadow: var(--shadow); }
.sig-card figcaption { display: grid; gap: 4px; align-content: start; font-size: .9rem; line-height: 1.45; padding: 12px 14px 14px; }
.sig-card strong { font-size: 1.02rem; }
.sig-act { color: var(--ink-2); font-size: .86rem; border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 2px; }
@media (max-width: 640px) {
  .sig-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sig-card figcaption { padding: 8px 10px 10px; font-size: .82rem; }
  .sig-card strong { font-size: .92rem; }
}
.sig-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; }
.sig-pic { position: relative; }
.sig-badge { position: absolute; top: 8px; left: 8px; font-size: .72rem; font-weight: 600; line-height: 1; padding: 4px 7px; border-radius: 999px; background: var(--accent); color: #fff; pointer-events: none; }
.sig-img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-bottom: 1px solid var(--line); }
.sig-fig { width: 100%; height: 138px; padding: 10px 0 4px; background: radial-gradient(120px 90px at 50% 60%, var(--accent-soft), transparent 70%), var(--surface-2); }
.sig-head { fill: var(--surface-2); stroke: var(--ink); stroke-width: 2.5; }
.sig-body { fill: #8f99a8; stroke: var(--ink); stroke-width: 2.5; }
.sig-limb { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.sig-limb.dim { stroke: color-mix(in srgb, var(--ink) 35%, transparent); }
.sig-limb.on { stroke: var(--ink); }
.sig-hand { fill: var(--accent); stroke: var(--accent); }
.sig-finger { stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }
.sig-grab { fill: none; stroke: var(--accent); stroke-width: 3.5; }
.sig-motion { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 3; }
.sig-arrowhead { fill: var(--accent); }

.num-out { display: grid; gap: 12px; }
.num-step { padding: 12px; border-radius: var(--radius-s); background: var(--surface-2); border: 1px solid var(--line); }
.num-hands { display: flex; gap: 18px; flex-wrap: wrap; }
.num-hand-wrap { display: grid; justify-items: center; gap: 4px; }
.num-hand { width: 70px; height: 88px; }
.num-img { width: 112px; height: 112px; border-radius: 14px; background: #fff; object-fit: contain; border: 1px solid var(--line); }
.num-img.left { transform: scaleX(-1); }
.num-hand .palm, .num-hand .finger { fill: #f3c7a5; stroke: #8a5a3c; stroke-width: 2; }
.num-hand.back .palm, .num-hand.back .finger { fill: #d9a07a; }
.num-hand .finger.up { fill: #f7d5b9; }
.num-hand.back .finger.up { fill: #e2ad87; }
.num-hand .zero { fill: none; stroke: #8a5a3c; stroke-width: 9; }
.num-hand .knuckle { stroke: #8a5a3c; stroke-width: 1.5; fill: none; opacity: .6; }
#num-input { max-width: 140px; font: 800 1.4rem var(--mono); }

ol.steps { padding-left: 1.3em; margin: 0 0 14px; display: grid; gap: 8px; }
.ap-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ap-court { width: 100%; height: auto; display: block; margin: 6px 0 12px; }
.ap-floor { fill: #e8c48e; stroke: #b7894a; stroke-width: 2; }
[data-theme="dark"] .ap-floor { fill: #7a6141; }
.ap-line { stroke: #fff; stroke-width: 2; }
.ap-ring { fill: none; stroke: #e8590c; stroke-width: 3; }
.ap-label { font: 700 12px var(--font); }
.ap-label.blue { fill: var(--team-a); }
.ap-label.gold { fill: #b88400; }
.ap-box { fill: #1b1f27; }
.ap-arrow { transition: fill .2s; }
.ap-ball { fill: #e8590c; stroke: #7a2e05; stroke-width: 1.5; }
ol.ap-log { padding-left: 1.2em; margin: 0; display: grid; gap: 4px; font-size: .92rem; color: var(--ink-2); }
ol.ap-log li:first-child { color: var(--ink); font-weight: 650; }

.pips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; min-height: 34px; }
.pip { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font: 800 .9rem var(--mono); color: #fff; }
.pip.p { background: #495057; } .pip.t { background: #1c7ed6; } .pip.u { background: #e8590c; } .pip.d { background: #c92a2a; }

dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 16px 0 0; }
dl.facts dt { font-weight: 700; color: var(--muted); }
dl.facts dd { margin: 0; }

.quiz-card { max-width: 820px; }
.quiz-opts { display: grid; gap: 8px; margin: 14px 0; }
.quiz-opts .btn { justify-content: flex-start; text-align: left; }
.quiz-progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 10px 0 16px; }
.quiz-progress span { display: block; height: 100%; background: var(--accent); transition: width .3s; }

ol.sources { padding-left: 1.2em; margin: 0; display: grid; gap: 10px; }
.glossary td { font-size: .92rem; padding: 7px 10px; }
.big-list li { margin: .45em 0; }
.video-row { align-items: stretch; }
.video-card.placeholder { display: grid; place-items: center; min-height: 220px; color: #c3cad8; padding: 20px; text-align: center; }

/* Animated demos under the practice tools, and the "how to try" list in the hero. */
.demo { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.demo > summary { cursor: pointer; padding: 12px 16px; font-weight: 650; color: var(--accent); }
.demo[open] > summary { border-bottom: 1px solid var(--line); }
.demo img { display: block; max-width: calc(100% - 24px); height: auto; margin: 12px auto 6px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.demo p { padding: 0 16px 14px; margin: 0; }
.tryit { margin-top: 22px; padding: 16px 18px; border-radius: var(--radius); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .88); max-width: 780px; }
.tryit-title { font-size: 1.05rem; margin: 0 0 8px; color: #fff; }
.tryit ol { margin: 0 0 8px; padding-left: 1.3em; display: grid; gap: 4px; }
.tryit p { margin: 0; font-size: .9rem; color: rgba(255, 255, 255, .72); }
.tryit a { color: #ffb185; font-weight: 650; }

/* "Which number is this?" practice next to the number trainer. */
.stack { display: grid; gap: 16px; align-content: start; }
.nq-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0 8px; }
.nq-opt { font: 750 1.3rem/1 var(--mono); min-height: 52px; }
.btn.nq-opt[disabled] { opacity: 1; cursor: default; }
.btn.nq-opt[disabled]:not(.right):not(.wrong) { opacity: .5; }
.nq-opt.right { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.nq-opt.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.nq-status p { margin: 0 0 8px; }
.nq-feedback { font-weight: 650; }
.nq-feedback.ok { color: var(--good); }
.nq-feedback.bad { color: var(--bad); }

/* The foul report formula in section 01: team colour + number + foul type = what you tap. */
.formula { margin-top: 16px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow); }
.formula-head { display: flex; gap: 12px; margin-bottom: 16px; }
.formula-head .ci { flex: none; color: var(--accent); font-size: 1.4rem; line-height: 1.2; }
.formula-head h3 { margin-bottom: 4px; }
.formula-head p { margin: 0; color: var(--ink-2); }
.fm-eq { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1.15fr; gap: 8px; }
.fm-term { display: grid; justify-items: center; align-content: start; gap: 10px; min-width: 0; padding: 14px 12px; text-align: center; border-radius: var(--radius-s); background: var(--surface-2); border: 1px solid var(--line); }
.fm-result { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.fm-pic { width: 84px; height: 84px; display: grid; place-items: center; flex: none; overflow: hidden; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.fm-pic img { width: 100%; height: 100%; object-fit: contain; }
.fm-pic svg { width: 46px; height: 56px; }
.fm-shirt { fill: #e03a3a; stroke: rgba(0, 0, 0, .25); stroke-width: 1.2; }
.fm-tap { align-content: center; gap: 6px; }
.fm-chip { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #e03a3a; color: #fff; font: 800 .95rem var(--mono); }
.fm-key { padding: 4px 6px; border-radius: 6px; background: #1b1f27; color: #fff; font: 800 .6rem var(--mono); letter-spacing: .04em; }
.fm-text { display: grid; gap: 3px; }
.fm-text b { display: flex; gap: 6px; align-items: center; justify-content: center; font-size: 1.08rem; }
.fm-n { width: 22px; height: 22px; display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--accent); color: #fff; font: 800 .78rem var(--mono); }
.fm-how { font-size: .9rem; color: var(--ink-2); }
.fm-eg { font-size: .85rem; color: var(--muted); }
.fm-op { align-self: center; font: 800 1.8rem/1 var(--mono); color: var(--accent); }
.fm-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .92rem; color: var(--ink-2); }
@media (max-width: 900px) {
  .fm-eq { grid-template-columns: 1fr; gap: 4px; }
  .fm-term { grid-template-columns: auto 1fr; justify-items: start; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; }
  .fm-text b { justify-content: flex-start; }
  .fm-pic { width: 72px; height: 72px; }
  .fm-op { justify-self: center; font-size: 1.4rem; }
}
@media (max-width: 640px) { .formula { padding: 16px 14px; } .formula-head .ci { display: none; } }

/* Foul cards open a pop-up that explains the foul (foul-dialog.js); the button covers the whole card. */
.sig-card.has-info { position: relative; transition: border-color .15s; }
.sig-card.has-info:hover { border-color: var(--accent); }
.sig-more { justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 2px 0; border: 0; background: none; color: var(--accent); font: 650 .86rem var(--font); text-align: left; cursor: pointer; }
.sig-more::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.foul-dlg { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); overscroll-behavior: contain; }
.foul-dlg::backdrop { background: rgba(10, 14, 22, .6); }
html:has(.foul-dlg[open]) { overflow: hidden; }
.foul-inner { position: relative; padding: 20px; }
.foul-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 400 1.5rem/1 var(--font); cursor: pointer; }
.foul-head { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: center; padding-right: 40px; margin-bottom: 12px; }
.foul-head h2 { font-size: 1.35rem; margin: 0 0 4px; }
.foul-head p { margin: 0; }
.foul-img { width: 120px; height: 120px; object-fit: contain; background: #fff; border-radius: 14px; border: 1px solid var(--line); }
.foul-row { padding: 10px 0; border-top: 1px solid var(--line); }
.foul-row h3 { margin: 0 0 4px; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.foul-row p { margin: 0; }
.foul-rule { margin: 4px 0 14px; }
.foul-close { width: 100%; }
@media (max-width: 480px) { .foul-inner { padding: 16px; } .foul-head { grid-template-columns: 88px minmax(0, 1fr); } .foul-img { width: 88px; height: 88px; } }
