/* Bii Rock Band (public/arcade/band.js). A club stage at night: the Geek Squad band under spotlights in the lane colours
   and a felt letterboard backdrop (public/band3d.js) up top; your note highway below, black road edged felt red, notes
   as hard lane-coloured bars with the cabinets' darker lip. Lanes: red, warm white, pink, Geek Squad orange. Jersey for
   everything drawn; setup is the CRT's inks on black. */
.ag-stage[data-kind="band"] { container: rb / size; }
.ag-stage[data-kind="band"] .rb {
  --rb-line: #3d1a20; --rb-ink: var(--ac-ink); --rb-ink-2: var(--ac-ink-2); --rb-felt: #b8111b; --rb-lip: #7c0a12;
  position: absolute; inset: 0; display: flex; flex-direction: column; background: #000; color: var(--rb-ink); font: 400 16px/1.3 var(--font);
}
.ag-stage[data-kind="band"] .rb [hidden] { display: none !important; }
.ag-stage[data-kind="band"] .rb :is(h2, p, ol) { margin: 0; padding: 0; }
.ag-stage[data-kind="band"] .rb ol { list-style: none; }

/* ---------- the stage ---------- */
.ag-stage[data-kind="band"] .rb-stage { position: relative; flex: 0 0 auto; height: clamp(170px, 40%, 380px); overflow: hidden; border-bottom: 2px solid var(--rb-felt); }
.ag-stage[data-kind="band"] .rb-cv3 { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .4s; }
.ag-stage[data-kind="band"] .rb.lit .rb-cv3 { opacity: 1; }
.ag-stage[data-kind="band"] .rb-note { position: absolute; inset: 0 0 40px; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--rb-ink-2); }
/* who's on what, under the players they belong to */
.ag-stage[data-kind="band"] .rb-band { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px;
  padding: 0 max(4px, env(safe-area-inset-right)) 0 max(4px, env(safe-area-inset-left)); }
