/* White House Barbie V2 — one room, three involuntary fans. */
:root {
  color-scheme: dark;
  --navy: #14213d;
  --cream: #fff8e7;
  --pink: #f184b6;
  --masthead-height: 56px;
  --footer-height: 36px;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
  background: var(--navy);
  color: var(--cream);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; min-height: 100%; }
body { min-width: 320px; min-height: 100svh; margin: 0; overflow-x: hidden; }
button { font: inherit; color: inherit; touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
button:not(:disabled), a { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--pink); outline-offset: 4px; }
img { display: block; max-width: 100%; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.masthead {
  position: relative;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  height: calc(var(--masthead-height) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgb(255 248 231 / 17%);
  background: var(--navy);
}
.unofficial-mark { display: flex; align-items: center; gap: 9px; font-size: 9px; line-height: 1.35; font-weight: 700; letter-spacing: .14em; }
.status-dot { width: 5px; height: 5px; flex: none; border-radius: 50%; background: var(--pink); }
.parody-tag { padding: 4px 6px; border: 1px solid rgb(241 132 182 / 60%); border-radius: 2px; color: var(--pink); font-size: 8px; letter-spacing: .12em; }
.mobile-break { display: none; }
.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.header-actions button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; min-width: 40px; min-height: 36px; margin: 0; padding: 8px 10px;
  border: 1px solid rgb(255 248 231 / 30%); border-radius: 3px;
  background: transparent; font-size: 11px; line-height: 1;
}
.header-actions button:hover { border-color: var(--cream); background: rgb(255 248 231 / 7%); }
.header-actions button[aria-pressed="true"] { border-color: var(--pink); color: var(--pink); }
.header-actions img { width: 17px; height: 17px; object-fit: contain; }
.story-icon { display: grid; width: 16px; height: 16px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 700; }

.briefing-room {
  position: relative;
  isolation: isolate;
  container-type: size;
  width: 100%;
  height: calc(100svh - var(--masthead-height) - var(--footer-height) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  min-height: 560px;
  overflow: hidden;
  background: #1b3a70 url("./assets/v2/scene/briefing-room-wide.webp") center / cover no-repeat;
}
.briefing-room::after {
  position: absolute; z-index: 35; inset: 0; content: ""; pointer-events: none;
  background: var(--cream); opacity: 0; transition: opacity 160ms ease-out;
}
.briefing-room.is-flashing::after { opacity: .18; }
.room-sign {
  position: absolute; z-index: 3; left: 50%; top: 1.5%;
  height: 15%; aspect-ratio: 1000 / 320;
  transform: translateX(-50%); pointer-events: none;
}
.room-sign img { width: 100%; height: 100%; max-width: none; object-fit: contain; }
.presenter {
  position: absolute; z-index: 5; left: 52%; bottom: 9%;
  height: 86%; aspect-ratio: 2 / 3;
  transform: translateX(-50%); pointer-events: none;
}
.presenter-art { position: relative; width: 100%; height: 100%; transform-origin: 50% 70%; }
.presenter-art img { width: 100%; height: 100%; max-width: none; object-fit: contain; object-position: center bottom; }
.presenter-art.is-speaking { animation: speaking 420ms ease-out; }
.presenter-art.is-celebrating { animation: pleased 600ms ease-out; }
@keyframes speaking { 0%,100% { transform: rotate(0); } 45% { transform: rotate(-1.5deg); } }
@keyframes pleased { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-5px); } }
.lectern {
  position: absolute; z-index: 7; left: 52%; bottom: 9%;
  height: 60%; aspect-ratio: 2 / 3;
  transform: translateX(-50%); pointer-events: none;
}
.lectern img { width: 100%; height: 100%; max-width: none; object-fit: contain; object-position: center bottom; }

