/* Class play uses Woodshed's shared stylesheet and tokens. Only game layout lives here. */
.class-play{max-width:960px;margin:0 auto}.class-play>h1{margin-bottom:.25rem}.class-play>[role=status]{font-size:.875rem;color:var(--muted-foreground)}.cp-content{min-width:0}.cp-form{max-width:780px;margin:1rem 0}.cp-form h2{margin:0}.cp-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.25rem}.cp-settings [hidden]{display:none}.cp-form label:has(input[type=checkbox]){display:flex;gap:.75rem;align-items:center;min-height:44px}.cp-form label:has(input[type=checkbox]) span{margin:0}.cp-form button{justify-self:start}.class-play button,.class-play input,.class-play select{min-height:44px;height:auto;white-space:normal}.class-play input,.class-play select{padding:.65rem .75rem}.class-play button{padding:.65rem 1rem;margin:.3rem .5rem .3rem 0}.cp-actions{display:flex;gap:.5rem;flex-wrap:wrap}.cp-join{display:block;overflow-wrap:anywhere;font-size:clamp(1rem,2vw,1.5rem);margin:1rem 0}.cp-clock{font-size:1.25rem;font-weight:600;min-height:2rem}.cp-error{color:var(--destructive);overflow-wrap:anywhere}.cp-error:empty{display:none}.cp-music{overflow-x:auto;padding:1rem 0}.cp-music svg{display:block;max-width:100%;height:auto;color:var(--foreground)}.cp-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;margin:1.25rem 0}.cp-choices button{margin:0;padding:1.15rem;text-align:left;justify-content:flex-start;overflow-wrap:anywhere}.cp-players{list-style:none;padding:0}.cp-players li{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;border-bottom:1px solid var(--border);padding:.75rem 0}.cp-players select{max-width:260px}.class-play summary{min-height:44px;padding:.65rem 0;cursor:pointer}.class-play details{margin:1rem 0}.cp-report{margin-top:2rem}.cp-privacy{font-size:.875rem;color:var(--muted-foreground)}.cp-qr{display:block;width:240px;max-width:100%;height:auto;margin:1.25rem 0}.hub-class-play{display:flex;align-items:center;gap:1rem;flex-wrap:wrap}.hub-class-play p{margin:0}
@media(max-width:560px){.cp-settings,.cp-choices{grid-template-columns:1fr}.cp-form{padding:1rem}.cp-choices button{padding:1rem}}
@media print{.topbar,.footer,.class-play button,.cp-clock,.class-play details:not(.cp-private-report),.class-play summary,.cp-error,[role=status]{display:none!important}.cp-report{display:block}@page{margin:18mm}}

/* The app (index.html) loads Count rhythms' styles too, and css/rhythm.css keeps every .rhythm-staff at least 650 px
   wide so that page's measure scrolls. Class Play sizes each staff itself: a Count race slice, a Rhythm detective answer,
   the board's measure. Held to 650 px, those burst their boxes (November 19, 2026, on the class's Chromebooks and the
   board: a Count race measure's slices drawn over one another, the board's finishers on top of the music, each
   detective answer cut off at its right edge). So none has that floor in Class Play, in the app as on class-play.html,
   which never loads rhythm.css (e2e/class-play-in-app.spec.js). */
.class-play .rhythm-staff { min-width: 0; }

.cp-pin{font-size:clamp(2rem,6vw,4.5rem);font-weight:600;letter-spacing:.08em;line-height:1.2;color:var(--foreground)}

/* How to play (js/class-play-how-to-view.js): the game's steps in each lobby and on the class board, before Start. The
   example measure writes its count, or where to tap, under each note in the staff's own coordinates, so the words scale
   with it; a rest's word is lighter, and the caption says the example in words too. */
.cp-howto { display: grid; gap: .75rem; margin: 1.5rem 0; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); color: var(--foreground); min-width: 0; }
.cp-howto h2 { margin: 0; }
.cp-howto-steps { margin: 0; padding-left: 1.5rem; display: grid; gap: .5rem; }
.cp-howto-example { margin: .25rem 0 0; display: grid; gap: .25rem; min-width: 0; }
.cp-howto-example figcaption { font-weight: 600; }
.cp-howto-music { overflow-x: auto; }
.cp-howto-music svg { display: block; max-width: 100%; height: auto; color: var(--foreground); }
.cp-howto-label { font-size: 32px; font-weight: 600; fill: currentColor; }
.cp-howto-label.is-rest { font-weight: 400; fill: var(--muted-foreground); }
/* On the class board: read from the back of the room. */
.cp-howto.cp-board .cp-howto-steps, .cp-howto.cp-board figcaption { font-size: clamp(1.125rem, 2.1vw, 1.75rem); }
.cp-howto.cp-board .cp-howto-music svg { width: 100%; max-width: 44rem; }
@media (max-width: 560px) { .cp-howto { padding: 1rem; } .cp-howto-steps { padding-left: 1.25rem; } }

.cp-leaderboard{margin:1.5rem 0}.cp-standings{list-style:none;padding:0;display:grid;gap:.6rem}.cp-standing{display:grid;grid-template-columns:2.5rem minmax(0,1fr) auto;align-items:center;gap:.75rem;padding:1rem;border-bottom:1px solid var(--border)}.cp-standing-rank{font-size:1.5rem;font-weight:600}.cp-standing-name{overflow-wrap:anywhere}.cp-standing-points{white-space:nowrap}.cp-standing.is-you{background:var(--accent);border-radius:var(--radius-md)}.cp-visual-choice{display:flex;flex-direction:column;align-items:stretch;gap:.5rem;background:var(--card);color:var(--foreground)}.cp-choice-tags{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .5rem;font-weight:600;align-self:flex-start}.cp-choice-tags:empty{display:none}.cp-choice-picture{display:flex;align-items:center;justify-content:center;width:100%;min-width:0;pointer-events:none}.cp-choice-picture .diagram{display:block;width:100%;height:auto;max-height:300px;margin:0}.cp-answer-review{padding:.75rem;border:1px solid var(--border);border-radius:var(--radius-md)}.cp-visual-choices{align-items:stretch}.cp-visual-choice:disabled{opacity:.8}.cp-visual-choice .key.pressed .key-label{font-weight:700}@media(max-width:560px){.cp-visual-choices{grid-template-columns:repeat(2,minmax(0,1fr))}.cp-visual-choices:has(.diagram-flute),.cp-visual-choices:has(.diagram-keyboard),.cp-visual-choices:has(.diagram-slide){grid-template-columns:1fr}.cp-standing{gap:.5rem;padding:.75rem .25rem;grid-template-columns:1.75rem minmax(0,1fr) auto}.cp-standing-points{font-size:.875rem}.cp-visual-choices button{padding:.75rem}}

