/* Classroom tools: timer, random name picker, spin the wheel (scripts/classroom-tools.mjs, public/tools/*.js).
   Tokens from style.css. The tool sits in one card at the top of the page; .ct-full (Full screen) fills the screen
   with white on dark blue and larger controls for the classroom board. Nothing flashes or shakes. */
.ct { --ct-navy: #10163a; margin: var(--s4) 0 0; padding: 16px; border: 2px solid var(--line-2); border-radius: var(--radius-lg); background: var(--card); }
.ct p { margin: 0; }
.ct-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 12px 0 0; }
.ct-row2 { margin-top: 8px; }
.ct-main { min-width: 9.5rem; font-size: var(--t-lg); }
.ct-sub { color: var(--muted); font-weight: 700; }
.ct .hint { font-size: var(--t-sm); color: var(--muted); margin: 6px 0 0; max-width: var(--measure); }
.ct-lab { display: block; font-weight: 800; margin: 0 0 6px; }
.ct textarea { width: 100%; font: inherit; font-size: var(--t-md); padding: 10px 12px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); resize: vertical; }
.ct-check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 0; font-weight: 600; }
.ct-check input { width: 22px; height: 22px; margin-top: 4px; flex: none; accent-color: var(--coral); }
.ct-custom { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 8px 12px; margin: 12px 0 0; }
.ct-custom label, .ct-sel { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.ct-custom input, .ct-sel select { font: inherit; font-weight: 700; width: 5.2rem; min-height: 48px; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); }
.ct-sel select { width: auto; }
.ct-edit, .ct-make, .ct-picked { margin: 20px 0 0; padding: 16px 0 0; border-top: 2px dashed var(--line-2); }
.ct-make h3, .ct-picked h3 { font-size: var(--t-lg); margin: 0 0 6px; }
.ct-make .ct-row { justify-content: flex-start; margin: 0; }
.ct-groups { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ct-groups strong { margin-right: .4em; }
.ct-picked ol { margin: 0; padding-left: 1.4em; columns: 2 10rem; }
.ct-privacy { margin: 10px 0 0; font-size: var(--t-sm); color: var(--muted); max-width: var(--measure); }
.ct-howto li { margin: 0 0 .7em; max-width: var(--measure); }
kbd { font: inherit; font-weight: 800; padding: 1px 7px; border: 2px solid var(--line-2); border-bottom-width: 3px; border-radius: 7px; background: #fff; }

/* timer */
.ct-presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px 0 0; }
.ct-face { position: relative; width: min(100%, 300px); aspect-ratio: 1; margin: 0 auto; }
.ct-ring { width: 100%; height: 100%; display: block; }
.ct-track { fill: none; stroke: var(--sun-soft); stroke-width: 9; }
.ct-left { fill: none; stroke: var(--sky); stroke-width: 9; stroke-linecap: round; transition: stroke .6s; }
.ct-low .ct-left { stroke: #e07a1f; }
.ct-read { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ct-digits { font-size: clamp(3.4rem, 17vw, 5.2rem); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ct-done .ct-digits { color: var(--green); }
.ct-done .ct-sub { color: var(--green); font-size: var(--t-lg); }

/* name picker */
.ct-stage { min-height: 9.5rem; display: grid; place-content: center; text-align: center; padding: 18px 12px; border-radius: var(--radius); background: var(--sun-field); }
.ct-name { font-size: clamp(2.4rem, 11vw, 4.6rem); font-weight: 900; line-height: 1.1; overflow-wrap: anywhere; }
.ct-rolling .ct-name { color: var(--muted); }
.ct-picker .ct-sub { margin-top: 6px; }

/* wheel */
.ct-spin { display: grid; gap: 12px; justify-items: center; }
@media (min-width: 820px) { .ct-spin { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; } }
.ct-wheel-box { position: relative; width: min(100%, 360px); }
@media (max-width: 500px) { .ct-wheel-box { width: min(100%, 290px); } }
.ct-wheel-btn { --b-bg: transparent; --b-bd: transparent; display: block; width: 100%; aspect-ratio: 1; padding: 0; border-radius: 50%; min-height: 0; }
.ct-wheel-btn:hover { --b-bg: transparent; }
.ct-wheel-btn svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ct-wheel-btn text { fill: var(--ink); font-family: var(--font); font-weight: 800; }
.ct-rot { transform-origin: 0 0; }
.ct-pointer { position: absolute; z-index: 1; top: -6px; left: 50%; width: 0; height: 0; transform: translateX(-50%); border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 28px solid var(--coral); filter: drop-shadow(0 2px 0 var(--ink)); }
.ct-out { text-align: center; }
.ct-result { min-height: 2.6em; font-size: var(--t-lg); font-weight: 700; display: grid; place-content: center; }
.ct-won { font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 900; line-height: 1.1; overflow-wrap: anywhere; }
.ct-fills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 4px; }
.ct-fl { font-weight: 800; margin-right: 4px; }
.ct-wheel .ct-custom { justify-content: flex-start; margin: 8px 0 14px; }

/* full screen: the tool alone, white on dark blue, bigger everything */
html.ct-lock { overflow: hidden; }
.ct.ct-full { position: fixed; inset: 0; z-index: 1000; margin: 0; border: 0; border-radius: 0; overflow: auto; background: var(--ct-navy); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 24px; }
.ct-full .ct-edit, .ct-full .ct-make, .ct-full .ct-custom, .ct-full .ct-presets { display: none; }
.ct-full .ct-sub, .ct-full .hint { color: #dfe3ff; }
.ct-full .ct-face { width: min(78vh, 92vw); }
.ct-full .ct-digits { font-size: min(22vh, 24vw); }
.ct-full .ct-track { stroke: #2a3470; }
.ct-full .ct-left { stroke: #ffcf4a; }
.ct-full.ct-low .ct-left { stroke: #ff9b5a; }
.ct-full.ct-done .ct-digits, .ct-full.ct-done .ct-sub { color: #9ff0b9; }
.ct-full .ct-stage { background: transparent; min-height: 50vh; }
.ct-full .ct-name { font-size: min(18vh, 14vw); }
.ct-full .ct-picked { border-color: #2a3470; }
.ct-full .ct-picked ol { color: #dfe3ff; }
.ct-full .ct-wheel-box { width: min(80vh, 92vw); }
.ct-full .ct-spin { grid-template-columns: 1fr; }
@media (min-aspect-ratio: 4/3) { .ct-full .ct-spin { grid-template-columns: auto minmax(0, 1fr); } .ct-full .ct-wheel-box { width: min(82vh, 60vw); } }
.ct-full .ct-result { color: #fff; font-size: 1.6rem; }
.ct-full .ct-won { font-size: min(12vh, 9vw); }
.ct-full .ct-main { font-size: 1.6rem; min-height: 64px; min-width: 12rem; }
.ct-full .alt { --b-bg: transparent; --b-bd: #fff; --b-fg: #fff; }
.ct-full .chip { --b-bg: #2a3470; --b-fg: #fff; }
@media (prefers-reduced-motion: reduce) { .ct-left { transition: none; } }
@media print { .ct { display: none; } }
/* Ideas by year level and the "Embed this tool" box (11 Nov 2026) */
.ct-years dt { font-weight: 800; margin: 12px 0 2px; }
.ct-years dd { margin: 0; }
.ct-embed-box .ct-code { width: 100%; font: .85rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 10px 12px; border: 2px solid var(--line-2); border-radius: 12px; background: #fff; color: var(--ink); resize: vertical; }
.ct-row-start { justify-content: flex-start; }