.speech {
  position: absolute; z-index: 25;
  width: max-content; max-width: 26ch; margin: 0; padding: 13px 17px;
  border: 1.5px solid var(--navy); border-radius: 8px;
  background: var(--cream); color: var(--navy);
  box-shadow: 4px 4px 0 rgb(8 20 43 / 18%);
  font-size: clamp(13px, 1.1cqw, 19px); font-weight: 600; line-height: 1.3;
  text-wrap: pretty; overflow-wrap: anywhere; pointer-events: none;
}
.speech::after {
  position: absolute; content: ""; bottom: -7px; left: 22px; width: 12px; height: 12px;
  border-right: 1.5px solid var(--navy); border-bottom: 1.5px solid var(--navy);
  background: inherit; transform: rotate(45deg);
}
.question-bubble { top: 36%; left: 6%; max-width: 25%; }
.answer-bubble { top: 34%; right: 6%; max-width: 24%; background: #ffe2ef; }
.answer-bubble::after { left: auto; right: 22px; }
.intro-hint {
  position: absolute; z-index: 23; bottom: 27%; left: 50%;
  width: max-content; max-width: calc(100% - 28px); margin: 0; padding: 8px 12px;
  border: 1px solid rgb(255 248 231 / 30%); border-radius: 3px;
  background: rgb(20 33 61 / 94%); color: var(--cream);
  font-size: clamp(10px, .8cqw, 13px); font-weight: 600; line-height: 1.3;
  text-align: center; transform: translateX(-50%); pointer-events: none;
}
.intro-hint span { color: var(--pink); }

.reporters { position: absolute; z-index: 20; inset: 0; pointer-events: none; }
.reporter {
  position: absolute; bottom: 0;
  width: clamp(180px, 27cqh, 350px); aspect-ratio: 9 / 8;
  margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent;
  pointer-events: auto; transform: translateX(-50%); transform-origin: center bottom;
  transition: transform 170ms ease-out, filter 170ms ease-out;
}
.reporter-a { left: 15%; }
.reporter-b { left: 48%; }
.reporter-c { left: 86%; }
.reporter > [data-state-image] { width: 100%; height: 100%; max-width: none; object-fit: contain; object-position: center bottom; pointer-events: none; -webkit-user-drag: none; }
.reporter .chair-label {
  position: absolute; z-index: 2; bottom: 1.5%; left: 50%;
  width: 62%; height: auto; max-width: none; transform: translateX(-50%); pointer-events: none;
}
.reporter-hint {
  position: absolute; z-index: 3; top: -12px; left: 50%;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 48px; margin: 0; padding: 6px 8px;
  border: 1px solid rgb(255 248 231 / 80%); border-radius: 3px;
  background: var(--navy); color: var(--cream);
  font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: .1em;
  transform: translateX(-50%); pointer-events: none;
}
.hint-arrow { font-size: 12px; }
.reporter[aria-disabled="false"] .reporter-hint { border-color: var(--pink); background: var(--pink); color: var(--navy); }
.reporter[aria-disabled="true"] { cursor: default; }
.reporter[aria-disabled="true"] .reporter-hint { opacity: .55; }
.reporter[data-asked="true"] .reporter-hint,
.reporter.is-asked .reporter-hint,
.reporter.is-converted .reporter-hint,
.is-finished .reporter-hint { visibility: hidden; }
.reporter:not([aria-disabled="true"]):is(:hover,:focus-visible) { transform: translateX(-50%) translateY(-5px); filter: brightness(1.06); }
.reporter:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; border-radius: 4px; }
.reporter.is-converting { z-index: 22; animation: reporter-conversion 650ms cubic-bezier(.15,.8,.2,1); }
@keyframes reporter-conversion { 0%,100% { transform: translateX(-50%) scale(1); } 42% { transform: translateX(-50%) scale(1.12); filter: brightness(1.12); } }
.is-busy .reporter { cursor: wait; }
.is-busy .reporter-hint { opacity: .45; }
.prop-cue {
  position: absolute; z-index: 28; left: 55%; bottom: 27%;
  display: grid; grid-template-columns: 52px 22px 52px; align-items: center; gap: 4px;
  padding: 8px 12px 22px; border: 1px solid rgb(241 132 182 / 60%); border-radius: 8px;
  background: rgb(20 33 61 / 95%); box-shadow: 0 5px 25px rgb(0 0 0 / 12%);
  pointer-events: none; transform: rotate(3deg);
}
.prop-cue img { width: 52px; height: 90px; object-fit: contain; }
.prop-cue > span:not(.prop-cue-caption) { color: var(--pink); font-size: 20px; }
.prop-cue-caption { position: absolute; bottom: 7px; left: 0; width: 100%; font-size: 7px; letter-spacing: .1em; text-align: center; color: var(--pink); }

