/* ui.css — owner track: C4. The tray's controls and the stamps over the stage (task B9): the choice chips and cards, the
   cloth cards, YES, AND! and the 'no' with its four exits, the HOLD button, the single buttons, PAIRS, the stamps, the
   flash and the toast's entrance. Then the title screen (task B10): the sound chip, the show switch, the two plastic
   stools and the tissue packet, the packet landing under the CHOPE! stamp, and the sound toggle; with C4.1's cut-paper
   logo, corner icons, tips and in-app banner, and the HUD resting under the title. Then the pause menu, the full
   screens over the page with the settings screen and the Programme Booklet in them (C4.2) and the star's Wardrobe and
   the HAPPIER ENDINGS album (C4.3), the config banner's dismiss, the loading curtain and its lift (tasks B12 and C4.1),
   the velvet curtains beside the column (C4.1), and the text app.css sizes in px, made to follow the text size (C4.2).
   C4.4 adds the Peranakan tile border on every card, the stamps' two-frame punch, the dotted local words with their
   48 px hit areas and gloss slip, the coach and the twin caption's stage-direction look.
   Cut paper on a night-time void deck: cream card stock with a hard offset shadow and hand-cut corners, ink lettering,
   and a squish when pressed. Sizes are in px; text is in rem and follows --text-scale, except where a control's size is
   fixed (YES, AND! is 200 x 72 and HOLD 120 across), whose lettering stops growing once it fills them. Every punch,
   slam, pulse and flash reads html.reduced-motion, which B12's boot and the settings screen set from the settings and
   the OS: there they become fades or hold still. Under .e2e (app.css) nothing animates at all. */

:root {
  --paper-press: 1px 1px 0 rgba(0, 0, 0, 0.35);
  /* A card's edge drawn just inside it, so a card on a sheet of the same cream (the Wardrobe's tags, the album's
     entries) still stands off it, with the paper shadow under it. */
  --card-edge: inset 0 0 0 1.5px rgba(91, 42, 94, 0.18);
  --gold-hi: #FFD866;
  --gold-lo: #C99A12;
  --no-grey: #C3C3CC;
  --no-ink: #6E6E7C;
  /* A Peranakan tile strip for the cards' top and bottom edges (section 10.7): rose flowers with gold hearts between
     teal diamonds with cream eyes, 14 x 8 px a tile, in teal #14A098, rose #C25A78 and gold #E6B422. */
  --tile-strip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8'%3E%3Cpath d='M7 0.6 10.4 4 7 7.4 3.6 4Z' fill='%2314A098'/%3E%3Ccircle cx='7' cy='4' r='1' fill='%23FFF6E5'/%3E%3Ccircle cx='0' cy='4' r='2.6' fill='%23C25A78'/%3E%3Ccircle cx='14' cy='4' r='2.6' fill='%23C25A78'/%3E%3Ccircle cx='0' cy='4' r='1' fill='%23E6B422'/%3E%3Ccircle cx='14' cy='4' r='1' fill='%23E6B422'/%3E%3C/svg%3E");
}

/* The tray sits in front of the caption band, so the badges that rise above a card's top edge show over the band's foot,
   and a dotted word's hit area on the band's last line, which runs a few px under the tray's top edge, takes no tap
   from it (ruling 264's cost line). */
#tray {
  z-index: 2;
}

/* — Shared: a piece of card stock with a key badge — */

.choice,
.cloth,
.ui-button,
.yesand-button,
.pairs-side,
.hold {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.choice,
.cloth {
  position: relative;
  background: var(--cards);
  color: var(--ink);
  box-shadow: var(--paper-shadow);
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}

/* Every card wears its Peranakan tile border (section 10.7): cards.js sets each card's own as its border-image-source
   (peranakan.js), cut here into its 12-unit corners and its edge tiles, which repeat whole along each side. The band is
   6 px wide, taken from the padding the card had, so nothing inside it moves. A border image is not clipped to the
   corners' curve, and each corner rosette's outer petal reaches to 1.64 px from the card's corner along the diagonal,
   where a corner of radius r curves in by 0.414r. So every corner is cut at most 4 px round (0.414 x 4 = 1.66 px), and
   the rosettes stay on the paper. */
.choice {
  border-style: solid;
  border-width: 6px;
  border-color: transparent;
  border-image-slice: 12;
  border-image-width: 6px;
  border-image-repeat: round;
  border-radius: 4px 3px 4px 2px;
}

.choice:active,
.cloth:active,
.ui-button:active,
.yesand-button:not([aria-disabled="true"]):active,
.pairs-side:active {
  transform: translate(2px, 2px) scale(0.97);
  box-shadow: var(--paper-press);
}

.choice-key,
.cloth-key {
  position: absolute;
  top: -7px;
  left: -6px;
  z-index: 1;
  width: 22px;
  height: 22px;
  border: 2px solid var(--cards);
  border-radius: 50%;
  background: var(--ink);
  color: var(--cards);
  font: 800 12px/18px "Baloo 2", system-ui, sans-serif;
  text-align: center;
}

.choice-sparkle,
.cloth-sparkle {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 15px;
  height: 15px;
  background: #FFF2BF;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 2px rgba(255, 211, 138, 0.9));
  animation: sparkle-twinkle 1.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sparkle-twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.75) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.1) rotate(45deg); }
}

/* A card's key badge and sparkle are placed from its padding box, inside the 6 px border: these keep them where they
   were before the card wore it. */
.choice-key {
  top: -13px;
  left: -12px;
}

.choice-sparkle {
  top: 1px;
  right: 1px;
}

/* — Choices: chips, role cards and ending cards — */

.choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 440px;
}

.choices-prompt {
  margin: 0;
  color: var(--window-warm);
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.choices-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 9px;
}

/* Chips: the interview's questions and the warm-up's shouts, one under another, the key at the left. */
.choices[data-layout="chips"] .choices-row {
  grid-auto-flow: row;
  gap: 7px;
}

.choices[data-layout="chips"] .choice {
  min-height: 48px;
  padding: 3px 10px 3px 38px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
}

.choices[data-layout="chips"] .choice-key {
  top: 50%;
  left: 5px;
  transform: translateY(-50%);
  border-color: transparent;
}

/* Cards: the role and ending cards, side by side, each framed in its tiles. */
.choices[data-layout="cards"] .choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  padding: 9px 0;
  text-align: center;
}

.choice-preview {
  display: block;
  flex: none;
  width: 96px;
  height: 128px;
  border-radius: 8px 6px 9px 7px;
  background: radial-gradient(ellipse 70% 55% at 50% 42%, #4A2C61, var(--sky-mid) 55%, var(--sky-dark));
  box-shadow: inset 0 0 0 2px rgba(43, 27, 47, 0.55);
}

.choice-label {
  font: 800 0.9375rem/1.05 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* A long label steps its size down (cards.js labelLength): the finale's casting card C runs to 84 characters at the
   longest tokens, which wrapped to eight lines on a 360 px phone and broke a 12-letter name inside itself. anywhere
   stays, the last resort for a word too wide even so: break-word would let it overflow the card. */
.choice-label[data-length="long"] {
  font-size: 0.8125rem;
}

.choice-label[data-length="longest"] {
  font-size: 0.6875rem;
  line-height: 1.1;
}

.choice-sub {
  color: var(--plum);
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.06em;
}

/* An ending card names its kind first, as a small stamp, then its poster title. */
.choices[data-choice="ending"] .choice {
  justify-content: center;
  gap: 6px;
}

.choices[data-choice="ending"] .choice-sub {
  order: -1;
  padding: 1px 7px 0;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  transform: rotate(-3deg);
}

/* The gold-ear LISTENED card: gold card stock, and an ear on a paper disc pinned to its top right corner. The disc
   rises over the card's top edge but keeps inside the card's own width, its 8° turn included (it reaches 2 px past
   its box on each side, and its right side sits 3 px past the padding box, inside the 6 px border), so whichever card
   is LISTENED (card A in the finale, card C in a teller's scene) its ear never reaches the next card or the key badge
   on that card's corner (the Phase C gate, capture 36). */
.choice[data-gold="true"] {
  background: linear-gradient(165deg, var(--gold-hi), var(--tone-callback) 48%, var(--gold-lo));
}

.choice[data-gold="true"] .choice-sub {
  color: var(--ink);
}

.choice-ear {
  position: absolute;
  top: -21px;
  right: -3px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--cards);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
  transform: rotate(8deg);
}

.choice-ear svg {
  width: 22px;
  height: 22px;
}

.choice-ear path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* — The cloth tray: a swatch of each cloth on a paper tag, in the tone table's order — */

.cloths {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 440px;
}

.cloth {
  --tone: var(--tone-callback);
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
  min-height: 48px;
  padding: 5px 3px 9px;
  border-radius: 10px 8px 11px 9px;
  touch-action: none;
  cursor: grab;
  transition: transform 160ms cubic-bezier(0.3, 1.3, 0.5, 1), box-shadow 90ms ease-out;
}

.cloth[data-tone="SPICY"] { --tone: var(--tone-spicy); }
.cloth[data-tone="SAD"] { --tone: var(--tone-sad); }
.cloth[data-tone="FABULOUS"] { --tone: var(--tone-fabulous); }
.cloth[data-tone="WEIRD"] { --tone: var(--tone-weird); }

/* The tag's foot: a strip of the cloth's colour, so the colour shows even where the swatch is small. */
.cloth::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 3px;
  height: 3px;
  border-radius: 2px;
  background: var(--tone);
}

/* CALLBACK's gold sits close to FABULOUS, so its card carries the cloth's thick dashed ink outline too. */
.cloth[data-tone="CALLBACK"] {
  outline: 2.5px dashed var(--ink);
  outline-offset: -5px;
}

.cloth[data-tone="CALLBACK"]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.cloth[data-dragging="true"] {
  z-index: 3;
  cursor: grabbing;
  box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.3);
  transition: none;
}

.cloth-art {
  display: block;
  width: min(100%, 64px);
  height: auto;
}

/* The tone's word, at the text size until it would outgrow its card: at 19cqi FABULOUS, the widest word, spans 94% of
   the card. A larger text size lets the word take more of a narrow card, up to 20.8cqi at 130% with its letters closed
   up to -0.01em, so even the five cloths on a 360 px phone grow their words. */
.cloth-word {
  margin-top: 3px;
  font: 800 min(0.8125rem, calc(19cqi + 6cqi * (var(--text-scale) - 1)))/1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: calc(0.02em - 0.1em * (var(--text-scale) - 1));
  white-space: nowrap;
}