.cp-results-popup { width: min(42rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; box-sizing: border-box; border: 1px solid var(--border); border-radius: 1rem; padding: clamp(1rem, 4vw, 2rem); background: var(--background, #faf7ed); color: var(--foreground, #263238); }
.cp-results-popup::backdrop { background: rgb(0 0 0 / 55%); }
.cp-results-popup .cp-leaderboard { margin-block: 1rem; }
.cp-results-popup button { min-height: 44px; }
.cp-winners { font-size: 1.25rem; font-weight: 600; }

.cp-podium { display: flex; gap: .5rem; align-items: end; margin-block: 1.5rem; }
.cp-podium-place { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .5rem; text-align: center; padding: 1rem .5rem; background: var(--muted); border-radius: .5rem .5rem 0 0; overflow-wrap: anywhere; }
.cp-podium-place strong { font-size: 1.8rem; }
.cp-place-1 { padding-top: 3rem; border: 2px solid var(--primary); }
.cp-place-2 { padding-top: 2rem; }

/* Performance notation stays readable and the tap surface stays still while polling. */
.cp-performance { display: grid; gap: 1rem; }
/* The round on one staff (js/class-performance-score.js): each line fills the width it's given, never wider, so measures
   can't run into one another; the script wraps the lines before the notes get too small and caps how large they grow. */
.cp-performance-score { display: grid; gap: .75rem; min-width: 0; }
.cp-performance-score .rhythm-staff { display: block; width: 100%; min-width: 0; height: auto; }
.cp-measure-number { font-family: var(--font-numeric); font-weight: 700; }
.cp-performance-progress { font-size: clamp(1.25rem, 3vw, 2rem); font-weight: 700; }
.cp-tap-pad { width: 100%; min-height: 100px; padding: 1rem; font: inherit; font-size: 1.25rem; touch-action: none; user-select: none; border: 3px solid currentColor; border-radius: 1rem; background: var(--card); color: var(--foreground); }
.cp-tap-pad:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
.cp-readiness { display: grid; gap: .75rem; }
.cp-readiness button { min-height: 44px; }
.cp-settings[hidden], .cp-tap-pad[hidden] { display: none; }
/* The page doesn't have the keyboard (js/class-performance-player.js): one bold line above the pad, pressed to fix it. */
.cp-focus-note { width: 100%; min-height: 44px; padding: .75rem 1rem; font: inherit; font-weight: 600; text-align: left; border: 3px solid var(--warning); border-radius: var(--radius-md); background: var(--card); color: var(--foreground); }
.cp-focus-note[hidden] { display: none; }
.cp-no-taps { font-weight: 600; }

.cp-settings > .cp-settings { grid-column: 1 / -1; }
/* Rhythm counting's choices, and rhythm performance's rhythms, are the Rhythm counting builder's rows
   (js/class-play-rhythm-setup.js): the builder's spacing, with Class Play's 44px targets. */
.cp-settings > :is(.cp-rhythm, .cp-performance-rhythm) { grid-column: 1 / -1; }
/* Rhythm performance's time signatures: a row of checkboxes across the setup (js/class-play-meters-view.js). */
.cp-settings > .cp-meters { grid-column: 1 / -1; margin: 0; }
.cp-meters[hidden] { display: none; }
.cp-meters > p { margin: 0; }
.cp-meters > p[hidden] { display: none; }
:is(.cp-rhythm, .cp-performance-rhythm) :is(.cp-rhythm-help, .cp-rhythm-problem) { margin: 0; }
.class-play :is(.cp-rhythm, .cp-performance-rhythm) .setting-seg button { margin: 0; padding: .35rem .85rem; min-height: 44px; }
.class-play :is(.cp-rhythm, .cp-performance-rhythm) .setting-open { margin: -.35rem -.5rem; padding: .35rem .5rem; min-height: 44px; }
/* Motivation features (js/class-play-motivation-view.js): teams, the class goal, personal bests and streaks.
   Every result is in words and numbers; color only adds to them. Celebrations fade in once, and not at all with reduced motion. */
.cp-settings-group { border: 0; padding: 1.25rem 0 0; margin: .5rem 0 0; border-top: 1px solid var(--border); display: grid; gap: .75rem; min-width: 0; }
.cp-settings-group legend { font-weight: 600; font-size: 1.125rem; padding: 0; margin-bottom: .5rem; }
.cp-motivation-help { margin: 0; }
.cp-team-badge { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; overflow-wrap: anywhere; }
.cp-team-letter { display: inline-grid; place-items: center; flex: none; min-width: 1.9em; height: 1.9em; border: 2px solid currentColor; border-radius: 999px; font-size: .9em; line-height: 1; }
.cp-team-list { list-style: none; padding: 0; display: grid; gap: .75rem; }
.cp-team-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.cp-team-members { overflow-wrap: anywhere; }
.cp-team-controls { display: grid; gap: .5rem; margin: 1rem 0; }
.cp-team-controls p { margin: 0; }
.cp-team-row-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem 1rem; }
.cp-team-row-controls label { flex: 0 1 14rem; }
.cp-team-row-controls button { margin: 0; }
.cp-team-controls h3 { margin: 0; }
/* A student's team choices: native radio buttons, each row a 44px target with the team's letter and name. */
.cp-team-choices { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: .25rem; }
.cp-team-choices legend { font-weight: 600; padding: 0; margin-bottom: .25rem; }
.cp-team-choice { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; min-height: 44px; padding: .25rem .5rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.cp-team-choice:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cp-team-choice input { width: 1.25rem; height: 1.25rem; min-height: 0; padding: 0; margin: 0; accent-color: var(--primary); flex: none; }
.cp-rename { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; }
.cp-rename label { flex: 1 1 14rem; }
.cp-rename button { margin: 0; }
.cp-motivation { display: grid; gap: 1rem; margin: 1rem 0; }
.cp-motivation:empty { display: none; }
.cp-mine { display: grid; gap: .5rem; }
.cp-mine p, .cp-goal p, .cp-shouts p { margin: 0; }
.cp-achievement { padding: .75rem 1rem; border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius-md); }
.cp-my-team { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.cp-team-rows { list-style: none; padding: 0; display: grid; gap: .25rem; margin: .5rem 0; }
.cp-team-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; align-items: center; gap: .25rem .75rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.cp-team-row.is-you { font-weight: 600; }
.cp-team-score { white-space: nowrap; }
.cp-team-finished { grid-column: 2 / -1; }
.cp-goal, .cp-score { display: grid; gap: .5rem; align-content: start; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); }
.cp-score h2 { margin: 0; }
.cp-score p { margin: 0; }
.cp-score-question { font-size: 1.125rem; font-weight: 600; }
.cp-goal-track.no-target::after { display: none; }
/* Your score and the class goal: side by side when there's room, stacked on a phone. */
.cp-score-pair { display: grid; gap: 1rem; }
@media (min-width: 640px) { .cp-score-pair:has(> :nth-child(2)) { grid-template-columns: 1fr 1fr; } }
.cp-goal h2, .cp-team-standings h2, .cp-shouts h2, .cp-improved h2 { margin: 0; }
.cp-goal-meter { display: flex; align-items: center; gap: 1rem; }
.cp-goal.is-met { border-width: 2px; border-color: var(--success); }
.cp-goal-track { position: relative; flex: 1; min-width: 0; }
.cp-goal-track::after { content: ''; position: absolute; top: -.35rem; bottom: -.35rem; left: calc(var(--target, 100%) - 1.5px); width: 3px; border-radius: 2px; background: var(--foreground); }
.cp-goal-bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 1.25rem; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--muted); color: var(--primary); }
.cp-goal-bar::-webkit-progress-bar { background: var(--muted); }
.cp-goal-bar::-webkit-progress-value { background: var(--primary); }
.cp-goal-bar::-moz-progress-bar { background: var(--primary); }
.cp-goal-value { font-size: 1.25rem; min-width: 3.5ch; text-align: right; }
.cp-goal-status { font-weight: 600; }
.cp-shout-list { margin: .25rem 0 0; padding-left: 1.25rem; }
.cp-how { font-size: .875rem; color: var(--muted-foreground); }
/* The class board is projected: read from the back of a room. */
.cp-board h2 { font-size: clamp(1.5rem, 2.6vw, 2.25rem); }
.cp-board .cp-team-row, .cp-board .cp-goal-status, .cp-board .cp-shout-list, .cp-board .cp-shouts p, .cp-board .cp-improved li { font-size: clamp(1.125rem, 2.1vw, 1.75rem); }
.cp-board .cp-goal-bar { height: clamp(1.25rem, 2vw, 2rem); }
.cp-board .cp-goal-value { font-size: clamp(1.5rem, 3vw, 2.5rem); }
@media (prefers-reduced-motion: no-preference) {
  .cp-celebrate { animation: cp-arrive .6s ease-out both; }
}
@keyframes cp-arrive { from { opacity: 0; transform: translateY(.35rem); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) {
  .cp-team-row { grid-template-columns: 1.75rem minmax(0, 1fr) auto; }
  .cp-goal-meter { gap: .5rem; }
}
.cp-board h3 { font-size: clamp(1.125rem, 1.8vw, 1.5rem); }

/* The countdown (js/class-play-clock.js). The seconds are always written out; the bar repeats them for the eye and
   turns red, with the number, for the last three seconds, as the practice question clock does. With reduced motion
   the bar steps once a second (the global stylesheet turns its slide off). */
.cp-countdown { display: grid; gap: .4rem; }
.cp-countdown-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .1rem 1rem; margin: 0; }
.cp-countdown-number { font-family: var(--font-numeric); font-variant-numeric: tabular-nums; font-weight: 600; }
.cp-countdown [hidden] { display: none; }
.cp-countdown-track { height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.cp-countdown-fill { width: 100%; height: 100%; border-radius: inherit; background: var(--accent-foreground); transition: width .25s linear; }
.cp-countdown.is-low .cp-countdown-fill { background: var(--destructive); }
.cp-countdown.is-low .cp-countdown-number { color: var(--destructive); }
.cp-countdown.is-paused .cp-countdown-fill { opacity: .45; }
.cp-countdown-note { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .cp-countdown-fill { transition: none; } }
/* The class board: a large number and a thick bar, read from the back of the room. */
.cp-countdown-board { gap: .75rem; margin: .75rem 0 1.5rem; }
.cp-countdown-board .cp-countdown-line { justify-content: flex-start; }
.cp-countdown-board .cp-countdown-number { font-size: clamp(4rem, 11vw, 9rem); font-weight: 500; line-height: .95; letter-spacing: -0.015em; }
.cp-countdown-board .cp-countdown-unit, .cp-countdown-board .cp-countdown-note { font-size: clamp(1.25rem, 2.6vw, 2.25rem); }
.cp-countdown-board .cp-countdown-track { height: clamp(1rem, 2vw, 1.75rem); }
/* A student's strip: the question number and the seconds, pinned to the top of the screen while the question is open.
   The top bar scrolls away under it rather than covering it. */
.cp-countdown-strip { position: sticky; top: 0; z-index: 5; padding: .5rem 0 .6rem; background: var(--background); }
.cp-countdown-strip .cp-countdown-line { font-size: .9375rem; }
.cp-countdown-strip .cp-countdown-number { font-size: 1.25rem; line-height: 1.2; }
html.cp-playing .topbar { position: static; }
.cp-answer-note { margin: 0; }

/* A student's question on a phone (or a tablet held upright): the strip, prompt, music, all four answers and the note
   under them fill the screen, so nothing needs scrolling to answer. The top bar, back link, heading and connection
   line step aside until the lobby or results (the connection line is still read out); an error still shows. The
   music and the answer pictures share what's left, 2 × 2 for every kind of chart, each picture as large as its cell. */
@media (max-width: 720px), (orientation: portrait) and (max-width: 1100px) {
  html.cp-playing .topbar, html.cp-playing .class-play > .back-link, html.cp-playing .class-play > h1 { display: none; }
  html.cp-playing .class-play > [role=status] { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  html.cp-playing .app { padding: 0 .75rem 2rem; }
  html.cp-playing .class-play > .cp-content { margin-top: 0; }
  .cp-screen { display: flex; flex-direction: column; box-sizing: border-box; height: 100vh; height: 100dvh; }
  .cp-screen > .cp-stage { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
  .cp-stage > h2 { flex: none; margin: 0 0 .25rem; font-size: 1.0625rem; line-height: 1.3; }
  .cp-stage > .cp-music { flex: 1 1 0; min-height: 4.5rem; max-height: 13rem; padding: .25rem 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
  .cp-stage > .cp-music svg { width: auto; height: 100%; max-width: 100%; }
  .cp-stage > .cp-music .rhythm-staff { min-width: 0; }
  .cp-stage > .cp-choices { flex: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: .5rem 0; }
  /* Written answers are big tiles, and a long count (three lines of Eastman syllables) makes its tile taller rather
     than spilling out of it. */
  .cp-stage > .cp-choices button { min-height: 5rem; padding: .75rem; }
  /* Tall fingering charts (woodwinds, strings) take most of the room, each as large as its cell; the staff above them
     keeps enough to read the note. Wide charts (flute, keyboard, slide, valves) are as wide as their cell, so the
     height they don't need goes to the staff. */
  .cp-stage > .cp-music:has(+ .cp-visual-choices) { max-height: 7.5rem; }
  .cp-stage > .cp-choices.cp-visual-choices { flex: 3 1 0; min-height: 0; gap: .375rem; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .cp-stage > .cp-visual-choices button.cp-visual-choice { min-height: 44px; padding: .25rem; gap: .125rem; }
  .cp-stage .cp-choice-tags { font-size: .875rem; line-height: 1.2; padding-left: .125rem; }
  .cp-stage .cp-choice-picture { flex: 1 1 0; min-height: 0; }
  .cp-stage .cp-choice-picture .diagram { width: 100%; height: 100%; max-height: none; }
  .cp-stage > .cp-music:has(+ .cp-visual-choices :is(.diagram-flute, .diagram-keyboard, .diagram-slide, .diagram-valves)) { max-height: 13rem; }
  .cp-stage > .cp-choices.cp-visual-choices:has(:is(.diagram-flute, .diagram-keyboard, .diagram-slide, .diagram-valves)) { flex: 0 1 auto; }
  .cp-stage .cp-choice-picture:has(:is(.diagram-flute, .diagram-keyboard, .diagram-slide, .diagram-valves)) { flex-basis: auto; }
  .cp-stage > .cp-answer-note { flex: none; font-size: .9375rem; }
}

/* Note naming setup (js/class-play-notes-view.js): who the questions are for, the same question's clef and range on a
   staff, and key signatures in three labelled rows, none checked to start. */
.cp-notes-hint { margin: 0; align-self: center; }
.cp-settings-group[hidden], .cp-range[hidden] { display: none; }
.cp-range .cp-range-low { grid-column: 1; }
.cp-range-error, .cp-range-preview { grid-column: 1 / -1; }
.cp-range-error { margin: 0; }
.cp-range-preview { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.cp-range-preview:empty { display: none; }
.cp-range-preview svg { display: block; max-width: 100%; height: auto; color: var(--foreground); }
.cp-range-preview p { margin: 0; }
.cp-keys { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; min-width: 0; }
.cp-keys legend { font-weight: 600; padding: 0; margin-bottom: .25rem; }
.cp-keys > p { margin: 0; }
.cp-key-rows { display: grid; gap: .25rem; }
.cp-key-row { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); align-items: center; gap: 0 1rem; padding-bottom: .25rem; border-bottom: 1px solid var(--border); }
.cp-key-row-name { align-self: start; line-height: 44px; font-size: .875rem; font-weight: 600; color: var(--muted-foreground); }
.cp-key-options { display: flex; flex-wrap: wrap; column-gap: 1.25rem; }
.cp-form label.cp-key { gap: .5rem; white-space: nowrap; }
.cp-key input { width: 1.125rem; height: 1.125rem; min-height: 0; padding: 0; margin: 0; accent-color: var(--primary); }
@media (max-width: 560px) { .cp-key-row { grid-template-columns: 1fr; padding-top: .5rem; } }
.cp-keys-summary { font-weight: 600; }

/* Instruments and notes (js/class-play-instruments-view.js): the instruments students can choose, in family rows
   behind a disclosure; concert notes in two octave rows; then one row per instrument saying what it reads, with
   Change range opening that instrument's lowest and highest note right under it. */
.cp-picked-summary, .cp-concert-summary { margin: 0; font-weight: 600; }
.class-play details.cp-instrument-list { margin: 0; }
.cp-instrument-list summary { font-weight: 600; }
.cp-instrument-list .cp-key-rows { padding-top: .25rem; }
.cp-instrument-notes { display: grid; gap: .75rem; min-width: 0; }
.cp-instrument-notes[hidden], .cp-reads-part[hidden], .cp-concert[hidden] { display: none; }
/* A concert note none of the game's keys has is left off the list. */
.cp-form .cp-concert label.cp-key[hidden], .cp-concert-keys[hidden] { display: none; }
.cp-concert-keys { margin: 0; }
.cp-reads-heading { margin: .5rem 0 0; font-size: 1rem; }
.cp-reads-note { margin: 0; }
.cp-reads { list-style: none; padding: 0; margin: 0; }
.cp-read { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 1rem; padding: .25rem 0; border-bottom: 1px solid var(--border); }
.cp-read-line { margin: 0; overflow-wrap: anywhere; }
.class-play .cp-read .cp-change-range { margin: 0; }
.cp-instrument-error { margin: 0; }
.cp-instrument-error:empty { display: none; }
.cp-read .cp-instrument-error, .cp-read .cp-range-editor { grid-column: 1 / -1; }
.cp-range-editor { padding: .5rem 0 .75rem; align-items: end; }
.cp-range-editor .cp-range-reset { grid-column: 1 / -1; }
@media (max-width: 560px) { .cp-read { grid-template-columns: 1fr; } .class-play .cp-read .cp-change-range { margin: .25rem 0 .5rem; } }

/* The same question for everyone on the class board: the staff beside the four choices on a wide screen, all read
   from the back of the room. The correct answer is marked in words and weight, never by color alone. */
.cp-board-question { display: grid; gap: .75rem 2.5rem; align-items: center; margin: .25rem 0 1rem; }
.cp-board-question h2 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2.25rem); }
.cp-board-question .cp-music { padding: 0; }
.cp-board-question .cp-music svg { width: 100%; max-width: 44rem; }
.cp-board-choices { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.cp-board-choice { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .75rem; padding: .6rem 1rem; border: 2px solid var(--border); border-radius: var(--radius-md); font-size: clamp(1.75rem, 3.2vw, 2.75rem); line-height: 1.2; overflow-wrap: anywhere; }
.cp-board-choice.is-correct { border-width: 4px; border-color: var(--foreground); font-weight: 700; }
.cp-board-correct { flex-basis: 100%; font-size: .45em; font-weight: 600; }
.cp-board-explanation, .cp-board-answered { font-size: clamp(1.125rem, 2vw, 1.5rem); margin: 0; }
@media (min-width: 900px) {
  .cp-board-question { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .cp-board-question h2, .cp-board-explanation { grid-column: 1 / -1; }
}

/* The answer a student chose. Once answers close the others dim (they're disabled); this one keeps full strength, a
   ring and the words "Your answer", so a tap that went through never looks like nothing happened. At the reveal the
   right answer comes back to full strength with a green ring, and a wrong pick's ring turns red. */
.cp-choices button.cp-picked, .cp-revealed button.cp-right { opacity: 1; }
.cp-choices button.cp-picked { box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--foreground); }
.cp-revealed button.cp-right { box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--success); }
.cp-revealed button.cp-picked:not(.cp-right) { box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--destructive); }
.cp-picked-tag { display: inline-block; padding: .1rem .5rem; border-radius: 999px; background: var(--foreground); color: var(--background); font-size: .8125rem; font-weight: 600; line-height: 1.3; white-space: nowrap; }
/* A written answer puts the words under its text; a picture's go above it, so the picture keeps its room. */
.cp-choices button.cp-picked:not(.cp-visual-choice) { flex-direction: column; align-items: flex-start; justify-content: center; gap: .35rem; }
/* A game that holds each note: the pad stays pressed while a note is held, by its border and fill as well as color. */
/* Solid, not the dashed "waits for a key" look a button.is-held gets elsewhere (css/style.css). */
.cp-tap-pad.is-held { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); border-style: solid; cursor: pointer; box-shadow: 0 0 0 4px var(--ring); transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { .cp-tap-pad.is-held { transform: none; } }

/* Musical terms and symbols (js/class-play-prompt-view.js, class play activities plan CA-1): a term or a meaning in
   large type, or a symbol drawn as practice draws it; answers that are symbols sit in picture tiles. On the board the
   symbol is at least 120px tall and a word reads from the back of the room; on a phone they share the stage. */
.cp-word { margin: 0; font-size: clamp(1.5rem, 5vw, 2.25rem); font-weight: 700; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.cp-symbol { display: flex; align-items: center; justify-content: center; min-height: 4rem; }
.cp-symbol svg.terms-prompt-symbol { width: auto; max-width: 100%; }
.cp-choice-symbol svg { display: block; height: 72px; width: auto; max-width: 100%; }
.cp-choice-symbol svg.term-symbol-dynamic { height: 44px; }
.cp-choice-symbol svg.term-symbol-glyph { height: 56px; }
.cp-symbol-choices .cp-visual-choice { align-items: center; }
.cp-symbol-choices .cp-choice-tags { align-self: flex-start; }
.cp-board-question .cp-word { font-size: clamp(2rem, 4.2vw, 3.5rem); text-align: left; }
.cp-board-question .cp-symbol { justify-content: flex-start; }
.cp-board-question .cp-music .cp-symbol svg.terms-prompt-symbol { width: auto; height: clamp(160px, 26vh, 240px); max-width: 100%; }
.cp-board-question .cp-music .cp-symbol svg.term-symbol-dynamic { height: clamp(120px, 17vh, 160px); }
.cp-board-question .cp-music .cp-symbol svg.term-symbol-glyph { height: clamp(130px, 19vh, 180px); }
.cp-board-question .cp-music .cp-symbol svg:is(.term-symbol-crescendo, .term-symbol-decrescendo) { height: clamp(120px, 15vh, 140px); }
.cp-board-phrases { align-items: start; }
.cp-board-phrases .cp-board-choices { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
.cp-board-phrases .cp-board-choice { font-size: clamp(1.25rem, 2.1vw, 1.875rem); padding: .45rem .9rem; }
@media (min-width: 900px) { .cp-board-question.cp-board-phrases { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.cp-board-choice.cp-board-symbol { align-items: center; }
.cp-board-choice .cp-choice-symbol { width: auto; }
.cp-board-choice .cp-choice-symbol svg { height: clamp(3.5rem, 9vh, 6rem); }
.cp-board-choice .cp-choice-symbol svg.term-symbol-dynamic { height: clamp(2.5rem, 6vh, 4rem); }
@media (max-width: 720px), (orientation: portrait) and (max-width: 1100px) {
  .cp-stage > .cp-music .cp-word { font-size: 1.5rem; }
  .cp-stage > .cp-music .cp-symbol { height: 100%; min-height: 4rem; }
  .cp-stage > .cp-music .cp-symbol svg.terms-prompt-symbol { height: 100%; max-height: 9rem; min-height: 4rem; }
  .cp-stage > .cp-music .cp-symbol svg.term-symbol-dynamic { max-height: 5rem; }
  .cp-stage .cp-choice-symbol svg { height: 100%; max-height: 4.5rem; min-height: 2rem; }
}

/* The terms setup (js/class-play-terms-view.js): question types and categories as rows of checkboxes, then each
   category's terms behind its own disclosure, with how many are chosen beside its name. */
.cp-term-group { border: 0; padding: 0; margin: .25rem 0 0; display: grid; gap: .5rem; min-width: 0; }
.cp-term-group[hidden] { display: none; }
.cp-term-group legend { font-weight: 600; padding: 0; margin-bottom: .25rem; }
.cp-term-group > p { margin: 0; }
.cp-term-row { display: flex; flex-wrap: wrap; column-gap: 1.25rem; }
.cp-form label.cp-term-check { gap: .5rem; white-space: nowrap; }
.cp-term-check input { width: 1.125rem; height: 1.125rem; min-height: 0; padding: 0; margin: 0; accent-color: var(--primary); flex: none; }
.cp-terms-summary { font-weight: 600; }
.cp-term-lists { display: grid; gap: 0; }
.class-play details.cp-term-category { margin: 0; border-bottom: 1px solid var(--border); }
.cp-term-category summary { font-weight: 600; }
.cp-term-count { margin-left: .75rem; font-weight: 400; font-size: .875rem; color: var(--muted-foreground); }
.cp-term-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0 1.25rem; padding-bottom: .5rem; }
.cp-form label.cp-term-check.cp-term { white-space: normal; }
.cp-term-mark { height: 28px; width: auto; max-width: 4.5rem; flex: none; }
.cp-term-mark.term-symbol-dynamic { height: 20px; }
.cp-term-left-out { margin: 0; }
.cp-terms-error { margin: .25rem 0 0; }
.cp-terms-error:empty { display: none; }

/* Key signatures (class play activities plan, CA-2): a signature on its own staff, as large as the room needs and no
   larger than the board's question allows; the signature a "which notes" question asked for shows at the reveal. */
.cp-music svg.cp-signature { display: block; width: 100%; max-width: 22rem; height: auto; margin: 0 auto; }
.cp-board-question .cp-music svg.cp-signature { width: auto; max-width: 100%; height: clamp(150px, 26vh, 220px); margin: 0; }
.cp-music svg.cp-reveal-signature { margin-top: .5rem; max-width: 16rem; }
.cp-board-question .cp-music svg.cp-reveal-signature { height: clamp(120px, 18vh, 170px); }
.cp-keysig-keys .cp-key-row { grid-template-columns: 7.5rem minmax(0, 1fr); }
@media (max-width: 560px) { .cp-keysig-keys .cp-key-row { grid-template-columns: 1fr; } }

/* Listening games (class play activities plan, CA-3): the lobby's Classroom sound card, the words where the clock
   will be while the example plays, and the director's listening controls. */
.cp-sound-check { display: grid; gap: .5rem; margin: 1rem 0; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); color: var(--foreground); }
.cp-sound-check h3, .cp-sound-check p { margin: 0; }
.cp-sound-check .cp-actions button { margin: 0; }
.cp-countdown .cp-listen-words { font-weight: 600; }
.cp-countdown-strip .cp-listen-words { font-size: 1rem; }
.cp-listen-note { margin: .5rem 0 0; font-weight: 600; }
.cp-listen-controls { margin: .5rem 0; }
.cp-quiet { font-weight: 600; }
.cp-tuning-notes { margin-top: .5rem; }
.cp-board-listen .cp-music:empty { display: none; }
.cp-board-listen .cp-board-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 900px) { .cp-board-question.cp-board-listen { grid-template-columns: minmax(0, 1fr); } }
.cp-listen-stage { margin: 0; text-align: center; font-size: clamp(1.25rem, 6vw, 1.75rem); font-weight: 600; }
.cp-music-listen { display: flex; align-items: center; justify-content: center; }
/* Interval identification (CA-4): two notes on a staff, large on the board and readable on a 320px phone; four heard
   answers two to a row. */
.cp-music svg.cp-interval { display: block; width: 100%; max-width: 22rem; height: auto; margin: 0 auto; }
.cp-board-question .cp-music svg.cp-interval { width: auto; max-width: 100%; height: clamp(150px, 26vh, 220px); margin: 0; }
.cp-board-listen .cp-board-choices:has(> :nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cp-interval-list .cp-key-row { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: .25rem 1rem; align-items: start; }
@media (max-width: 560px) { .cp-interval-list .cp-key-row { grid-template-columns: minmax(0, 1fr); } }
/* AP harmony (AP-1): a chord or a short progression on one staff, with three ledger lines' room, as the AP practice
   draws it; as large on the board as an interval. */
.cp-music svg.cp-chords { display: block; width: 100%; max-width: 24rem; height: auto; margin: 0 auto; }
.cp-board-question .cp-music svg.cp-chords { width: auto; max-width: 100%; height: clamp(160px, 30vh, 260px); margin: 0; }
@media (min-width: 900px) { .cp-board-question.cp-board-phrases.cp-board-chords { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.cp-board-long .cp-board-choice { font-size: clamp(1.125rem, 1.75vw, 1.625rem); }
/* Rhythm detective (CA-5): four written rhythms. On a phone they stack, one to a line, each measure on its own line;
   on the board two by two, a two-measure answer's measures side by side. A dense measure comes in slices
   (rhythmCuts): on a phone each slice is drawn at a plain measure's size (--slice is its width in plain measures),
   a line each; on the board the slices sit side by side as one measure. */
.cp-rhythm-choices { grid-template-columns: minmax(0, 1fr); }
.cp-choice-rhythm { display: flex; flex-wrap: wrap; gap: 0 .5rem; justify-content: center; }
.cp-rhythm-measure { display: flex; flex-wrap: wrap; flex: 1 1 14rem; width: 100%; max-width: 30rem; }
.cp-rhythm-measure .rhythm-staff { display: block; width: calc(100% * min(1, var(--slice, 1))); height: auto; color: var(--foreground); }
.cp-board-choice .cp-rhythm-measure { flex-wrap: nowrap; }
.cp-board-choice .cp-rhythm-measure .rhythm-staff { width: auto; min-width: 0; flex: var(--slice, 1) 1 0; }
/* On a phone, a game fills one screen so nothing needs scrolling to answer. Four rhythms of two measures, or dense
   ones in slices, don't fit at a readable size, and being able to read them wins: here each answer takes the lines
   it needs and the screen scrolls when they don't all fit. A plain measure each still fits on one screen. */
@media (max-width: 720px), (orientation: portrait) and (max-width: 1100px) {
  .cp-screen:has(.cp-rhythm-choices) { height: auto; min-height: 100vh; min-height: 100dvh; }
  .cp-screen:has(.cp-rhythm-choices) > .cp-stage { flex: 1 0 auto; }
  .cp-stage > .cp-rhythm-choices .cp-choice-picture { flex: none; }
}
.cp-stage > .cp-choices.cp-rhythm-choices { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; flex: 1 1 auto; }
/* On a computer (owner request, November 12, 2026), a student's question fills the screen as it does on a phone, so
   all four answers show without scrolling: the top bar, back link, heading and connection line step aside while the
   question is up (the connection line is still read out), and the rhythms sit two by two, each measure on one line,
   a dense one's slices side by side (owner request, November 19, 2026). They're drawn as large as their cell lets
   them, at one scale for all four so a note is as large in every answer: the widest measure of the four and how many
   measures (--rhythm-width, in staff units; --rhythm-lines; a staff is 145 units tall, and .995 keeps a row that just
   fits from wrapping). js/class-play-prompt-view.js (fitRhythmChoices, rhythmScale) works out the size from each
   cell's measured size and sets it on the cell, so a browser that gets container units wrong (some school Chromebooks
   used the whole window, November 13, 2026) still draws them to fit; only there, when one line would draw a staff
   too small to read (LEGIBLE_STAFF), does a dense measure's slices take a line each (--rhythm-slice,
   --rhythm-slices). The one-line sum here is for a browser without ResizeObserver. A cell's size never depends on
   what's drawn in it (contain: size, for a browser without container queries), and a staff is never wider than its
   cell. A window under 500px tall keeps the scrolling page. js/class-play-prompt-view.js uses the same query. */
@media (width > 720px) and (orientation: landscape) and (height >= 500px), (width > 1100px) and (height >= 500px) {
  html.cp-playing:has(.cp-stage > .cp-rhythm-choices) :is(.topbar, .class-play > .back-link, .class-play > h1) { display: none; }
  html.cp-playing:has(.cp-stage > .cp-rhythm-choices) .class-play > [role=status] { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  html.cp-playing:has(.cp-stage > .cp-rhythm-choices) .app { padding-top: 0; }
  html.cp-playing .class-play:has(.cp-stage > .cp-rhythm-choices) { max-width: 1200px; }
  html.cp-playing .class-play > .cp-content:has(.cp-stage > .cp-rhythm-choices) { margin-top: 0; }
  .cp-screen:has(> .cp-stage > .cp-rhythm-choices) { display: flex; flex-direction: column; box-sizing: border-box; height: 100vh; height: 100dvh; padding-bottom: .5rem; }
  .cp-screen:has(> .cp-stage > .cp-rhythm-choices) > * { flex: none; }
  .cp-screen > .cp-stage:has(> .cp-rhythm-choices) { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
  .cp-stage:has(> .cp-rhythm-choices) > h2 { margin: 0 0 .25rem; }
  .cp-stage:has(> .cp-rhythm-choices) > .cp-music { flex: none; min-height: 2.5rem; padding: .25rem 0; overflow: visible; }
  .cp-stage:has(> .cp-rhythm-choices) .cp-listen-stage { font-size: 1.375rem; }
  .cp-stage > .cp-choices.cp-rhythm-choices { flex: 1 1 0; min-height: 0; margin: .5rem 0; gap: .5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .cp-stage > .cp-rhythm-choices button.cp-visual-choice { min-height: 0; padding: .5rem .75rem; gap: .25rem; overflow: hidden; }
  .cp-stage > .cp-rhythm-choices .cp-choice-rhythm { flex: 1 1 0; min-height: 0; contain: size; container-type: size; flex-direction: column; flex-wrap: nowrap; align-items: center; justify-content: center; gap: .25rem;
    --rhythm-scale: min(100cqw / var(--rhythm-width, 650) * .995, (100cqh - (var(--rhythm-lines, 1) - 1) * .25rem) / (var(--rhythm-lines, 1) * 145)); }
  .cp-stage > .cp-rhythm-choices .cp-rhythm-measure { flex: none; width: auto; max-width: 100%; }
  .cp-stage > .cp-rhythm-choices .cp-rhythm-measure .rhythm-staff { flex: none; width: calc(var(--slice, 1) * 650 * var(--rhythm-scale)); max-width: 100%; height: auto; }
}
.cp-board-choice.cp-board-symbol .cp-choice-rhythm { flex: 1 1 auto; }
.cp-board-question:has(.cp-choice-rhythm) .cp-board-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .cp-board-question:has(.cp-choice-rhythm) { grid-template-columns: minmax(0, 1fr); } }
/* Every other game's question fills a computer's screen too (Class Play lobby plan, LB-18 and LB-D19; owner request,
   November 14, 2026, after a clarinet's fingering answers ran past the bottom of a 14-inch MacBook Pro): the top bar,
   back link, heading and connection line step aside as they do for Rhythm detective, and the stage becomes two
   columns, the prompt and music on the left and the four answers with the line under them on the right (the LB
   mockups' Chromebook question, Q1 to Q4). Written answers are large tiles at the top of their column, level with the
   music; pictures (fingering charts, symbols) get the wider column and share all of it, each as large as its cell.
   Rhythm counting keeps one column: the measure, then its four rows of counts at full width. The music is drawn as
   large as its column allows, up to a cap, so a staff isn't blown up past reading size. The explanation, team line
   and class goal follow the screen, as on a phone. The same query as Rhythm detective's, so a computer's screen is
   one rule; js/class-play-prompt-view.js (COMPUTER_FILLS_SCREEN) uses it too. */
@media (width > 720px) and (orientation: landscape) and (height >= 500px), (width > 1100px) and (height >= 500px) {
  html.cp-playing:has(.cp-stage > .cp-choices:not(.cp-rhythm-choices)) :is(.topbar, .class-play > .back-link, .class-play > h1) { display: none; }
  html.cp-playing:has(.cp-stage > .cp-choices:not(.cp-rhythm-choices)) .class-play > [role=status] { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  html.cp-playing:has(.cp-stage > .cp-choices:not(.cp-rhythm-choices)) .app { padding-top: 0; }
  html.cp-playing .class-play:has(.cp-stage > .cp-choices:not(.cp-rhythm-choices)) { max-width: 1200px; }
  html.cp-playing .class-play > .cp-content:has(.cp-stage > .cp-choices:not(.cp-rhythm-choices)) { margin-top: 0; }
  .cp-screen:has(> .cp-stage > .cp-choices:not(.cp-rhythm-choices)) { display: flex; flex-direction: column; box-sizing: border-box; height: 100vh; height: 100dvh; padding-bottom: 1rem; }
  .cp-screen:has(> .cp-stage > .cp-choices:not(.cp-rhythm-choices)) > * { flex: none; }
  .cp-screen > .cp-stage:has(> .cp-choices:not(.cp-rhythm-choices)) {
    flex: 1 1 0; min-height: 0; display: grid; column-gap: clamp(1.25rem, 2.5vw, 2rem);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "prompt ." "music answers" "music note";
  }
  .cp-stage:has(> .cp-choices:not(.cp-rhythm-choices)) > h2 { grid-area: prompt; margin: .25rem 0 .5rem; font-size: clamp(1.25rem, 2vw, 1.625rem); line-height: 1.3; }
  .cp-stage > .cp-music:has(~ .cp-choices:not(.cp-rhythm-choices)) {
    grid-area: music; min-height: 0; padding: 0 0 .5rem; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .5rem;
  }
  .cp-stage > .cp-music:has(~ .cp-choices:not(.cp-rhythm-choices)) > svg { flex: 0 1 auto; width: 100%; max-width: 36rem; height: auto; min-height: 0; }
  .cp-stage > .cp-music:has(~ .cp-choices:not(.cp-rhythm-choices)) > :is(.cp-symbol, .cp-word, .cp-listen-stage) { flex: 0 1 auto; min-height: 0; max-width: 100%; }
  .cp-stage > .cp-music:has(~ .cp-choices:not(.cp-rhythm-choices)) .cp-symbol svg.terms-prompt-symbol { width: auto; max-width: 100%; height: clamp(8rem, 24vh, 12rem); }
  .cp-stage > .cp-music:has(~ .cp-choices:not(.cp-rhythm-choices)) .cp-symbol svg.term-symbol-dynamic { height: clamp(6rem, 16vh, 9rem); }
  .cp-stage > .cp-music:has(~ .cp-choices:not(.cp-rhythm-choices)) .cp-symbol svg.term-symbol-glyph { height: clamp(6.5rem, 18vh, 10rem); }
  .cp-stage > .cp-music:has(~ .cp-choices:not(.cp-rhythm-choices)) .cp-symbol svg:is(.term-symbol-crescendo, .term-symbol-decrescendo) { height: clamp(6rem, 14vh, 8rem); }
  .cp-stage > .cp-choices:not(.cp-rhythm-choices) { grid-area: answers; align-self: start; margin: 0; gap: .625rem; }
  .cp-stage > .cp-choices:not(.cp-rhythm-choices, .cp-visual-choices, .cp-count-choices) button { min-height: 6.5rem; padding: .75rem 1rem; font-size: clamp(1.25rem, 2vw, 1.625rem); line-height: 1.25; }
  .cp-stage:has(> .cp-choices:not(.cp-rhythm-choices)) > .cp-answer-note { grid-area: note; align-self: start; margin: .75rem 0 0; }
  /* Pictures: the answers take the right column from top to bottom, the line under them at its foot. */
  .cp-screen > .cp-stage:has(> .cp-visual-choices:not(.cp-rhythm-choices)) {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "prompt answers" "music answers" "music note";
  }
  .cp-stage > .cp-choices.cp-visual-choices:not(.cp-rhythm-choices) { align-self: stretch; min-height: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .cp-stage > .cp-visual-choices:not(.cp-rhythm-choices) button.cp-visual-choice { min-height: 0; padding: .5rem; gap: .25rem; overflow: hidden; }
  .cp-stage > .cp-visual-choices:not(.cp-rhythm-choices) .cp-choice-picture { flex: 1 1 0; min-height: 0; }
  .cp-stage > .cp-visual-choices:not(.cp-rhythm-choices) .cp-choice-picture .diagram { width: 100%; height: 100%; max-height: none; }
  .cp-stage:has(> .cp-visual-choices:not(.cp-rhythm-choices)) > .cp-answer-note { margin-top: .5rem; }
  /* Wide charts (flute, keyboard, slide) are one to a row, as on a narrow phone, so each is drawn across the column. */
  .cp-stage > .cp-choices.cp-visual-choices:has(:is(.diagram-flute, .diagram-keyboard, .diagram-slide)) { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: .5rem; }
  .cp-stage > .cp-visual-choices:has(:is(.diagram-flute, .diagram-keyboard, .diagram-slide)) button.cp-visual-choice { padding: .375rem .5rem; }
  /* A symbol answer is drawn as large as its tile allows, up to about twice its usual size. */
  .cp-stage > .cp-symbol-choices .cp-choice-symbol svg { height: 100%; max-height: 9rem; min-height: 2.5rem; }
  /* Rhythm counting: the measure across the top and the four rows of counts under it, at full width so every beat's
     column has room; the measure gives up height before the answers do. */
  .cp-screen > .cp-stage:has(> .cp-choices.cp-count-choices) {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, max-content) auto auto; align-content: start;
    grid-template-areas: "prompt" "music" "answers" "note";
  }
  .cp-stage > .cp-music:has(~ .cp-choices.cp-count-choices) { padding: .25rem 0 .75rem; }
  .cp-stage > .cp-music:has(~ .cp-choices.cp-count-choices) > svg { width: 100%; max-width: none; min-width: 0; max-height: 11rem; }
  .cp-stage > .cp-choices.cp-count-dense .cp-count-word { font-size: 1.125rem; }
}

/* Joining (Class Play join lock plan, JL-1). The director's countdown to lock joining sits under the PIN at board size;
   once locked, the PIN stays, the QR code dims and a padlock says so in words. A student's join form and lobby show the
   same countdown as one line with a slim bar. A latecomer's locked screen leads with a padlock and a heading. */
.cp-join-lock { display: grid; gap: .5rem; margin: 1rem 0 1.5rem; }
.cp-join-lock > p { margin: 0; }
.cp-lock-times { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.cp-lock-times button { margin: 0; }
.cp-lock-times button[aria-pressed="true"] { border-color: var(--foreground); font-weight: 600; }
.cp-lock-label { font-weight: 600; margin-right: .25rem; }
.cp-join-countdown.cp-countdown-board { margin: 0; }
.cp-join-countdown .cp-join-label { font-weight: 600; }
.cp-countdown-board.cp-join-countdown .cp-join-label { font-size: clamp(1.25rem, 2.6vw, 2.25rem); }
.cp-countdown-board.cp-join-countdown .cp-countdown-number { font-size: clamp(3rem, 8vw, 6.5rem); }
.cp-join-line { margin: .75rem 0; }
.cp-join-line .cp-countdown-number { font-size: 1.25rem; }
.cp-join-count { font-size: 1.125rem; font-weight: 600; }
.cp-lock-icon { width: 1.2em; height: 1.2em; flex: none; }
.cp-join-locked, .cp-locked-heading { display: flex; align-items: center; gap: .5rem; }
.cp-join-locked { font-size: clamp(1.25rem, 2.6vw, 2.25rem); font-weight: 600; }
.cp-qr.is-locked { opacity: .3; }
.cp-join-lock > button { justify-self: start; margin: 0; }
/* Saved Class Play games (template library plan, TL-2): the newest few on Host a class game, each one click from its
   lobby, a saved game's title on the lobby, and what to do when one can't open. */
.cp-saved-games { max-width: 780px; margin: 1rem 0 0; }
.cp-saved-games h2 { margin: 0; }
.cp-saved-games p { margin: 0; }
.cp-saved-games[hidden] { display: none; }
.cp-saved-list { list-style: none; margin: 0; padding: 0; }
.cp-saved-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; padding: .6rem 0; border-top: 1px solid var(--border); }
.cp-saved-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1 1 16rem; overflow-wrap: anywhere; }
.cp-saved-item .btn { min-height: 44px; display: inline-flex; align-items: center; }
.cp-saved-title { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 600; margin: .25rem 0; overflow-wrap: anywhere; }
.cp-saved-problem { max-width: 780px; margin: 1rem 0; }
.cp-saved-problem h2, .cp-saved-problem p { margin: 0; }
.cp-saved-problem .btn { min-height: 44px; display: inline-flex; align-items: center; }

/* Changing a player's name (Class Play nicknames plan, NN-1): the panel opens under the director's row, and the
   student's notice that the director changed it. */
.cp-players li > .cp-name-panel { flex: 1 0 100%; display: grid; gap: .25rem; margin: 0; padding: .5rem 0 .25rem 1rem; border-left: 2px solid var(--border); }
.cp-name-panel .cp-actions button, .cp-name-panel > button { margin: 0; justify-self: start; }
.cp-name-panel .cp-name-problem { margin: 0; }
.class-play > [role=status] .cp-undo { margin: 0 0 0 .5rem; min-height: 44px; }
.cp-name-note { font-weight: 600; margin: .5rem 0; }
.cp-screen > .cp-name-note { flex: none; margin: .25rem 0; }
.cp-name-panel .cp-rename { max-width: 34rem; }

/* A student asked for a new nickname (NN-2): the form in the lobby, or a compact panel above the question. */
.cp-my-name { max-width: 34rem; }
.cp-my-name h2, .cp-my-name h3, .cp-my-name p { margin: 0; }
.cp-my-name button { justify-self: start; }
.cp-my-name-panel { display: grid; gap: .25rem; margin: .25rem 0 .5rem; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); color: var(--card-foreground); }
.cp-my-name-panel h3 { font-size: 1rem; }
.cp-screen > .cp-my-name-panel { flex: none; }
.cp-players li.cp-choosing { font-style: italic; }
.cp-players li.cp-choosing button { font-style: normal; }
.cp-choosing-note { font-weight: 600; }

/* Random names for everyone (NN-3): the join form's line in place of the nickname box, and the director's
   confirmation in place. */
.cp-random-name-note { font-weight: 600; margin: 0; }
.cp-random-all { display: grid; gap: .25rem; margin: .5rem 0 1rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); color: var(--card-foreground); max-width: 40rem; }
.cp-random-all p { margin: 0; }

/* Count race (count race plan, CR-1): the measures with a space under each note and rest. On a phone each slice of a
   dense measure takes a line at a plain measure's size (js/class-play-count-entry.js); a wider screen sets the slices
   side by side as one measure. Each space sits under its note and is no wider than the gap to its neighbour, so
   counts never touch. A rest's space is slashed whether or not it has a count, since the slash goes on by itself. */
.cp-count { display: grid; gap: .5rem; min-width: 0; }
.cp-count-music { display: grid; gap: .5rem; min-width: 0; }
.cp-count-line { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 0; min-width: 0; max-width: 56rem; margin: 0 auto; width: 100%; }
.cp-count-slice { width: calc(100% * var(--share, 1)); min-width: 0; }
.cp-count-slice svg { display: block; width: 100%; height: auto; color: var(--foreground); }
@media (min-width: 721px) {
  .cp-count-line { flex-wrap: nowrap; }
  .cp-count-slice { width: auto; flex: var(--slice, 1) 1 0; }
}
.cp-count-spaces { position: relative; height: 2.75rem; container-type: inline-size; margin-top: -.5rem; }
.cp-count-spaces.is-empty { height: .5rem; }
.cp-count-space { position: absolute; top: 0; left: var(--x); transform: translateX(-50%); width: min(3rem, calc(var(--gap, 1) * 100cqw - 4px)); height: 2.5rem; display: grid; place-items: center; }
/* On a touch screen each space is a 44 px target at least (the slices are cut so they're that wide on a phone). */
@media (pointer: coarse) {
  .cp-count-entry .cp-count-spaces { height: 3.25rem; }
  .cp-count-entry .cp-count-space { height: 2.75rem; }
}
.class-play .cp-count-input { box-sizing: border-box; width: 100%; height: 100%; min-height: 0; padding: 0; margin: 0; text-align: center; font-family: var(--font-numeric); font-weight: 600; font-size: min(1.25rem, calc(var(--gap, 1) * 42cqw)); line-height: 1; color: var(--foreground); background: var(--card); border: 1px solid var(--input-border); border-radius: var(--radius-sm); }
.cp-count-space.is-selected .cp-count-input { outline: 3px solid var(--ring); outline-offset: 1px; border-color: var(--ring); }
.cp-count-space.is-rest::after { content: ''; position: absolute; left: 50%; top: 50%; width: 70%; height: 2px; background: currentColor; transform: translate(-50%, -50%) rotate(-55deg); pointer-events: none; color: var(--foreground); }
.cp-count-entry.is-closed .cp-count-input { background: var(--muted); }
/* Counts to read: the board at the reveal, and a student's own counts marked ✓ or ×, with the right count under a wrong
   one, in words for screen readers and never by color alone. */
.cp-count-read .cp-count-spaces { height: 2.75rem; }
/* A student's own counts: the count, its mark, and under a wrong one the right count, three lines. */
.cp-count-read.has-marks .cp-count-spaces { height: 5.25rem; }
.cp-count-shown { height: auto; grid-auto-flow: row; gap: 0; font-family: var(--font-numeric); font-weight: 600; font-size: min(1.25rem, calc(var(--gap, 1) * 42cqw)); line-height: 1.2; }
.cp-count-shown.is-rest::after { top: .7em; }
.cp-count-shown .cp-count-value { padding: .25rem 0 .1rem; }
.cp-count-mark { font-size: .8em; font-weight: 700; }
.cp-count-shown.is-right .cp-count-mark { color: var(--success); }
.cp-count-shown.is-wrong .cp-count-value { text-decoration: line-through; text-decoration-thickness: 2px; }
.cp-count-shown.is-wrong .cp-count-mark { color: var(--destructive); }
.cp-count-fix { margin-top: .15rem; padding: .05rem .3rem; font-weight: 700; color: var(--background); background: var(--foreground); border-radius: var(--radius-sm); }
.cp-count-key .cp-count-shown { color: var(--foreground); }
/* The tiles: beat numbers on one row, syllables on the next, each at least 44 px. Back and Clear beside them; Check is
   the one filled button. */
.cp-count-tiles { display: grid; gap: .375rem; }
.cp-count-tile-row { display: flex; flex-wrap: wrap; gap: .375rem; }
.class-play .cp-count-tile { margin: 0; min-width: 3rem; min-height: 3rem; padding: .25rem .75rem; font-family: var(--font-numeric); font-weight: 600; font-size: 1.25rem; line-height: 1; justify-content: center; }
.cp-count-edits, .cp-count-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.class-play .cp-count-edits button, .class-play .cp-count-actions button { margin: 0; }
.class-play .cp-count-check { min-width: 9rem; }
.cp-count-left { margin: 0; }
.cp-count-side { display: grid; gap: .5rem; align-content: start; }
@media (min-width: 721px) {
  .cp-count-entry { grid-template-columns: auto minmax(0, 1fr); column-gap: 1.5rem; }
  .cp-count-entry > .cp-count-music { grid-column: 1 / -1; }
  .cp-count-entry > .cp-count-side { align-content: end; }
}
.cp-count + .cp-answer-note, .cp-count + .cp-explanation { margin-top: .5rem; }
/* On a phone the question runs on past one screen when it must (two measures in slices), rather than squeezing. */
@media (max-width: 720px), (orientation: portrait) and (max-width: 1100px) {
  .cp-screen:has(.cp-count) { height: auto; }
  .cp-screen > .cp-stage:has(> .cp-count) { flex: none; }
  .cp-stage > .cp-count { flex: none; margin: .25rem 0; }
  .class-play .cp-count-check { flex: 1 1 100%; }
  .cp-count-tile-row { gap: .3rem; }
  .class-play .cp-count-tile { flex: 1 0 3rem; }
}
/* On the class board: the measures large, the counts under them at the reveal, and the fastest right counts. */
.cp-board-count { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .cp-board-question.cp-board-count { grid-template-columns: minmax(0, 1fr); } }
.cp-board-count .cp-count-line { max-width: 60rem; }
.cp-board-count .cp-count-read .cp-count-spaces { height: 3.5rem; }
.cp-board-count .cp-count-shown { font-size: min(2.25rem, calc(var(--gap, 1) * 46cqw)); }
.cp-board-fastest { font-size: clamp(1.25rem, 2.2vw, 1.75rem); font-weight: 700; margin: 0; }
/* Keeping trying (CR-2): the first three to finish, on the board as they finish, and the count the class missed most. */
.cp-board-finishers { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-size: clamp(1.25rem, 2.2vw, 1.75rem); font-weight: 600; }
.cp-board-finishers li { padding: .25rem .75rem; border: 2px solid var(--border); border-radius: var(--radius-md); }
.cp-board-finishers li:first-child { border-color: var(--foreground); font-weight: 700; }
.cp-board-missed { font-size: clamp(1.125rem, 2vw, 1.5rem); margin: 0; }
@media (min-width: 900px) {
  .cp-board-question.cp-board-count.has-finishers { grid-template-columns: minmax(0, 3fr) minmax(12rem, 1fr); }
  .cp-board-count.has-finishers > :not(.cp-count, .cp-board-finishers) { grid-column: 1 / -1; }
  .cp-board-count.has-finishers .cp-board-finishers { flex-direction: column; align-self: center; }
}

/* Rhythm counting's answers (owner request, November 14, 2026): one answer to a row, its counts in a column for each
   beat, every row's columns the same width, so the four answers line up under one another and a difference shows
   where it is. A line between beats, as the beams group the notes on the staff; a beat with nothing said stays empty. */
.cp-choices.cp-count-choices, .cp-stage > .cp-choices.cp-count-choices { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
.cp-choices button.cp-count-choice { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: .35rem; padding: .65rem .75rem; }
.cp-stage > .cp-choices.cp-count-choices button { min-height: 3.25rem; padding: .5rem .75rem; }
.cp-counts { display: block; align-self: stretch; }
.cp-count-beats { display: grid; grid-template-columns: repeat(var(--beats, 4), minmax(0, 1fr)); }
.cp-count-beat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .45em; min-height: 1.4em; padding: 0 .5em; border-inline-start: 2px solid color-mix(in srgb, currentColor 40%, transparent); }
.cp-count-beat:first-child { border-inline-start: 0; padding-inline-start: 0; }
.cp-count-word { font-size: 1.25rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.cp-answer-review .cp-counts { margin: .25rem 0; }
@media (max-width: 400px) {
  .cp-count-beat { gap: 0 .3em; padding: 0 .4em; }
  .cp-count-word { font-size: 1.0625rem; }
}
/* A beat of five or six counts (sixteenth triplets, 12/8 sixteenths) is set smaller and closer, so all four still fit. */
.cp-count-dense .cp-count-beat { gap: 0 .25em; padding: 0 .3em; }
.cp-count-dense .cp-count-word { font-size: .9375rem; line-height: 1.25; }
.cp-stage > .cp-choices.cp-count-dense button { padding: .375rem .5rem; }
/* A phone on its side has room across but not down: two answers to a row, each still a column per beat. */
@media (orientation: landscape) and (max-height: 500px) {
  .cp-stage > .cp-choices.cp-count-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-stage > .cp-choices.cp-count-choices button { min-height: 2.75rem; padding: .375rem .625rem; }
  .cp-stage .cp-count-word { font-size: 1.0625rem; line-height: 1.3; }
}

/* Get ready (owner request, November 14, 2026): after Start, a large number counts down to the first question, on the
   class board (read from the back of the room) and on each student's screen (the whole screen on a phone). Each new
   number arrives with a small pop unless motion is reduced. */
.cp-ready { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; text-align: center; padding: 1.5rem 0; }
.cp-ready h2 { margin: 0; }
.cp-ready-number { display: grid; place-items: center; margin: 0; border-radius: 50%; background: var(--primary); color: var(--primary-foreground); font-family: var(--font-numeric); font-variant-numeric: tabular-nums; font-weight: 600; line-height: 1; }
.cp-ready-note { margin: 0; font-weight: 600; }
.cp-ready-board { min-height: 50vh; }
.cp-ready-board h2 { font-size: clamp(2rem, 5vw, 4rem); }
.cp-ready-board .cp-ready-number { width: clamp(9rem, 22vw, 16rem); height: clamp(9rem, 22vw, 16rem); font-size: clamp(5rem, 13vw, 10rem); }
.cp-ready-board .cp-ready-note { font-size: clamp(1.25rem, 2.6vw, 2.25rem); }
.cp-ready-device { min-height: 70vh; min-height: 70dvh; }
.cp-ready-device h2 { font-size: clamp(1.75rem, 8vw, 2.5rem); }
.cp-ready-device .cp-ready-number { width: clamp(7rem, 40vw, 10rem); height: clamp(7rem, 40vw, 10rem); font-size: clamp(4rem, 24vw, 6.5rem); }
.cp-ready-device .cp-ready-note { font-size: 1.125rem; }
@media (prefers-reduced-motion: no-preference) {
  .cp-ready-number { animation: cp-ready-pop .45s ease-out both; }
}
@keyframes cp-ready-pop { from { opacity: .4; transform: scale(1.18); } to { opacity: 1; transform: none; } }
