.presentation-scene {
  color: #f8f7ef;
  overflow-wrap: anywhere;
}
.presentation-scene h1 {
  color: #c9c7d0;
  font-size: clamp(18px, 2.2vw, 36px);
  margin: 12px 0 30px;
}
.presentation-scene h2 {
  color: inherit;
  font-size: clamp(24px, 4vw, 64px);
  line-height: 1.12;
  margin: 16px 0 28px;
}
.presentation-brand {
  color: #dcff82;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.13em;
}
.presentation-state {
  color: #dcff82;
  font-size: 14px;
  font-weight: 700;
}
.presentation-options {
  display: grid;
  gap: 12px;
}
.presentation-options > div {
  display: flex;
  gap: 18px;
  padding: 14px 20px;
  background: #383340;
  border-radius: 9px;
  font-size: clamp(18px, 2.5vw, 36px);
}
.presentation-options > div > span:first-child {
  color: #dcff82;
}
.presentation-result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 15px;
  font-size: clamp(18px, 2.2vw, 32px);
  margin: 18px 0;
}
.presentation-bar {
  grid-column: 1 / -1;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #494451;
}
.presentation-bar-fill {
  width: 0;
  height: 100%;
  background: #dcff82;
  transition: width 500ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .presentation-bar-fill {
    transition: none;
  }
}
.presentation-total {
  color: #ccc6d4;
  font-size: 16px;
}
.presentation-safe {
  color: #f8f7ef;
  font-size: clamp(20px, 3vw, 42px);
  text-align: center;
  padding: 20vh 5%;
}
html:has(body.overlay-output),
body.overlay-output,
.overlay-output #app,
.overlay-output .projection-content {
  background: transparent !important;
}
.overlay-output .projection-content {
  max-width: none;
  min-height: 100vh;
  padding: 4vh 4vw;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.overlay-output .presentation-scene {
  width: min(1100px, 100%);
}
.overlay-output .presentation-card {
  background: #24232df2;
  border-left: 6px solid #dcff82;
  border-radius: 12px;
  padding: 24px 30px;
}
.overlay-output .presentation-card h2 {
  font-size: clamp(24px, 3vw, 48px);
}
.overlay-output .presentation-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.overlay-output .presentation-options > div {
  font-size: clamp(16px, 2vw, 28px);
}
.admin-view .presentation-mini {
  padding: 14px;
}
.admin-view .presentation-mini h1 {
  color: #f8f7ef;
  font-size: 14px;
  margin: 8px 0 10px;
}
.admin-view .presentation-mini h2 {
  font-size: 15px;
  color: #f8f7ef;
  line-height: 1.2;
  margin: 6px 0 10px;
}
.admin-view .presentation-mini .presentation-brand {
  font-size: 8px;
}
.admin-view .presentation-mini .presentation-state {
  font-size: 8px;
}
.admin-view .presentation-mini .presentation-options {
  gap: 4px;
}
.admin-view .presentation-mini .presentation-options > div {
  font-size: 10px;
  padding: 5px;
  gap: 6px;
}
.admin-view .presentation-mini .presentation-result {
  font-size: 10px;
  margin: 6px 0;
  gap: 3px;
}
.admin-view .presentation-mini .presentation-bar {
  height: 5px;
}
.admin-view .presentation-mini .presentation-total,
.admin-view .presentation-mini p {
  color: #ddd7e5;
  font-size: 10px;
}
.admin-view .presentation-mini .presentation-safe {
  padding: 20px 5%;
}
.admin-view .operator-safety {
  border: 1px solid #ddd7e5;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  background: #faf8fc;
}
.admin-view .panic-button {
  background: #a32b3f;
  color: white;
}
.admin-view .operator-safety .field {
  margin: 14px 0 8px;
  font-size: 12px;
}
.admin-view .operator-safety .command-notice {
  color: #80314a;
  font-size: 13px;
}
.admin-view .operator-safety p:empty {
  display: none;
}
@media (max-width: 600px) {
  .overlay-output .presentation-options {
    grid-template-columns: 1fr;
  }
  .overlay-output .presentation-card {
    padding: 16px;
  }
}

/* Browser stage: full viewport with safe margins; overlay keeps its own alpha. */
html:has(body.projection:not(.overlay-output)),
body.projection:not(.overlay-output),
.projection:not(.overlay-output) #app {
  min-height: 100vh;
  min-height: 100dvh;
  background: #24232d;
}
body.projection {
  margin: 0;
}
.projection:not(.overlay-output) .projection-content {
  box-sizing: border-box;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 5vh 5vw;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 18vw);
  align-items: center;
  gap: 3vw;
}
.projection:not(.overlay-output) .presentation-scene {
  min-width: 0;
}
.projection:not(.overlay-output) .presentation-scene h1 {
  font-size: clamp(18px, min(1.6vw, 3vh), 30px);
  line-height: 1.2;
  margin: 12px 0 24px;
}
.projection:not(.overlay-output) .presentation-scene h2 {
  font-size: clamp(28px, min(4.2vw, 7.6vh), 88px);
  line-height: 1.12;
  margin: 12px 0 24px;
}
.projection:not(.overlay-output) .presentation-result {
  font-size: clamp(18px, min(2.4vw, 4.4vh), 48px);
  line-height: 1.2;
  gap: 6px 18px;
  margin: 10px 0;
}
.projection:not(.overlay-output) .presentation-options > div {
  font-size: clamp(18px, min(2.4vw, 4.4vh), 48px);
  line-height: 1.2;
  padding: 10px 16px;
}
.projection:not(.overlay-output) .compact-qr,
.projection:not(.overlay-output) .sharing-note {
  float: none;
  box-sizing: border-box;
  min-width: 0;
  max-width: none;
  margin: 0;
  overflow-wrap: anywhere;
}
.projection:not(.overlay-output) .compact-qr img {
  width: min(240px, 100%);
  height: auto;
}
.projection:not(.overlay-output) .presentation-safe {
  padding: 0;
}
/* Five/six choices use two columns and a smaller scale before text can overflow.
   The full strings remain visible: no clipping, line clamp or scroll container. */