/* CALLBACK's word has less of its card: the dashed outline takes 5 px of each side, and the word keeps 2 px clear of the
   dashes, so the card's 100cqi less 8 px. CALLBACK is 4.82em wide in Baloo 2 800 with its letters spaced as at 100%,
   its last letter's spacing included, so at most (100cqi - 8px) / 5, which leaves its ink a little to spare either side
   (on a 360 px phone's five cloths it once ran flush against the dashes and read as ICALLBACKI). Where the card leaves
   it room, it grows to 19.6cqi at 130%, not 20.8. */
.cloth[data-tone="CALLBACK"] .cloth-word {
  font-size: min(0.8125rem, calc(19cqi + 2cqi * (var(--text-scale) - 1)), calc((100cqi - 8px) / 5));
}

/* A tone's teaser: two or three words, wrapped between them. Its longest word (Thunderclap, 5.96em in Nunito 800) fits
   the card whole at 100cqi / 6.1, so a narrow card (five cloths on a 360 px phone) never breaks a word inside itself;
   overflow-wrap: anywhere is only the last resort for a word no content has. Where the card leaves room, it grows with
   the text size. */
.cloth-teaser {
  margin-top: 2px;
  color: var(--plum);
  font-size: min(0.6875rem, calc(18cqi + 4cqi * (var(--text-scale) - 1)), calc(100cqi / 6.1));
  font-weight: 800;
  line-height: 1.12;
  overflow-wrap: anywhere;
  text-align: center;
  text-wrap: balance;
}

/* CALLBACK's teaser is its story's object, in capitals (THE CALENDAR INVITE), and keeps 2 px clear inside the dashed
   outline: 4 px of padding on the card's 3 puts it 7 px in from each side, the dashes' inner edge being 5 px in. The room
   there holds a word of 5.8em (TEASER_WORD_EM, which validate.js holds every word of a callback's name to; CALENDAR is
   5.56em as set), so no word is ever broken from a 320 px phone up, at every text size. At 18cqi CALENDAR outgrew a
   360 px phone's card and broke as CALENDA / R. */
.cloth[data-tone="CALLBACK"] .cloth-teaser {
  padding-inline: 4px;
  font-size: min(0.6875rem, calc((100cqi - 8px) / 5.8));
}

/* — YES, AND! and the 'no' — */

.yesand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.yesand-button {
  position: relative;
  flex: none;
  width: 200px;
  height: 72px;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 17px 13px 18px 12px;
  background: linear-gradient(170deg, var(--gold-hi), var(--tone-fabulous) 45%, var(--tone-callback));
  color: var(--ink);
  font: 800 min(1.75rem, 30px)/1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.02em;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}

/* Up but not yet pressable: no pulse, no press, and an arrow cursor. */
.yesand-button[aria-disabled="true"] {
  cursor: default;
}

/* A tiny grey slip that takes no input at all, ever (section 3.7). */
.yesand-no {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 28px;
  border-radius: 8px 6px 9px 6px;
  background: var(--no-grey);
  color: var(--no-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

/* Its four exits, each as the star takes it on stage. Flicked up towards the stage, to be folded into a star. */
.yesand-no[data-exit="noStar"] {
  animation: no-star 460ms cubic-bezier(0.55, 0, 0.75, 0.45) forwards;
}

@keyframes no-star {
  25% { transform: translate(4px, 6px) rotate(10deg); }
  to { transform: translate(-40px, -170px) rotate(-300deg) scale(0.4); opacity: 0; }
}

/* Tucked behind the Conductor, who stands stage left. */
.yesand-no[data-exit="noBehind"] {
  animation: no-behind 460ms cubic-bezier(0.5, 0, 0.7, 0.5) forwards;
}

@keyframes no-behind {
  30% { transform: translate(6px, -6px) rotate(6deg); }
  to { transform: translate(-190px, 4px) rotate(-16deg) scale(0.6); opacity: 0; }
}

/* Choped: a tissue packet drops onto it, and the two go together. */
.yesand-no[data-exit="noChope"] {
  animation: no-chope 460ms ease-in forwards;
}

.yesand-no[data-exit="noChope"]::after {
  content: "";
  position: absolute;
  inset: -5px -6px;
  border-radius: 5px;
  background: linear-gradient(#FFFFFF 0 38%, #8DBBE8 38% 60%, #FFFFFF 60%);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
  animation: no-chope-packet 460ms cubic-bezier(0.4, 1.5, 0.6, 1) forwards;
}

@keyframes no-chope {
  0%, 55% { transform: none; opacity: 1; }
  to { transform: translateY(8px) scale(0.85); opacity: 0; }
}

@keyframes no-chope-packet {
  from { transform: translateY(-70px) rotate(-14deg); opacity: 0; }
  35% { transform: translateY(0) rotate(-4deg); opacity: 1; }
  to { transform: translateY(0) rotate(-4deg); opacity: 1; }
}

/* Sat on: squashed flat by Kopi the cat. */
.yesand-no[data-exit="noKopi"] {
  animation: no-kopi 460ms cubic-bezier(0.6, 0, 0.8, 0.6) forwards;
  transform-origin: 50% 100%;
}

@keyframes no-kopi {
  35% { transform: scale(1.1, 0.85); }
  to { transform: translateY(6px) scale(1.5, 0.08); opacity: 0; }
}

/* — HOLD: a paper disc ringed by its gauge, the gold band hatched and notched — */

.hold {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  margin: 10px 26px;
  padding: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #FFFDF7, var(--cards) 58%, #EBDDC2);
  color: var(--ink);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
  touch-action: none;
  animation: hold-breathe 1.5s ease-in-out infinite;
}

.hold[data-state="held"] {
  background: radial-gradient(circle at 38% 32%, #FFF5D6, #FFE7A6 60%, #F2CF6E);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
  transform: translate(2px, 2px) scale(0.95);
  animation: none;
}

@keyframes hold-breathe {
  50% { transform: scale(1.035); }
}

.hold-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.hold-track,
.hold-band,
.hold-hatch {
  fill: none;
  stroke-width: 10;
}

.hold-track {
  stroke: rgba(91, 42, 94, 0.38);
}

.hold-band {
  stroke: var(--tone-callback);
}

.hold-hatch {
  stroke: var(--ink);
  opacity: 0.6;
}

.hold-notch {
  stroke: var(--ink);
  stroke-width: 2.6;
  stroke-linecap: round;
}

.hold-word {
  position: relative;
  font: 800 min(1.75rem, 30px)/1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.05em;
}

.hold-gold {
  position: absolute;
  padding: 2px 6px 1px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: repeating-linear-gradient(135deg, var(--tone-callback) 0 3px, var(--gold-lo) 3px 6px);
  color: var(--ink);
  font: 800 11px/1.1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.1em;
  text-shadow: 0 0 2px var(--cards), 0 0 1px var(--cards);
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(-8deg);
  pointer-events: none;
}

/* — The single buttons — */

.ui-button {
  position: relative;
  min-width: 48px;
  min-height: 48px;
  box-shadow: var(--paper-shadow);
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}

/* LET'S WATCH!: velvet red, gold lettering, and a ring of marquee bulbs. */
.ui-button[data-id="letsWatch"] {
  width: min(100%, 300px);
  min-height: 84px;
  padding: 12px 22px;
  border: 3px solid var(--tone-callback);
  border-radius: 15px 12px 16px 11px;
  background: radial-gradient(ellipse 80% 90% at 50% 25%, #A8253E, var(--velvet) 62%, var(--velvet-deep));
  color: var(--tone-fabulous);
  font: 800 min(2rem, 36px)/1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.03em;
  text-shadow: 2px 2px 0 var(--velvet-deep);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
}

.ui-button[data-id="letsWatch"]::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 3px dotted var(--window-warm);
  border-radius: 10px 8px 11px 7px;
  pointer-events: none;
}

/* The acknowledgment: a cream card in the teller's own words. */
.ui-button[data-id="ack"] {
  max-width: 100%;
  min-height: 56px;
  padding: 12px 26px 13px;
  border: 2.5px solid var(--ink);
  border-radius: 17px 12px 18px 12px;
  background: var(--cards);
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.2;
}

.ui-button[data-id="next"] {
  padding: 9px 34px 8px;
  border-radius: 24px 20px 23px 21px;
  background: var(--cards);
  color: var(--ink);
  font: 800 1.125rem/1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.06em;
}

/* The house lights' skip stays quiet: an outline, not a card. */
.ui-button[data-id="skip"] {
  padding: 8px 26px 7px;
  border: 2px solid rgba(255, 246, 229, 0.6);
  border-radius: 24px 20px 23px 21px;
  background: rgba(30, 22, 49, 0.55);
  color: var(--cards);
  font: 800 1rem/1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.06em;
  box-shadow: none;
}

/* A pulse: the button breathes, and a warm ring spreads from it. */
.ui-button[data-pulse="true"],
.yesand-button[data-pulse="true"] {
  animation: control-pulse 1.1s ease-in-out infinite;
}

@keyframes control-pulse {
  0% { transform: scale(1); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(255, 211, 138, 0.75); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4), 0 0 0 14px rgba(255, 211, 138, 0); }
}

/* — PAIRS (C6.2 replaces it): the line over its two halves — */

.pairs {
  display: grid;
  gap: 7px;
  width: 100%;
  max-width: 440px;
}

.pairs-line {
  margin: 0;
  color: var(--window-warm);
  font-size: 0.9375rem;
  font-weight: 800;
  text-align: center;
}

.pairs-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.pairs-side {
  min-height: 64px;
  border-radius: 13px 10px 14px 9px;
  color: var(--ink);
  font: 800 1.25rem/1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.04em;
  box-shadow: var(--paper-shadow);
  transition: transform 60ms ease-out, box-shadow 60ms ease-out;
}

.pairs-side[data-side="POLITE"] {
  background: var(--accent-nurul);
}

.pairs-side[data-side="SHOWTIME"] {
  background: var(--tone-fabulous);
}

/* — Stamps over the stage (banner.js): each slams down with a two-frame punch, then holds — */

/* The stamps size their lettering to the stage's width, so a long name still fits. */
#overlay {
  container-type: inline-size;
}

/* Centred across the stage, as wide as its words up to 90% of it, then wrapping. */
.stamp {
  --at: translateY(-50%) rotate(-6deg);
  position: absolute;
  top: 30%;
  left: 0;
  right: 0;
  width: fit-content;
  max-width: 90%;
  margin: 0 auto;
  padding: 6px 16px 3px;
  border: 3px solid var(--ink);
  border-radius: 9px 7px 10px 6px;
  background: var(--cards);
  color: var(--ink);
  font: 800 min(2.25rem, 10cqi)/1.02 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.03em;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
  transform: var(--at);
  animation: stamp-punch 100ms steps(1, end) both;
}

/* The punch: two held frames, the stamp coming down too big and its shadow far off, then squashed into the stage,
   then at rest. steps(1) holds each frame for its 50 ms, three refreshes at 60 Hz, rather than easing between them.
   The last frame names no shadow, so the fill holds each stamp's own (the name card's --paper-shadow, not this one). */
@keyframes stamp-punch {
  0% { transform: var(--at) scale(1.32); box-shadow: 9px 9px 0 rgba(0, 0, 0, 0.3); }
  50% { transform: var(--at) translate(2px, 3px) scale(0.93); box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.45); }
  100% { transform: var(--at); }
}

.stamp[data-kind="bigLaugh"] {
  --at: translateY(-50%) rotate(-7deg);
  top: 27%;
  padding: 8px 20px 4px;
  background: var(--tone-fabulous);
  font-size: min(2.75rem, 12.5cqi);
}

/* Committed!: a small tag pinned high on the right. */
.stamp[data-kind="committed"] {
  --at: translateY(-50%) rotate(5deg);
  top: 11%;
  left: auto;
  right: 7%;
  margin: 0;
  padding: 4px 11px 2px;
  border-color: var(--cards);
  background: var(--accent-star);
  color: var(--cards);
  font-size: min(1.0625rem, 6cqi);
}

.stamp[data-kind="fullyCommitted"],
.stamp[data-kind="ruleOfThree"] {
  --at: translateY(-50%) rotate(-4deg);
  top: 17%;
  border-color: var(--cards);
  background: var(--plum);
  color: var(--cards);
  font-size: min(1.5rem, 7.5cqi);
  letter-spacing: 0.06em;
}

.stamp[data-kind="ruleOfThree"] {
  --at: translateY(-50%) rotate(-9deg);
  top: 40%;
  border: 4px double var(--tone-spicy);
  background: var(--cards);
  color: var(--tone-spicy);
}

/* TAKE TWO! on a clapperboard: troupe black with a striped top. */
.stamp[data-kind="takeTwo"] {
  --at: translateY(-50%) rotate(-3deg);
  top: 18%;
  padding-top: 15px;
  border-color: var(--cards);
  background:
    repeating-linear-gradient(-55deg, var(--cards) 0 9px, var(--troupe-black) 9px 18px) 0 0 / 100% 9px no-repeat,
    var(--troupe-black);
  color: var(--cards);
}

.stamp[data-kind="improvises"] {
  --at: translateY(-50%) rotate(-5deg);
  border-color: var(--cards);
  background: var(--accent-star);
  color: var(--cards);
  font-size: min(1.875rem, 8.5cqi);
}

.stamp[data-kind="chope"] {
  --at: translateY(-50%) rotate(-12deg);
  top: 46%;
  padding: 6px 18px 2px;
  border: 5px double var(--tone-spicy);
  background: rgba(255, 246, 229, 0.92);
  color: var(--tone-spicy);
  font-size: min(3rem, 14cqi);
}

/* The teller's name card, held up at the foot of the stage as they walk up. */
.stamp[data-kind="nameCard"] {
  --at: rotate(-2deg);
  top: auto;
  bottom: 7%;
  max-width: min(88%, 340px);
  padding: 9px 16px 10px;
  border-width: 2px;
  font: 800 1rem/1.25 Nunito, system-ui, sans-serif;
  letter-spacing: 0;
  box-shadow: var(--paper-shadow);
}

/* The freeze's camera flash: white, gone in half a second. */
.flash {
  position: absolute;
  inset: 0;
  background: #FFFFFF;
  animation: flash-out 520ms ease-out forwards;
  pointer-events: none;
}

@keyframes flash-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* — The toast drops into B8's slot under the HUD — */

#toast:not(:empty) {
  animation: toast-in 180ms ease-out;
}

