.room{display:grid;grid-template-columns:minmax(0,2fr) minmax(260px,1fr);gap:8px;align-items:start}
@media(max-width:900px){.room{grid-template-columns:1fr}}
.modes{margin:0 0 8px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.modes .tabs button{font-size:var(--t-body)}
/* the classroom display: always 16:9 */
.dwrap{width:min(100%,calc(var(--maxh,56vh) * 16 / 9));margin:0 auto}
.display{position:relative;border-radius:var(--r-xl);overflow:hidden;background:#0f1a33;color:#fff;box-shadow:var(--shadow);aspect-ratio:16/9;container-type:size;display:flex;flex-direction:column;padding:2cqw 2.4cqw;gap:1.4cqw}
.cueband{display:flex;align-items:center;gap:1.6cqw;padding:.8cqw 2cqw;border-radius:1.4cqw;background:rgba(15,26,51,.85);border:1px solid rgba(255,255,255,.2);flex:none}
.cueband .dot{width:1.4cqw;height:1.4cqw;border-radius:50%;background:#7cd4f7;flex:none}
.cueband p{margin:0;flex:1;min-width:0;max-width:none;font-size:3.2cqw;font-weight:700;line-height:1.15}
.cueband .stagetag{flex:none;padding:.4cqw 1.6cqw;border-radius:999px;background:var(--gold);color:var(--gold-ink);font-size:1.7cqw;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.scene{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:space-around;gap:1.2cqw}
.big{margin:0;max-width:none;font-size:5cqw;font-weight:700;line-height:1.05;text-align:center}
.big.huge{font-size:8cqw}
.notes{display:flex;align-items:center;gap:3cqw}
.nd{width:8cqw;height:8cqw;border-radius:50%;border:.5cqw solid #7cd4f7;color:#7cd4f7;display:grid;place-items:center;font-size:4.2cqw;font-weight:700;background:transparent}
.nd[data-lit="1"]{background:var(--gold);border-color:#fff;color:var(--gold-ink);box-shadow:0 0 0 1cqw rgba(255,214,74,.35)}
.notes .arrow{font-size:4cqw;color:#7cd4f7}
.notes.seven{gap:1.4cqw}.notes.seven .nd{width:7cqw;height:7cqw;font-size:3.4cqw}.notes.seven .gap{width:2.4cqw}
.cards{display:flex;gap:1.6cqw;width:100%}
.mcard{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.6cqw;background:#fff;color:var(--plum);border:.5cqw solid #fff;border-radius:2cqw;padding:1cqw .6cqw;min-width:0}
.mcard svg{width:auto;height:var(--ico,11cqw)}
.mcard b{font-size:3.1cqw;line-height:1.05;color:var(--ink);text-align:center}
.mcard.on{border-color:var(--gold);box-shadow:0 0 0 .8cqw var(--gold);transform:scale(1.03)}
.mcard.dim{opacity:.5}
.scene.small .mcard{--ico:6cqw;flex-direction:row;gap:1.2cqw;padding:.4cqw 1cqw;min-height:8cqw;box-sizing:border-box}.scene.small .mcard b{font-size:2.8cqw;text-align:left}
.xylo{width:100%;flex:none}
.xylo svg{display:block;width:100%;height:auto;max-height:20cqw}
.xylo svg{overflow:visible}
.xylo .bar rect{fill:var(--nc,#e2b66d);stroke:rgba(30,22,37,.55);stroke-width:3}
.xylo .bar text{font-family:var(--font);font-weight:700;font-size:26px;fill:var(--nt,#3b2a0c);text-anchor:middle}
.xylo .bar text.sol{font-size:24px}
.xylo .bar[data-do="1"] rect{stroke:#ffd54a;stroke-width:7}
.xylo .bar[data-ans="1"] rect{stroke:#fff;stroke-width:6}
/* the lit bar keeps its note colour: a bright gold ring sits outside it, a dark gap between, plus a glow */
.xylo .bar .ring{fill:none;stroke:none;pointer-events:none}
.xylo .bar[data-lit="1"] .ring{stroke:#ffd54a;stroke-width:5;filter:drop-shadow(0 0 7px rgba(255,213,74,.9))}
.xylo .rail{stroke:#8a6a30;stroke-width:8;stroke-linecap:round}
.xylo .tag{font-family:var(--font);font-weight:700;font-size:34px;fill:#ffd54a;text-anchor:middle}
.xylo .tag.ans{fill:#7cd4f7}
.titlebanner{margin:0;max-width:none;font-size:4.6cqw;font-weight:700;color:var(--gold);text-align:center;line-height:1.05}
.lyrics{display:grid;grid-template-columns:repeat(2,1fr);gap:.4cqw 3cqw;width:100%;padding:0 3cqw;font-size:2.5cqw;line-height:1.25;color:#dfe8ff}
.lyrics span{white-space:nowrap}
.lyrics .s{padding:0 .2cqw;border-radius:.5cqw;font-style:normal}
.lyrics .s[data-lit="1"]{background:var(--gold);color:var(--gold-ink)}
.rules{margin:0;padding:0;list-style:none;display:grid;gap:.8cqw;font-size:2.8cqw;font-weight:700;width:100%;counter-reset:r}
.rules li{counter-increment:r;display:flex;gap:1.4cqw;align-items:center;background:rgba(255,255,255,.1);border-radius:1.4cqw;padding:.7cqw 1.6cqw}
.rules li::before{content:counter(r);flex:none;width:3.6cqw;height:3.6cqw;border-radius:50%;background:var(--gold);color:var(--gold-ink);display:grid;place-items:center;font-size:2.4cqw}
.chips{display:flex;gap:1.6cqw}
.chip{width:6cqw;height:6cqw;border-radius:50%;border:.4cqw solid #7cd4f7;display:grid;place-items:center;font-size:3cqw;font-weight:700;color:#7cd4f7}
.chip.on{background:var(--gold);color:var(--gold-ink);border-color:#fff}
.chip.done{background:#7cd4f7;color:#0f1a33}
/* controls */
.transport{display:flex;gap:8px;align-items:center;margin:8px 0 0;flex-wrap:wrap;justify-content:center}
.transport .btn{min-height:64px;min-width:170px;font-size:var(--t-title);padding:0 var(--s5)}
.transport .btn.play{background:var(--gold);border-color:var(--gold);color:var(--gold-ink)}
.transport .btn[hidden]{display:none}
.transport .seg{margin-right:8px}
.panel .card{margin:0 0 8px}
.panel h3{margin:0 0 4px}
.panel .say{font-size:var(--t-say);font-weight:700;line-height:1.2;margin:0;color:var(--ink)}
.panel .step{margin:0 0 8px;color:var(--ink-soft);font-weight:700}
.msg{min-height:1.5em;margin:4px 0 0}
.cvbar{display:none}
body.classview .wrap>header,body.classview .panel,body.classview footer{display:none}
body.classview .wrap{padding:4px 0;max-width:none} /* Class view: the display can be wider than the 1200px page column, so the column goes full width and the display centres in it */
body.classview .room{grid-template-columns:1fr}
body.classview .dwrap{width:min(calc(100vw - 32px),calc((100vh - 140px) * 16 / 9))}
body.classview #pcLink,body.classview .modes{display:none}
body.classview .cvbar{display:flex;align-items:center;gap:12px;margin:0 0 4px;justify-content:space-between}
body.classview .cvbar{min-height:44px}
body.classview .cvbar .cvtitle{font-size:20px;font-weight:700;color:var(--plum);flex:1;min-width:0}
body.classview .cvbar #classOff{min-width:44px;min-height:44px;font-size:18px}
.cvopts{display:inline-flex;gap:14px;align-items:center}
.cvopts .opt{display:inline-flex;align-items:center;gap:6px}
.cvopts .opt b{font-size:14px;color:var(--ink)}
.cvopts .seg{display:inline-flex}
.cvopts .seg button{min-height:40px;min-width:44px;font-size:14px;padding:0 10px}
/* Tune Trail: the path of bars, one stone per note, in order */
.trail{position:relative;width:63.8cqw;height:14cqw;flex:none}
.trail .line{position:absolute;left:0;top:0;width:63.8cqw;height:14cqw;overflow:visible;pointer-events:none}
.tl{stroke:rgba(255,255,255,.7);stroke-width:5px;stroke-linecap:round;vector-effect:non-scaling-stroke}
.tl:not([data-shown]){display:none}
/* stones sit at pitch height on one ladder; a hidden note is a tall "?" slot that gives no height */
.stone{position:absolute;box-sizing:border-box;width:7cqw;height:7cqw;border-radius:50%;border:.5cqw solid #fff;background:#fff;color:var(--plum);display:grid;place-items:center;align-content:center;font-size:3.6cqw;font-weight:700;line-height:1}
.stone b,.stone small{display:block;line-height:1.05;font-weight:700}
.stone b{font-size:3cqw;color:var(--plum)}
.stone small{font-size:3.6cqw;color:var(--plum)}
.trail.words .stone small,.wsong.words .stone small{color:var(--ink)}
.trail.words .stone small{font-size:2.4cqw}
.stone.col{background:var(--nc);color:var(--nt)}
.stone.col b,.stone.col small,.trail.words .stone.col small,.wsong.words .stone.col small{color:var(--nt)}
/* lit stone: still its note colour; a dark gap, a thick bright-gold ring and a glow (never a fill change) */
.stone[data-lit="1"]{box-shadow:0 0 0 .3cqw #0f1a33,0 0 0 1.1cqw #ffd54a,0 0 2.4cqw 1.4cqw rgba(255,213,74,.7)}
.slot{position:absolute;bottom:0;box-sizing:border-box;width:7cqw;height:14cqw;border-radius:3.5cqw;border:.3cqw solid #7cd4f7;background:transparent;color:#7cd4f7;display:grid;place-items:center;font-size:4cqw;font-weight:700;line-height:1}
.slot.later{border-style:dashed;opacity:.5}
.slot[data-lit="1"]{border-color:var(--gold);border-style:solid;border-width:.4cqw;opacity:1}
.transport .seg[hidden],[hidden]{display:none!important}
.scene.bands{justify-content:flex-start;gap:.9cqw}
.scene.bands .big.huge{font-size:6.2cqw}
.scene.bands .rules{gap:.5cqw;font-size:2.4cqw}.scene.bands .rules li{padding:.35cqw 1.4cqw}.scene.bands .rules li::before{width:3cqw;height:3cqw;font-size:2cqw}
.scene.bands .chip{width:4.6cqw;height:4.6cqw;font-size:2.4cqw}

/* Revealed tune: the whole song as a 2 x 3 grid on one pitch ladder (0.9cqw per step), stone + lyric per note */
.display.song{padding-top:.8cqw;padding-bottom:.8cqw;gap:.6cqw}   /* the song grid needs every pixel: the text floors stay, the frame tightens */
.scene.reveal{justify-content:flex-start;gap:.3cqw}
.wsong{display:grid;grid-template-columns:1fr 1fr;grid-auto-flow:row;gap:.2cqw 3cqw;width:100%;justify-items:center}
.wline{position:relative;width:48.3cqw;height:13.1cqw}
.wline .line{position:absolute;left:0;top:0;width:48.3cqw;height:10.1cqw;overflow:visible}
.wn{position:absolute;top:0;width:6.9cqw;height:13.1cqw}
.wn .stone{left:.65cqw;width:5.6cqw;height:5.6cqw;border-width:.3cqw}
.wn .stone small{font-size:3cqw}
.wsong.words .stone b{font-size:2.6cqw}.wsong.words .stone small{font-size:2.15cqw}
.wn .stone[data-lit="1"]{box-shadow:0 0 0 .2cqw #0f1a33,0 0 0 .75cqw #ffd54a,0 0 1.6cqw 1cqw rgba(255,213,74,.7)}
.wn .s{position:absolute;left:50%;bottom:0;transform:translateX(-50%);font-style:normal;font-weight:700;font-size:2.6cqw;line-height:1.1;color:#dfe8ff;white-space:nowrap;padding:0 .3cqw;border-radius:.5cqw}
.wn .s[data-lit="1"]{background:var(--gold);color:var(--gold-ink)}
.scene.reveal .xylo.slim{flex:1 1 0;min-height:0;display:flex;justify-content:center}
.scene.reveal .xylo.slim svg{height:100%;width:auto;max-height:none}
.xylo.slim svg{height:14cqw;width:auto;margin:0 auto;max-height:none}
.xylo.slim.fit .bar text{font-size:29.3px}.xylo.slim.fit .bar text.sol{font-size:24.8px}
/* Tune Trail options: solfège names and hand signs */
.modes .opt{display:inline-flex;align-items:center;gap:6px}
.modes .opt b{font-size:var(--t-meta)}
.modes .opt .seg button{min-height:44px;min-width:56px}
.toprow{display:flex;gap:1.4cqw;align-items:stretch;flex:none}
.toprow .cueband{flex:1;min-width:0}
.display.signs .cueband{min-height:12.5cqw}
.cueband p.gold{color:var(--gold);font-size:4.4cqw;line-height:1.05}
.signslot{flex:none;width:32cqw;height:12.5cqw}
.signbox{box-sizing:border-box;width:100%;height:100%;background:#fff;border-radius:1.4cqw;padding:.6cqw 1cqw;display:flex;align-items:center;justify-content:center;gap:1.6cqw;color:var(--plum)}
.signbox img{width:22cqw;height:11cqw;object-fit:contain;display:block}
.signbox b{font-size:4.4cqw;line-height:1;font-weight:700}
.display.song.signs .xylo .bar text{display:none}   /* about 7px tall at this size: unreadable, so the bars are shown unlabelled */
/* where the tune starts: a pointer above the first note's bar */
.xylo.hasstart{position:relative}
.xylo .startmark{position:absolute;bottom:calc(100% - .4cqw);transform:translateX(-50%);font-family:var(--font);font-weight:700;font-size:3.2cqw;line-height:.95;text-align:center;color:#ffd54a;white-space:nowrap;pointer-events:none}
.bar .title .sname{display:block;font-weight:400;font-size:var(--t-label);color:var(--ink-soft)}
body.classview .cvbar .cvtitle{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cvtitle .cvsong{display:inline;font-size:inherit;font-weight:400;color:var(--ink-soft)}
.cvtitle .cvsong::before{content:" · "}
body.classview .cvbar.named{flex-wrap:wrap;row-gap:2px}body.classview .cvbar.named .cvtitle{flex:1 1 100%}
/* Tune picker (teacher row): the tune number and its grades; the song name only while the Song name switch is on */
.tunes{display:inline-flex;gap:6px;align-items:center}
.tunebtn{flex-direction:column;gap:0;min-height:44px;padding-top:2px;padding-bottom:2px;line-height:1.1;text-align:center}
.tunebtn b{font-size:var(--t-body)}.tunebtn small{font-size:var(--t-label);font-weight:400;color:var(--ink-soft)}
.tunebtn small.tn{font-weight:700;color:var(--plum)}
.tunebtn[aria-current="page"]{background:var(--plum);border-color:var(--plum);color:#fff}
.tunebtn[aria-current="page"] small{color:#fff}
/* a long tune (lines of more than seven notes): rows of two lines of their own length, spacing and ladder step set by the tune (model songLayout) */
.wsong.rows{display:flex;flex-direction:column;align-items:center;gap:.2cqw}
.wrow{display:flex;justify-content:center;gap:2.2cqw;width:100%}
/* a longer opening: smaller stones (5.6-7cqw), the song grid's text sizes */
.trail.dense .stone small{font-size:3cqw}
.trail.dense.words .stone b{font-size:2.6cqw}.trail.dense.words .stone small{font-size:2.15cqw}
/* a longer opening has low notes on the lane floor, so its Start pointer is one line ("Start ▼", the arrow over the bar) and never reaches into the lane */
.trail.dense ~ .xylo .startmark{display:flex;align-items:center;gap:.5cqw;transform:translateX(calc(-100% + 1.7cqw))}
.trail.dense ~ .xylo .startmark br{display:none}
/* whole-song view: the slim xylophone never grows past the display or its sensible height */
.scene.reveal .xylo.slim{max-height:15cqw}
.scene.reveal .xylo.slim svg{max-width:100%;max-height:15cqw}
/* Class view bar: the title keeps its full text; the controls drop to a second row when there is no room */
body.classview .cvbar{flex-wrap:wrap;row-gap:4px}
body.classview .cvbar .cvtitle{flex:1 0 auto;overflow:visible;text-overflow:clip}
/* Tune Trail bar range (design: Stitch "Range Isolation Exploration", variant C): bars the tune never plays are faded but still there, the bars it uses sit in a gold frame, a star marks the first note */
.xylo .rangeframe{fill:rgba(255,213,74,.1);stroke:#ffd54a;stroke-width:5;pointer-events:none}
.xylo .bar.off{opacity:.4;filter:grayscale(.75)}
.xylo .bar.off rect:not(.ring){stroke-dasharray:9 7;stroke:rgba(255,255,255,.55);stroke-width:2.5}
.xylo .rangelabel{position:absolute;bottom:calc(100% - .4cqw);transform:translateX(-100%);font-family:var(--font);font-weight:700;font-size:2.6cqw;line-height:.95;text-align:right;color:#ffd54a;white-space:nowrap;pointer-events:none}
.xylo.ranged .startmark{font-size:3.2cqw}
.xylo.ranged .startmark{text-shadow:0 0 1.2cqw rgba(255,213,74,.6)}
/* a longer opening (smaller stones, low notes on the lane floor): the star and the range label are one line each and sit right on the drawing */
.trail.dense ~ .xylo.ranged .startmark{display:block;white-space:nowrap;transform:translateX(-50%)}
.trail.dense ~ .xylo.ranged .startmark br,.trail.dense ~ .xylo.ranged .rangelabel br{display:none}
.trail.dense ~ .xylo.ranged .rangelabel{white-space:nowrap}
.xylo.ranged .rangelabel{bottom:calc(100% + .2cqw)}
