@font-face {
  font-family: Sora;
  src: url("assets/brand/fonts/sora-latin-400.woff2") format("woff2");
  font-display: swap;
}
body.audience-page {
  height: 100dvh;
  margin: 0;
  background: transparent;
  overflow: hidden;
}
.audience-stage {
  --chair-top: #79628f;
  --chair-bottom: #3b2e50;
  --chair-edge: #211c30;
  --chair-piping: #bd97d775;
  box-sizing: border-box;
  container-type: inline-size;
  font:
    12px/1.5 Sora,
    system-ui,
    sans-serif;
  height: 100%;
  padding: 0 10px 2px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  pointer-events: none;
  overflow: hidden;
}
.audience-stage[data-theme="light"] {
  --chair-top: #b19ac8;
  --chair-bottom: #6d5588;
  --chair-edge: #4b395f;
  --chair-piping: #f0defeaa;
}
.audience-stage[hidden] {
  display: none !important;
}
.theater-seats {
  --seat-width: clamp(40px, 14.7cqw, 86px);
  --seat-span: 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--seat-span), var(--seat-width));
  align-items: end;
  flex: none;
  min-height: 134px;
  padding: 0 8px 10px;
  isolation: isolate;
}
.theater-seats::before {
  content: "";
  position: absolute;
  inset: 32px -12px 0;
  border-radius: 50% 50% 20% 20%;
  background: radial-gradient(ellipse at 50% 100%, #b49ee126, transparent 68%);
  z-index: -1;
}
.theater-seats::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  border-radius: 50% 50% 8px 8px;
  background: linear-gradient(#b09ace35, #3f344f45 32%, #20192c50);
  border-bottom: 1px solid #aa88d054;
  box-shadow: 0 6px 12px #07041429;
  z-index: -1;
}
.theater-seat {
  position: relative;
  grid-row: 1;
  grid-column: calc(var(--seat-span) - var(--seat-slot));
  width: var(--seat-width);
  height: calc(var(--seat-width) * 1.45);
  z-index: var(--seat-depth);
  /* Shared full size for live and demo viewers; depth comes from position. */
  transform: translateY(var(--seat-lift));
  transform-origin: 50% 100%;
}
.theater-seat {
  --holding-facing: 1;
}
.theater-seat[data-family="moonkin"],
.theater-seat[data-family="toadie"] {
  --holding-facing: -1;
}
.theater-seat[data-look="cheer"] {
  z-index: 8;
}
.theater-actor {
  position: absolute;
  bottom: 14%;
  left: 50%;
  width: 148%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  z-index: 2;
}
.theater-actor img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  visibility: hidden;
  filter: drop-shadow(0 3px 3px #10091c50);
}
.theater-actor .rest-avatar {
  visibility: visible;
  transform: scaleX(calc(var(--rest-facing) * var(--holding-facing)))
    rotate(var(--rest-tilt));
  transition: transform 350ms ease-in-out;
}
.theater-actor .cheer-avatar {
  transform: scaleX(calc(var(--rest-facing) * var(--holding-facing)));
}
.theater-seat[data-look="side"] .rest-avatar {
  transform: scaleX(calc(var(--rest-facing) * var(--holding-facing)))
    rotate(calc(-5deg * var(--rest-facing)));
}
.theater-seat[data-look="up"] .rest-avatar {
  visibility: hidden;
}
.theater-seat[data-look="up"] .up-avatar {
  /* The sprite shares the resting head anchor; lifting the whole body looks standing. */
  visibility: visible;
}
.theater-seat[data-look="sway"] .theater-actor {
  animation: snack-sway 1700ms ease-in-out both;
}
.theater-seat[data-look="cheer"] .rest-avatar {
  visibility: hidden;
}
.theater-seat[data-look="cheer"] .cheer-avatar {
  visibility: visible;
}
.theater-seat[data-look="cheer"] .theater-actor {
  animation: popcorn-cheer 1900ms ease-in-out both;
}
.theater-seat[data-family="chartling"][data-look="cheer"] .theater-actor {
  animation-name: pretzel-cheer;
}
.theater-seat[data-family="toadie"][data-look="cheer"] .theater-actor {
  animation-name: drink-toast;
}
.theater-chair {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) perspective(240px) rotateY(var(--seat-angle));
  width: 90%;
  height: 40%;
  border-radius: 48% 48% 12% 12%;
  background: linear-gradient(
    165deg,
    var(--chair-top),
    var(--chair-bottom) 85%
  );
  border: 2px solid var(--chair-edge);
  box-shadow:
    inset 0 3px 0 var(--chair-piping),
    inset 0 -4px 7px #150b2733,
    0 7px 9px #09050f45;
  z-index: 3;
}
.theater-chair::before,
.theater-chair::after {
  content: "";
  position: absolute;
  bottom: -1px;
  width: 9%;
  height: 65%;
  border: 2px solid var(--chair-edge);
  background: linear-gradient(var(--chair-top), var(--chair-bottom));
  box-shadow: inset 0 2px 0 var(--chair-piping);
  border-radius: 7px;
}
.theater-chair::before {
  left: -7%;
}
.theater-chair::after {
  right: -7%;
}
.arriving .theater-actor {
  animation: walk-to-seat 1.5s ease-out both;
}
.arriving .theater-actor img {
  visibility: hidden;
}
.arriving .theater-actor .rest-avatar {
  visibility: visible;
  transform: scaleX(var(--holding-facing));
  transition: none;
}
.leaving .theater-actor {
  animation: leave-seat 650ms ease-in both;
}
.leaving .theater-chair {
  animation: empty-seat 450ms 200ms ease-out both;
}
.leaving .theater-actor img {
  visibility: hidden;
}
.leaving .theater-actor .rest-avatar {
  visibility: visible;
}
@keyframes leave-seat {
  0% {
    transform: translateX(-50%);
    opacity: 1;
  }
  30% {
    transform: translate(-50%, -9px);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + 24px), -12px);
    opacity: 0;
  }
}
@keyframes empty-seat {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
/* Reuse the original exit and entrance. Only the occupant moves. */
.profile-leaving .theater-actor,
.event-leaving .theater-actor {
  animation: leave-seat 650ms ease-in both;
}
.profile-entering .theater-actor,
.returning .theater-actor {
  animation: walk-to-seat 1.5s ease-out both;
}
:is(.profile-leaving, .event-leaving, .profile-entering, .returning)
  .theater-actor
  img {
  visibility: hidden;
}
:is(.profile-leaving, .event-leaving, .profile-entering, .returning)
  .theater-actor
  .rest-avatar {
  visibility: visible;
  transition: none;
}
:is(.profile-leaving, .event-leaving) .theater-actor .rest-avatar {
  transform: scaleX(calc(-1 * var(--holding-facing)));
}
:is(.profile-entering, .returning) .theater-actor .rest-avatar {
  transform: scaleX(var(--holding-facing));
}
.event-away .theater-actor {
  opacity: 0;
  animation: none !important;
}
/* Event attention uses the existing raised-chin pose. Chairs and entrance
   paths stay fixed, and cheer bounces keep facing the display. */
.theater-seat.event-focused .rest-avatar,
.theater-seat.event-focused .cheer-avatar {
  visibility: hidden;
}
.theater-seat.event-focused .up-avatar {
  visibility: visible;
  transform: scaleX(calc(var(--event-facing) * var(--holding-facing)));
}
@keyframes snack-sway {
  0%,
  100% {
    transform: translateX(-50%) rotate(0);
  }
  35% {
    transform: translateX(-50%) rotate(-3deg);
  }
  70% {
    transform: translateX(-50%) rotate(3deg);
  }
}
@keyframes popcorn-cheer {
  0%,
  100% {
    transform: translateX(-50%);
  }
  18% {
    transform: translate(-50%, -9px) rotate(-4deg);
  }
  34% {
    transform: translate(-50%, -1px) rotate(2deg);
  }
  52% {
    transform: translate(-50%, -12px) rotate(3deg);
  }
  72% {
    transform: translate(-50%, -2px) rotate(-2deg);
  }
}
@keyframes pretzel-cheer {
  0%,
  100% {
    transform: translateX(-50%);
  }
  18% {
    transform: translate(-50%, -7px) rotate(-6deg);
  }
  35% {
    transform: translate(-50%, -4px) rotate(5deg);
  }
  52% {
    transform: translate(-50%, -10px) rotate(-5deg);
  }
  70% {
    transform: translate(-50%, -2px) rotate(3deg);
  }
}
@keyframes drink-toast {
  0%,
  100% {
    transform: translateX(-50%);
  }
  28% {
    transform: translate(-50%, -8px) rotate(-3deg);
  }
  48% {
    transform: translate(-50%, -5px) rotate(3deg);
  }
  68% {
    transform: translate(-50%, -8px) rotate(-2deg);
  }
}
.theater-seat.is-speaking {
  z-index: 9;
}
.audience-bubble {
  --bubble-tail-x: 50%;
  position: absolute;
  bottom: 116%;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(150px, 36cqw);
  background: #f5effe;
  border: 1px solid #d4bfec;
  color: #392e46;
  box-shadow: inset 0 1px 0 #fff9;
  filter: drop-shadow(0 3px 5px #0002);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  z-index: 6;
}
.audience-bubble::before,
.audience-bubble::after {
  content: "";
  position: absolute;
  left: var(--bubble-tail-x);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-style: solid;
}
.audience-bubble::before {
  top: 100%;
  border-width: 13px 12px 0 4px;
  border-color: #d4bfec transparent transparent;
}
.audience-bubble::after {
  top: calc(100% - 1px);
  border-width: 11px 10px 0 3px;
  border-color: #f5effe transparent transparent;
}
.audience-bubble-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.theater-seat:is([data-edge="first"], [data-edge="only"]) .audience-bubble {
  --bubble-tail-x: min(50%, calc(var(--seat-width) / 2));
  left: 0;
  transform: none;
}
.theater-seat:is([data-edge="last"], [data-edge="only"]) .audience-bubble {
  --bubble-tail-x: max(50%, calc(100% - var(--seat-width) / 2));
  left: auto;
  right: 0;
  transform: none;
}
@keyframes walk-to-seat {
  0% {
    transform: translate(calc(-50% + 100px), -4px) rotate(3deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  25% {
    transform: translate(calc(-50% + 68px), -10px) rotate(-3deg);
  }
  45% {
    transform: translate(calc(-50% + 44px), -2px) rotate(2deg);
  }
  65% {
    transform: translate(calc(-50% + 20px), -8px) rotate(-2deg);
  }
  85% {
    transform: translate(-50%, -5px);
  }
  100% {
    transform: translate(-50%, 0);
  }
}
@container (max-width: 480px) {
  .theater-seats {
    min-height: 0;
    padding: 0 4px 6px;
  }
  /* Keep compact highlights readable with room for the speech-bubble tail. */
  .audience-bubble {
    max-width: min(160px, 55cqw);
    padding: 5px 8px;
    font-size: 10px;
    line-height: 1.3;
  }
  .audience-bubble-text {
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}
@media (prefers-reduced-motion: reduce) {
  .audience-stage * {
    animation: none !important;
    transition: none !important;
  }
  .theater-actor img {
    visibility: hidden !important;
  }
  .theater-actor .rest-avatar {
    visibility: visible !important;
  }
  .theater-seat.event-focused .rest-avatar {
    visibility: hidden !important;
  }
  .theater-seat.event-focused .up-avatar {
    visibility: visible !important;
  }
}