@keyframes toast-in {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* — The dotted local words (typing.js; sections 2.2 and 13), only while options.explainLocalTerms is on: a dotted
   underline in plum, and a hit area of at least 48 x 48 px (ruling 264).
   - Each word is an inline span, so the line breaks round it as round any word, and the '?' or ':' after it stays on
     its line. An inline-block would not do: a break may fall on either side of one, so its punctuation could wrap alone.
   - Its box is its face's content area (about 1.35em in Nunito) grown by padding, which takes no room in an inline's
     line. So the padding is sized from the font: (48 px - 1.2em) / 2, at least 14 px, which makes the box 50 px or
     more in Nunito. That is 14.4 px in the band at text 1, about as much as the band's 14 px clip leaves room for, and
     15 px in a 15 px bubble. (A fallback face, before the fonts load, can come out a pixel or so short.)
   - Horizontally, 14 px a side, which negative margins take back: the text never moves, and a short word is 48 px wide.
   - It is position: relative, so it takes taps over the text after it and the line under it, which in flow would take
     the taps on its padding. Where two hit areas meet, typing.js gives the tap to the nearer word. — */

.gloss {
  --gloss-pad: max(14px, calc((48px - 1.2em) / 2));
  position: relative;
  display: inline;
  padding-block: var(--gloss-pad);
  padding-inline: 14px;
  margin-inline: -14px;
  white-space: nowrap;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--plum);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: help;
}

/* The part of a dotted word not typed yet: in place, unseen, as the rest of its line is (app.css's .untyped). */
.gloss-rest {
  visibility: hidden;
}

/* The band's three-line clip (app.css's .caption-text: max-height 3lh, overflow hidden) clips hit testing at the text
   box too, so a word on the first or last line would take no tap above or below its line, and one at a line's start or
   end none beside it. Its edges move out 14 px all round without moving the text: every box is border-box, so the text
   area stays 3lh and the band's width. At the sides that runs 2 px past the band's 12 px padding, inside its margin. */
.caption-text {
  padding-block: 14px;
  margin-block: -14px;
  max-height: calc(3lh + 28px);
  padding-inline: 14px;
  margin-inline: -14px;
}

/* A twin's smaller line (below) is 18.2 px at text 1, so its clip moves out 15 px, (48 - 18.2) / 2 rounded up: a
   dotted word on its first line keeps its 48 px, where 14 px would leave it about 47.6. */
#caption[data-kind="twin"] .caption-text {
  padding-block: 15px;
  margin-block: -15px;
  max-height: calc(3lh + 30px);
}

/* The bubbles take no taps (app.css), so every tap on one falls through to the stage for a hurry; only a dotted word
   takes its own. */
[data-gloss] {
  pointer-events: auto;
}

/* The gloss slip over the stage: the word as written, in plum, and its gloss, on one cream line, its pointer at the
   word (typing.js places it and sets --point-x and data-point). Empty, it has no box, but stays a live region, so its
   next gloss is read out. It takes no taps. */
.gloss-slip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  max-width: min(92%, 22em);
  color: var(--ink);
  font: 800 0.9375rem/1.25 Nunito, system-ui, sans-serif;
  pointer-events: none;
}

.gloss-slip:not(:empty) {
  padding: 6px 12px 7px;
  border-radius: 10px 8px 11px 7px;
  background: var(--cards);
  box-shadow: var(--paper-shadow);
  animation: gloss-in 160ms ease-out;
}

.gloss-slip:not(:empty)::after {
  content: "";
  position: absolute;
  left: var(--point-x, 50%);
  width: 14px;
  height: 8px;
  margin-left: -7px;
  background: var(--cards);
}

.gloss-slip[data-point="down"]::after {
  top: 100%;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.gloss-slip[data-point="up"]::after {
  bottom: 100%;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.gloss-slip-word {
  margin-right: 2px;
  color: var(--plum);
  font: 800 1rem/1.1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.01em;
}

@keyframes gloss-in {
  from { opacity: 0; }
}

/* — The coach (coach.js; section 13), over the stage in the first show. None of it takes a tap. — */

/* The ghost hand: a cut-paper hand pinching a SPICY cloth, rising from the tray's edge up the stage to the cue ring,
   over and over. It moves on a track (coach.js): unaimed, the track is the stage, so its path is in the stage's own
   percentages, from the tray's edge to the middle; aimed, the track runs from the drop point (--aim-x, --aim-y, the cue
   ring's centre) straight down to the stage's foot, and the hand rises up it to put its cloth's centre on the point.
   The hand stands at its path's start (left and top) and moves along it by translate alone, in the track's own units
   (it is a size container), so the drag lays nothing out from frame to frame. */
.coach-hand {
  position: absolute;
  inset: 0;
  z-index: 2;   /* over the caption band (app.css: z-index 1 in #app), whose feeling chip rises over the stage */
  pointer-events: none;
}

.coach-hand-track {
  position: absolute;
  inset: 0;
  container-type: size;
}

.coach-hand[data-aim] .coach-hand-track {
  inset: var(--aim-y) auto 0 var(--aim-x);
  width: 0;
}

.coach-hand-art {
  position: absolute;
  left: 30%;
  top: calc(100% - 66px);
  width: 56px;
  height: 70px;
  opacity: 0.92;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.35));
  animation: ghost-drag 2800ms cubic-bezier(0.45, 0, 0.35, 1) infinite;
}

/* Aimed, the hand stands with its cloth's centre on the track's line: the cloth's box is 6 to 32.5 across and 1.5 to
   22 down the art's 48 x 60 units, drawn at 7/6 px a unit, so its centre is 22.5 px across and 13.7 px down. It
   presses and tilts about that centre, so the cloth's centre stays where the path puts it. */
.coach-hand[data-aim] .coach-hand-art {
  left: -22.5px;
  top: max(24px, calc(100% - 66px));
  transform-origin: 22.5px 13.7px;
  animation-name: ghost-drag-aimed;
}

.coach-hand-svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Down onto the cloth at the tray's edge (its palm over the beat line's feeling chip, which sits on the band's top
   edge), a press, the drag up the stage with a tilt, the let-go, and away: from 30% across and 66 px above the foot to
   46% across and 40% down (38% as it fades). */
@keyframes ghost-drag {
  0% { translate: 0 0; opacity: 0; transform: none; }
  10% { opacity: 0.92; transform: none; }
  20% { translate: 0 0; transform: scale(0.88); }
  68% { translate: 16cqw calc(66px - 60cqh); transform: scale(0.88) rotate(-8deg); opacity: 0.92; }
  78% { translate: 16cqw calc(66px - 60cqh); transform: scale(1) rotate(-4deg); }
  100% { translate: 16cqw calc(66px - 62cqh); transform: none; opacity: 0; }
}

/* The same, aimed: from the tray's edge (at least 24 px under the point) up the track, the cloth let go on the point,
   13.7 px above the hand's top (21.7 as it fades). */
