/* ==========================================================================
   Spellings, brain breaks, fact of the day, reading timer, random number.
   Loaded only on those pages.
   ========================================================================== */
.big-out { font-size: clamp(4rem, 14vw, 9rem); font-weight: 750; letter-spacing: -0.05em; line-height: 1; color: var(--accent); }
.big-out.rolling { color: var(--text-2); }
.big-out.landed { animation: land 0.5s var(--ease); }
.big-out.placeholder { font-size: clamp(1.4rem, 3vw, 2rem); color: var(--muted); font-weight: 600; letter-spacing: -0.02em; }
.multi-out { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.multi-out span { font-size: clamp(2.4rem, 7vw, 5rem); font-weight: 750; min-width: 1.6em; padding: 8px 20px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-text); letter-spacing: -0.04em; animation: land 0.5s var(--ease) backwards; }
.range-note { color: var(--muted); font-weight: 600; font-size: 1rem; }
body.presenting .big-out { font-size: clamp(8rem, 34vh, 30rem); }
body.presenting .big-out.placeholder { font-size: clamp(2rem, 4vw, 3.5rem); }
body.presenting .multi-out span { font-size: clamp(3rem, 12vh, 10rem); }
body.presenting .range-note { font-size: clamp(1rem, 2.4vh, 1.8rem); }
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.range-row input { width: 100%; text-align: center; font-weight: 650; font-size: 1.1rem; }
.dice-pips { display: none; }