.finale-panel {
  position: absolute; z-index: 32; top: 22%; left: 5%;
  display: grid; justify-items: center; gap: 9px;
  width: min(310px, 25%); max-height: 72%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; margin: 0; padding: 15px;
  border: 1px solid rgb(241 132 182 / 55%); border-radius: 8px;
  background: rgb(20 33 61 / 96%); color: var(--cream);
  text-align: center;
}
.eyebrow { margin: 0; font-size: 9px; font-weight: 700; line-height: 1.25; letter-spacing: .12em; text-transform: uppercase; }
.finale-panel .eyebrow { color: var(--pink); }
.finale-panel h2 { margin: 0; font-size: clamp(17px, 1.7cqw, 28px); line-height: 1.05; letter-spacing: -.035em; }
.pass-preview { width: auto; max-width: 100%; height: 32cqh; max-height: 320px; object-fit: contain; }
.finale-actions { display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap; gap: 7px; width: 100%; }
.finale-actions :is(button,a) {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 40px; margin: 0; padding: 9px 10px;
  border: 1px solid rgb(255 248 231 / 75%); border-radius: 3px;
  background: transparent; color: var(--cream);
  font-size: 11px; font-weight: 700; line-height: 1.2; text-decoration: none;
}
.finale-actions #save-button { border-color: var(--pink); background: var(--pink); color: var(--navy); }
.finale-actions :is(button,a):hover { background: var(--cream); border-color: var(--cream); color: var(--navy); }
.finale-actions img { width: 15px; height: 15px; object-fit: contain; }
.open-pass-link { font-size: 10px; line-height: 1.3; color: rgb(255 248 231 / 76%); text-underline-offset: 3px; }
.site-footer {
  position: relative; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 8px 20px;
  min-height: calc(var(--footer-height) + env(safe-area-inset-bottom, 0px));
  padding: 8px max(20px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  border-top: 1px solid rgb(255 248 231 / 17%); background: var(--navy);
  color: rgb(255 248 231 / 65%); font-size: 9px; line-height: 1.3;
}
#progress-label { flex: none; color: var(--cream); font-size: 10px; font-weight: 700; white-space: nowrap; }
.footer-punchline { text-align: right; }
.parody-note { text-align: center; }

.story-dialog:not([open]) { display: none; }
.story-dialog[open] { display: block; }
.story-dialog {
  position: fixed; inset: 0;
  width: min(580px, calc(100vw - 32px)); max-height: min(740px, calc(100svh - 32px));
  margin: auto; padding: 38px 30px 28px; overflow-y: auto;
  border: 2px solid var(--navy); border-radius: 8px;
  background: var(--cream); color: var(--navy); box-shadow: 12px 12px 0 rgb(0 0 0 / 18%);
}
.story-dialog::backdrop { background: rgb(9 18 37 / 80%); backdrop-filter: blur(3px); }
.close-button {
  position: absolute; top: 8px; right: 8px; display: grid; place-items: center;
  width: 36px; height: 36px; padding: 0; border: 1px solid rgb(20 33 61 / 25%); border-radius: 3px;
  background: transparent; color: var(--navy); font-size: 25px; line-height: 1;
}
.close-button:hover { background: var(--navy); color: var(--cream); }
.story-dialog .eyebrow { margin: 0 0 10px; color: #8a3663; }
.story-dialog h2 { margin: 0 0 20px; font-size: clamp(28px, 4.5vw, 43px); line-height: 1.05; letter-spacing: -.035em; }
.story-dialog p { font-size: 14px; line-height: 1.6; }
.story-dialog .source-link { display: inline-block; margin: 1px 0 20px; font-size: 13px; font-weight: 700; text-underline-offset: 4px; }
.story-dialog .source-note { margin-bottom: 0; color: rgb(20 33 61 / 68%); font-size: 11px; line-height: 1.5; }
.no-script { position: absolute; z-index: 28; top: 35%; left: 5%; width: min(340px,90%); margin: 0; padding: 18px; border: 1px solid var(--pink); border-radius: 5px; background: var(--navy); color: var(--cream); font-size: 14px; }

@media (orientation: portrait) {
  :root { --masthead-height: 54px; --footer-height: 52px; }
  .briefing-room { min-height: 450px; background-image: url("./assets/v2/scene/briefing-room-mobile.webp"); }
  .room-sign { height: min(15cqh, 27cqw); max-width: 90%; }
  .presenter { bottom: 18%; height: min(74cqh, 138cqw); }
  .lectern { bottom: 18%; height: min(46cqh, 86cqw); }
  .reporter { width: 35%; }
  .reporter-a { left: 15%; }
  .reporter-b { left: 50%; }
  .reporter-c { left: 85%; }
  .reporter .chair-label { width: 76%; bottom: 2%; }
  .reporter-hint { top: -12px; gap: 3px; min-width: 38px; padding: 5px 6px; font-size: 8px; }
  .hint-arrow { font-size: 10px; }
  .speech { padding: 10px 12px; font-size: clamp(12px, 3.2cqw, 17px); line-height: 1.25; box-shadow: 3px 3px 0 rgb(8 20 43 / 15%); }
  .question-bubble { top: 58%; left: 4%; max-width: 92%; }
  .answer-bubble { top: 72%; right: 4%; max-width: 86%; }
  .speech::after { display: none; }
  .answer-bubble::after { top: -5px; bottom: auto; border-top: 1.5px solid var(--navy); border-left: 1.5px solid var(--navy); border-bottom: 0; border-right: 0; }
  .intro-hint { bottom: 24%; padding: 9px 10px; font-size: clamp(10px,2.7cqw,13px); }
  .prop-cue { left: 8%; bottom: 32%; grid-template-columns: 34px 16px 34px; padding: 5px 8px 19px; }
  .prop-cue img { width: 34px; height: 58px; }
  .prop-cue-caption { bottom: 5px; font-size: 6px; }
  .finale-panel {
    top: auto; bottom: 2%; left: 50%; width: min(94%, 460px);
    grid-template-columns: minmax(0,.8fr) minmax(0,1fr);
    grid-template-areas: "pass eyebrow" "pass title" "pass actions" "pass note";
    gap: 7px 12px; align-content: center; align-items: center;
    padding: 12px; transform: translateX(-50%);
  }
  .finale-panel .eyebrow { grid-area: eyebrow; font-size: 8px; }
  .finale-panel h2 { grid-area: title; font-size: clamp(18px,5cqw,27px); }
  .pass-preview { grid-area: pass; width: 100%; height: auto; max-height: 33cqh; }
  .finale-actions { grid-area: actions; flex-direction: column; gap: 6px; }
  .finale-actions :is(button,a) { width: 100%; min-height: 38px; padding: 8px 5px; font-size: 11px; }
  .open-pass-link { grid-area: note; font-size: 9px; }
  .site-footer { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 4px; padding-left: 12px; padding-right: 12px; }
  #progress-label { grid-column: 1; grid-row: 1; }
  .footer-punchline { grid-column: 2; grid-row: 1; font-size: 8px; }
  .parody-note { grid-column: 1 / -1; grid-row: 2; font-size: 8px; }
}

@media (max-width: 600px) {
  .masthead { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .unofficial-mark { gap: 6px; font-size: 8px; letter-spacing: .09em; }
  .mobile-break { display: inline; }
  .parody-tag { padding: 3px 4px; font-size: 7px; }
  .header-actions { gap: 6px; }
  .header-actions button { min-width: 38px; min-height: 38px; padding: 8px; }
  .header-actions .action-label, #sound-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .story-dialog { width: calc(100vw - 24px); max-height: calc(100svh - 24px); padding: 38px 20px 24px; }
}
@media (max-width: 360px) {
  .unofficial-mark { font-size: 7px; letter-spacing: .06em; gap: 5px; }
  .parody-tag { font-size: 6px; }
  .header-actions button { min-width: 36px; min-height: 36px; padding: 7px; }
  .header-actions { gap: 5px; }
  .story-dialog p { font-size: 13px; }
}
@media (max-height: 620px) and (orientation: landscape) {
  :root { --masthead-height: 44px; --footer-height: 32px; }
  .briefing-room { min-height: 300px; }
  .unofficial-mark { font-size: 8px; }
  .header-actions button { min-height: 32px; }
  .reporter { width: min(24cqw, 34cqh); }
  .reporter-a { left: 14%; }
  .reporter-b { left: 49%; }
  .reporter-c { left: 86%; }
  .reporter-hint { top: -8px; font-size: 8px; padding: 5px 6px; }
  .question-bubble { left: 4%; top: 35%; max-width: 24%; }
  .answer-bubble { right: 4%; top: 35%; max-width: 23%; }
  .speech { padding: 10px 12px; font-size: 12px; }
  .intro-hint { bottom: 34%; font-size: 10px; }
  .finale-panel { top: 20%; left: 3%; width: 25%; gap: 6px; padding: 10px; }
  .finale-panel h2 { font-size: 17px; }
  .pass-preview { height: 30cqh; }
  .finale-actions { gap: 5px; }
  .finale-actions :is(button,a) { min-height: 32px; padding: 7px 8px; font-size: 9px; }
  .site-footer { padding-top: 6px; padding-bottom: 6px; font-size: 8px; }
  .parody-note { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reporter:not([aria-disabled="true"]):is(:hover,:focus-visible) { transform: translateX(-50%); filter: none; }
  .briefing-room::after { display: none !important; }
}
.error-page { display: grid; align-content: center; min-height: 100svh; padding: 8vw; background: var(--navy); color: var(--cream); }
.error-page p { font-size: 12px; letter-spacing: .15em; color: var(--pink); }
.error-page h1 { margin: 20px 0; font-size: clamp(36px,7vw,86px); line-height: 1.05; letter-spacing: -.04em; }
.error-page a { width: max-content; padding: 12px 0; text-underline-offset: 6px; }