@keyframes ghost-drag-aimed {
  0% { translate: 0 0; opacity: 0; transform: none; }
  10% { opacity: 0.92; transform: none; }
  20% { translate: 0 0; transform: scale(0.88); }
  68% { translate: 0 calc(-13.7px - max(24px, 100cqh - 66px)); transform: scale(0.88) rotate(-8deg); opacity: 0.92; }
  78% { translate: 0 calc(-13.7px - max(24px, 100cqh - 66px)); transform: scale(1) rotate(-4deg); }
  100% { translate: 0 calc(-21.7px - max(24px, 100cqh - 66px)); transform: none; opacity: 0; }
}

/* The two labels: a cream slip saying the flow's coaching. Only the label under the meter has a pointer, at the hearts
   it explains; the hold coach names the HOLD button instead. */
.coach-label {
  position: absolute;
  max-width: calc(100% - 20px);
  margin: 0;
  padding: 6px 12px 7px;
  border: 2px solid var(--ink);
  border-radius: 9px 7px 10px 8px;
  background: var(--cards);
  color: var(--ink);
  font: 800 0.875rem/1.25 Nunito, system-ui, sans-serif;
  letter-spacing: 0.01em;
  text-align: center;
  text-wrap: balance;
  box-shadow: var(--paper-shadow);
  pointer-events: none;
  animation: coach-bob 1600ms ease-in-out infinite alternate;
}

.coach-label::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 9px;
  background: var(--ink);
}

/* One rule of a label that says two (coach.js labelParts): kept whole on one line where it fits, so the label breaks
   only between its rules, and wrapped inside itself where it cannot, never overflowing the slip. */
.coach-label-part {
  display: inline-block;
}

/* Under the meter: at the stage's top left, its pointer up at the hearts, 10 px under the HUD so the pointer's 9 px
   reach the strip's foot. (The first scene's YOU tag once hung from the HUD there; it is pinned to the Conductor's
   chest now, far below.) */
.coach-label[data-coach="meterLabel"] {
  top: 10px;
  left: 10px;
  text-align: left;
}

.coach-label[data-coach="meterLabel"]::before {
  bottom: 100%;
  left: 16px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

/* The hold coach, edged in the GOLD: at the stage's top, centred on one line, as high as the label under the meter,
   over the block's windows and above every face and role sign of a first Big Finish. On a phone lying down it sits in
   the sky beside the letterboxed world (the landscape-phone rules below). It names the HOLD button, so it has no
   pointer. */
.coach-label[data-coach="holdGold"] {
  top: 10px;
  left: 50%;
  translate: -50% 0;
  white-space: nowrap;
  border-color: var(--gold-lo);
  outline: 2px dashed var(--tone-callback);
  outline-offset: 2px;
}

.coach-label[data-coach="holdGold"]::before {
  display: none;
}

@keyframes coach-bob {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

/* — A sound's visual twin in the band (showCaption kind 'twin'; C3.3): a stage direction, not a line anyone says, so
   smaller, in italic (fonts.css has no italic Nunito, so the browser slants the upright face) and in plum, still
   reading on the cream at 130% text: plum on the cards' cream is about 10:1. — */

#caption[data-kind="twin"] .caption-text {
  color: var(--plum);
  font-size: 0.875rem;
  font-style: italic;
  letter-spacing: 0.02em;
}

/* — A phone lying down keeps its portrait column (app.css), so the tray packs tighter to leave the stage room: a role
   card shows its preview at a little over half size, the same picture, framed the same. The short stage letterboxes
   the world: the label under the meter keeps to one line above the signs, and the hold coach sits at its top right, in
   the sky beside it, clear of every face and sign — */

@media (orientation: landscape) and (max-height: 500px) {
  /* The label under the meter on one line, so it stays over the block's windows, above every sign held up: on two
     lines at 130% its foot came down over them. */
  .coach-label[data-coach="meterLabel"] {
    top: 6px;
    font-size: min(0.875rem, 13px);
  }

  .coach-label[data-coach="holdGold"] {
    top: 8px;
    left: auto;
    right: 8px;
    translate: none;
    max-width: 150px;
    white-space: normal;
  }

  .choice-preview {
    width: 54px;
    height: 72px;
  }

  /* Each cloth's swatch at five eighths of its size (it still carries the icon and the print, and the card its word,
     teaser and 48 px), so the stage gets 20 px more: the world is a strip there, its signs' capitals about 4 px tall. */
  .cloth-art {
    width: min(100%, 40px);
  }

  .choices[data-layout="cards"] .choice {
    gap: 2px;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .choices[data-layout="chips"] .choices-row {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }

  .hold {
    margin-top: 4px;
    margin-bottom: 4px;
  }
}

/* — Reduced motion: no punch, slam or flash; pulses and sparkles hold still, and the 'no' fades where it stands — */

html.reduced-motion .stamp {
  animation: soft-in 220ms ease-out both;
}

html.reduced-motion .flash {
  background: var(--cards);
  animation: flash-soft 700ms ease-in-out forwards;
}

html.reduced-motion .ui-button[data-pulse="true"],
html.reduced-motion .yesand-button[data-pulse="true"] {
  animation: none;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4), 0 0 0 5px rgba(255, 211, 138, 0.6);
}

html.reduced-motion .hold,
html.reduced-motion .choice-sparkle,
html.reduced-motion .cloth-sparkle,
html.reduced-motion #toast:not(:empty),
html.reduced-motion .gloss-slip:not(:empty),
html.reduced-motion .coach-label,
html.reduced-motion .coach-hand-art,
html.reduced-motion .coach-hand[data-aim] .coach-hand-art {
  animation: none;
}

/* The ghost hand holds still at the cloth, and a dashed line with an arrowhead shows the drag it would make, on its
   track: up the stage to the middle, or, aimed, straight up from the hand to the arrowhead's tip on the point. */
html.reduced-motion .coach-hand-track::before,
html.reduced-motion .coach-hand-track::after {
  content: "";
  position: absolute;
  left: calc(30% + 25px);
}

html.reduced-motion .coach-hand-track::before {
  top: 42%;
  height: calc(58% - 74px);
  border-left: 3px dashed var(--cards);
}

html.reduced-motion .coach-hand-track::after {
  top: calc(42% - 12px);
  width: 18px;
  height: 14px;
  margin-left: -7.5px;
  background: var(--cards);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

html.reduced-motion .coach-hand[data-aim] .coach-hand-track::before,
html.reduced-motion .coach-hand[data-aim] .coach-hand-track::after {
  left: -1.5px;
}

/* From under the arrowhead to 8 px over the hand. */
html.reduced-motion .coach-hand[data-aim] .coach-hand-track::before {
  top: 12px;
  height: max(4px, calc(100% - 86px));
}

html.reduced-motion .coach-hand[data-aim] .coach-hand-track::after {
  top: 0;
}

html.reduced-motion .yesand-no[data-exit] {
  animation: soft-out 240ms ease-out forwards;
}

html.reduced-motion .yesand-no[data-exit]::after {
  animation: none;
  display: none;
}

html.reduced-motion .choice:active,
html.reduced-motion .cloth:active,
html.reduced-motion .ui-button:active,
html.reduced-motion .yesand-button:not([aria-disabled="true"]):active,
html.reduced-motion .pairs-side:active {
  transform: none;
}

@keyframes soft-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes soft-out {
  to { opacity: 0; }
}

@keyframes flash-soft {
  from { opacity: 0; }
  35% { opacity: 0.55; }
  to { opacity: 0; }
}

/* — The title screen (task B10): the sound chip, then the show switch over two plastic stools with the tissue packet
   between them, in the tray; the sound toggle in the stage's top-right corner. The stools and the packet are the
   stage's own art (props.js), painted onto canvases, so they match what the stage draws — */

.title,
.title-controls {
  display: flex;
  flex: 1 1 100%;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

/* The in-app browser's banner (#title-banner-slot; D1 fills it when Teams or Slack opened the page): a warm notice slip
   pinned above the controls, its plum edge folded over, so it reads as a note from the house rather than a control. */
.title-banner {
  width: min(100%, 420px);
  padding: 7px 14px 8px 18px;
  border-radius: 4px 11px 5px 10px;
  background: var(--window-warm);
  color: var(--ink);
  box-shadow: var(--paper-shadow), inset 6px 0 0 var(--plum);
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  transform: rotate(-0.8deg);
}

.sound-chip-option,
.title-switch-option,
.title-stool,
.title-sound,
.title-screen-button,
.title-back {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  font: inherit;
  cursor: pointer;
}

/* Back to your poster (D6; main.js offers it for 12 hours after a show): a card-stock ticket under the banner, with a
   little plum poster at its left, that opens the last show's poster again. It stays pressed in while the poster
   prints. */
.title-back {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(100%, 420px);
  min-height: 48px;
  padding: 5px 16px 5px 6px;
  border: 0;
  border-radius: 12px 9px 13px 10px;
  background: var(--cards);
  color: var(--ink);
  box-shadow: var(--paper-shadow);
  font: 800 0.9375rem/1.1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-align: left;
  transform: rotate(0.6deg);
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}

.title-back .title-icon {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 5px;
  border-radius: 50%;
  background: var(--plum);
  color: var(--cards);
}

.title-back:active,
.title-back[aria-busy="true"] {
  transform: translate(2px, 2px) rotate(0.6deg) scale(0.98);
  box-shadow: var(--paper-press);
}

/* The sound chip: two cards, Sound on with a teal speaker, Desk mode with a sleeping plum laptop. */
.sound-chip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 400px);
  padding: 4px 2px 6px;
}

.sound-chip-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 92px;
  padding: 12px 10px 11px;
  border: 0;
  border-radius: 15px 11px 16px 10px;
  background: var(--cards);
  color: var(--ink);
  box-shadow: var(--paper-shadow);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.15;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}

.sound-chip-option[data-choice="desk"] {
  border-radius: 11px 15px 10px 16px;
}

.sound-chip-option .title-icon {
  width: 42px;
  height: 42px;
  padding: 6px;
  border-radius: 50%;
  color: var(--cards);
}

.sound-chip-option[data-choice="on"] .title-icon {
  background: var(--accent-star);
}

.sound-chip-option[data-choice="desk"] .title-icon {
  background: var(--plum);
}

.title-icon {
  display: block;
  overflow: visible;
}

.title-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.title-icon .title-icon-speaker {
  fill: currentColor;
}

.title-icon .title-icon-zz,
.title-icon .title-icon-lines {
  stroke-width: 1.8;
}

.title-icon .title-icon-knob {
  fill: currentColor;
}

.title-icon .title-icon-star {
  fill: currentColor;
  stroke-width: 1.2;
}

