/* ch-open (builder A): every selector starts with .so (the scene class on the layer) or an so- class.
 * Compact = (max-width: 959px), (max-height: 599px); phone = (max-width: 759px) and (orientation: portrait). */
.so .se-beat { display: grid; gap: 10px; align-content: start; }
.so .se-beat .se-src--line { margin-top: -4px; }
.so .se-label__dot { flex: none; }

/* ---------- 1 cover ---------- */
.so-cover .se-scrim.so-scrim--cover { background:
  radial-gradient(110% 85% at 0% 0%, rgb(5 5 6 / .9) 0, rgb(5 5 6 / .55) 32%, transparent 60%),
  radial-gradient(60% 40% at 0% 100%, rgb(5 5 6 / .75) 0, transparent 70%),
  linear-gradient(0deg, rgb(5 5 6 / .5) 0, transparent 20%); }
.so-cover .se-t { font-size: clamp(34px, 3.7vw, 62px); max-width: min(100%, 14.5em); }
.so-cover .se-note { font-size: clamp(17px, 1.45vw, 22px); color: rgb(255 255 255 / .84); max-width: 24em; }

/* ---------- 3 es-rank: tube labels on two lines ---------- */
.so-tubes .so-tl { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.so-tubes .so-tl .se-label__dot { margin: 0; }
.so-tubes .so-tl__t { display: inline; line-height: 1.25; }
.so-tubes .so-tl b { font-weight: 600; font-variant-numeric: tabular-nums; }
.so-tubes .so-tl { background: rgb(8 8 10 / .92); }
.so-tubes.so-cmp .so-tl { gap: 0; padding: 2px 5px; font-size: 14px; }
.so-tubes.so-cmp .so-tl .se-label__dot { display: none; }
.so-tubes.so-cmp .so-tl b { color: var(--tc, #fff); }
.so-tubes.so-cmp .so-tl__t > span { display: none; }
.so-tubes .so-tleg { display: none; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; gap: 4px 14px; }
.so-tubes.so-cmp .so-tleg { display: flex; }

.so-tubes .so-tleg li { display: flex; align-items: center; gap: 7px; font-size: 14px; line-height: 1.3; color: rgb(255 255 255 / .9); }
.so-tubes .so-tleg i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); flex: none; }

/* ---------- 4 es-updates: the legend under the drum ---------- */
.so-seis .so-legend { display: inline-flex; gap: 16px; }
.so-seis .so-legend span { display: inline-flex; align-items: center; }

/* ---------- 5 levers: name plaques run up each pipe ---------- */
.so-organ .so-plaque { display: inline-flex; align-items: center; gap: 7px; padding: 0; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / .9), 0 0 12px rgb(0 0 0 / .85); }
.so-organ .so-num { min-width: 28px; text-align: center; padding: 3px 8px; font-variant-numeric: tabular-nums; font-weight: 600; }
.so-organ .so-group { color: #FFE2C8; }

@media (max-width: 959px), (max-height: 599px) {
  .so-tubes .se-t, .so-seis .se-t, .so-organ .se-t, .so-tubes .se-side, .so-seis .se-side, .so-organ .se-side { max-width: 45vw; }
  .so-organ .so-plaque { font-size: 14px; }
  .so-organ .so-num { min-width: 22px; padding: 2px 5px; }
  .so-cover .se-t { font-size: clamp(26px, 3.6vw, 34px); }
  .so-cover .se-note { font-size: 15px; }
}
@media (max-width: 759px) and (orientation: portrait) {
  .so-tubes .se-t, .so-seis .se-t, .so-organ .se-t, .so-tubes .se-side, .so-seis .se-side, .so-organ .se-side { max-width: 100%; }
  .so-cover .se-t { font-size: clamp(26px, 7.4vw, 32px); }
}

/* fix round 1 (builder B): fine leader lines from labels to their anchors (es-rank, es-updates, levers) */
.so .so-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.so .so-lines g { transition: opacity .4s; }
.so .so-lines path { stroke: rgb(255 255 255 / .35); stroke-width: 1.2; fill: none; }
.so .so-lines circle { fill: rgb(255 255 255 / .75); }
.scene:not(.is-active).so .so-lines g { transition: none; }
.so-organ .so-plaque { white-space: normal; line-height: 1.25; }

/* fix round 2: levers beat 1 on compact and phone: a numbered legend and the short note; desktop keeps names with lines */
.so-organ .so-narrow { display: none; }
.so-organ .so-plaque__n { display: none; min-width: 22px; height: 22px; place-items: center; border-radius: 11px; background: rgb(255 176 122 / .2); box-shadow: inset 0 0 0 1px rgb(255 176 122 / .55); color: #FFD2AE; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-shadow: none; flex: none; }
@media (max-width: 959px), (max-height: 599px) {
  .so-organ .so-wide { display: none; }
  .so-organ .se-note.so-narrow { display: block; }
  .so-organ .so-plaque__n.so-narrow { display: inline-grid; }
}
@media (max-height: 399px) and (orientation: landscape) { .so-organ .so-plaque__n { min-width: 20px; height: 20px; } .so-organ .so-plaque { line-height: 1.15; } }

/* fix round 3: label chips over 3D are opaque, so nothing of the world shows through them */
.so .se-label--pill { background: rgb(8 8 10 / .92); }

/* ---------- 5 levers: the switchback trail ---------- */
.so-trail .so-name { color: #fff; background: rgb(8 8 10 / .9); }
.so-trail .so-num { min-width: 26px; text-align: center; padding: 3px 7px; font-variant-numeric: tabular-nums; font-weight: 600; background: rgb(8 8 10 / .92); }
.so-trail .so-group { color: #FFE9D6; background: rgb(8 8 10 / .9); }
.so-trail .so-narrow { display: none; }
.so-trail .so-lines path { stroke: rgb(255 255 255 / .5); }
.so-trail .so-legend-l.so-narrow { display: none; }
.so-trail ol.so-legend-l { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, auto)); gap: 4px 16px; justify-content: start; }
.so-trail .so-legend-l li { display: flex; align-items: baseline; gap: 7px; font-size: 14px; line-height: 1.3; color: rgb(255 255 255 / .9); white-space: nowrap; }
.so-trail .so-legend-l b { min-width: 16px; font-weight: 600; color: #FFB07A; font-variant-numeric: tabular-nums; }
@media (max-width: 959px), (max-height: 599px) {
  .so-trail .so-wide { display: none !important; }
  .so-trail .se-note.so-narrow { display: block; }
  .so-trail .so-legend-l.so-narrow { display: grid; }
  .so-trail .se-beat:not(.is-on) .so-narrow { display: none; }
  .so-trail .se-t, .so-trail .se-side { max-width: 48vw; }
}
@media (max-width: 759px) and (orientation: portrait) {
  .so-trail .se-t, .so-trail .se-side { max-width: 100%; }
}
@media (max-height: 400px) and (orientation: landscape) { .so-tubes.so-cmp .se-t, .so-tubes.so-cmp .se-side { max-width: 55vw; } }
