/* ---------------- the toy's furniture ---------------- */
#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  font-family: 'Chakra Petch', sans-serif;
  color: var(--cream);
}
#ui button {
  pointer-events: auto;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#ui svg {
  width: 1.5em;
  height: 1.5em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand {
  position: absolute;
  left: calc(var(--u) * 1.6 + env(safe-area-inset-left));
  top: calc(var(--u) * 1.2 + env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand .b1 {
  font: 600 calc(var(--u) * 2.3) Fraunces, Georgia, serif;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 #6b3d0c, 0 0 18px rgba(255, 200, 90, 0.35);
}
.brand .b2 {
  font: 500 calc(var(--u) * 0.95) 'Chakra Petch', sans-serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-top: calc(var(--u) * 0.35);
}
.spotBtn {
  position: absolute;
  right: calc(var(--u) * 1.4 + env(safe-area-inset-right));
  top: calc(var(--u) * 1.2 + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.5em 0.9em 0.5em 0.7em;
  border-radius: 999px;
  border: 2px solid rgba(255, 211, 107, 0.65);
  background: linear-gradient(180deg, rgba(70, 30, 34, 0.85), rgba(36, 14, 20, 0.85));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  font-size: calc(var(--u) * 1.15) !important;
  font-weight: 700 !important;
  color: var(--gold) !important;
}
.spotBtn.bump {
  animation: bump 0.6s cubic-bezier(0.3, 1.8, 0.5, 1);
}
@keyframes bump {
  30% {
    transform: scale(1.35) rotate(-6deg);
  }
}
.bar {
  position: absolute;
  left: 50%;
  bottom: calc(var(--u) * 1.3 + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 0.5);
  padding: calc(var(--u) * 0.45);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(64, 28, 32, 0.78), rgba(30, 12, 18, 0.82));
  border: 1px solid rgba(255, 211, 107, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
}
.bar button {
  display: flex;
  align-items: center;
  gap: 0.4em;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 0.55em 1em 0.55em 0.8em;
  font-size: calc(var(--u) * 1.1) !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em;
  transition: background 0.15s, transform 0.12s;
  touch-action: none;
}
.bar button:hover {
  background: rgba(255, 211, 107, 0.18);
}
.bar button:active,
.bar button.on {
  transform: scale(0.94);
  background: rgba(255, 211, 107, 0.3);
}
.bar button.big {
  background: linear-gradient(180deg, #ffd96e, #e59a2a);
  color: #3a1706 !important;
  box-shadow: 0 3px 0 #9a5a12, 0 6px 14px rgba(229, 154, 42, 0.35);
}
.bar button.big.on {
  animation: jiggle 0.12s linear infinite;
}
@keyframes jiggle {
  25% {
    transform: translate(-2px, 1px) rotate(-3deg) scale(0.96);
  }
  75% {
    transform: translate(2px, -1px) rotate(3deg) scale(0.96);
  }
}
.bar button.sm {
  padding: 0.55em;
}
.bar .sep {
  width: 1px;
  align-self: stretch;
  margin: 0.3em 0.15em;
  background: rgba(255, 255, 255, 0.15);
}
.hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--u) * 6.4 + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: calc(var(--u) * 1.1);
  padding: 0.5em 1.1em;
  border-radius: 999px;
  background: rgba(20, 8, 12, 0.55);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  transition: opacity 1s, transform 1s;
  animation: hintIn 1.2s 1s both;
}
.hint b {
  color: var(--gold);
}
.hint.gone {
  opacity: 0;
  transform: translate(-50%, 10px);
}
@keyframes hintIn {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
}
.pops {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.pop,
.shout {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(calc(-50% + var(--x, 0px)), -50%) rotate(var(--r, 0deg));
  font: 400 calc(var(--u) * 3) 'Russo One', sans-serif;
  color: #fff;
  -webkit-text-stroke: calc(var(--u) * 0.18) #3a1706;
  paint-order: stroke fill;
  text-shadow: 0 calc(var(--u) * 0.35) 0 #3a1706, 0 0 24px rgba(255, 220, 120, 0.6);
  white-space: nowrap;
  animation: popUp 1.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.pop.gold {
  color: var(--gold);
}
@keyframes popUp {
  0% {
    opacity: 0;
    scale: 0.2;
  }
  14% {
    opacity: 1;
    scale: 1.15;
  }
  24% {
    scale: 1;
  }
  75% {
    opacity: 1;
    translate: 0 -4vh;
  }
  100% {
    opacity: 0;
    translate: 0 -12vh;
  }
}
.shout {
  top: 30%;
  font-size: calc(var(--u) * 5.2);
  color: #bfe8ff;
  animation: shout 2.2s cubic-bezier(0.2, 1.7, 0.4, 1) both;
}
.shout.storm {
  color: #fff;
  text-shadow: 0 calc(var(--u) * 0.4) 0 #12325a, 0 0 36px rgba(140, 210, 255, 0.85);
  -webkit-text-stroke-color: #12325a;
}
.shout.too {
  font-size: calc(var(--u) * 7);
  color: #ff5a6e;
  -webkit-text-stroke-color: #3a0610;
  text-shadow: 0 calc(var(--u) * 0.45) 0 #3a0610, 0 0 40px rgba(255, 80, 100, 0.7);
  animation: shout 2.2s cubic-bezier(0.2, 1.7, 0.4, 1) both, wobble 0.18s 0.3s 6 ease-in-out;
}
@keyframes shout {
  0% {
    opacity: 0;
    scale: 2.6;
  }
  12% {
    opacity: 1;
    scale: 0.9;
  }
  20% {
    scale: 1.05;
  }
  26% {
    scale: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    scale: 1.08;
  }
}
@keyframes wobble {
  50% {
    rotate: 4deg;
  }
}
.toasts {
  position: absolute;
  left: 50%;
  top: calc(var(--u) * 7 + env(safe-area-inset-top));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
}
.toast {
  font-size: calc(var(--u) * 1.2);
  padding: 0.55em 1.2em;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(70, 30, 34, 0.92), rgba(36, 14, 20, 0.92));
  border: 1px solid rgba(255, 211, 107, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  animation: toastIn 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  transition: opacity 0.5s, transform 0.5s;
}
.toast.out {
  opacity: 0;
  transform: translateY(-12px);
}
.toast b {
  color: var(--gold);
}
.toast em {
  font-style: normal;
  opacity: 0.7;
  margin-left: 0.3em;
}
.toast i {
  font-style: normal;
  color: var(--gold);
}
.toast.spot {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(255, 211, 107, 0.35), 0 6px 20px rgba(0, 0, 0, 0.35);
}
.toast.night {
  background: linear-gradient(180deg, rgba(24, 30, 70, 0.92), rgba(12, 14, 36, 0.92));
  border-color: rgba(160, 190, 255, 0.5);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.8);
  }
}
.book {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 4, 8, 0.55);
  pointer-events: auto;
  transition: opacity 0.3s;
}
.book.hidden {
  opacity: 0;
  pointer-events: none;
}
.bookIn {
  width: min(92vw, 620px);
  max-height: 86vh;
  overflow: auto;
  padding: calc(var(--u) * 1.6);
  border-radius: calc(var(--u) * 1.4);
  background: linear-gradient(180deg, #fff6e0, #f1dfb8);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 0 0 3px #c98a24, inset 0 0 0 6px #fff6e0, inset 0 0 0 7px #c98a24;
  transform: rotate(-1deg);
}
.bookHd {
  display: flex;
  align-items: center;
  gap: 1em;
}
.bookHd b {
  font: 600 calc(var(--u) * 2) Fraunces, Georgia, serif;
  color: #8a2a1a;
}
.bookHd span {
  flex: 1;
  font-weight: 600;
  opacity: 0.7;
}
.bookHd .x {
  border: 0;
  background: none;
  font-size: calc(var(--u) * 1.4);
  color: var(--ink) !important;
}
.bookSub {
  font-size: calc(var(--u) * 1.05);
  opacity: 0.75;
  margin: 0.3em 0 1em;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--u) * 10), 1fr));
  gap: calc(var(--u) * 0.8);
}
.stk {
  aspect-ratio: 1.15;
  border-radius: calc(var(--u) * 0.9);
  border: 2px dashed rgba(42, 20, 8, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  text-align: center;
  padding: 0.5em;
  font-size: calc(var(--u) * 0.95);
  font-weight: 600;
  color: rgba(42, 20, 8, 0.45);
  transform: rotate(var(--r));
}
.stk i {
  font-style: normal;
  font: 400 calc(var(--u) * 2.2) 'Russo One', sans-serif;
}
.stk.found {
  border: 0;
  background: linear-gradient(160deg, #ff6b6b, #c2253a);
  color: #fff;
  box-shadow: 0 3px 0 #7a1020, 0 6px 14px rgba(0, 0, 0, 0.25), inset 0 0 0 3px rgba(255, 255, 255, 0.6);
}
.stk.found:nth-child(3n + 1) {
  background: linear-gradient(160deg, #57d38c, #1f8a50);
  box-shadow: 0 3px 0 #0d5a30, 0 6px 14px rgba(0, 0, 0, 0.25), inset 0 0 0 3px rgba(255, 255, 255, 0.6);
}
.stk.found:nth-child(3n + 2) {
  background: linear-gradient(160deg, #6fb7ff, #2a62c9);
  box-shadow: 0 3px 0 #173a80, 0 6px 14px rgba(0, 0, 0, 0.25), inset 0 0 0 3px rgba(255, 255, 255, 0.6);
}
.stk.found i {
  color: #ffd36b;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
@media (max-width: 640px) {
  .bar button span {
    display: none;
  }
  .bar button {
    padding: 0.6em;
  }
  .hint {
    white-space: normal;
    width: 86vw;
    text-align: center;
  }
  .brand .b2 {
    display: none;
  }
  .toast {
    white-space: normal;
    text-align: center;
    max-width: 70vw;
  }
}
@media (max-height: 480px) {
  .bar button span {
    display: none;
  }
  .bar button {
    padding: 0.5em;
  }
  .hint {
    display: none;
  }
  /* a phone on its side: the book goes wide, seven stickers a row, so it all fits in one look */
  .bookIn {
    width: min(96vw, 860px);
    max-height: 92vh;
    padding: calc(var(--u) * 1.1) calc(var(--u) * 1.4);
  }
  .bookSub {
    display: none;
  }
  .grid {
    grid-template-columns: repeat(7, 1fr);
    gap: calc(var(--u) * 0.6);
  }
  .stk {
    aspect-ratio: 1.3;
  }
}

/* phone motion: the opt-in card */
.motionCard {
  position: absolute;
  left: 50%;
  bottom: calc(var(--u) * 9 + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(92vw, 26em);
  font-size: max(14px, calc(var(--u) * 1.15));
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4em 0.9em;
  padding: 1em 1.1em;
  border-radius: 1.1em;
  background: linear-gradient(180deg, rgba(70, 30, 34, 0.96), rgba(36, 14, 20, 0.96));
  border: 1px solid rgba(255, 211, 107, 0.55);
  box-shadow: 0 0 30px rgba(255, 211, 107, 0.2), 0 10px 30px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  animation: toastIn 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  z-index: 5;
}
.motionCard.hidden {
  display: none;
}
.mcIcon svg {
  width: 2.2em;
  height: 2.2em;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mcText {
  line-height: 1.35;
}
.mcText b {
  display: block;
  color: var(--gold);
  font-size: 1.12em;
  margin-bottom: 0.2em;
}
.mcText i {
  font-style: normal;
  color: var(--gold);
}
.mcBtns {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.6em;
  justify-content: flex-end;
  margin-top: 0.3em;
}
.mcBtns button,
.mcBtns a {
  font: inherit;
  color: #fff;
  text-decoration: none;
  padding: 0.55em 1.1em;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}
#ui .mcBtns .mcYes,
#ui .mcBtns .mcGo {
  color: #2a1208;
  font-weight: 700;
  border-color: transparent;
  background: linear-gradient(180deg, #ffe39a, #f0b43c);
}


/* ---------------- Wibble Wobble's own bits ---------------- */
.confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}
/* every letter of a shout wobbles on its own, like jelly */
.shout b {
  display: inline-block;
  font-weight: 400;
  animation: letterWob 0.5s calc(var(--i) * -0.07s) ease-in-out infinite alternate;
}
@keyframes letterWob {
  from {
    transform: translateY(-0.04em) scale(1.06, 0.94) rotate(-3deg);
  }
  to {
    transform: translateY(0.04em) scale(0.94, 1.08) rotate(3deg);
  }
}
.shout.jelly {
  color: #ff6b7d;
  -webkit-text-stroke-color: #4a0616;
  text-shadow: 0 calc(var(--u) * 0.4) 0 #4a0616, 0 0 34px rgba(255, 90, 120, 0.75);
}
.shout.gold {
  color: #ffd36b;
  -webkit-text-stroke-color: #4a2606;
  text-shadow: 0 calc(var(--u) * 0.4) 0 #4a2606, 0 0 34px rgba(255, 200, 90, 0.8);
}
.shout.xmas {
  font-size: calc(var(--u) * 6);
  color: #fff;
  -webkit-text-stroke-color: #7a0b1d;
  text-shadow: 0 calc(var(--u) * 0.45) 0 #7a0b1d, 0 0 40px rgba(255, 210, 120, 0.9);
}
.pop.small {
  font-size: calc(var(--u) * 2);
}
.pop.red {
  color: #ff8a9a;
}
.pop.green {
  color: #9dffb4;
}
.note {
  position: absolute;
  transform: translate(-50%, -50%);
  font: 400 calc(var(--u) * 3.4) 'Russo One', sans-serif;
  color: hsl(calc(45deg + var(--h)), 100%, 70%);
  -webkit-text-stroke: calc(var(--u) * 0.14) #3a1706;
  paint-order: stroke fill;
  animation: noteUp 1.3s ease-out both;
}
@keyframes noteUp {
  0% {
    opacity: 0;
    scale: 0.3;
  }
  20% {
    opacity: 1;
    scale: 1.2;
  }
  100% {
    opacity: 0;
    translate: calc(var(--u) * 2) calc(var(--u) * -8);
    rotate: 20deg;
  }
}
/* the song's words, karaoke style */
.karaoke {
  position: absolute;
  left: 50%;
  bottom: calc(var(--u) * 10.5 + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: 92vw;
  text-align: center;
  font: 400 calc(var(--u) * 2.6) 'Russo One', sans-serif;
  color: rgba(255, 255, 255, 0.55);
  -webkit-text-stroke: calc(var(--u) * 0.12) #3a1706;
  paint-order: stroke fill;
  opacity: 0;
  transition: opacity 0.4s;
}
.karaoke.on {
  opacity: 1;
}
.karaoke b {
  display: inline-block;
  font-weight: 400;
  transition: color 0.1s, transform 0.15s;
}
.karaoke b.sung {
  color: #ffd36b;
}
.karaoke b.now {
  color: #ff6b7d;
  transform: scale(1.3) translateY(-0.12em) rotate(-4deg);
}
/* the cracker joke: a curled paper slip */
.joke {
  position: absolute;
  left: 50%;
  top: 12%;
  translate: -50% 0;
  transform: rotate(-2deg);
  width: min(78vw, calc(var(--u) * 34));
  padding: calc(var(--u) * 1.2) calc(var(--u) * 1.6);
  background: linear-gradient(180deg, #fffaf0, #f3e6c8);
  color: #3a1706;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 -8px 12px rgba(150, 100, 40, 0.15);
  font: 600 calc(var(--u) * 1.25) Fraunces, Georgia, serif;
  text-align: center;
  pointer-events: auto;
  cursor: pointer;
  animation: jokeIn 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.joke::before,
.joke::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  background: radial-gradient(circle at 0 50%, transparent 5px, #fffaf0 5.5px) 0 0 / 10px 14px repeat-y;
}
.joke::before {
  left: -9px;
  transform: scaleX(-1);
}
.joke::after {
  right: -9px;
}
.joke .ja {
  margin-top: 0.6em;
  font: 400 calc(var(--u) * 1.5) 'Russo One', sans-serif;
  color: #c4122f;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.2, 1.8, 0.4, 1);
}
.joke .ja.show {
  opacity: 1;
  transform: none;
}
.joke.hidden {
  display: none;
}
.joke.out {
  animation: jokeOut 0.5s ease-in both;
}
@keyframes jokeIn {
  from {
    opacity: 0;
    transform: translateY(-40px) rotate(-12deg) scale(0.6);
  }
}
@keyframes jokeOut {
  to {
    opacity: 0;
    transform: translateY(-30px) rotate(6deg) scale(0.8);
  }
}
/* on a wide screen the joke sits to the right, over the fireplace, out of the way of the jelly's words */
@media (min-aspect-ratio: 1/1) {
  .joke {
    left: auto;
    right: calc(var(--u) * 2 + env(safe-area-inset-right));
    top: 30%;
    translate: none;
    width: min(30vw, calc(var(--u) * 26));
    transform: rotate(2deg);
  }
}
/* spoon mode: the spoon itself is the pointer */
#ui.spooning ~ canvas,
body:has(#ui.spooning) #c,
body:has(#ui.shaking) #c {
  cursor: none;
}
/* the book's bonus sticker and the moulds row */
.stk.bonus {
  border-color: rgba(196, 18, 47, 0.45);
}
.stk.bonus.found {
  background: linear-gradient(160deg, #ffd96e, #e59a2a);
  box-shadow: 0 3px 0 #9a5a12, 0 6px 14px rgba(0, 0, 0, 0.25), inset 0 0 0 3px rgba(255, 255, 255, 0.7);
}
.stk.bonus.found i {
  color: #c4122f;
}
.mouldHd {
  margin: calc(var(--u) * 1.2) 0 calc(var(--u) * 0.5);
  font: 600 calc(var(--u) * 1.2) Fraunces, Georgia, serif;
  color: #5a2a0c;
}
.moulds {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: calc(var(--u) * 0.8);
}
.mld {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3em;
  font-size: calc(var(--u) * 0.95);
  font-weight: 600;
  color: rgba(42, 20, 8, 0.45);
  text-align: center;
}
.mld i {
  width: calc(var(--u) * 4);
  height: calc(var(--u) * 3.4);
  border-radius: 45% 45% 12% 12% / 60% 60% 14% 14%;
  border: 2px dashed rgba(42, 20, 8, 0.25);
}
.mld.seen {
  color: #3a1706;
}
.mld.seen i {
  border: 0;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.75), transparent 28%), var(--c);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25), inset 0 -6px 10px rgba(0, 0, 0, 0.25);
  animation: mldWob 1.2s ease-in-out infinite alternate;
}
@keyframes mldWob {
  from {
    transform: skewX(-4deg) scaleY(1.03);
  }
  to {
    transform: skewX(4deg) scaleY(0.97);
  }
}

/* ================= Jingle Run ================= */
/* the first hint sits at the top centre, like a toast that stays */
.hint {
  top: calc(var(--u) * 1.3 + env(safe-area-inset-top));
  bottom: auto;
  background: linear-gradient(180deg, rgba(70, 30, 34, 0.88), rgba(36, 14, 20, 0.88));
  border: 1px solid rgba(255, 211, 107, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.hint.gone {
  transform: translate(-50%, -10px);
}
/* Drop shows which marble is loaded */
.bar button.big {
  position: relative;
}
.pouchDot {
  width: 1.05em;
  height: 1.05em;
  border-radius: 50%;
  margin-left: 0.15em;
  background: radial-gradient(circle at 35% 30%, #fff 0 12%, transparent 13%), repeating-conic-gradient(from 20deg, #e8203a 0 25deg, #fff2ea 25deg 50deg);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(90, 40, 6, 0.35);
}
.pouch {
  position: absolute;
  left: 50%;
  bottom: calc(var(--u) * 6.6 + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: calc(var(--u) * 0.8) calc(var(--u) * 1);
  border-radius: calc(var(--u) * 1.4);
  background: linear-gradient(180deg, rgba(70, 30, 34, 0.94), rgba(36, 14, 20, 0.94));
  border: 1px solid rgba(255, 211, 107, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  animation: toastIn 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.pouch.hidden {
  display: none;
}
.pouchHd {
  font: 600 calc(var(--u) * 1.1) Fraunces, Georgia, serif;
  color: var(--gold);
  text-align: center;
  margin-bottom: 0.5em;
}
.pouchRow {
  display: flex;
  gap: calc(var(--u) * 0.5);
}
.pouchRow button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: calc(var(--u) * 0.9);
  padding: 0.6em 0.5em 0.5em;
  min-width: calc(var(--u) * 5.2);
  font-size: calc(var(--u) * 0.85) !important;
}
.pouchRow button.on {
  background: rgba(255, 211, 107, 0.25);
  box-shadow: inset 0 0 0 2px var(--gold);
}
.pouchRow button.locked {
  opacity: 0.45;
}
.pouchRow i {
  width: calc(var(--u) * 2.4);
  height: calc(var(--u) * 2.4);
  border-radius: 50%;
  box-shadow: inset 0 -4px 6px rgba(0, 0, 0, 0.35), 0 3px 8px rgba(0, 0, 0, 0.4);
}
.pouchRow button.locked i {
  filter: grayscale(1) brightness(0.5);
}
/* the carol card: a found tune, its notes lighting up as the band plays it */
.carolCard {
  position: absolute;
  left: 50%;
  top: calc(var(--u) * 6.2 + env(safe-area-inset-top));
  transform: translateX(-50%);
  text-align: center;
  padding: calc(var(--u) * 0.8) calc(var(--u) * 1.8) calc(var(--u) * 0.9);
  border-radius: calc(var(--u) * 1.4);
  background: linear-gradient(180deg, rgba(255, 246, 224, 0.96), rgba(244, 226, 190, 0.96));
  color: #3a1706;
  box-shadow: 0 3px 0 #9a5a12, 0 12px 34px rgba(0, 0, 0, 0.4), inset 0 0 0 3px rgba(255, 211, 107, 0.8);
  animation: toastIn 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  transition: opacity 0.5s, transform 0.5s;
  max-width: 92vw;
}
.carolCard.hidden {
  display: none;
}
.carolCard.out {
  opacity: 0;
  transform: translate(-50%, -14px);
}
.ccT {
  font: 600 calc(var(--u) * 1.9) Fraunces, Georgia, serif;
  color: #a10f24;
}
.ccS {
  font-size: calc(var(--u) * 1.05);
  opacity: 0.8;
  margin-top: 0.2em;
}
.ccN {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25em;
  margin-top: 0.45em;
  font: 700 calc(var(--u) * 0.95) 'Chakra Petch', sans-serif;
}
.ccN b {
  min-width: 1.9em;
  padding: 0.15em 0.3em;
  border-radius: 0.5em;
  background: rgba(58, 23, 6, 0.08);
  color: rgba(58, 23, 6, 0.5);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.ccN b.sung {
  background: #c4122f;
  color: #fff;
  transform: translateY(-2px);
}
/* build mode: the tray of pieces, the tuning strip, the bin */
.buildBar.hidden,
.bar.main.hidden {
  display: none;
}
.tray {
  display: flex;
  gap: calc(var(--u) * 0.35);
}
.tray button {
  flex-direction: column;
  gap: 0.15em !important;
  padding: 0.35em 0.6em 0.4em !important;
  border-radius: calc(var(--u) * 1) !important;
  font-size: calc(var(--u) * 0.8) !important;
  cursor: grab !important;
}
.tray img {
  width: calc(var(--u) * 3);
  height: calc(var(--u) * 3);
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45));
}
.tune {
  position: absolute;
  left: 50%;
  bottom: calc(var(--u) * 8.4 + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: calc(var(--u) * 0.6) calc(var(--u) * 0.9);
  border-radius: calc(var(--u) * 1.2);
  background: linear-gradient(180deg, rgba(70, 30, 34, 0.94), rgba(36, 14, 20, 0.94));
  border: 1px solid rgba(255, 211, 107, 0.45);
  pointer-events: auto;
  text-align: center;
}
.tune.hidden {
  display: none;
}
.tuneHd {
  font-size: calc(var(--u) * 0.95);
  margin-bottom: 0.4em;
}
.tuneHd b {
  color: var(--gold);
}
.tuneRow {
  display: flex;
  gap: calc(var(--u) * 0.35);
  justify-content: center;
}
.tn {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: calc(var(--u) * 0.7);
  background: var(--c);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  padding: 0.1em 0.15em;
  min-width: calc(var(--u) * 2.6);
}
.tn b {
  font: 700 calc(var(--u) * 1.05) 'Chakra Petch', sans-serif;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.tn button {
  border: 0;
  background: transparent;
  color: #fff !important;
  font-size: calc(var(--u) * 0.8) !important;
  padding: 0.2em 0.6em;
  opacity: 0.85;
}
.bin {
  position: absolute;
  right: calc(var(--u) * 1.6 + env(safe-area-inset-right));
  bottom: calc(var(--u) * 7 + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.8em 1.2em;
  border-radius: 999px;
  border: 2px dashed rgba(255, 211, 107, 0.5);
  background: rgba(30, 12, 18, 0.7);
  font-size: calc(var(--u) * 1);
  transition: transform 0.15s, background 0.15s;
}
.bin.hidden {
  display: none;
}
.bin.hot {
  transform: scale(1.12);
  background: rgba(196, 18, 47, 0.8);
  border-color: #fff;
}
#ui.building .brand,
#ui.building .spotBtn {
  opacity: 0.4;
}
/* the songbook page */
.songs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: calc(var(--u) * 0.6);
}
.song {
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.45em 0.6em;
  border-radius: calc(var(--u) * 0.7);
  border: 2px dashed rgba(42, 20, 8, 0.2);
  font-size: calc(var(--u) * 0.85);
  color: rgba(42, 20, 8, 0.5);
}
.song i {
  font-style: normal;
  font-weight: 700;
}
.song.found {
  border: 0;
  background: linear-gradient(160deg, #c4122f, #8a0a20);
  color: #fff;
  box-shadow: 0 2px 0 #5a0614;
}
@media (max-width: 640px) {
  .songs {
    grid-template-columns: repeat(2, 1fr);
  }
  .tray span {
    display: none;
  }
  .tray img {
    width: calc(var(--u) * 2.6);
    height: calc(var(--u) * 2.6);
  }
}
/* the carols panel */
.bar button span {
  white-space: nowrap;
}
.carols {
  position: absolute;
  left: 50%;
  bottom: calc(var(--u) * 6.6 + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(var(--u) * 34), calc(100vw - 24px));
  padding: calc(var(--u) * 1) calc(var(--u) * 1.2) calc(var(--u) * 1.1);
  border-radius: calc(var(--u) * 1.4);
  background: linear-gradient(180deg, rgba(70, 30, 34, 0.95), rgba(36, 14, 20, 0.95));
  border: 1px solid rgba(255, 211, 107, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  animation: toastIn 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  color: #fff4e4;
}
.carols.hidden {
  display: none;
}
.crHd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.crHd b {
  font: 600 calc(var(--u) * 1.35) Fraunces, Georgia, serif;
  color: var(--gold);
}
.crHd span {
  font-size: calc(var(--u) * 0.85);
  opacity: 0.7;
}
.crSub {
  font-size: calc(var(--u) * 0.85);
  opacity: 0.8;
  margin: 0.4em 0 0.8em;
  line-height: 1.35;
}
.crSongs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: calc(var(--u) * 0.4);
  margin-bottom: calc(var(--u) * 0.8);
}
.crSongs .sg {
  display: flex;
  align-items: center;
  gap: 0.5em;
  text-align: left;
  border: 1px dashed rgba(255, 211, 107, 0.25);
  background: rgba(255, 255, 255, 0.04);
  border-radius: calc(var(--u) * 0.7);
  padding: 0.45em 0.6em;
  font-size: calc(var(--u) * 0.85) !important;
  color: rgba(255, 244, 228, 0.55) !important;
  cursor: pointer;
}
.crSongs .sg i {
  font-style: normal;
  color: var(--gold);
  width: 1.1em;
  text-align: center;
}
.crSongs .sg.heard,
.crSongs .sg.found {
  border-style: solid;
  color: #fff4e4 !important;
}
.crSongs .sg.found {
  background: rgba(255, 211, 107, 0.12);
}
.crSongs .sg.on {
  box-shadow: inset 0 0 0 2px var(--gold);
}
.crRow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: calc(var(--u) * 0.35);
  margin-top: calc(var(--u) * 0.45);
}
.crRow label {
  width: calc(var(--u) * 3.4);
  font-size: calc(var(--u) * 0.8);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.65;
}
.crRow .chip {
  border: 1px solid rgba(255, 211, 107, 0.35);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 0.3em 0.85em;
  font-size: calc(var(--u) * 0.85) !important;
  color: #fff4e4 !important;
  cursor: pointer;
}
.crRow .chip.on {
  background: linear-gradient(180deg, #ffe08a, #d9a531);
  color: #3a1a06 !important;
  border-color: transparent;
  font-weight: 700;
}
.crRow .sw {
  display: flex;
  align-items: center;
  gap: 0.6em;
  border: 0;
  background: transparent;
  color: #fff4e4 !important;
  font-size: calc(var(--u) * 0.95) !important;
  cursor: pointer;
  padding: 0.2em 0;
}
.crRow .sw i {
  width: 2.4em;
  height: 1.3em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  position: relative;
  transition: background 0.2s;
}
.crRow .sw i::after {
  content: '';
  position: absolute;
  left: 0.15em;
  top: 0.15em;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.crRow .sw.on i {
  background: #d9a531;
}
.crRow .sw.on i::after {
  transform: translateX(1.1em);
}
/* panels that are centred with transform rise in with the individual transform properties so they don't slide */
@keyframes riseIn {
  from {
    opacity: 0;
    translate: 0 -16px;
    scale: 0.85;
  }
}
@keyframes riseUp {
  from {
    opacity: 0;
    translate: 0 16px;
    scale: 0.9;
  }
}
.carolCard {
  animation-name: riseIn;
}
.pouch,
.carols {
  animation-name: riseUp;
}
/* wide screens: the carol card sits in the left margin, clear of the stocking's cuff and the toasts */
@media (min-aspect-ratio: 21/13) {
  .carolCard {
    left: calc(var(--u) * 1.6 + env(safe-area-inset-left));
    top: calc(var(--u) * 6.4 + env(safe-area-inset-top));
    transform: none;
    max-width: min(30vw, calc(var(--u) * 26));
    rotate: -1.5deg;
  }
  .carolCard.out {
    transform: translateY(-14px);
  }
}
/* portrait phones: the hint drops below the brand row; toasts and the carol card stack under it */
@media (max-aspect-ratio: 1/1) {
  .hint {
    top: calc(var(--u) * 4.8 + env(safe-area-inset-top));
    width: auto;
    white-space: nowrap;
  }
  .toasts {
    top: calc(var(--u) * 8.4 + env(safe-area-inset-top));
  }
  .carolCard {
    top: calc(var(--u) * 12.5 + env(safe-area-inset-top));
    width: min(92vw, calc(var(--u) * 30));
    padding-left: calc(var(--u) * 1);
    padding-right: calc(var(--u) * 1);
  }
}
/* shouts never run off a narrow screen */
.shout {
  font-size: min(calc(var(--u) * 5.2), 10.5vw);
}
/* the open book sits above pops, toasts and the carol card */
.book {
  z-index: 30;
}
/* the sticker book's "start again" (two taps) */
.bookFoot {
  text-align: center;
  margin-top: calc(var(--u) * 1);
}
.bookFoot .wipe {
  border: 1px dashed rgba(42, 20, 8, 0.3);
  background: transparent;
  border-radius: 999px;
  padding: 0.4em 1.1em;
  font-size: calc(var(--u) * 0.85) !important;
  color: rgba(42, 20, 8, 0.6) !important;
  cursor: pointer;
}
.bookFoot .wipe.sure {
  background: #c4122f;
  border-color: #c4122f;
  color: #fff !important;
}

/* ================= second pass: labels, the piece toolbar and handles, the Runs chooser, phones ================= */
.bar button.sm:not(.lab) span {
  display: none;
}
.bar button.lab,
.buildBar button.sm {
  padding: 0.55em 0.95em 0.55em 0.7em;
}
.bar.buildBar button.sm span {
  display: inline;
}
.bar button.off {
  opacity: 0.55;
}
.bar button:focus-visible,
.selBar button:focus-visible,
.rn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
/* the panels above a bar follow its height (layoutBars sets --barTop) */
.pouch,
.carols {
  bottom: calc(var(--barTop, calc(var(--u) * 6.6)) + env(safe-area-inset-bottom));
}
.tune {
  bottom: calc(var(--barTop, calc(var(--u) * 8.4)) + env(safe-area-inset-bottom));
}
#ui:has(.selBar.dock:not(.hidden)) .tune {
  bottom: calc(var(--barTop, 90px) + 66px + env(safe-area-inset-bottom));
}
.selBar.hidden,
.hRot.hidden,
.hSize.hidden,
.hStalk.hidden,
.runs.hidden {
  display: none !important;
}

/* the selected piece's toolbar: a pill floating over the piece (docked above the bar on small screens) */
.selBar {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px 5px 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(70, 30, 34, 0.95), rgba(36, 14, 20, 0.95));
  border: 1px solid rgba(255, 211, 107, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  pointer-events: auto;
  z-index: 8;
  animation: toastIn 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.selName {
  font: 600 15px Fraunces, Georgia, serif;
  color: var(--gold);
  padding: 0 8px 0 12px;
  white-space: nowrap;
}
.selBar button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.15s, transform 0.12s, opacity 0.15s;
  touch-action: manipulation;
}
.selBar button svg {
  width: 24px !important;
  height: 24px !important;
}
.selBar button:hover {
  background: rgba(255, 211, 107, 0.22);
}
.selBar button:active {
  transform: scale(0.9);
}
.selBar button.off {
  opacity: 0.3;
}
.selBar button.del {
  margin-left: 4px;
  background: rgba(196, 18, 47, 0.45);
}
.selBar button.del:hover {
  background: rgba(220, 30, 60, 0.75);
}
.selBar.dock {
  left: 50% !important;
  top: auto !important;
  bottom: calc(var(--barTop, 90px) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  animation-name: riseUp;
}

/* the handles: a gold knob on a dotted stalk to turn it, a square knob on the corner to size it */
.hStalk {
  position: absolute;
  left: 0;
  top: 0;
  height: 0;
  border-top: 2px dashed rgba(255, 221, 140, 0.85);
  transform-origin: 0 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
  z-index: 6;
}
.hRot,
.hSize {
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 3px solid #fff8e8;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2b8, #f2b53c 55%, #c47a14);
  color: #4a1e04 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(255, 211, 107, 0.25);
  cursor: grab !important;
  touch-action: none;
  z-index: 7;
  transition: box-shadow 0.15s, scale 0.15s;
}
.hSize {
  border-radius: 14px;
  cursor: nwse-resize !important;
}
.hRot svg,
.hSize svg {
  width: 26px !important;
  height: 26px !important;
  stroke-width: 2.4 !important;
}
.hRot:hover,
.hSize:hover {
  scale: 1.08;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 0 7px rgba(255, 211, 107, 0.35);
}
.hRot.active,
.hSize.active {
  scale: 1.18;
  cursor: grabbing !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 0 10px rgba(255, 211, 107, 0.4);
}
.hDeg {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  translate: -50% 0;
  font: 700 12px 'Chakra Petch', sans-serif;
  font-style: normal;
  color: #fff4e4;
  background: rgba(30, 12, 18, 0.85);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.hRot.active .hDeg,
.hRot:hover .hDeg {
  opacity: 1;
}
#ui.dragging,
#ui.dragging * {
  cursor: grabbing !important;
}

/* the Runs chooser */
.runs {
  position: absolute;
  left: 50%;
  bottom: calc(var(--barTop, 90px) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(1000px, calc(100vw - 24px));
  box-sizing: border-box;
  max-height: calc(100vh - var(--barTop, 90px) - 70px);
  overflow-y: auto;
  padding: 14px 16px 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(70, 30, 34, 0.96), rgba(36, 14, 20, 0.96));
  border: 1px solid rgba(255, 211, 107, 0.5);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  z-index: 20;
  animation: riseUp 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  color: #fff4e4;
}
.rnHd {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rnHd b {
  font: 600 22px Fraunces, Georgia, serif;
  color: var(--gold);
}
.rnHd .x {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 18px !important;
}
.rnSub {
  font-size: 14px;
  opacity: 0.8;
  margin: 2px 0 12px;
}
.rnGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 176px));
  justify-content: center;
  gap: 12px;
}
.rn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  gap: 2px;
  padding: 8px 8px 10px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 211, 107, 0.2);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.rn:hover {
  background: rgba(255, 211, 107, 0.14);
  transform: translateY(-3px);
  box-shadow: inset 0 0 0 2px rgba(255, 211, 107, 0.6), 0 8px 18px rgba(0, 0, 0, 0.35);
}
.rn.on {
  box-shadow: inset 0 0 0 2px var(--gold);
  background: rgba(255, 211, 107, 0.12);
}
.rn .mm {
  display: block;
  aspect-ratio: 1;
  border-radius: 11px;
  background: radial-gradient(ellipse at 50% 40%, #3a2a3a, #1a0f18);
  margin-bottom: 6px;
  overflow: hidden;
}
#ui .rn .mm svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke: none;
  stroke-width: 0;
}
.rn b {
  font: 600 16px Fraunces, Georgia, serif;
  color: var(--gold);
  line-height: 1.15;
}
.rn small {
  font-size: 12.5px;
  line-height: 1.25;
  opacity: 0.8;
}
.rn em {
  font-style: normal;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffdca0;
  margin-top: 3px;
}
.rn .now {
  position: absolute;
  top: 14px;
  left: 14px;
  font: 700 11px 'Chakra Petch', sans-serif;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3a1706;
  background: linear-gradient(180deg, #ffd96e, #e59a2a);
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 0 #9a5a12;
}

/* phones held upright: two rows of labelled buttons, every one a thumb-sized target; the kit's way-home buttons sit
   top left, so the toasts and the carol card drop below them */
@media (max-width: 640px) {
  .bar.main,
  .bar.buildBar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    width: calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-width: 480px;
    box-sizing: border-box;
    padding: 6px;
    border-radius: 22px;
    bottom: calc(8px + env(safe-area-inset-bottom));
  }
  .bar.buildBar.hidden,
  .bar.main.hidden {
    display: none;
  }
  .bar .sep {
    display: none;
  }
  .bar button,
  .bar button.sm,
  .bar button.lab {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 54px;
    padding: 6px 2px 5px;
    border-radius: 14px;
  }
  .bar button span,
  .bar button.sm:not(.lab) span {
    display: block;
    font-size: 11px !important;
    line-height: 1;
    letter-spacing: 0.02em;
  }
  .bar button svg {
    width: 24px !important;
    height: 24px !important;
  }
  .bar button.big .pouchDot {
    position: absolute;
    top: 5px;
    right: 7px;
    width: 13px;
    height: 13px;
    margin: 0;
  }
  .tray {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    padding-bottom: 4px;
    margin-bottom: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  .tray button {
    min-height: 48px !important;
    padding: 4px 0 !important;
  }
  .tray span {
    display: none !important;
  }
  .tray img {
    width: 34px !important;
    height: 34px !important;
  }
  .toast {
    max-width: calc(100vw - 32px);
    font-size: 13px;
  }
  .selBar button {
    width: 48px;
    height: 48px;
  }
  .selName {
    display: none;
  }
  .runs {
    width: calc(100vw - 16px);
    padding: 12px 12px 14px;
  }
  .rnGrid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .rn .mm {
    aspect-ratio: 1.35;
  }
  .rnSub {
    font-size: 13px;
  }
}
@media (max-aspect-ratio: 1/1) {
  .toasts {
    top: max(calc(var(--u) * 8.4), 108px);
  }
  .carolCard {
    top: max(calc(var(--u) * 12.5), 150px);
  }
}
/* phones on their side: the bars lose their labels so nothing shrinks, and the tuning strip moves to the right edge,
   clear of the piece you're tuning */
@media (max-height: 480px) {
  .bar.buildBar button.sm span,
  .tray span {
    display: none;
  }
  .bar.buildBar button.sm {
    padding: 0.55em;
  }
  .tune,
  #ui:has(.selBar.dock:not(.hidden)) .tune {
    left: auto;
    right: calc(8px + env(safe-area-inset-right));
    top: 58px;
    bottom: auto;
    transform: none;
  }
}