/* The show switch: a ticket torn in two along a dashed perforation; the half that is picked is the solid card. */
.title-switch {
  display: flex;
  justify-content: center;
}

.title-switch-option {
  position: relative;
  min-width: 48px;
  min-height: 48px;
  padding: 2px 16px 0;
  border: 2px dashed rgba(255, 246, 229, 0.6);
  background: transparent;
  color: var(--cards);
  font: 800 0.9375rem/1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.title-switch-option[data-kind="tonight"] {
  border-right-width: 0;
  border-radius: 13px 0 0 11px;
}

.title-switch-option[data-kind="encore"] {
  border-left-width: 0;
  border-radius: 0 11px 13px 0;
}

.title-switch-option[aria-pressed="true"] {
  z-index: 1;
  border-style: solid;
  border-color: var(--cards);
  background: var(--cards);
  color: var(--ink);
  box-shadow: var(--paper-shadow);
}

.title-switch-option[aria-pressed="false"]:active {
  background: rgba(255, 246, 229, 0.12);
}

/* The stools, KOPI BREAK on the left and LUNCH BREAK on the right, level with each other, their tags hanging below,
   and the packet between them at seat height. */
.title-stools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  width: min(100%, 420px);
}

.title-stool {
  position: relative;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 48px;
  min-height: 48px;
  padding: 4px 2px 6px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: inherit;
}

.title-stool[data-length="lunch"] {
  grid-column: 3;
}

.title-stool-art {
  position: relative;
  z-index: 1;
  display: block;
  width: 64px;
  height: 76px;
  transition: transform 120ms ease-out;
}

/* A chalk ring on the floor round the stool's feet: dashed under the default stool, lit while the packet is over one. */
.title-stool::before {
  content: "";
  position: absolute;
  top: 67px;
  left: 50%;
  width: 92px;
  height: 22px;
  margin-left: -46px;
  border: 2px dashed transparent;
  border-radius: 50%;
}

.title-stool[data-default="true"]::before {
  border-color: rgba(255, 246, 229, 0.85);
  animation: chalk-glow 2.4s ease-in-out infinite;
}

.title-stool[data-over="true"]::before {
  border-style: solid;
  border-color: var(--window-warm);
  background: rgba(255, 211, 138, 0.18);
  animation: none;
}

.title-stool[data-over="true"] .title-stool-art,
.title-stool:active .title-stool-art {
  transform: translateY(-3px) scale(1.05);
}

@keyframes chalk-glow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Each stool's paper tag: its show in Baloo, and how long it runs in small Nunito under it. */
.title-stool-tag {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  max-width: 152px;
  padding: 6px 8px 7px;
  border-radius: 7px 10px 8px 11px;
  background: var(--cards);
  color: var(--ink);
  box-shadow: var(--paper-shadow);
  text-align: center;
  transform: rotate(-1.5deg);
}

.title-stool[data-length="lunch"] .title-stool-tag {
  border-radius: 10px 7px 11px 8px;
  transform: rotate(1.5deg);
}

.title-stool[data-default="true"] .title-stool-tag {
  box-shadow: var(--paper-shadow), 0 0 0 3px rgba(255, 211, 138, 0.6);
}

.title-stool[data-over="true"] .title-stool-tag {
  box-shadow: var(--paper-shadow), 0 0 0 3px var(--window-warm);
}

.title-stool-label {
  font: 800 0.875rem/1.05 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.03em;
}

.title-stool-sub {
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25;
  color: rgba(43, 27, 47, 0.8);
}

/* The tissue packet: it bobs to be picked up, follows the finger with pointer capture, and springs home if it is not
   dropped on a stool. Only the packet takes touch-action: none. */
.title-packet {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  grid-column: 2;
  width: 72px;
  height: 64px;
  margin-top: 14px;
  touch-action: none;
  cursor: grab;
  animation: packet-bob 2.6s ease-in-out infinite;
  transition: transform 260ms cubic-bezier(0.3, 1.4, 0.5, 1);
}

.title-packet-art {
  display: block;
  width: 64px;
  height: 50px;
  pointer-events: none;
}

.title-packet[data-dragging="true"] {
  z-index: 5;
  cursor: grabbing;
  filter: drop-shadow(4px 7px 0 rgba(0, 0, 0, 0.3));
  animation: none;
  transition: none;
}

@keyframes packet-bob {
  0%, 100% { translate: 0 0; rotate: -4deg; }
  50% { translate: 0 -4px; rotate: 2deg; }
}

/* Choped: the packet lands on the stool's seat, lying across it as seen from a little above, low enough to stay clear
   of the show switch over the stools; and the other stool steps back. */
.title-stool .title-packet {
  position: absolute;
  top: -20px;
  left: 50%;
  margin: 0 0 0 -36px;
  scale: 0.78;
  rotate: -5deg;
  animation: packet-land 260ms cubic-bezier(0.3, 1.4, 0.5, 1) both;
}

@keyframes packet-land {
  from { translate: 0 -28px; scale: 1.1; rotate: 8deg; }
  to { translate: 0 0; scale: 0.78; rotate: -5deg; }
}

.title-controls[inert] .title-stool:not([data-choped="true"]) {
  opacity: 0.45;
}

/* — The stage's furniture under the title (C4.1). The stage is a size container, so the logo, the tip and the corners
   size and place themselves by the room the stage has. On a stage up to twice as wide as tall the corner discs stand
   in two columns at the top corners, the logo hangs between them and the tip under it: a slip where the stage is tall
   enough for both to stay above the star's peek, else one scrolling line (D5). On a stage wider than that (a phone
   lying down, a short window) the world is a narrow strip in the middle, 0.72 of the stage's height wide, so the discs
   stand in rows, and the logo and the tip move out to the wings, leaving the peek clear. The stage's children are all
   positioned, so its size never comes from them. — */

/* --logo-top and --logo-w place and size the logo, whose height is 0.33 of its width (its SVG's 1000 x 330 viewBox),
   and the tip hangs under it from them. */
#stage-wrap {
  container: stage / size;
  --logo-top: 8px;
  --logo-w: min(100cqw - 136px, 380px, 100cqh);
  --logo-foot: calc(var(--logo-top) + var(--logo-w) * 0.33);
}

/* The corners: the star's Wardrobe and the Programme Booklet at the left, the sound toggle and settings at the right,
   each a paper disc; a screen's disc shows only once the game can open that screen. */
.title-corner {
  position: absolute;
  top: 8px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.title-corner[data-side="left"] {
  left: 8px;
}

.title-corner[data-side="right"] {
  right: 8px;
}

.title-sound,
.title-screen-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--cards);
  color: var(--ink);
  box-shadow: var(--paper-shadow);
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}

.title-sound .title-icon,
.title-screen-button .title-icon {
  width: 28px;
  height: 28px;
}

/* The sound toggle's speaker is crossed out while the sound is off, on a paler disc. */
.title-sound[aria-pressed="false"] {
  background: rgba(255, 246, 229, 0.7);
  color: var(--plum);
}

.title-sound[aria-pressed="false"] .title-icon-waves,
.title-sound[aria-pressed="true"] .title-icon-cross {
  display: none;
}

.sound-chip-option:active,
.title-sound:active,
.title-screen-button:active {
  transform: translate(2px, 2px) scale(0.96);
  box-shadow: var(--paper-press);
}

/* The logo: #title-name keeps its words as its text, for readers and for anything that reads the heading, and hides
   them visually (never display: none) while the cut-paper lettering shows. It hangs at the top of the stage between
   the corner columns, as wide as the stage allows but never taller than a third of it, so a short phone keeps the
   star's peek; a hard plum shadow lifts the card off the night sky. A name with no glyphs shows the words instead. */
#title-name {
  top: var(--logo-top);
  left: 0;
  right: 0;
  padding: 0;
  font: 800 clamp(26px, 8cqw, 42px)/0.95 "Baloo 2", system-ui, sans-serif;
  text-shadow: 3px 3px 0 var(--plum);
}

#title-name .logo {
  display: block;
  width: var(--logo-w);
  height: auto;
  margin: 0 auto;
  overflow: visible;
  filter: drop-shadow(3px 3px 0 rgba(20, 8, 24, 0.55));
}

#title-name[data-logo="art"] .title-name-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#title-name[data-logo="words"] .title-name-text {
  display: block;
  width: var(--logo-w);
  margin: 0 auto;
  overflow-wrap: anywhere;
}

/* The tip: a cream slip under the logo, stamped PSST!, saying one line about the star from the config's bio or in-jokes
   and changing every few seconds, each new one fading in. */
.title-tip {
  position: absolute;
  top: calc(var(--logo-foot) + 10px);
  left: 0;
  right: 0;
  width: fit-content;
  max-width: min(100cqw - 136px, 320px);
  margin: 0 auto;
  padding: 5px 11px 6px 8px;
  border-radius: 9px 6px 10px 5px;
  background: var(--cards);
  color: var(--ink);
  box-shadow: var(--paper-shadow);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
  transform: rotate(-1.2deg);
  pointer-events: none;
}

.title-tip[data-turn="0"] {
  animation: tip-in-a 420ms ease-out;
}

.title-tip[data-turn="1"] {
  animation: tip-in-b 420ms ease-out;
}

/* Two names for one fade, so each change of data-turn starts it again. */
@keyframes tip-in-a {
  from { opacity: 0; }
}

@keyframes tip-in-b {
  from { opacity: 0; }
}

.title-tip-tag {
  display: inline-block;
  margin-right: 5px;
  padding: 1px 5px 0;
  border-radius: 4px;
  background: var(--plum);
  color: var(--cards);
  font: 800 0.6875rem/1.25 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.06em;
  transform: rotate(-4deg);
}

/* A stage too short for the logo and the slip both to stay above the star's peek (a 360x640 or 375x667 phone, or a
   taller one at a larger text size): the tip is one straight line, tucked just under the logo between the corner
   columns, and its words scroll through their window from the first to the last once a turn (title.js's TIP_MS, 6 s),
   holding still at either end. Words that fit hold still. A stage more than twice as wide as tall and too short for
   the wing's slip (a 360x560 or 375x548 phone at a large text size, under 160 px) has the same line, in its right wing
   (below). */
