/* The show: a dark living room around the Holiday TV (the TV page lives in an iframe and brings its own wall). The
   page adds a thin bar above, the hook (landing) or the casting deck (show) below, and cream paper dialogs. */

.showpage { background: #1c100c; color: #f3e6cf; margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }
.showpage::before { display: none; }
.showbar {
  display: flex; align-items: center; gap: var(--s-4); min-height: 56px; padding: 0 var(--gutter);
  background: linear-gradient(#2a1d16, #1c120d); box-shadow: 0 1px 0 rgb(201 154 85 / .25), 0 6px 18px -8px #000;
  position: relative; z-index: 5;
}
.showbar .wordmark { color: #f6e4c2; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lg); text-decoration: none; display: inline-flex; align-items: center; gap: var(--s-2); }
.showbar .wordmark svg { width: 26px; height: 26px; }
.showbar .tagline { margin: 0; flex: 1; font-size: var(--fs-sm); color: #cdb68f; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barbtns { display: flex; gap: var(--s-2); align-items: center; }
.btn--lg { min-height: 56px; padding: 0 var(--s-6); font-size: var(--fs-lg); }
.showpage .btn--ghost { --fg: #f6e4c2; }
.showpage .btn--ghost:hover { background: rgb(255 255 255 / .08); }

.tvstage { position: relative; flex: 1; min-height: 0; display: flex; }
.tvstage iframe { display: block; width: 100%; height: calc(100dvh - 56px - 40px); border: 0; background: #1c100c; }  /* a strip of page shows under the TV: the wheel can't scroll over an iframe */
/* show: the TV gets the whole room; the cast lives in the pill + side card (no deck under it) */

/* ---- landing: the hook over the room's left wall; below the fold on phones ---- */
.hook {
  position: absolute; left: max(var(--gutter), 3vw); bottom: 92px; z-index: 4; width: min(24rem, 38vw);
  padding: var(--s-5); border-radius: var(--r-lg); color: #f6e4c2;
  background: linear-gradient(rgb(40 26 18 / .88), rgb(26 16 11 / .92)); backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1.5px rgb(201 154 85 / .45), 0 24px 50px -20px #000;
}
.hook .kicker, .dlg .kicker { margin: 0 0 var(--s-2); font: 700 var(--fs-xs)/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: #e2bd66; }
.hook h1 { margin: 0 0 var(--s-3); font: 700 clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem)/var(--lh-tight) var(--font-display); color: #fff4df; }
.hook p { margin: 0 0 var(--s-4); font-size: var(--fs-md); line-height: var(--lh-ui); color: #e8d6b2; }
.hook .price { margin: var(--s-3) 0 0; font-size: var(--fs-sm); color: #cdb68f; }
.howlink { color: #e2bd66; }
.showpage[data-mode="landing"] .tvstage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: linear-gradient(transparent, #1c100c); pointer-events: none; }
html { scroll-behavior: smooth; }
@media (max-width: 960px) {
  .showbar .tagline { display: none; }
  .tvstage iframe { height: min(78dvh, 120vw); }
  .hook { position: static; width: auto; margin: var(--s-4) var(--gutter) 0; }
  .showpage[data-mode="landing"] .tvstage { flex-direction: column; }
  .barbtns .btn { min-height: 40px; padding: 0 var(--s-4); font-size: var(--fs-sm); }
}
.below { padding-top: var(--s-7); padding-bottom: var(--s-6); color: #e8d6b2; }
.how3 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); }
.how3 li { position: relative; padding: var(--s-5) var(--s-5) var(--s-5) calc(var(--s-5) + 2.6rem); border-radius: var(--r-lg);
  background: rgb(255 230 190 / .05); box-shadow: inset 0 0 0 1px rgb(201 154 85 / .3); }
.how3 .n { position: absolute; left: var(--s-4); top: var(--s-4); width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%;
  background: #9c1f33; color: #fff6ec; font: 700 var(--fs-md) var(--font-display); box-shadow: 0 0 0 3px rgb(201 154 85 / .35); }
.how3 h3 { margin: 0 0 var(--s-2); font: 600 var(--fs-lg)/1.2 var(--font-display); color: #fff4df; }
.how3 p { margin: 0; font-size: var(--fs-sm); line-height: var(--lh-ui); }
@media (max-width: 760px) { .how3 { grid-template-columns: 1fr; } }
.footer { margin-top: var(--s-7); font-size: var(--fs-sm); color: #a8906b; text-align: center; }
.footer a { color: inherit; }

/* ---- dialogs: cream paper over the dark room ---- */
.dlg { width: min(34rem, calc(100% - 2 * var(--gutter))); border: 0; border-radius: var(--r-lg); padding: var(--s-6); color: var(--c-ink);
  background: var(--c-card); box-shadow: var(--sh-3); }
.dlg--wide { width: min(64rem, calc(100% - 2 * var(--gutter))); }
.dlg::backdrop { background: rgb(10 5 3 / .72); backdrop-filter: blur(3px); }
.dlg h2 { margin: 0 0 var(--s-2); font: 700 var(--fs-xl)/var(--lh-tight) var(--font-display); color: var(--c-primary); }
.dlg > form > .muted, .dlg > .muted { margin: 0 0 var(--s-4); }
.dlg .x { position: absolute; top: var(--s-3); right: var(--s-3); width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 26px; line-height: 1; color: var(--c-ink-2); cursor: pointer; }
.dlg .x:hover { background: var(--c-paper-2); }
.dlg .btn + .btn, .dlg .btn + .hint, .dlg .notice + .btn, .dlg .check + .btn { margin-top: var(--s-3); }
.dlg .dropzone { margin: var(--s-3) 0; }
.dlg .check { margin: var(--s-4) 0; }
.dlg .thumbs li .th img, .dlg .thumbs li .th i { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--c-paper-2); font-style: normal; font-size: var(--fs-xs); }
.dlg .thumbs li button { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--c-ink); color: #fff; cursor: pointer; }
.dlg .hint { margin: var(--s-3) 0 0; }
.dlgfoot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-4); flex-wrap: wrap; }
.perks { list-style: none; margin: var(--s-4) 0 var(--s-5); padding: 0; display: grid; gap: var(--s-3); }
.perks li { padding-left: 1.8rem; position: relative; line-height: var(--lh-ui); }
.perks li::before { content: ""; position: absolute; left: 0; top: .35em; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--c-ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10.5l4 4 8-9' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; }
.perks li.muted::before { background: var(--c-line); }

/* ---- the cast dialog ---- */
.castgrid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-5); align-items: start; }
@media (max-width: 760px) { .castgrid { grid-template-columns: 1fr; } }
.castgrid .photo-frame { background: var(--c-paper-2); padding: var(--s-2); border-radius: var(--r-md); box-shadow: var(--sh-1); }
.castgrid .photo-stage { position: relative; }
.castgrid .photo-stage img { display: block; width: 100%; height: auto; border-radius: var(--r-sm); }
.ring { position: absolute; translate: -50% -50%; aspect-ratio: 1; border-radius: 50%;
  box-shadow: 0 0 0 3px #fff6ec, 0 0 0 5px var(--c-accent); pointer-events: none; }
.ring::after { content: attr(data-n); position: absolute; left: 50%; bottom: 0; translate: -50% 60%; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--c-accent); color: #fff; font: 700 12px var(--font-ui); box-shadow: 0 0 0 2px #fff6ec; }
.rows:focus { outline: none; }
.rows { display: grid; gap: var(--s-3); max-height: min(60dvh, 34rem); overflow: auto; padding-right: 2px; }
.row { display: grid; grid-template-columns: 56px 1fr; gap: var(--s-3); align-items: start; padding: var(--s-3); border-radius: var(--r-md); background: var(--c-paper); }
.row .face { width: 56px; height: 56px; border-radius: 50%; background: var(--c-paper-2); box-shadow: 0 0 0 2px var(--c-line); }
.rowmain { display: grid; gap: var(--s-2); min-width: 0; }
.rowtop { display: flex; gap: var(--s-2); align-items: center; }
.rowtop .num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--c-accent); color: #fff; font: 700 13px var(--font-ui); }
.rowtop .name { flex: 1; min-width: 0; min-height: 44px; }
.inc { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); white-space: nowrap; cursor: pointer; }
.inc input { width: 20px; height: 20px; accent-color: var(--c-primary); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pills .sep { width: 1px; height: 22px; background: var(--c-line); margin: 0 4px; }
.pill { position: relative; }
.pill input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pill span { display: inline-grid; place-items: center; min-height: 34px; padding: 0 12px; border-radius: var(--r-pill); border: 1.5px solid var(--c-line); font-size: var(--fs-sm); background: var(--c-card); }
.pill input:checked + span { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); font-weight: 600; }
.pill input:focus-visible + span { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.row .about { min-height: 40px; font-size: var(--fs-sm); }

/* ---- the deck under the TV: who's on, who's being drawn ---- */
.deck { height: 96px; padding: var(--s-2) var(--gutter); display: grid; grid-template-rows: auto auto; align-content: center; gap: 4px;
  background: linear-gradient(#17100c, #0f0906); box-shadow: 0 -1px 0 rgb(201 154 85 / .25); }
.castrow { display: flex; gap: var(--s-3); overflow-x: auto; scrollbar-width: none; }
.cm { flex: none; display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: rgb(255 230 190 / .06); box-shadow: inset 0 0 0 1px rgb(201 154 85 / .3); }
.cm img, .cm i { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #3a2a1f; }
.cm[data-status="ready"] { box-shadow: inset 0 0 0 1.5px #5fbf7a; }
.cm[data-status="ready"] img { box-shadow: 0 0 0 2px #5fbf7a; }
.cmname { font: 700 var(--fs-sm)/1.1 var(--font-ui); color: #fff4df; }
.cmline { font-size: 12px; line-height: 1.1; color: #cdb68f; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.cm[data-status="ready"] .cmline { color: #8fe0a6; }
.cmline svg { width: 14px; height: 14px; }
.cm .spin { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #e2bd66; border-right-color: transparent; animation: cmspin .9s linear infinite; display: inline-block; }
@keyframes cmspin { to { rotate: 360deg; } }
.decknote { margin: 0; font-size: var(--fs-xs); color: #a8906b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flash { position: absolute; left: 50%; top: 16px; translate: -50% 0; z-index: 6; padding: var(--s-3) var(--s-5); border-radius: 999px;
  background: linear-gradient(#9c1f33, #6b1221); color: #fff6ec; font: 700 var(--fs-md) var(--font-display); box-shadow: 0 0 0 2px #e2bd66, 0 14px 30px -10px #000;
  animation: flashin .5s var(--ease-out); }
.flash p { margin: 0; }
@keyframes flashin { from { translate: -50% -24px; opacity: 0; } }

/* ---- cards ---- */
.cardprev { margin: var(--s-3) 0 var(--s-4); background: var(--c-paper-2); padding: var(--s-2); border-radius: var(--r-md); }
.cardprev img { display: block; width: 100%; height: auto; max-height: 48dvh; object-fit: contain; border-radius: var(--r-sm); }
.dlg .row2 { display: grid; grid-template-columns: auto 1fr; gap: var(--s-4); align-items: end; margin-bottom: var(--s-4); }
@media (max-width: 560px) { .dlg .row2 { grid-template-columns: 1fr; } }
.dlg .btn--ghost { --fg: var(--c-primary); }
.dlg .btn--ghost:hover { background: rgb(0 0 0 / .04); }
.cm[data-status="error"] { box-shadow: inset 0 0 0 1.5px #d9534f; }
.cm .retry { appearance: none; border: 0; background: transparent; color: #ffb3ad; font: 600 12px var(--font-ui); padding: 0; cursor: pointer; text-decoration: underline; }

/* ---- the show's cast pill (over the TV room, top right) and its side card ---- */
.castpill { all: unset; cursor: pointer; position: absolute; z-index: 6; top: 12px; right: 14px; display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px; border-radius: 999px; background: rgb(28 18 13 / .78); color: #f6e4c2; backdrop-filter: blur(4px);
  box-shadow: inset 0 0 0 1.5px rgb(201 154 85 / .45), 0 6px 18px -6px #000; font: 700 14px var(--font-ui); letter-spacing: .02em; }
.castpill:hover { background: rgb(40 26 18 / .9); }
.castpill:focus:not(:focus-visible) { outline: none; }
.castpill:focus-visible { outline: 2px solid #f2c45a; outline-offset: 2px; }
.castpill .faces { display: flex; margin: 0; gap: 0; flex-wrap: nowrap; }   /* not studio.css .faces (a 24 px top margin + gap) */
.castpill .faces img, .castpill .faces i { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: #e8d6b2; box-shadow: 0 0 0 2px #1c120d; }
.castpill .faces > * + * { margin-left: -8px; }
.castpill .faces [data-status="drawing"], .castpill .faces [data-status="queued"] { opacity: .45; }
.castpill[aria-expanded="true"] { opacity: 0; pointer-events: none; }

.showpanel { position: fixed; z-index: 30; top: 0; right: 0; height: 100dvh; width: min(380px, 94vw); overflow-y: auto; box-sizing: border-box;
  color: var(--c-ink); background: var(--c-card); background-image: var(--tex-paper, none); border-radius: 22px 0 0 22px; padding: var(--s-5) var(--s-5) var(--s-4);
  box-shadow: -20px 0 50px -20px #000, 0 0 0 1px rgb(255 240 210 / .3); transform: translateX(105%); transition: transform .35s var(--ease-out); }
.showpanel.open { transform: none; }
.showpanel .x { position: absolute; top: var(--s-3); right: var(--s-3); width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--c-paper-2);
  font-size: 22px; line-height: 1; color: var(--c-ink-2); cursor: pointer; }
.showpanel header { padding-right: 40px; }
.showpanel .kicker { margin: 0; font: 700 var(--fs-xs)/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-2); }
.showpanel h2 { margin: 4px 0 0; font: 800 1.7rem/1.05 var(--font-display); color: var(--c-accent); }
.showpanel .sub { margin: 4px 0 0; font-family: var(--font-display); font-style: italic; color: var(--c-primary); }
.psec { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--c-line); }
.psec h3 { margin: 0 0 var(--s-3); font: 700 var(--fs-md)/1.2 var(--font-display); color: var(--c-primary); }
.pnote { margin: var(--s-2) 0 var(--s-3); font-size: var(--fs-sm); line-height: 1.4; color: var(--c-ink-2); }
.pkeys { margin: var(--s-5) 0 0; font-size: var(--fs-xs); color: var(--c-ink-2); }
.pcast { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.pcast .cm { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 6px 10px 6px 6px;
  border-radius: 14px; background: var(--c-paper); box-shadow: inset 0 0 0 1px var(--c-line); }
.pcast .cm img, .pcast .cm > i { grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--c-paper-2); }
.pcast .cm[data-status="ready"] { box-shadow: inset 0 0 0 1.5px #3f9a5a; }
.pcast .cm[data-status="ready"] img { box-shadow: 0 0 0 2px #3f9a5a; }
.pcast .cmname { font: 700 var(--fs-md)/1.1 var(--font-ui); color: var(--c-ink); }
.pcast .cmline { font-size: var(--fs-sm); color: var(--c-ink-2); display: inline-flex; align-items: center; gap: 6px; white-space: normal; }
.pcast .cm[data-status="ready"] .cmline { color: #2f7a46; }
.pcast .cm .retry { color: #b3261e; }
#pCard .seg, #pCard .field { margin: 0 0 var(--s-3); }
#pCard .cardprev { margin: 0 0 var(--s-3); }
#pCard .btn + .btn { margin-top: var(--s-2); }
#pCard .btn--ghost { --fg: var(--c-primary); }
.plock p { margin: 0 0 var(--s-3); font-size: var(--fs-sm); color: var(--c-ink-2); }
@media (max-width: 700px) {
  .showpanel { top: auto; bottom: 0; left: 0; width: 100%; height: auto; max-height: 85dvh; border-radius: 22px 22px 0 0; transform: translateY(105%); }
  .castpill { top: 10px; }
}

/* the curtain call: the cast in a line, overlapping, waving */
.curtain { display: flex; justify-content: center; align-items: flex-end; padding: var(--s-2) 0 var(--s-1); margin-bottom: var(--s-2);
  background: radial-gradient(ellipse 70% 55% at 50% 100%, rgb(156 31 51 / .12), transparent 70%); }
.curtain figure { position: relative; margin: 0; flex: 0 1 auto; min-width: 0; display: grid; justify-items: center; }
.curtain figure + figure { margin-left: -9%; }
.curtain img { display: block; height: var(--fh, 210px); width: auto; filter: drop-shadow(0 6px 6px rgb(60 30 10 / .25)); }
.curtain figcaption { margin-top: 4px; font: 700 var(--fs-sm)/1 var(--font-display); color: var(--c-primary); white-space: nowrap; }
.curtain[hidden] { display: none; }
