:root {
  --paper: #211d31;
  --wash: #3d2b47;
  --surface: #41334b;
  --ink: #fff1d3;
  --label: #d0bdd1;
  --edge: #5d4b62;
  --primary: #f8cb80;
  --on-primary: #463146;
}
.scene {
  background: #332236 url(./theatre.webp) center/cover;
}
.players {
  position: absolute;
  inset: 11% 5% 9%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 1%;
}
.musician {
  -webkit-touch-callout: none;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 90%;
  min-width: 0;
  position: relative;
  isolation: isolate;
}
.musician::before {
  content: "";
  position: absolute;
  inset: 15% 0 4%;
  z-index: -1;
  background: radial-gradient(ellipse closest-side, var(--note), transparent);
  opacity: 0;
  transition: opacity 0.15s;
}
.musician::after {
  content: "";
  position: absolute;
  inset: auto 16% 12%;
  height: 4%;
  z-index: -1;
  background: #100e1699;
  border-radius: 50%;
  filter: blur(3px);
}
.musician img {
  width: 100%;
  height: 85%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  transform-origin: center bottom;
  transition: transform 0.15s;
  filter: drop-shadow(0 4px 4px #21121dac);
}
.musician.singing::before {
  opacity: 0.9;
}
.musician.singing img {
  transform: translateY(-5%) rotate(-3deg) scale(1.05);
}
.musician.cue .nametag {
  outline: 3px dashed var(--note);
  outline-offset: 4px;
}
.nametag {
  margin-top: 4px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 30px;
  background: #322338ed;
  color: #fff9e3;
  border: 1px solid var(--note);
  font-size: clamp(12px, 2vw, 19px);
}
.nametag b {
  color: var(--note);
}
.phrase {
  margin-top: 12px;
  padding: 8px 12px;
  min-height: 46px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: #312537;
}
.beat {
  height: 31px;
  width: 31px;
  display: grid;
  place-items: center;
  border: 1px dashed #ae97a8;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
}
.beat.inked {
  color: #332435;
  background: var(--note);
  border: 0;
}
.beat-now {
  outline: 2px solid #ffefd7;
  outline-offset: 2px;
}
@media (max-width: 600px) {
  .scene {
    aspect-ratio: 1.04;
    background-size: cover;
  }
  .players {
    inset: 6% 8% 3%;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 1%;
  }
  .musician {
    height: 100%;
  }
  .musician img {
    height: calc(100% - 25px);
  }
  .nametag {
    font-size: 13px;
    padding: 2px 10px;
  }
  .beat {
    width: 25px;
    height: 25px;
    font-size: 17px;
  }
}
.beat.timed-beat {
  width: calc(24px + var(--beats) * 17px);
  border-radius: 18px;
}
.controls .note-tool::before,
.controls .compose-tool::before {
  content: "♪";
  margin-right: 7px;
  color: #f2cf8b;
  font-family: Georgia, serif;
  font-size: 1.17em;
}
.controls .compose-tool::before {
  content: "♫";
  color: #bfe7dd;
}

button.beat {
  min-width: 44px;
  min-height: 44px;
}
button.beat[aria-pressed="true"] {
  outline: 3px dashed #ffeed1;
  outline-offset: 2px;
}

.sheet-covers {
  display: flex;
  gap: 5px;
  align-items: end;
  margin: 8px 0 -13px;
  padding-left: 8px;
}
.sheet-covers[hidden] {
  display: none;
}
.sheet-covers button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  border: 1px solid #89758a;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  color: #eddfd6;
  background: #49394e;
  padding: 4px 13px;
  font-weight: 700;
}
.sheet-covers b {
  color: #f2d38e;
  font-size: 1.22em;
}
.sheet-covers button[aria-pressed="true"] {
  background: #f7e3b6;
  color: #413042;
}
.sheet-covers button[aria-pressed="true"] b {
  color: #805c3d;
}

.concert-program {
  width: min(390px, 92vw);
  max-height: 90dvh;
  overflow: auto;
  padding: 18px;
  border: 3px double #a87949;
  border-radius: 8px;
  text-align: center;
  color: #473143;
  background: #f8e6bd;
}
.concert-program::backdrop {
  background: #160e21ad;
}
.concert-program h2 {
  margin: 0 0 14px;
  font:
    700 26px Georgia,
    serif;
}
.concert-bill {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.concert-program button {
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #9d7655;
  border-radius: 7px;
  background: #ffefd3;
  color: #4a3042;
  font-weight: 700;
}
.concert-bill button span {
  display: block;
  font-size: 26px;
  line-height: 1.05;
  color: #8a4b52;
}
.concert-bill button:disabled {
  opacity: 0.5;
}

.choose-leader .musician .nametag {
  border-width: 2px;
}
.choose-leader .musician:first-child::before {
  opacity: 0.45;
}
@keyframes first-bow {
  0%,
  75%,
  100% {
    transform: rotate(0);
  }
  35% {
    transform: translateY(-4%) rotate(-5deg);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .choose-leader .musician:first-child img {
    animation: first-bow 1.8s ease-in-out 3;
  }
}
