* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  color-scheme: dark;
  font: 100%/1.36 system-ui, sans-serif;
  color: #fff1d7;
  background: #130c07;
  --gold: #ffcb64;
  --bronze: #b47636;
  --ink: #140c07;
  --display: Georgia, 'Times New Roman', serif;
}
body {
  margin: 0;
  min-height: 100dvh;
  padding: clamp(.8rem, 2.1vw, 1.9rem);
  background: radial-gradient(ellipse at 50% 45%, #150a0210 10%, #0a0401ad 100%), url('/studio-room.jpg') center 47% / cover fixed;
}
.cabinet {
  position: relative;
  border: 1px solid var(--bronze);
  border-radius: 1.15rem;
  background:
    radial-gradient(ellipse at 15% 0%, #6d421e50, transparent 46%),
    repeating-linear-gradient(108deg, #ffffff08 0 1px, #00000018 1px 3px),
    linear-gradient(155deg, #23170e, #100a06 63%, #1f140b);
  box-shadow: inset 0 1px #ffe2a081, inset 0 0 0 3px #4b2c18, inset 0 -3px #080402, 0 5px 0 #261508, 0 12px 25px #080401af, 0 0 17px #ec771826;
}
.panel::before, .panel::after {
  position: absolute; top: .62rem; width: .38rem; height: .38rem; content: '';
  border-radius: 50%; pointer-events: none;
  background: linear-gradient(145deg,#ffe2ac 22%,#73502e 45%,#211108 50%,#bd8c54 62%,#3c291a);
  box-shadow: 0 1px 2px #000;
}
.panel::before { left: .55rem; }
.panel::after { right: .55rem; }
.brand {
  display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.2rem);
  width: fit-content; max-width: 100%; margin: 0 auto clamp(.8rem, 3vh, 1.6rem);
  padding: .55rem clamp(.8rem, 2.2vw, 1.45rem);
}
.brand-copy { font-size: clamp(1.05rem, 2.35vw, 1.9rem); line-height: 1.1; white-space: nowrap; }
.brand-copy strong { font: italic 900 1em var(--display); color: #ffe0a1; }
.brand-copy > span { font-style: italic; }
.brand-copy small { display: block; font-size: .66em; margin-top: .26rem; color:#e4ceb2; }
.brand-tab, .transport-mode {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font-weight: 800; border: 1px solid #ffb854; white-space: nowrap;
}
.brand-tab { padding: .4rem .8rem; border-radius: 5rem; color: #251000; background: linear-gradient(#ffde88,#f29c1a); box-shadow: 0 0 .9rem #ff9e3849; }
.wave { display: inline-flex; align-items: center; gap: .22rem; color: #ffc05a; filter: drop-shadow(0 0 .3rem #ff880cbd); }
.wave i { width: .24rem; height: .75rem; border-radius: .5rem; background: linear-gradient(#ffe5a1,#ff9a1c); }
.wave i:nth-child(2), .wave i:nth-child(6) { height: 1.22rem; }
.wave i:nth-child(3), .wave i:nth-child(5) { height: 1.65rem; }
.wave i:nth-child(4) { height: 2.1rem; }
.stage {
  display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(12rem, 1.2fr) minmax(14rem, 1fr);
  align-items: start; gap: 1rem clamp(.75rem, 2.7vw, 2.6rem);
  max-width: 92rem; margin: auto;
}
.session { display: contents; }
.profile, .session-left { grid-column: 1; grid-row: 1; }
.lobby, .session-right { grid-column: 3; grid-row: 1; }
.stage-mark {
  grid-column: 2; grid-row: 1; justify-self: center; text-align: center;
  margin-top: clamp(.3rem, 2.9vh, 2rem);
  color: #ffe1a8; text-shadow: 0 .12em .3em #1a0801, 0 0 1.1rem #f1931b64;
  line-height: 1.02;
}
.stage-mark .wave { transform: scale(1.24); margin: .35em 0 .6em; }
.stage-mark strong { display: block; font-size: clamp(2rem, 5.1vw, 5rem); font-weight: 950; letter-spacing: -.055em; }
.stage-mark > span:last-child { display: block; font: italic 800 clamp(1.25rem, 2.8vw, 2.8rem) var(--display); }
.rail { display: grid; gap: .85rem; min-width: 0; }
.panel { padding: .85rem clamp(.9rem, 2vw, 1.4rem) 1rem; min-width: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .35rem; margin-bottom: .65rem; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font: italic 800 clamp(1.2rem, 2.35vw, 2rem)/1.08 var(--display); color: #ffe1ab; text-shadow: 0 2px .25rem #000; }
.panel > h1, .panel > h2 { margin-bottom: .7rem; }
h3 { font-size: clamp(1.15rem, 2.25vw, 1.8rem); }
p { overflow-wrap: anywhere; }
p:empty { display: none; }
.subtle { color: #e6cdb5; font-size: .9rem; }
.live-mark {
  display: inline-flex; align-items: center; gap: .34rem; white-space: nowrap;
  border: 1px solid #f7805b75; color: #fff3e5; border-radius: 2rem;
  padding: .18rem .5rem; background: #691a0f; font-size: .75rem; font-weight: 800;
}
.live-mark i, .transport-mode i { width: .48rem; height: .48rem; border-radius: 50%; background: #ff704c; box-shadow: 0 0 .45rem #ff5425; }
.well {
  border: 1px solid #79502a; border-radius: .7rem;
  background: linear-gradient(120deg,#1b1009,#0c0806);
  box-shadow: inset 0 .1rem .24rem #000; padding: .6rem .7rem;
}
.session-status p { border-top: 1px solid #69472d; margin-top: .32rem; padding-top: .46rem; color: #fae4c9; font-size: .9rem; }
.roster { padding-block: .26rem; }
.musician {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: .5rem; padding: .35rem 0; font-size: .94rem; font-weight: 700;
}
.musician:not(:empty)::after { content: ''; width: .45rem; height: .45rem; border-radius: 100%; background: #89e778; box-shadow: 0 0 .45rem #75f34d75; }
.musician[data-connecting]::after { background: #ffb858; box-shadow: none; }
.musician + .musician, #self:not(:empty) + #musician:not(:empty) { border-top: 1px solid #664329; }
label { display: block; margin-block: .2rem .36rem; }
input, select, button { font: inherit; }
input:not([type=range]), select, button {
  min-height: 44px; padding: .45rem .7rem; color: inherit;
  border: 1px solid #936439; border-radius: .55rem; background: linear-gradient(#36261b,#1d130c);
}
input, select { width: 100%; }
select { appearance: none; background: linear-gradient(45deg, transparent 50%, #ffcb64 50%) right .91rem center / .35rem .35rem no-repeat, linear-gradient(135deg, #ffcb64 50%, transparent 50%) right .56rem center / .35rem .35rem no-repeat, #2a1c12; padding-right: 1.65rem; }
input[type=range] { accent-color: #ffba26; margin: .3rem 0 .6rem; cursor: pointer; }
button { cursor: pointer; font-weight: 700; box-shadow: inset 0 1px #fff1c63c, 0 2px 4px #0009; }
button:not(:disabled):hover { border-color: #ffbb5d; background: linear-gradient(#633813,#371e0c); }
button:disabled { cursor: default; opacity: .52; }
:focus-visible { outline: 3px solid #ffbe61; outline-offset: 3px; }
.invite { width: 100%; margin-top: .55rem; border-style: dashed; }
#invite-status { margin-top: .45rem; }
.mix-controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .4rem; }
.mix-controls button { border-radius: 2rem; min-height: 36px; padding-inline: .25rem; }
output { display: grid; place-items: center; border-radius: 2rem; color: var(--gold); border: 1px solid #ffba26; font-weight: 850; box-shadow: inset 0 0 .65rem #e68c1050; }
#hear { width: 100%; margin-top: .55rem; }
.network { display: flex; align-items: end; gap: .4rem; justify-content: space-between; }
#ping { color: #b3ee67; font-size: clamp(1.25rem, 3.2vw, 2.45rem); white-space: nowrap; }
#ping-chart { display: flex; justify-content: end; align-items: end; gap: .12rem; min-height: 2rem; }
#ping-chart span { width: clamp(.18rem, .37vw, .36rem); border-radius: .14rem .14rem 0 0; height: .28rem; background: linear-gradient(#a6d846,#54781e); }
#ping-chart [data-level="1"] { height: .48rem; } #ping-chart [data-level="2"] { height: .7rem; }
#ping-chart [data-level="3"] { height: .92rem; } #ping-chart [data-level="4"] { height: 1.14rem; }
#ping-chart [data-level="5"] { height: 1.36rem; } #ping-chart [data-level="6"] { height: 1.58rem; }
#ping-chart [data-level="7"] { height: 1.8rem; } #ping-chart [data-level="8"] { height: 2rem; }
.transport {
  grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; justify-content: space-between;
  gap: .7rem; padding: clamp(.8rem, 2vw, 1.45rem);
  background: repeating-linear-gradient(45deg,#372719 0 1px,#100b07 1px 3px,#2c1e13 3px 4px);
}
.transport-controls { display: flex; justify-content: center; align-items: stretch; gap: .55rem; flex: 1; }
.transport-mode { border-radius: .6rem; padding: .45rem .7rem; color: #ffe9b4; background: linear-gradient(#4a250d,#1f1209); box-shadow: inset 0 0 .75rem #da86165e; }
.transport-mode i { background: #ffc54b; box-shadow: 0 0 .45rem #ff9c25; }
.amp-knob {
  width: clamp(1.2rem, 5vw, 3rem); aspect-ratio: 1; border: 1px solid #ffdaad; border-radius: 50%;
  background: conic-gradient(from 67deg,#362316,#e1af73,#594026,#ffe0ad,#63402a,#edbb82,#362316);
  box-shadow: 0 0 0 .2rem #271b11, 0 .18rem .5rem #000;
}
#rooms { display: grid; gap: .42rem; margin-top: .55rem; }
.room { text-align: left; display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; }
.room.invited { border-color: var(--gold); }
.occupants { display: block; font-weight: 400; font-size: .875rem; color: #e9cdb4; overflow-wrap: anywhere; }
.available { color: var(--gold); font-size: .875rem; white-space: nowrap; }
.notice { color: #ffb5a3; margin-top: .55rem; }
@media (max-width: 760px) {
  .stage { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .8rem; }
  .stage-mark { grid-column: 1 / -1; margin: .35rem 0 .8rem; }
  .profile, .session-left { grid-column: 1; grid-row: 2; }
  .lobby, .session-right { grid-column: 2; grid-row: 2; }
  .transport { grid-row: 3; }
}
@media (max-width: 520px) {
  .brand-copy small, .brand-tab { display: none; }
  .brand { padding: .45rem .7rem; }
  .stage { display: flex; flex-direction: column; max-width: 32rem; }
  .stage-mark { align-self: center; }
  .stage > :not(.stage-mark), .rail, .transport { width: 100%; }
  .transport-controls { flex-wrap: wrap; }
  .amp-knob { display: none; }
}
@media (max-width: 520px) {
  .stage:has(.session:not([hidden])) { padding-bottom: 5.5rem; }
  .transport {
    position: fixed;
    z-index: 2;
    inset: auto .65rem max(.45rem, env(safe-area-inset-bottom));
    width: auto;
    padding: .48rem;
  }
  .transport-mode { display: none; }
  .transport-controls button { flex: 1; }
}

.input-settings { margin-top: .55rem; }
.input-settings summary { cursor: pointer; color: #ffe1ab; font-size: .88rem; font-weight: 700; }
#input-summary { color: #c8a581; font-weight: 500; margin-left: .3rem; }
.input-settings button { width: 100%; min-height: 36px; margin-top: .35rem; }
#capture-input { font-size: .8rem; }
.stage { row-gap: .65rem; }
.rail { gap: .58rem; }
.panel { padding-block: .63rem .72rem; }
.panel > h1, .panel > h2, .panel-header { margin-bottom: .5rem; }
.room { min-height: 36px; padding-block: .34rem; }
.well { padding-block: .46rem; }
@media (max-height: 520px) and (min-width: 600px) {
  body { padding-block: .4rem; }
  .brand { margin-bottom: .5rem; padding-block: .3rem; }
  .stage-mark { margin-top: .5rem; }
  .transport { padding-block: .35rem; }
}

.instrument-settings { margin-top: .5rem; }
.instrument-settings summary, .input-settings summary {
  display: flex; align-items: center; gap: .5rem; min-height: 36px; padding: .25rem .55rem;
  list-style: none; background: linear-gradient(#282019,#14110e);
  border: 1px solid #8d623a; border-top-color: #bd955f; border-radius: .4rem;
  color: #ffe1ab; font-size: .83rem; font-weight: 700; cursor: pointer;
}
.instrument-settings summary::-webkit-details-marker, .input-settings summary::-webkit-details-marker { display: none; }
.instrument-settings summary::after, .input-settings summary::after { content: '▾'; color: #ffd17a; }
.instrument-settings[open] summary::after, .input-settings[open] summary::after { content: '▴'; }
#instrument-summary, #input-summary { margin-left: auto; font-weight: 600; color: #d8b88e; }
.instrument-grid { min-width: 0; border: 0; padding: 0; margin: .4rem 0 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .28rem; }
.instrument-tile { position: relative; margin: 0; min-width: 0; cursor: pointer; overflow: hidden; background: #17130e;
  border: 1px solid #8e6135; border-top-color: #dbab65; border-radius: .42rem; color: #ffe3ac; text-align: center; }
.instrument-tile input { position: absolute; inset: 0; opacity: 0; margin: 0; height: 100%; cursor: pointer; }
.instrument-tile img { display: block; width: 100%; height: clamp(2rem,5vw,3.15rem); object-fit: cover; border-bottom: 1px solid #8e6135; }
.instrument-tile span { display: block; font-size: clamp(.58rem,1vw,.76rem); font-weight: 750; line-height: 1.25; padding: .16rem .05rem; }
.instrument-tile:has(:checked), .instrument-tile:hover { border-color: #ffd27a; background: #492c12; }
.instrument-tile:has(:focus-visible) { outline: 2px solid #ffcd75; outline-offset: 1px; }
.instrument-grid:disabled { opacity: .55; }
@media (min-width: 521px) and (max-width: 920px) {
  .instrument-tile span { font-size: .62rem; }
}