.ag-stage[data-kind="band"] .rb-chip { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px;
  height: 30px; padding: 0 6px 3px; background: #000000d0; font: 400 18px/1 var(--ac-pixel); letter-spacing: .02em; }
.ag-stage[data-kind="band"] .rb-chip .rb-ic { width: 18px; height: 18px; }
.ag-stage[data-kind="band"] .rb-cn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--rb-ink-2); }
.ag-stage[data-kind="band"] .rb-chip.me .rb-cn { color: #fff; }
.ag-stage[data-kind="band"] .rb-chip.crew .rb-cn { color: #8a6a6f; }
.ag-stage[data-kind="band"] .rb-cx { font-weight: 400; color: var(--c); }
.ag-stage[data-kind="band"] .rb-cx:empty { display: none; }
.ag-stage[data-kind="band"] .rb-ok { display: block; width: 14px; height: 14px; }
.ag-stage[data-kind="band"] .rb-chip.hot .rb-cx { color: #fff; }
.ag-stage[data-kind="band"] .rb-cm { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--rb-line); }
.ag-stage[data-kind="band"] .rb-chip.crew .rb-cm { background: transparent; }
.ag-stage[data-kind="band"] .rb-cm s { position: absolute; inset: 0; background: var(--c); transform-origin: 0 50%; transform: scaleX(0); text-decoration: none; }
.ag-stage[data-kind="band"] .rb-chip.me .rb-cm s { transform: scaleX(1); }

/* ---------- below the stage: setup, or your highway ---------- */
.ag-stage[data-kind="band"] .rb-low { position: relative; flex: 1; min-height: 0; }
.ag-stage[data-kind="band"] .rb-hw { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; touch-action: none;
  padding-bottom: calc(10px + var(--sab, 0px)); visibility: hidden; cursor: pointer; }
.ag-stage[data-kind="band"] .rb.playing .rb-hw, .ag-stage[data-kind="band"] .rb[data-phase="play"] .rb-hw { visibility: visible; }
.ag-stage[data-kind="band"] .rb-cv { flex: 1; min-height: 0; width: 100%; display: block; }
.ag-stage[data-kind="band"] .rb-keys { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 4px; max-width: 100%; }
/* the lane buttons: felt-red cabinet keys with the darker lip, each wearing its lane's bar */
.ag-stage[data-kind="band"] .rb-key { position: relative; height: 62px; padding: 0; border: 0; background: var(--rb-felt); color: #fff; touch-action: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; pointer-events: none; }
.ag-stage[data-kind="band"] .rb-key::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--rb-lip); }
.ag-stage[data-kind="band"] .rb-key i { position: absolute; left: 22%; right: 22%; top: 20px; height: 12px; background: var(--c); }
.ag-stage[data-kind="band"] .rb-key.down { transform: translateY(3px); background: #d3121c; }
.ag-stage[data-kind="band"] .rb-key.down::after { height: 3px; }
/* a hit: the lane bar punches out white; held (a long note): pressed in, the bar burning in its colour */
.ag-stage[data-kind="band"] .rb-key.hit i { animation: rb-hit .22s cubic-bezier(.2, 1.6, .4, 1); }
.ag-stage[data-kind="band"] .rb-key.held { transform: translateY(4px); background: #d3121c; }
.ag-stage[data-kind="band"] .rb-key.held::after { height: 2px; }
.ag-stage[data-kind="band"] .rb-key.held i { left: 12%; right: 12%; top: 16px; height: 20px; outline: 3px solid #fff; }
@keyframes rb-hit { 0% { transform: scale(1.7, 2.2); background: #fff; } 100% { transform: none; } }

/* ---------- setup ---------- */
.ag-stage[data-kind="band"] .rb-setup { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 12px max(12px, env(safe-area-inset-right)) calc(16px + var(--sab, 0px)) max(12px, env(safe-area-inset-left)); scroll-padding-bottom: 150px; }
.ag-stage[data-kind="band"] .rb:not([data-phase="setup"]) .rb-setup { display: none; }
.ag-stage[data-kind="band"] .rb-setup > * { max-width: 520px; margin-left: auto; margin-right: auto; }
.ag-stage[data-kind="band"] .rb-h { font: 400 24px/1 var(--ac-pixel); letter-spacing: .02em; color: #fff; margin: 4px auto 8px; }
.ag-stage[data-kind="band"] .rb-h + .rb-songs { margin-top: 0; }
.ag-stage[data-kind="band"] .rb-insts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ag-stage[data-kind="band"] .rb-inst { display: grid; justify-items: center; gap: 2px; min-height: 92px; padding: 8px 4px 9px; border: 0; background: #160a0c; color: var(--rb-ink);
  font: 400 15px/1.15 var(--font); cursor: pointer; position: relative; }
.ag-stage[data-kind="band"] .rb-inst .rb-ic { width: 36px; height: 36px; }
.ag-stage[data-kind="band"] .rb-inst b { font: 400 21px/1 var(--ac-pixel); letter-spacing: .02em; }
.ag-stage[data-kind="band"] .rb-inst span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--rb-ink-2); }
.ag-stage[data-kind="band"] .rb-inst.on { background: #2a1014; color: #fff; }
.ag-stage[data-kind="band"] .rb-inst.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--c); }
.ag-stage[data-kind="band"] .rb-inst.on span { color: #fff; }
.ag-stage[data-kind="band"] .rb-inst:disabled { opacity: 1; cursor: default; }
.ag-stage[data-kind="band"] .rb-inst:disabled :is(.rb-ic, b) { opacity: .4; }
.ag-stage[data-kind="band"] .rb-lvls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; margin-bottom: 18px; }
.ag-stage[data-kind="band"] .rb-lvl { min-height: 44px; border: 0; background: #160a0c; color: var(--rb-ink-2); font: 400 20px/1 var(--ac-pixel); letter-spacing: .02em; cursor: pointer; }
.ag-stage[data-kind="band"] .rb-lvl.on { background: var(--rb-felt); color: #fff; }
.ag-stage[data-kind="band"] .rb-songs { display: grid; gap: 4px; }
.ag-stage[data-kind="band"] .rb-song { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n d" "f d"; align-items: center; column-gap: 12px;
  min-height: 54px; padding: 8px 12px; border: 0; background: #160a0c; color: var(--rb-ink); text-align: left; font: 400 15px/1.25 var(--font); cursor: pointer; }
.ag-stage[data-kind="band"] .rb-song b { grid-area: n; font-weight: 700; font-size: 16px; }
.ag-stage[data-kind="band"] .rb-song > span:not(.rb-dense) { grid-area: f; color: var(--rb-ink-2); font-size: 14px; }
.ag-stage[data-kind="band"] .rb-song { position: relative; }
.ag-stage[data-kind="band"] .rb-song.on { background: #2a1014; }
.ag-stage[data-kind="band"] .rb-song.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rb-felt); }
.ag-stage[data-kind="band"] .rb-song:disabled { opacity: 1; cursor: default; }
.ag-stage[data-kind="band"] .rb-song:disabled:not(.on) { color: var(--rb-ink-2); }
/* how busy your part is in that song: five pixel bars */
.ag-stage[data-kind="band"] .rb-dense { grid-area: d; display: flex; align-items: flex-end; gap: 2px; height: 18px; }
.ag-stage[data-kind="band"] .rb-dense i { width: 5px; background: var(--rb-line); }
.ag-stage[data-kind="band"] .rb-dense i:nth-child(1) { height: 6px; } .ag-stage[data-kind="band"] .rb-dense i:nth-child(2) { height: 9px; }
.ag-stage[data-kind="band"] .rb-dense i:nth-child(3) { height: 12px; } .ag-stage[data-kind="band"] .rb-dense i:nth-child(4) { height: 15px; }
.ag-stage[data-kind="band"] .rb-dense i:nth-child(5) { height: 18px; }
.ag-stage[data-kind="band"] .rb-dense i.on { background: #ff9aa2; }
.ag-stage[data-kind="band"] .rb-go { position: sticky; bottom: calc(-16px - var(--sab, 0px)); display: grid; gap: 8px; margin-top: 12px;
  padding: 10px 0 calc(16px + var(--sab, 0px)); margin-bottom: calc(-16px - var(--sab, 0px)); background: #000; }
.ag-stage[data-kind="band"] .rb-ready { min-height: 52px; border: 0; background: var(--rb-felt); color: #fff; font: 700 18px/1 var(--font); cursor: pointer; }
.ag-stage[data-kind="band"] .rb-ready.on { background: #2a1014; color: #fff; }
.ag-stage[data-kind="band"] .rb-wait { text-align: center; color: var(--rb-ink-2); font-size: 14px; }
.ag-stage[data-kind="band"] .rb-time { height: 3px; background: var(--rb-line); overflow: hidden; }
.ag-stage[data-kind="band"] .rb-time i { display: block; height: 100%; background: var(--rb-felt); transform-origin: 0 50%; }

/* wide screens (landscape phones, desktops): the stage on the left, the notes on the right */
@container rb (min-aspect-ratio: 5/4) {
  .ag-stage[data-kind="band"] .rb { flex-direction: row; }
  .ag-stage[data-kind="band"] .rb-stage { height: auto; flex: 1 1 58%; border-bottom: 0; border-right: 2px solid var(--rb-felt); }
  .ag-stage[data-kind="band"] .rb-low { flex: 1 1 42%; max-width: 520px; }
}
@media (prefers-reduced-motion: reduce) {
  .ag-stage[data-kind="band"] .rb-cv3 { transition: none; }
  .ag-stage[data-kind="band"] .rb-key.hit i { animation: none; }
}