/* Reading timer */
.read-stage { --read: #b4532a; --read-soft: #fbeee6; }
[data-theme='dark'] .read-stage { --read: #f0956a; --read-soft: #2b1d16; }
.read-book { width: min(220px, 40vw); color: var(--read); }
.read-book svg { width: 100%; height: auto; display: block; }
.read-time { font-size: clamp(3.4rem, 11vw, 7rem); font-weight: 650; letter-spacing: -0.045em; line-height: 1; }
.read-time.soft { font-size: clamp(2rem, 6vw, 3.6rem); color: var(--text-2); }
.read-label { font-size: clamp(1.1rem, 2.2vw, 1.6rem); font-weight: 650; color: var(--read); letter-spacing: -0.01em; outline: none; border-radius: 6px; padding: 2px 8px; }
.read-label:focus { background: var(--surface-2); }
.read-bar { width: min(560px, 90%); height: 14px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.read-bar > span { display: block; height: 100%; background: var(--read); border-radius: inherit; transition: width 0.5s linear; }
.read-prompt { max-width: 40ch; font-size: clamp(1.1rem, 2.4vw, 1.6rem); font-weight: 600; color: var(--text); background: var(--read-soft); padding: 16px 22px; border-radius: 16px; }
.read-prompt small { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--read); margin-bottom: 6px; }
.read-stage.is-done .read-time { color: var(--read); }
body.presenting .read-book { width: min(300px, 26vh); }
body.presenting .read-time { font-size: clamp(5rem, 20vh, 16rem); }
body.presenting .read-time.soft { font-size: clamp(3rem, 10vh, 8rem); }
body.presenting .read-label { font-size: clamp(1.4rem, 4vh, 3rem); }
body.presenting .read-bar { height: 22px; width: min(900px, 80vw); }
body.presenting .read-prompt { font-size: clamp(1.4rem, 4vh, 3rem); }
.page-turn { transform-origin: 50% 50%; }
.is-running .page-turn { animation: pageflip 6s ease-in-out infinite; }
@keyframes pageflip { 0%, 70% { transform: scaleX(1); opacity: 0; } 75% { opacity: 1; } 100% { transform: scaleX(-1); opacity: 0; } }

/* Fact of the day */
.fact-cat { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fc, var(--accent-text)); background: color-mix(in srgb, var(--fc, var(--accent)) 12%, var(--surface)); padding: 6px 14px; border-radius: 99px; }
.fact-text { font-size: clamp(1.5rem, 3.6vw, 2.6rem); font-weight: 650; letter-spacing: -0.025em; line-height: 1.25; max-width: 30ch; animation: land 0.45s var(--ease); }
.fact-date { color: var(--muted); font-size: 0.95rem; font-weight: 550; }
body.presenting .fact-text { font-size: clamp(2rem, 6vh, 5rem); max-width: 26ch; }
body.presenting .fact-cat { font-size: clamp(0.9rem, 2vh, 1.4rem); }
body.presenting .fact-date { font-size: clamp(1rem, 2.2vh, 1.6rem); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle { font: inherit; font-size: 0.82rem; font-weight: 600; padding: 6px 12px; border-radius: 99px; cursor: pointer; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.chip-toggle[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

/* Brain breaks */
.bb-name { font-size: clamp(2.2rem, 6.5vw, 4.6rem); font-weight: 750; letter-spacing: -0.04em; line-height: 1.05; max-width: 16ch; }
.bb-name.placeholder { font-size: clamp(1.4rem, 3vw, 2rem); color: var(--muted); font-weight: 600; letter-spacing: -0.02em; }
.bb-name.landed { animation: land 0.5s var(--ease); }
.bb-how { font-size: clamp(1.05rem, 2vw, 1.4rem); color: var(--text-2); max-width: 36ch; margin: 0; }
.bb-count { font-size: clamp(3rem, 9vw, 6rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--accent); }
.bb-count.done { color: var(--green); }
.bb-next { font-size: 1rem; color: var(--muted); font-weight: 550; }
.bb-next b { color: var(--text-2); }
.bb-dots { display: flex; gap: 6px; }
.bb-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.bb-dots i.on { background: var(--accent); }
.bb-dots i.past { background: color-mix(in srgb, var(--accent) 40%, var(--surface-3)); }
body.presenting .bb-name { font-size: clamp(3rem, 11vh, 9rem); }
body.presenting .bb-how { font-size: clamp(1.3rem, 3.4vh, 2.6rem); }
body.presenting .bb-count { font-size: clamp(5rem, 18vh, 14rem); }
body.presenting .bb-next { font-size: clamp(1rem, 2.4vh, 1.8rem); }
.act-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; max-height: 460px; overflow: auto; }
.act-row { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: start; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.act-row.off { opacity: 0.55; }
.act-row input[type='checkbox'] { margin-top: 10px; width: 16px; height: 16px; accent-color: var(--accent); }
.act-fields { display: grid; gap: 4px; min-width: 0; }
.act-fields input { height: 34px; padding: 0 8px; font-size: 0.88rem; }
.act-fields .act-how { font-size: 0.8rem; color: var(--text-2); }
.act-side { display: grid; gap: 4px; justify-items: end; }
.act-secs { width: 64px !important; text-align: center; }
.act-tools { display: flex; gap: 2px; }
.mini { width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; font-size: 0.95rem; }
.mini:hover { background: var(--surface-2); color: var(--text); }
.mini[disabled] { opacity: 0.3; cursor: default; }

/* Spellings */
.sp-word { display: flex; flex-wrap: wrap; gap: clamp(6px, 1vw, 12px); justify-content: center; }
.sp-letter { min-width: 1.1em; padding: 0 0.08em 0.06em; font-size: clamp(2.2rem, 6vw, 4.4rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; border-bottom: 4px solid var(--border-strong); text-align: center; text-transform: lowercase; }
.sp-letter.shown { color: var(--text); }
.sp-letter.gap { color: transparent; }
.sp-letter.missed { color: var(--red); }
.sp-letter.space { border-color: transparent; }
.sp-letter.given { color: var(--accent); }
.sp-tiles { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sp-tiles span { display: grid; place-items: center; width: clamp(48px, 8vw, 76px); aspect-ratio: 1; font-size: clamp(1.8rem, 4.6vw, 3.2rem); font-weight: 700; text-transform: lowercase; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); animation: land 0.45s var(--ease) backwards; }
.sp-answer { font-size: clamp(2.4rem, 7vw, 5rem); font-weight: 750; letter-spacing: -0.02em; color: var(--green); text-transform: lowercase; animation: land 0.45s var(--ease); }
.sp-msg { font-size: clamp(1.1rem, 2.4vw, 1.6rem); font-weight: 650; min-height: 1.4em; color: var(--text-2); }
.sp-msg.win { color: var(--green); }
.sp-msg.lose { color: var(--red); }
.sp-keys { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 5px; width: min(640px, 100%); }
.sp-keys button { font: inherit; font-weight: 700; font-size: 1rem; aspect-ratio: 1; min-height: 34px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; text-transform: lowercase; padding: 0; }
.sp-keys button:hover:not([disabled]) { border-color: var(--accent); background: var(--accent-soft); }
.sp-keys button.hit { background: color-mix(in srgb, var(--green) 20%, var(--surface)); border-color: var(--green); color: var(--green); }
.sp-keys button.miss { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.sp-keys button[disabled] { cursor: default; }
.sp-pic { width: min(220px, 42vw); color: var(--text-2); }
.sp-pic svg { width: 100%; height: auto; display: block; }
.sp-pic .part { opacity: 0.1; transition: opacity 0.3s; }
.sp-pic .part.on { opacity: 1; }
.sp-pic .balloon { transition: opacity 0.25s, transform 0.25s; transform-box: fill-box; transform-origin: center; }
.sp-pic .balloon.popped { opacity: 0; transform: scale(1.5); }
.sp-lives { font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.sp-cover { width: min(560px, 90%); padding: 40px 20px; border-radius: 18px; background: var(--surface-2); border: 2px dashed var(--border-strong); font-size: clamp(1.4rem, 3.4vw, 2.4rem); font-weight: 700; color: var(--text-2); }
.sp-countbar { width: min(420px, 80%); height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.sp-countbar span { display: block; height: 100%; background: var(--accent); width: 100%; }
.sp-hint { font-size: clamp(1rem, 2vw, 1.3rem); color: var(--muted); font-style: italic; max-width: 40ch; }
.game-tabs { width: 100%; }
.game-tabs button { white-space: nowrap; }
body.presenting .sp-letter { font-size: clamp(3rem, 11vh, 8rem); }
body.presenting .sp-tiles span { width: clamp(64px, 12vh, 130px); font-size: clamp(2.4rem, 7vh, 5.4rem); }
body.presenting .sp-answer { font-size: clamp(3rem, 12vh, 9rem); }
body.presenting .sp-keys { width: min(1000px, 90vw); }
body.presenting .sp-keys button { font-size: clamp(1rem, 2.6vh, 2rem); }
body.presenting .sp-pic { width: min(300px, 26vh); }
body.presenting .sp-cover { font-size: clamp(2rem, 6vh, 4rem); }
body.presenting .sp-msg { font-size: clamp(1.4rem, 3.6vh, 2.8rem); }
body.presenting .sp-hint { font-size: clamp(1.2rem, 3vh, 2.2rem); }
@media (max-width: 640px) { .sp-keys { grid-template-columns: repeat(9, minmax(0, 1fr)); } }

/* Class jobs */
.jobs-body { justify-content: flex-start; }
.jobs-title { margin: 0; font-size: clamp(1.2rem, 2.4vw, 1.7rem); }
.jobs-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; text-align: left; }
.job-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 12px 14px 14px; border-top: 5px solid var(--jc); display: grid; gap: 6px; align-content: start; animation: land 0.45s var(--ease) backwards; }
.job-role { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em; color: var(--jc); text-transform: uppercase; }
.job-who { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.job-who.none { color: var(--muted); font-weight: 550; font-size: 1rem; }
.job-pick { height: 32px; font-size: 0.85rem; padding: 0 30px 0 8px; }
body.presenting .jobs-body { padding: 70px 3vw 20px; }
body.presenting .jobs-title { font-size: clamp(1.6rem, 4vh, 3rem); }
body.presenting .jobs-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 30vw), 1fr)); gap: 2vh 1.4vw; }
body.presenting .job-role { font-size: clamp(0.9rem, 2vh, 1.5rem); }
body.presenting .job-who { font-size: clamp(1.4rem, 4vh, 3.2rem); }
body.presenting .job-pick { display: none; }
.role-row { grid-template-columns: auto 1fr auto; align-items: center; }
.role-row .act-secs { width: 54px !important; }

/* Points tally */
.pts-body { justify-content: flex-start; align-items: stretch; }
.pts-title { margin: 0; text-align: center; font-size: clamp(1.2rem, 2.4vw, 1.7rem); }
.pts { display: grid; gap: 10px; width: 100%; }
.pts.grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.pt-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.pt-fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--pc) 22%, transparent); border-right: 4px solid var(--pc); transition: width 0.5s var(--ease); pointer-events: none; }
.pt-name { position: relative; font: inherit; font-weight: 700; font-size: 1.15rem; text-align: left; background: none; border: 0; color: var(--text); cursor: pointer; padding: 6px 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-name .lead { color: var(--amber); margin-left: 6px; }
.pt-score { position: relative; font-size: 1.6rem; font-weight: 750; min-width: 2.2em; text-align: right; letter-spacing: -0.03em; }
.pt-score.bump { animation: bump 0.4s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); color: var(--pc); } }
.pt-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 1.3rem; font-weight: 700; cursor: pointer; }
.pt-btn.plus { background: var(--pc); border-color: transparent; color: #fff; }
.pts.grid .pt-row { grid-template-columns: 1fr auto; grid-template-areas: 'n n' 's s' 'm p'; text-align: center; }
.pts.grid .pt-name { grid-area: n; text-align: center; white-space: normal; }
.pts.grid .pt-score { grid-area: s; text-align: center; font-size: 2rem; }
.pts.grid .pt-btn.minus { grid-area: m; justify-self: start; }
.pts.grid .pt-btn.plus { grid-area: p; justify-self: end; }
.pts.grid .pt-fill { inset: auto 0 0 0; width: 100% !important; height: var(--h); border-right: 0; border-top: 4px solid var(--pc); transition: height 0.5s var(--ease); }
body.presenting .pts-body { padding: 70px 4vw 24px; }
body.presenting .pts-title { font-size: clamp(1.6rem, 4vh, 3rem); }
body.presenting .pt-row { padding: 1.4vh 1.4vw; }
body.presenting .pt-name { font-size: clamp(1.2rem, 3.6vh, 2.8rem); }
body.presenting .pt-score { font-size: clamp(1.6rem, 5vh, 4rem); }
body.presenting .pt-btn { width: clamp(40px, 6vh, 64px); height: clamp(40px, 6vh, 64px); font-size: clamp(1.2rem, 3vh, 2rem); }
.item-color { width: 34px; height: 34px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); cursor: pointer; }