@container stage ((max-height: 339px) and (max-aspect-ratio: 2 / 1)) or ((min-aspect-ratio: 2 / 1) and (max-height: 159px)) {
  .title-tip {
    top: calc(var(--logo-foot) + 4px);
    display: flex;
    align-items: center;
    gap: 5px;
    width: min(100cqw - 136px, 320px);
    max-width: none;
    padding: 2px 9px 3px 6px;
    line-height: 1.15;
    white-space: nowrap;
    transform: none;
  }

  .title-tip-tag {
    flex: none;
    margin-right: 0;
  }

  .title-tip-window {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    container-type: inline-size;
  }

  .title-tip-text {
    display: inline-block;
    vertical-align: top;
    animation: tip-roll-a 6000ms linear infinite;
  }

  .title-tip[data-turn="1"] .title-tip-text {
    animation-name: tip-roll-b;
  }

  /* Reduced motion: the line holds still, and title.js pages a tip longer than it, a line's worth of words at a time;
     only a single word wider than the whole line would end in an ellipsis. The text's selector outranks the turn's
     (.title-tip[data-turn="1"] .title-tip-text), whose animation-name would otherwise win over none. */
  html.reduced-motion .title-tip-window {
    text-overflow: ellipsis;
  }

  html.reduced-motion .title-tip .title-tip-text {
    display: inline;
    animation: none;
  }
}

/* Two names for one scroll, so each new tip starts it again: still, along to the last word (the window's width less the
   words' own, never past their start), and still again. */
@keyframes tip-roll-a {
  0%, 15% { translate: 0; }
  90%, 100% { translate: min(0px, 100cqi - 100%); }
}

@keyframes tip-roll-b {
  0%, 15% { translate: 0; }
  90%, 100% { translate: min(0px, 100cqi - 100%); }
}

/* A stage more than twice as wide as tall: the discs stand in rows, the logo hangs in the left wing under its row, as
   wide as the wing and short enough to fit under the row, and the tip stands in the right wing under its row: a slip,
   or, under 160 px tall, the one scrolling line (above). */
@container stage (min-aspect-ratio: 2 / 1) {
  #title-name,
  .title-tip {
    --wing: calc((100cqw - 72cqh) / 2 - 16px);
  }

  .title-corner {
    flex-direction: row;
  }

  .title-corner[data-side="right"] {
    flex-direction: row-reverse;
  }

  #title-name {
    --logo-w: min(var(--wing), 360px, (100cqh - 72px) * 3);
    top: 64px;
    left: 8px;
    right: auto;
  }

  #title-name .logo,
  #title-name[data-logo="words"] .title-name-text {
    margin: 0;
  }

  .title-tip {
    top: 64px;
    left: auto;
    right: 8px;
    max-width: min(var(--wing), 300px);
    margin: 0;
  }
}

/* A stage more than twice as wide as tall and under 100 px (a short phone lying down at a large text size) has too
   little room under the rows of discs: there the logo came down to 37 px wide, its letters 5 px tall. So the logo and
   the tip stand at the top, each beside its row of discs. */
@container stage (min-aspect-ratio: 2 / 1) and (max-height: 99px) {
  #title-name {
    --logo-w: min(var(--wing) - 112px, 360px, (100cqh - 16px) * 3);
    top: 8px;
    left: 120px;
  }

  .title-tip {
    top: 8px;
    right: 120px;
    max-width: min(var(--wing) - 112px, 300px);
  }
}

/* The one line in a wing about 120 px wide: its words get the wing's whole width under the PSST! stamp, not the half
   beside it. */
@container stage (min-aspect-ratio: 2 / 1) and (max-height: 159px) {
  .title-tip {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    width: min(var(--wing), 300px);
  }

  .title-tip-window {
    flex: none;
    width: 100%;
  }
}

/* A short phone held upright (or one whose browser bars take room): the stools and the packet shrink a little, so the
   stage keeps more of the screen. */
@media (orientation: portrait) and (max-height: 680px) {
  .title,
  .title-controls {
    gap: 10px;
  }

  .title-stool-art {
    width: 54px;
    height: 64px;
  }

  .title-stool::before {
    top: 56px;
    width: 80px;
    height: 18px;
    margin-left: -40px;
  }

  .title-packet {
    width: 64px;
    height: 56px;
    margin-top: 10px;
  }

  .title-packet-art {
    width: 58px;
    height: 45px;
  }

  .title-stool .title-packet {
    top: -16px;
    margin-left: -32px;
  }
}

/* A phone lying down: each stool stands beside its tag, as wide as its half of the tray allows so the tags take as few
   lines as they can, and everything packs tighter, so the stage keeps what room it can (the logo and the tip move out
   to the wings, above). The default stool keeps its tag's gold edge in place of the chalk ring. */
@media (orientation: landscape) and (max-height: 500px) {
  .title,
  .title-controls {
    gap: 6px;
  }

  /* With the in-app banner up, Back to your poster shares its row, the two halves wrapping their words, so the pair
     takes one row of the tray rather than two; the controls, a whole row wide, wrap under them. */
  .title {
    flex-flow: row wrap;
    justify-content: center;
  }

  .title-banner:has(+ .title-back),
  .title-banner:not([hidden]) + .title-back {
    flex: 1 1 0;
    min-width: 0;
  }

  .title-banner:has(+ .title-back) {
    width: auto;
    font-size: 0.75rem;
  }

  .title-back {
    font-size: 0.8125rem;
  }

  .title-switch-option {
    padding: 2px 12px 0;
    font-size: 0.8125rem;
  }

  .title-stools {
    align-items: center;
  }

  .title-stool {
    flex-direction: row;
    gap: 5px;
    padding: 0 2px;
  }

  .title-stool-art {
    flex: none;
    width: 36px;
    height: 43px;
  }

  .title-stool::before {
    display: none;
  }

  .title-stool-tag {
    max-width: none;
    padding: 4px 7px 5px;
  }

  .title-stool-label {
    font-size: 0.75rem;
  }

  .title-stool-sub {
    font-size: 0.625rem;
  }

  .title-packet {
    width: 52px;
    height: 48px;
    margin-top: 0;
  }

  .title-packet-art {
    width: 46px;
    height: 36px;
  }

  .title-stool .title-packet {
    top: -12px;
    left: 20px;
    margin-left: -26px;
  }

  .sound-chip-option {
    min-height: 64px;
    flex-direction: row;
  }
}

/* Reduced motion: the packet and the chalk ring hold still, the packet lands without a bounce, a new tip simply
   appears, and nothing squishes. */
html.reduced-motion .title-packet,
html.reduced-motion .title-stool .title-packet,
html.reduced-motion .title-stool[data-default="true"]::before,
html.reduced-motion .title-tip {
  animation: none;
}

html.reduced-motion .title-packet {
  transition: none;
}

html.reduced-motion .title-stool[data-over="true"] .title-stool-art,
html.reduced-motion .title-stool:active .title-stool-art,
html.reduced-motion .sound-chip-option:active,
html.reduced-motion .title-sound:active,
html.reduced-motion .title-screen-button:active {
  transform: none;
}

html.reduced-motion .title-back:active,
html.reduced-motion .title-back[aria-busy="true"] {
  transform: rotate(0.6deg);
}

/* — The HUD under the title: the title marks #hud data-idle, and the meter and the pause button rest, hidden but in
   their places, so the strip keeps its 48 px and nothing re-frames; the show's first setHud wakes them (hud.js). The
   pause button's focus ring is drawn just inside its 48 px, so the column's edge never clips it. — */

#hud[data-idle="true"] .hud-meter,
#hud[data-idle="true"] .hud-dots,
#hud[data-idle="true"] .hud-you,
#hud[data-idle="true"] .hud-pause {
  visibility: hidden;
}

.hud-pause:focus-visible {
  border-radius: 50%;
  outline-offset: -4px;
}

/* — The pause menu (tasks B12 and C4.2): a card over the column, which dims behind it. Resume first, then Settings,
   which opens the settings screen over the menu, then Curtain early, pale until a scene of the show has finished — */

.pause {
  position: absolute;
  inset: 0;
  z-index: 8;   /* over the poster screen's 6, so a page hidden on the poster still comes back paused */
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 16px);
  background: rgba(30, 22, 49, 0.78);
}

.pause-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(100%, 300px);
  padding: 16px 20px 20px;
  border-radius: 15px 11px 16px 12px;
  background: var(--cards);
  color: var(--ink);
  box-shadow: var(--paper-shadow);
}

.pause-heading {
  margin: 0 0 2px;
  font: 800 1.75rem/1.1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-align: center;
}

.pause-button {
  -webkit-appearance: none;
  appearance: none;
  min-height: 48px;
  margin: 0;
  padding: 10px 18px 9px;
  border: 2.5px solid var(--ink);
  border-radius: 24px 20px 23px 21px;
  background: var(--cards);
  color: var(--ink);
  font: 800 1.125rem/1.1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: var(--paper-shadow);
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}

.pause-button[data-id="resume"] {
  border-color: var(--plum);
  background: var(--plum);
  color: var(--cards);
}

.pause-button:disabled {
  border-style: dashed;
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.pause-button:not(:disabled):active {
  transform: translate(2px, 2px) scale(0.97);
  box-shadow: var(--paper-press);
}

html.reduced-motion .pause-button:not(:disabled):active {
  transform: none;
}

/* — The full screens (C4.2; screen.js), in #screens: the settings screen and the Programme Booklet, and C4.3's
   Wardrobe and album. The whole window dims, and a sheet of card stock as wide as the column comes up over it, under a
   header with the screen's name and a round close button. A sheet taller than the window scrolls inside itself, with
   app.css's manipulation, under its header, which stays at its top. The screen sits over the pause menu (inside #app),
   the config banner (10) and the toast (11), since nothing else on the page answers while it is up — */

.screen {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 12px) calc(env(safe-area-inset-right) + 12px)
    calc(env(safe-area-inset-bottom) + 16px) calc(env(safe-area-inset-left) + 12px);
  overflow: hidden;
  background: rgba(20, 10, 28, 0.84);
  color: var(--ink);
}

/* The screen and its sheet take the focus (the sheet as it opens, so the arrow keys scroll it); neither is a control,
   so neither shows a ring. */
.screen:focus,
.screen-sheet:focus {
  outline: none;
}

/* Centred while it is shorter than the window; taller, it fills the window's height and scrolls. */
.screen-sheet {
  flex: 0 1 auto;
  width: min(100%, 456px);
  min-height: 0;
  margin: auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: manipulation;
  border-radius: 16px 12px 17px 13px;
  background: var(--cards);
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.45);
  animation: screen-in 200ms cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes screen-in {
  from { transform: translateY(24px); opacity: 0; }
}

/* z-index 2: over anything a screen's content lifts to 1 as it scrolls under the header, so a tap on the close button
   always reaches it. */
.screen-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 8px 8px 8px 20px;
  border-radius: 16px 12px 0 0;
  background: var(--cards);
  box-shadow: 0 2px 0 rgba(91, 42, 94, 0.14);
}