.projection:not(.overlay-output) .presentation-options:has(> :nth-child(5)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2vh;
}
.projection:not(.overlay-output)
  .presentation-options:has(> :nth-child(5))
  > div {
  font-size: clamp(14px, min(1.3vw, 2.2vh), 28px);
  padding: 0.9vh 0.8vw;
  gap: 0.8vw;
}
/* Rating options are short: one row of five, at full projection size. */
.projection:not(.overlay-output)
  .presentation-options.kind-rating-options:has(> :nth-child(5)) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.projection:not(.overlay-output)
  .presentation-options.kind-rating-options:has(> :nth-child(5))
  > div {
  font-size: clamp(18px, min(2.4vw, 4.4vh), 48px);
  padding: 10px 16px;
  justify-content: center;
  text-align: center;
}
.projection:not(.overlay-output)
  .presentation-options
  > div
  > span:first-child {
  flex-shrink: 0;
  white-space: nowrap;
}
.projection:not(.overlay-output)
  .presentation-card:has(
    > .presentation-result
      ~ .presentation-result
      ~ .presentation-result
      ~ .presentation-result
      ~ .presentation-result
  ) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2vw;
}
.projection:not(.overlay-output)
  .presentation-card:has(
    > .presentation-result
      ~ .presentation-result
      ~ .presentation-result
      ~ .presentation-result
      ~ .presentation-result
  )
  > :not(.presentation-result) {
  grid-column: 1 / -1;
}
.projection:not(.overlay-output)
  .presentation-card:has(
    > .presentation-result
      ~ .presentation-result
      ~ .presentation-result
      ~ .presentation-result
      ~ .presentation-result
  )
  > .presentation-result {
  font-size: clamp(14px, min(1.2vw, 2vh), 28px);
  margin: 0.6vh 0;
  align-content: start;
}
.projection:not(.overlay-output)
  .presentation-card:has(
    .presentation-options > :nth-child(5),
    > .presentation-result:nth-last-child(n + 6)
  )
  h2 {
  font-size: clamp(28px, min(3.5vw, 6.4vh), 72px);
  margin: 6px 0 12px;
}
.projection:not(.overlay-output)
  .presentation-card:has(> .presentation-result:nth-last-child(n + 6))
  .presentation-total {
  margin: 8px 0 0;
}
.projection:not(.overlay-output) .words-size-1 {
  font-size: clamp(1.5rem, 3vw, 3rem);
}
.projection:not(.overlay-output) .words-size-2 {
  font-size: clamp(1.8rem, 4.5vw, 4.5rem);
}
.projection:not(.overlay-output) .words-size-3 {
  font-size: clamp(2.1rem, 6vw, 6rem);
}
.projection:not(.overlay-output) .words-size-4 {
  font-size: clamp(2.4rem, 7.5vw, 7.5rem);
}
.projection:not(.overlay-output) .words-size-5 {
  font-size: clamp(2.7rem, 9vw, 9rem);
}
.projection:not(.overlay-output) .questions-screen h3 {
  font-size: clamp(28px, min(3.8vw, 6.8vh), 80px);
}
/* Rating remains five cells even in a narrow overlay; other kinds keep their grid. */
.overlay-output .kind-rating-options,
.overlay-output .kind-rating-results {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.overlay-output .kind-rating-options > div {
  min-width: 0;
  justify-content: center;
}
.overlay-output .kind-rating-results > :not(.presentation-result) {
  grid-column: 1 / -1;
}
.overlay-output .kind-rating-results .presentation-result {
  min-width: 0;
}
@media (orientation: portrait) {
  .projection:not(.overlay-output) .projection-content {
    grid-template-columns: minmax(0, 1fr);
    align-content: space-between;
    gap: 3vh;
  }
  .projection:not(.overlay-output) .presentation-scene h1 {
    font-size: clamp(20px, 3vw, 36px);
    margin-bottom: 3vh;
  }
  .projection:not(.overlay-output) .presentation-scene h2 {
    font-size: clamp(30px, 4.5vw, 58px);
    margin-bottom: 2vh;
  }
  .projection:not(.overlay-output) .presentation-result,
  .projection:not(.overlay-output) .presentation-options > div {
    font-size: clamp(20px, 3vw, 36px);
    line-height: 1.25;
  }
  .projection:not(.overlay-output) .presentation-result {
    margin: 0.5vh 0;
    gap: 10px 18px;
  }
  .projection:not(.overlay-output) .presentation-options {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.2vh;
  }
  .projection:not(.overlay-output) .compact-qr {
    text-align: left;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 4vw;
  }
  .projection:not(.overlay-output) .compact-qr img {
    width: clamp(120px, 20vw, 240px);
  }
  .projection:not(.overlay-output) .compact-qr h3 {
    font-size: clamp(20px, 2.8vw, 34px);
  }
  .projection:not(.overlay-output) .compact-qr p,
  .projection:not(.overlay-output) .sharing-note {
    font-size: clamp(16px, 2.2vw, 26px);
  }
}

/* Trivia: deadline widgets are shared by console, phone and output. */
.trivia-countdown {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  font-variant-numeric: tabular-nums;
}
.trivia-seconds {
  font-size: clamp(28px, 5vw, 64px);
}
.trivia-countdown progress {
  width: 100%;
  height: 12px;
  accent-color: #7c9e54;
}
.trivia-leaderboard {
  width: min(100%, 1100px);
  margin: 0 auto;
}
.trivia-ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.trivia-ranking-row {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr) auto;
  gap: 10px 22px;
  align-items: center;
  background: #383340;
  border-radius: 12px;
  padding: 16px 22px;
}
.trivia-ranking-rank {
  color: #dcff82;
  font-variant-numeric: tabular-nums;
}
.trivia-ranking-alias {
  overflow-wrap: anywhere;
  font-size: clamp(18px, 2.3vw, 35px);
}
.trivia-ranking-points {
  font-size: clamp(18px, 2.3vw, 35px);
  font-variant-numeric: tabular-nums;
}
.trivia-ranking-correct {
  grid-column: 2 / -1;
  color: #ccc6d4;
  font-size: 13px;
}
.trivia-ranking-total {
  color: #ccc6d4;
  font-size: 16px;
}
.presentation-mini .trivia-ranking-row {
  padding: 7px;
  gap: 4px;
  grid-template-columns: 25px minmax(0, 1fr) auto;
}
.presentation-mini :is(.trivia-ranking-alias, .trivia-ranking-points) {
  font-size: 12px;
}
.presentation-mini .trivia-ranking-correct {
  font-size: 9px;
}
@media (max-aspect-ratio: 9/12) {
  .projection-content:has(.trivia-leaderboard) {
    padding: 7vh 5vw;
  }
  .trivia-ranking-row {
    padding: 18px 15px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
  }
  .trivia-ranking-alias,
  .trivia-ranking-points {
    font-size: clamp(18px, 3.4vw, 40px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .trivia-ranking-row {
    transition: none;
    animation: none;
  }
}
.participant-stage .participant-score {
  padding: 18px;
  border-radius: 14px;
  background: #edf5e0;
  color: #263322;
  font-size: 20px;
}
@media (min-aspect-ratio: 1/1) {
  .projection .trivia-ranking-list:has(> :nth-child(7)) {
    gap: 6px;
  }
  .projection .trivia-ranking-list:has(> :nth-child(7)) .trivia-ranking-row {
    grid-template-columns: 40px minmax(0, 1fr) auto 95px;
    padding: 8px 16px;
  }
  .projection
    .trivia-ranking-list:has(> :nth-child(7))
    :is(.trivia-ranking-alias, .trivia-ranking-points) {
    font-size: clamp(18px, 2vw, 28px);
  }
  .projection
    .trivia-ranking-list:has(> :nth-child(7))
    .trivia-ranking-correct {
    grid-column: auto;
    text-align: right;
    font-size: 12px;
  }
}

/* 008: opt-in brand colors stay on an experience container, never the page root. */
.presentation-scene[data-experience-branding],
.projection-content[data-experience-branding]:not([data-brand-overlay]) {
  color: var(--brand-ink);
  background: var(--brand-background);
}
.presentation-scene[data-experience-branding][data-brand-overlay] {
  background: transparent;
}
.presentation-scene[data-experience-branding]
  :is(
    h1,
    h2,
    .presentation-total,
    .trivia-ranking-correct,
    .trivia-ranking-total
  ) {
  color: var(--brand-ink) !important;
}
.presentation-scene[data-experience-branding]
  :is(
    .presentation-brand,
    .presentation-state,
    .experience-brand-name,
    .trivia-ranking-rank,
    .presentation-options > div > span:first-child
  ) {
  color: var(--brand-accent) !important;
}
.presentation-scene[data-experience-branding]
  :is(.presentation-options > div, .trivia-ranking-row) {
  background: var(--brand-background);
  border: 1px solid var(--brand-tone);
  color: var(--brand-ink);
}
.presentation-scene[data-experience-branding] .presentation-bar {
  background: var(--brand-tone);
}
.presentation-scene[data-experience-branding] .presentation-bar-fill {
  background: var(--brand-accent);
}
.presentation-scene[data-experience-branding] .trivia-countdown progress {
  accent-color: var(--brand-accent);
}
.overlay-output
  .presentation-scene[data-experience-branding]
  .presentation-card {
  background: var(--brand-background);
  color: var(--brand-ink);
  border-left-color: var(--brand-accent);
}
.presentation-scene .experience-brand-name {
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
/* Legacy title/note styling is unchanged unless this output opts into branding. */
.projection-content[data-experience-branding]:not([data-brand-overlay])
  .sharing-note {
  color: var(--brand-ink);
}

.words-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 1rem;
}
.words-word {
  display: inline-block;
  overflow-wrap: anywhere;
  line-height: 1.1;
  font-weight: 800;
  color: var(--experience-accent, #6d47ea);
  animation: words-enter 0.25s ease-out;
}
/* Projection uses the validated foreground; Studio's light preview keeps its accent. */
.projection .words-word {
  color: inherit;
}
.words-size-1 {
  font-size: clamp(1rem, 2vw, 2rem);
}
.words-size-2 {
  font-size: clamp(1.2rem, 3vw, 3rem);
}
.words-size-3 {
  font-size: clamp(1.4rem, 4vw, 4rem);
}
.words-size-4 {
  font-size: clamp(1.6rem, 5vw, 5rem);
}
.words-size-5 {
  font-size: clamp(1.8rem, 6vw, 6rem);
}
@keyframes words-enter {
  from {
    opacity: 0;
    transform: translateY(0.15em);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .words-word {
    animation: none;
    transition: none;
  }
}

.questions-screen {
  display: grid;
  gap: 1rem;
}
.questions-screen article {
  border-top: 1px solid currentColor;
  padding: 0.6em 0;
  overflow-wrap: anywhere;
}
.questions-screen h3 {
  margin: 0.3em 0;
  font-size: clamp(1.5rem, 3vw, 3.4rem);
  line-height: 1.15;
}
.questions-screen p,
.questions-screen small {
  color: inherit;
}

.scratch-screen {
  font-size: clamp(1.5rem, 4vw, 4rem);
  text-align: center;
}
.scratch-screen p {
  color: inherit !important;
}
.presentation-mini .scratch-screen {
  font-size: clamp(1rem, 1.5vw, 1.6rem);
}
/* One text-only plate renderer on phones, output scenes and Studio monitors. */
.broadcast-card {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
/* Keep a fixed plate readable over bright video without filling the canvas. */
.overlay-output .broadcast-card {
  background: var(--brand-background, #24232df2);
  color: var(--brand-ink, #f8f7ef);
  border-left: 6px solid var(--brand-accent, #dcff82);
  border-radius: 12px;
  padding: 24px 30px;
}
.broadcast-card .broadcast-card-kind {
  display: block;
  font-size: 0.7em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1em;
}
.broadcast-card p {
  white-space: pre-wrap;
  line-height: 1.5;
  color: inherit;
}
.participant-view .broadcast-card {
  padding: clamp(24px, 7vw, 48px);
  border: 1px solid currentColor;
  border-radius: 24px;
  margin: 24px 0;
}
.participant-view .broadcast-card h2 {
  font-size: clamp(28px, 8vw, 48px);
  line-height: 1.1;
  color: inherit;
}
.presentation-scene .broadcast-card h2 {
  color: inherit;
}
.ls-root .ls-stage-phone .broadcast-card {
  margin-top: 22px;
}
.ls-root .ls-stage-phone .broadcast-card h2 {
  font-size: 24px;
  line-height: 1.1;
}
.ls-root .ls-out-screen .broadcast-card h2 {
  font-size: clamp(16px, 5cqw, 36px);
  line-height: 1.1;
}

/* 034: only approved, fully preloaded images enter this surface. */
.photos-wall {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  max-height: 65vh;
}
.photos-wall > p {
  grid-column: 1 / -1;
}
.photos-wall img {
  display: block;
  width: 100%;
  height: min(14vh, 170px);
  object-fit: cover;
  border-radius: 8px;
  animation: photos-appear 0.2s ease-out;
}
.photos-featured {
  grid-template-columns: 1fr;
}
.photos-featured img {
  height: 65vh;
  object-fit: contain;
  border-radius: 0;
}
.photos-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.photos-gallery img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
}
@keyframes photos-appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (max-width: 600px) {
  .photos-wall {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .photos-featured {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .photos-wall img {
    animation: none;
  }
}
.projection .photos-featured {
  position: fixed;
  inset: 0;
  z-index: 2;
  max-height: none;
}
.projection .photos-featured img {
  width: 100%;
  height: 100vh;
  object-fit: contain;
}
.projection:not(.overlay-output) .photos-featured {
  background: var(--brand-background, #f4f3ec);
}
.presentation-mini .photos-wall img {
  height: 60px;
}
.presentation-mini .photos-featured img {
  height: 180px;
}
.projection .presentation-card:has(.photos-featured) {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.projection .presentation-card:has(.photos-featured) > :not(.photos-featured) {
  visibility: hidden;
}
/* 035: team competition, scoped to its own component roots. */
.teams-ranking {
  width: 100%;
  color: var(--experience-ink, inherit);
}
.teams-ranking h2 {
  font-size: clamp(24px, 3vw, 64px);
  margin: 0 0 20px;
}
.teams-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 20px;
  margin: 14px 0;
  font-size: clamp(16px, 1.8vw, 34px);
  overflow-wrap: anywhere;
}
.teams-row p {
  grid-column: 1 / -1;
  font-size: 0.65em;
  margin: 0;
}
.teams-track {
  grid-column: 1 / -1;
  background: rgba(128, 128, 128, 0.25);
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
}
.teams-fill {
  height: 100%;
  background: currentColor;
  transition: width 0.35s ease;
}
.teams-method {
  font-size: clamp(12px, 1vw, 22px);
  margin-top: 24px;
}
.teams-picker {
  display: grid;
  gap: 14px;
}
.teams-picker button {
  min-height: 52px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.teams-settings {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid #c8d4bc;
  border-radius: 12px;
  min-width: 0;
}
.teams-settings label {
  display: grid;
  gap: 7px;
}
.teams-settings input:not([type="checkbox"]),
.teams-settings textarea,
.teams-settings select {
  box-sizing: border-box;
  width: 100%;
  padding: 12px;
  border: 1px solid #c8d4bc;
  border-radius: 8px;
  background: white;
  color: #263322;
}
.teams-settings :is(input, textarea, select):focus-visible {
  outline: 3px solid #799d46;
  outline-offset: 3px;
}
.teams-table {
  overflow-x: auto;
}
.teams-table table {
  width: 100%;
  border-collapse: collapse;
}
.teams-table th,
.teams-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #c8d4bc;
}
@media (prefers-reduced-motion: reduce) {
  .teams-fill {
    transition: none;
  }
}
@media (max-width: 600px) {
  .teams-row {
    grid-template-columns: 1fr;
  }
  .teams-row > * {
    grid-column: 1;
  }
}