.screen-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font: 800 1.5rem/1.05 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.screen-close {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--plum);
  color: var(--cards);
  box-shadow: var(--paper-shadow);
  cursor: pointer;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}

.screen-close-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
}

.screen-close:active {
  transform: translate(2px, 2px) scale(0.96);
  box-shadow: var(--paper-press);
}

/* — The settings screen: each setting under a perforation, its name, a note on what it does, and its choices as one
   ticket torn into parts, the chosen part solid plum — */

.settings-row {
  padding: 16px 20px 18px;
  border-top: 2px dashed rgba(91, 42, 94, 0.28);
}

.settings-name {
  margin: 0;
  font: 800 1.1875rem/1.15 "Baloo 2", system-ui, sans-serif;
}

.settings-note {
  margin: 3px 0 0;
  color: var(--plum);
  font-size: 0.875rem;
  line-height: 1.35;
}

/* isolation: the pressed part's lift over its neighbours (z-index 1) stays inside its own ticket, under the header. */
.settings-choices {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin-top: 12px;
  isolation: isolate;
}

.settings-choice {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  min-width: 48px;
  min-height: 48px;
  margin: 0;
  padding: 6px 8px 5px;
  border: 2px dashed rgba(43, 27, 47, 0.45);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 800 1rem/1.1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.settings-choice + .settings-choice {
  border-left-width: 0;
}

.settings-choice:first-child {
  border-radius: 14px 0 0 12px;
}

.settings-choice:last-child {
  border-radius: 0 12px 15px 0;
}

.settings-choice[aria-pressed="true"] {
  z-index: 1;
  border-style: solid;
  border-color: var(--plum);
  background: var(--plum);
  color: var(--cards);
  box-shadow: var(--paper-shadow);
}

.settings-choice[aria-pressed="false"]:active {
  background: rgba(91, 42, 94, 0.1);
}

/* A focused choice's ring rises over its pressed neighbour, which would hide the side the two share. */
.settings-choice:focus-visible {
  z-index: 2;
}

/* The text sizes: sample letters at each size, which do not follow the text size themselves, over the percentage. */
.settings-size {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.settings-size-sample {
  display: flex;
  align-items: flex-end;
  height: 21px;
  font: 800 18px/1 "Baloo 2", system-ui, sans-serif;
}

.settings-choice[data-value="1.15"] .settings-size-sample {
  font-size: 20.7px;
}

.settings-choice[data-value="1.3"] .settings-size-sample {
  font-size: 23.4px;
}

.settings-size-percent {
  font: 800 0.75rem/1 Nunito, system-ui, sans-serif;
}

/* — The Programme Booklet: a plum cover band with its name in gold, edged with the Peranakan tile strip, then the
   programme on the cream page: the picture cards beside their words, the story of Playback Theatre, the star's page,
   the glossary with each word dotted as the captions dot it, and the credits, centred, with the troupe's ticket — */

.screen[data-screen="booklet"] .screen-head {
  padding-bottom: 16px;
  background: var(--plum) var(--tile-strip) left bottom / 14px 8px repeat-x;
  color: var(--tone-callback);
  box-shadow: none;
}

.screen[data-screen="booklet"] .screen-title {
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

.screen[data-screen="booklet"] .screen-close {
  background: var(--cards);
  color: var(--plum);
}

.booklet-part {
  padding: 18px 20px 4px;
}

.booklet-part:last-child {
  padding-bottom: 24px;
}

/* Every part's heading in the programme's capitals, whichever case its words come in (BookletCopy's two and
   UI_LABELS's three). */
.booklet-heading {
  margin: 0 0 10px;
  color: var(--plum);
  font: 800 1.25rem/1.15 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.booklet-cards {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.booklet-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.booklet-art {
  display: block;
  width: 88px;
  height: 66px;
  transform: rotate(-1.5deg);
}

.booklet-card:nth-child(even) .booklet-art {
  transform: rotate(1.5deg);
}

.booklet-card-title {
  margin: 0;
  font: 800 1.0625rem/1.15 "Baloo 2", system-ui, sans-serif;
}

.booklet-card-body,
.booklet-text,
.booklet-gloss {
  font-size: 0.9375rem;
  line-height: 1.4;
}

.booklet-card-body {
  margin: 2px 0 0;
}

.booklet-text {
  margin: 0 0 10px;
}

.booklet-bio {
  margin: 0 0 10px;
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.35;
}

.booklet-jokes {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

/* Each in-joke behind a gold paper star. */
.booklet-joke {
  position: relative;
  padding-left: 24px;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.booklet-joke::before {
  content: "";
  position: absolute;
  top: 0.2em;
  left: 0;
  width: 15px;
  height: 15px;
  background: var(--tone-callback);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.booklet-glossary {
  display: grid;
  gap: 10px;
  margin: 0 0 10px;
}

.booklet-word {
  font: 800 1.0625rem/1.2 "Baloo 2", system-ui, sans-serif;
  text-decoration: underline dotted var(--plum);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.booklet-gloss {
  margin: 1px 0 0;
}

.booklet-part[data-part="credits"] {
  text-align: center;
}

.booklet-credit {
  margin: 0 0 6px;
  font-size: 0.875rem;
  line-height: 1.4;
}

.booklet-invite {
  margin: 14px 0 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

/* The troupe's link: a gold ticket with a dashed tear-off edge inside it. */
.booklet-troupe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 12px 0 4px;
  padding: 9px 22px 8px;
  border-radius: 7px;
  background: var(--tone-callback);
  color: var(--ink);
  box-shadow: var(--paper-shadow);
  font: 800 1rem/1.15 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.03em;
  text-decoration: none;
  outline: 1.5px dashed rgba(43, 27, 47, 0.5);
  outline-offset: -5px;
}

.booklet-troupe:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.booklet-troupe:active {
  transform: translate(2px, 2px);
  box-shadow: var(--paper-press);
}

html.reduced-motion .screen-sheet {
  animation: soft-in 160ms ease-out;
}

html.reduced-motion .screen-close:active,
html.reduced-motion .booklet-troupe:active {
  transform: none;
}

/* — The star's Wardrobe (C4.3; wardrobe.js): a dressing room. Under a troupe-black header with a brass rail along its
   foot, the gold ALBUM ticket, then each story's roles pegged to a brass rail, each a card-stock tag with the star's
   paper doll on the night sky, its name, and its best rating in tissue packets; a role not played yet hangs there as a
   dashed tag with the doll's silhouette. The finale's FINALLY card hangs gold across a whole rail, its three stand-ins
   on the rail under it, and the two secret stickers come last, die-cut — */

.screen[data-screen="wardrobe"] .screen-head {
  padding-bottom: 14px;
  background: var(--troupe-black) linear-gradient(#E3BD5C, #9A7428) left calc(100% - 5px) / 100% 4px no-repeat;
  color: var(--cards);
  box-shadow: none;
}

.screen[data-screen="wardrobe"] .screen-close {
  background: var(--cards);
  color: var(--troupe-black);
}

/* The ALBUM: a gold ticket the width of the page, an open book beside its name. */
.wardrobe-album {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: calc(100% - 28px);
  min-height: 56px;
  margin: 16px 14px 2px;
  padding: 8px 16px;
  border: 0;
  border-radius: 9px 7px 10px 6px;
  background: linear-gradient(165deg, var(--gold-hi), var(--tone-callback) 48%, var(--gold-lo));
  color: var(--ink);
  box-shadow: var(--paper-shadow);
  font: 800 1.0625rem/1.1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-align: left;
  cursor: pointer;
  outline: 1.5px dashed rgba(43, 27, 47, 0.45);
  outline-offset: -6px;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}

.wardrobe-album:focus-visible {
  outline: 3px solid var(--plum);
  outline-offset: 2px;
}

.wardrobe-album:active {
  transform: translate(2px, 2px);
  box-shadow: var(--paper-press);
}

.wardrobe-album-icon {
  flex: none;
  width: 30px;
  height: 30px;
}

.wardrobe-album-pages {
  fill: var(--cards);
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.wardrobe-album-spine {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.wardrobe-album-word {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wardrobe-part {
  padding: 18px 14px 6px;
}

.wardrobe-part:last-child {
  padding-bottom: 24px;
}

.wardrobe-story-title,
.wardrobe-stickers-title,
.album-story-title {
  margin: 0;
  color: var(--plum);
  font: 800 1.25rem/1.15 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.wardrobe-story-teller,
.album-story-teller {
  margin: 1px 0 0;
  color: rgba(43, 27, 47, 0.72);
  font-size: 0.875rem;
  font-weight: 800;
}

/* A rail: a brass bar over a row of cards, each pegged to it. */
.wardrobe-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
  padding: 20px 0 0;
  list-style: none;
  background: linear-gradient(#E3BD5C, #9A7428) left top / 100% 4px no-repeat;
}

.wardrobe-cards + .wardrobe-cards {
  margin-top: 18px;
}

.wardrobe-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 4px 10px;
  border-radius: 10px 8px 11px 7px;
  background: var(--cards);
  box-shadow: var(--paper-shadow), var(--card-edge);
  text-align: center;
}

/* The peg: a split wooden clothes peg from the rail down over the tag's top edge. */
.wardrobe-card::before {
  content: "";
  position: absolute;
  top: -25px;
  left: 50%;
  width: 10px;
  height: 32px;
  margin-left: -5px;
  border-radius: 3px 3px 4px 4px;
  background: linear-gradient(90deg, #E8C792 0 44%, #8F6638 44% 56%, #D6AE72 56%);
  box-shadow: 1.5px 1.5px 0 rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.wardrobe-doll {
  display: block;
  flex: none;
  width: 96px;
  height: 128px;
  border-radius: 8px 6px 9px 7px;
  background: radial-gradient(ellipse 70% 55% at 50% 42%, #4A2C61, var(--sky-mid) 55%, var(--sky-dark));
  box-shadow: inset 0 0 0 2px rgba(43, 27, 47, 0.55);
}

.wardrobe-card-name {
  max-width: 100%;
  font: 800 0.8125rem/1.08 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.wardrobe-packets {
  display: flex;
  gap: 1px;
}

.wardrobe-packet {
  display: block;
  width: 15px;
  height: 11.5px;
}

.wardrobe-packet-body {
  fill: #FFFFFF;
  stroke: var(--ink);
  stroke-width: 2.2;
}

.wardrobe-packet[data-full="false"] .wardrobe-packet-body {
  fill: none;
  stroke: rgba(43, 27, 47, 0.38);
  stroke-dasharray: 4 3;
}

.wardrobe-packet-band {
  fill: var(--accent-star);
}

.wardrobe-packet-puff {
  fill: #FFFFFF;
  stroke: var(--ink);
  stroke-width: 2;
}

.wardrobe-card-status {
  color: var(--plum);
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

/* Not played yet: an empty dashed tag, the doll a silhouette on a dimmer sky, its words quieter. */
.wardrobe-card[data-state="locked"] {
  background: transparent;
  box-shadow: none;
  outline: 2px dashed rgba(91, 42, 94, 0.32);
  outline-offset: -2px;
}

.wardrobe-card[data-state="locked"] .wardrobe-doll {
  background: radial-gradient(ellipse 70% 55% at 50% 42%, #3A2E4A, #2C2240 55%, #1E1631);
}

.wardrobe-card[data-state="locked"] .wardrobe-card-name {
  color: rgba(43, 27, 47, 0.62);
}

.wardrobe-card[data-state="locked"] .wardrobe-card-status {
  color: rgba(43, 27, 47, 0.62);
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0;
}

/* FINALLY: the star as herself, gold across the whole rail, her doll beside her name, packets and rating, which sit
   centred beside it. */
.wardrobe-card[data-kind="finally"] {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  grid-template-rows: 1fr auto auto auto 1fr;
  justify-items: start;
  gap: 4px 14px;
  padding: 10px 14px 10px 10px;
  text-align: left;
}

.wardrobe-card[data-kind="finally"][data-state="played"] {
  background: linear-gradient(165deg, var(--gold-hi), var(--tone-callback) 48%, var(--gold-lo));
}

.wardrobe-card[data-kind="finally"] .wardrobe-doll {
  grid-row: 1 / -1;
}

.wardrobe-card[data-kind="finally"] .wardrobe-card-name {
  grid-column: 2;
  grid-row: 2;
  font-size: 1.0625rem;
}

.wardrobe-card[data-kind="finally"] .wardrobe-packets {
  grid-column: 2;
  grid-row: 3;
}

.wardrobe-card[data-kind="finally"] .wardrobe-card-status {
  grid-column: 2;
  grid-row: 4;
}

.wardrobe-card[data-kind="finally"][data-state="played"] .wardrobe-card-status {
  color: var(--ink);
}

/* The secret stickers: die-cut discs on the page, a found one in colour, a secret one a grey question. */
.wardrobe-stickers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.wardrobe-sticker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.wardrobe-sticker-art {
  display: block;
  width: 72px;
  height: 72px;
  padding: 4px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: var(--paper-shadow);
  transform: rotate(-6deg);
}

.wardrobe-sticker:nth-child(even) .wardrobe-sticker-art {
  transform: rotate(5deg);
}

.wardrobe-sticker-ribbon {
  fill: var(--plum);
}

.wardrobe-sticker-heart {
  fill: var(--cards);
  stroke: var(--ink);
  stroke-width: 2;
}

.wardrobe-sticker-star {
  fill: var(--tone-callback);
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.wardrobe-sticker-disc {
  fill: #D9D2DF;
  stroke: rgba(91, 42, 94, 0.45);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.wardrobe-sticker-mark {
  fill: none;
  stroke: rgba(91, 42, 94, 0.7);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wardrobe-sticker-text {
  max-width: 100%;
  font: 800 0.875rem/1.1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}

.wardrobe-sticker[data-state="locked"] .wardrobe-sticker-text {
  color: rgba(43, 27, 47, 0.62);
  font: italic 800 0.8125rem/1.2 "Nunito", system-ui, sans-serif;
  letter-spacing: 0;
}

/* — The HAPPIER ENDINGS album (C4.3; album.js): a scrapbook of the night's endings under a velvet header, the Big
   Laughs counted on a troupe-black ticket, then each story's endings as cards pasted on the page: a found one with its
   stamp over its poster title (a LISTENED one gold), a locked one a dashed space with a padlock and its hint — */

.screen[data-screen="album"] .screen-head {
  padding-bottom: 16px;
  background: var(--velvet) var(--tile-strip) left bottom / 14px 8px repeat-x;
  color: var(--gold-hi);
  box-shadow: none;
}

.screen[data-screen="album"] .screen-title {
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

.screen[data-screen="album"] .screen-close {
  background: var(--cards);
  color: var(--velvet);
}

.album-laughs {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 16px 14px 2px;
  padding: 8px 14px 8px 10px;
  border-radius: 9px 7px 10px 6px;
  background: var(--troupe-black);
  color: var(--cards);
  box-shadow: var(--paper-shadow);
}

.album-laughs-art {
  display: block;
  width: 44px;
  height: 44px;
}

.album-laughs-burst {
  fill: var(--meter-haha);
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.album-laughs-ha {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.album-laughs-label {
  font: 800 1rem/1.1 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.album-laughs-count {
  color: var(--meter-haha);
  font: 800 1.75rem/1 "Baloo 2", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

.album-story {
  padding: 18px 14px 6px;
}

.album-story:last-child {
  padding-bottom: 24px;
}

.album-endings {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.album-ending {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: 9px 7px 10px 6px;
  background: var(--cards);
  box-shadow: var(--paper-shadow), var(--card-edge);
}

/* The kind as a small rubber stamp, tilted, in its own ink; the album label stands in for it where there is one. */
.album-ending-kind {
  flex: none;
  max-width: 42%;
  padding: 1px 7px 0;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  color: var(--plum);
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-align: center;
  overflow-wrap: anywhere;
  transform: rotate(-3deg);
}

.album-ending[data-kind="SWEET"] .album-ending-kind {
  color: #A8325F;
}

.album-ending[data-kind="ABSURD"] .album-ending-kind {
  color: #1E7A45;
}

.album-ending[data-kind="CAMEO"] .album-ending-kind {
  color: #7A4F0A;
}

.album-ending-title {
  min-width: 0;
  font: 800 0.9375rem/1.15 "Baloo 2", system-ui, sans-serif;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

/* A LISTENED ending: gold card stock, as its card is in the tray. */
.album-ending[data-gold="true"] {
  background: linear-gradient(165deg, var(--gold-hi), var(--tone-callback) 48%, var(--gold-lo));
}

.album-ending[data-gold="true"] .album-ending-kind {
  color: var(--ink);
}

/* Locked: a dashed space on the page, a padlock and the hint. */
.album-ending[data-state="locked"] {
  background: transparent;
  box-shadow: none;
  outline: 2px dashed rgba(91, 42, 94, 0.32);
  outline-offset: -2px;
}

.album-lock {
  flex: none;
  width: 22px;
  height: 22px;
}

.album-lock-shackle {
  fill: none;
  stroke: rgba(91, 42, 94, 0.7);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.album-lock-body {
  fill: rgba(91, 42, 94, 0.7);
}

.album-ending-hint {
  min-width: 0;
  color: rgba(43, 27, 47, 0.78);
  font-size: 0.875rem;
  font-style: italic;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

html.reduced-motion .wardrobe-album:active {
  transform: none;
}

/* — The config banner's dismiss (task B12): a tap anywhere on the banner closes it, and the cross in its corner, named
   only for screen readers, so the banner's text stays the message alone, is there for the keyboard — */

#config-banner {
  cursor: pointer;
}

.config-banner-close {
  -webkit-appearance: none;
  appearance: none;
  float: right;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: -9px -14px -4px 6px;   /* into the banner's own padding, so the 48 px target reaches its corner */
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.config-banner-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
}

/* — The loading curtain (tasks B12 and C4.1): index.html hangs it down, red paper over the whole page in folds with a
   gold hem and the cut-paper logo a little above its middle (logoSvg for the default name, which js/boot/logo.js
   re-lays for the configured one), until the title, a deep-linked show or a dev page is up and main.js marks it up.
   Only a curtain with a data-state is drawn, so a page that copies the body without main.js (the e2e harness) shows
   none. Marked up, it rises off the page, taking no click from that moment, and is hidden once it has risen; under
   ?e2e and with reduced motion (both set before the curtain lifts) it is gone at once — */

#curtain[data-state] {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top) + 24px) calc(env(safe-area-inset-right) + 16px)
    calc(env(safe-area-inset-bottom) + 24px) calc(env(safe-area-inset-left) + 16px);
  background:
    linear-gradient(rgba(0, 0, 0, 0) 72%, rgba(0, 0, 0, 0.4)),
    repeating-linear-gradient(90deg, var(--velvet-deep) 0, #A8253E 22px, #B9304A 30px, var(--velvet-deep) 52px),
    #A8253E;
  box-shadow: inset 0 -6px 0 var(--tone-callback);
  transition: transform 600ms cubic-bezier(0.6, 0, 0.85, 0.3), visibility 0s linear 600ms;
}

#curtain[data-state="up"] {
  transform: translateY(-100%);
  visibility: hidden;
  pointer-events: none;
}

html.e2e #curtain[data-state="up"],
html.reduced-motion #curtain[data-state="up"] {
  display: none;
}

#curtain .logo {
  width: min(100%, 600px);
  height: auto;
  margin-bottom: 8vh;
  overflow: visible;
  filter: drop-shadow(5px 5px 0 rgba(40, 6, 16, 0.5));
}

/* — The velvet curtains beside the column (C4.1; curtains.js draws them): page furniture behind #app, shown only where
   the window is wider than the column, each filling its side from the window's edge to the column's, over the dark of
   the wings that its gathered folds uncover by the column. Each throws its paper shadow towards the stage. — */

.curtains {
  position: fixed;
  inset: 0;
  display: none;
  pointer-events: none;
}

@media (min-width: 481px) {
  .curtains {
    display: block;
  }
}

.curtains-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(50% - 240px);
  background: #170B20;
}

.curtains-panel[data-side="left"] {
  left: 0;
}

.curtains-panel[data-side="right"] {
  right: 0;
}

.curtains-drape {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(5px 3px 0 rgba(8, 2, 12, 0.55));
}

.curtains-panel[data-side="right"] .curtains-drape {
  filter: drop-shadow(-5px 3px 0 rgba(8, 2, 12, 0.55));
}

/* — Text app.css sizes in px, made to follow the text size (C4.2), since app.css is frozen: the HA slots' letters, the
   YOU tag, the beat line's thought bubble and the STAR stamp. The HA slots keep their 30 x 22 inside the 48 px strip,
   so their letters grow with the text size inside them, up to 15 px, where they still keep about 3 px clear of the
   slot's dashed border — */

.hud-ha {
  font-size: min(calc(13px * var(--text-scale)), 15px);
}

/* The YOU tag grows with the text too, as far as the camera's scale lets it stay on the Conductor (app.css). */
.hud-you {
  font-size: min(0.875rem, calc(var(--you-k, 0.52) * 48px));
}

.caption-thought {
  font-size: 0.875rem;
}

.caption-star {
  font-size: 0.9375rem;
}
