/* תגיד רגע. Clean-up of 2026-11-09: one calm indigo room for every screen, plain panels, clear labels,
   one yellow button per screen. The colour lives in the characters, the painted scenes and the title cards. */

@font-face { font-family: 'Suez One'; src: url(../fonts/suez-hebrew.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; font-display: swap; }
@font-face { font-family: 'Suez One'; src: url(../fonts/suez-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url(../fonts/rubik-hebrew.woff2) format('woff2'); font-weight: 300 900; unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url(../fonts/rubik-latin.woff2) format('woff2'); font-weight: 300 900; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; font-display: swap; }

:root {
  --ink: #16182c;
  --bg: #171a45;
  --card: #232869;
  --card-2: #1b1f55;
  --cream: #fff4dc;
  --cream-dim: #d9d2e6;
  --line: rgba(255, 244, 220, .24);
  --cream-faint: var(--line);
  --sun: #ffc83a;
  --tomato: #f2553a;
  --stamp: #d93620;
  --rule: var(--sun);
  --display: 'Suez One', 'Frank Ruhl Libre', 'David', serif;
  --ui: 'Rubik', system-ui, sans-serif;
  --r: 4px;
  --pad: clamp(14px, 4vw, 28px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  caret-color: var(--ink);
}
::selection { background: var(--sun); color: var(--ink); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* the eight places: only the film itself (the stage and its title cards) changes colour */
[data-place=sea]     { --bg: #0a2740; --card: #125f93; --rule: #9fe0f5; }
[data-place=street]  { --bg: #3b1a08; --card: #9c4512; --rule: #ffd28a; }
[data-place=kitchen] { --bg: #3a0f14; --card: #a8323a; --rule: #ffd27a; }
[data-place=forest]  { --bg: #0b2a17; --card: #1f6b3a; --rule: #d9f0a8; }
[data-place=roof]    { --bg: #130f33; --card: #3a2f8f; --rule: #ff9ab8; }
[data-place=desert]  { --bg: #33220a; --card: #7f560e; --rule: #ffe08a; }
[data-place=stairs]  { --bg: #26122d; --card: #6b3a7a; --rule: #ffc83a; }
[data-place=market]  { --bg: #3d1024; --card: #a2315f; --rule: #c9f0ff; }

/* film grain: only while the film is running */
.fx { display: none; position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
body:has(.show) .fx { display: block; }
.fx .grain { position: absolute; inset: -40px; background-size: 180px 180px; opacity: .05; mix-blend-mode: screen; animation: grain 0.9s steps(1) infinite; }
.fx .flick, .fx .scr, .fx .vig { display: none; }
@keyframes grain {
  0% { transform: translate(0, 0); } 12% { transform: translate(-31px, 17px); } 25% { transform: translate(22px, -29px); }
  37% { transform: translate(-13px, -9px); } 50% { transform: translate(33px, 26px); } 62% { transform: translate(-27px, 31px); }
  75% { transform: translate(9px, -35px); } 87% { transform: translate(-36px, -14px); }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

#view { position: relative; min-height: 100dvh; }
#view > .screen:not(.show) { animation: rise .3s var(--ease) both; }

/* ---------- panel ---------- */
.icard { position: relative; background: var(--card); border-radius: 6px; padding: clamp(18px, 4vw, 30px); text-align: center; }
.icard .dia { display: none; }
.lbl { display: block; font-size: .88rem; font-weight: 500; color: var(--cream-dim); }
.lbl.sect { text-align: start; margin-bottom: -10px; }

.line { font-family: var(--display); font-size: clamp(1.7rem, 5.6vw, 3.3rem); line-height: 1.3; text-wrap: balance; color: var(--cream); }
.line b { font-weight: 400; color: var(--rule); }
.quote { font-family: var(--display); font-size: clamp(1.9rem, 6.6vw, 3.9rem); line-height: 1.22; text-wrap: balance; margin: .35em 0; color: var(--cream); }
.small { font-size: .92rem; color: var(--cream-dim); }
.dim { color: var(--cream-dim); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 8px 20px; border-radius: var(--r);
  border: 2px solid var(--cream); font-family: var(--ui); font-weight: 700; font-size: 1.05rem; line-height: 1.1;
  color: var(--cream); background: transparent; transition: background .15s, color .15s, opacity .15s, transform .15s var(--ease);
}
.btn:hover { background: rgba(255, 244, 220, .14); }
.btn:active { transform: translateY(1px); }
.btn.solid { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.btn.solid:hover { background: #ffd666; border-color: #ffd666; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.sm { min-height: 40px; padding: 4px 14px; font-size: .95rem; }
.link { color: var(--cream-dim); text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; font-size: .95rem; padding: 8px 4px; }
.link:hover { color: var(--cream); }

.field { display: block; width: 100%; min-height: 48px; background: var(--cream); color: var(--ink); border: 2px solid transparent; border-radius: var(--r); padding: 8px 12px; font-family: var(--ui); font-weight: 700; font-size: 1.15rem; text-align: start; }
.field::placeholder { color: #6a6880; font-weight: 500; opacity: 1; }
.field:focus { outline: none; border-color: var(--sun); box-shadow: 0 0 0 3px rgba(255, 200, 58, .4); }
.field.code { direction: ltr; text-align: center; letter-spacing: .18em; }
.field.code::placeholder { letter-spacing: 0; direction: rtl; }
textarea.field { resize: none; min-height: 84px; line-height: 1.4; }

.seg { display: inline-flex; border: 2px solid var(--cream); border-radius: var(--r); overflow: hidden; }
.seg button { padding: 7px 16px; min-height: 40px; font-family: var(--ui); font-weight: 500; font-size: .98rem; color: var(--cream); border-inline-start: 1px solid var(--line); transition: background .15s, color .15s; }
.seg button:first-child { border-inline-start: 0; }
.seg button[aria-pressed=true] { background: var(--cream); color: var(--ink); font-weight: 700; }
.seg button:hover:not([aria-pressed=true]) { background: rgba(255, 244, 220, .14); }
.seg[data-ro] { pointer-events: none; opacity: .7; }

.plate { display: inline-block; background: var(--card-2); border-radius: 2px; padding: 3px 10px; font-size: .85rem; font-weight: 500; color: var(--cream); }

.toast { position: fixed; z-index: 70; inset-inline: 0; bottom: 18px; display: flex; justify-content: center; pointer-events: none; }
.toast > div { background: var(--cream); color: var(--ink); padding: 9px 16px; border-radius: var(--r); font-weight: 700; animation: rise .3s var(--ease) both; }

/* leaving the room: always the same place, the top corner */
.room-tools { position: fixed; z-index: 55; top: 10px; inset-inline-end: 12px; display: flex; gap: 8px; }
.roster { position: fixed; z-index: 56; top: 58px; inset-inline-end: 12px; width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 70px); overflow: auto; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; padding: 14px; display: grid; gap: 10px; animation: rise .2s var(--ease) both; }
.roster-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.roster ul { list-style: none; padding: 0; display: grid; gap: 6px; }
.roster li { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; }
.roster li.off .portrait, .roster li.off .nm { opacity: .5; }
.roster .portrait { width: 40px; height: 46px; }
.roster .nm { font-weight: 700; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.roster .nm small { display: block; font-weight: 400; font-size: .8rem; color: var(--cream-dim); }
.back { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: var(--card-2); border: 2px solid var(--sun); border-radius: var(--r); font-weight: 500; }
.exit { min-height: 40px; padding: 6px 14px; font-size: .9rem; font-weight: 500; color: var(--cream); background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r); }
.exit:hover { background: var(--cream); color: var(--ink); }

/* ---------- screens ---------- */
.screen { min-height: 100dvh; padding: 64px var(--pad) var(--pad); display: flex; flex-direction: column; align-items: center; background: var(--bg); }

/* ---------- home ---------- */
.home { justify-content: center; gap: 18px; padding-top: var(--pad); }
.hero { text-align: center; }
.logo { font-family: var(--display); font-weight: 400; font-size: clamp(3rem, 12vw, 4.6rem); line-height: 1; color: var(--cream); }
.logo span { color: var(--sun); }
.tag { margin-top: 6px; font-size: clamp(1rem, 3.2vw, 1.15rem); color: var(--cream-dim); text-wrap: balance; }
.home .icard { width: min(100%, 680px); }
.form { display: grid; gap: 16px; text-align: start; }
.who-am-i { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.fields { display: grid; gap: 6px; justify-items: start; align-content: start; }
.fields .field { margin-bottom: 10px; }
.err { color: #ffc2b5; font-weight: 500; font-size: .95rem; }
.err:empty { display: none; }
.enter { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border-top: 1px solid var(--line); padding-top: 16px; }
.way { display: grid; gap: 6px; align-content: start; }
.way > .btn { width: 100%; }
.join { display: flex; gap: 8px; }
.join .field { flex: 1; min-width: 0; }
.join .btn { white-space: nowrap; }
.hint { font-size: .85rem; color: var(--cream-dim); }

.ticker { width: min(100%, 680px); text-align: center; color: var(--cream-dim); font-size: clamp(.95rem, 3vw, 1.05rem); min-height: 3.2em; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.ticker span { animation: rise .5s var(--ease) both; }
.ticker span:nth-child(2) { animation-delay: .8s; color: var(--cream); font-weight: 500; }
/* the way back to all the games: same corner the room uses for its exit */
.badge { position: fixed; z-index: 55; top: 10px; inset-inline-end: 12px; display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; font-size: .9rem; font-weight: 500; color: var(--cream); background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; }
.badge:hover { background: var(--cream); color: var(--ink); }
.home { padding-top: 60px; }

/* ---------- portraits ---------- */
.portrait { width: 74px; height: 84px; border-radius: 50% / 46%; overflow: hidden; background: var(--tint, var(--cream)); position: relative; isolation: isolate; }
.portrait .char { position: absolute; width: 112%; left: -6%; top: 4%; }

/* ---------- lobby ---------- */
.lobby { justify-content: flex-start; }
.lobby .icard { width: min(100%, 680px); display: grid; gap: 20px; }
.room-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; text-align: start; }
.room-head h2 { font-family: var(--ui); font-weight: 700; font-size: clamp(2.2rem, 8vw, 3rem); line-height: 1; letter-spacing: .08em; color: var(--sun); }
.room-invite { display: grid; gap: 4px; justify-items: end; }
.cast { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 10px; }
.member { position: relative; flex: 0 0 112px; min-width: 0; display: grid; justify-items: center; align-content: start; gap: 2px; padding: 10px 4px 8px; background: var(--card-2); border: 2px solid transparent; border-radius: var(--r); }
.member.me { border-color: var(--sun); }
.member.ghost { border: 2px dashed var(--line); background: none; color: var(--cream-dim); min-height: 124px; align-content: center; font-size: .85rem; }
.member.off { opacity: .45; }
.member button.pt { all: unset; cursor: pointer; }
.member button.pt:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 50%; }
.member .nm { font-weight: 700; font-size: 1.05rem; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .tg { font-size: .8rem; color: var(--sun); min-height: 1.2em; }
.member .kick { min-height: 32px; padding: 2px 10px; font-size: .82rem; color: var(--cream-dim); text-decoration: underline; text-underline-offset: .2em; }
.member .kick:hover { color: var(--cream); }
/* who has a microphone, and my own: connect, test, choose */
.ms { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; line-height: 1.2; color: var(--cream-dim); }
.ms .mic-ico { width: 13px; height: 13px; flex: none; }
.ms.ok { color: var(--sun); }
.ms.no { color: #ffb9ab; }
.micbox { background: var(--card-2); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 10px; text-align: start; }
.mic-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mic-row .mic-ico { width: 28px; height: 28px; flex: none; color: var(--cream-dim); }
.micbox.ok .mic-row .mic-ico { color: var(--sun); }
.micbox.denied .mic-row .mic-ico, .micbox.none .mic-row .mic-ico, .micbox.unsupported .mic-row .mic-ico { color: #ffb9ab; }
.mic-txt { flex: 1 1 190px; font-size: .92rem; line-height: 1.35; color: var(--cream-dim); }
.mic-txt b { display: block; font-size: 1rem; color: var(--cream); }
.mic-test { display: grid; gap: 6px; }
.mic-test .meter { width: 100%; height: 14px; background: var(--card); }
.field.sel { font-size: 1rem; font-weight: 500; min-height: 44px; }
.opts { display: flex; flex-wrap: wrap; gap: 14px 24px; }
.opts .grp { display: grid; gap: 4px; justify-items: start; }
.me-opts { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.lobby #go { display: grid; grid-template-columns: 1fr; gap: 6px; justify-items: stretch; justify-content: stretch; border-top: 1px solid var(--line); padding-top: 16px; }
.lobby #go .btn { min-height: 56px; font-size: 1.25rem; }
.lobby #go .small { text-align: center; }

/* ---------- leader countdown ---------- */
.leader { justify-content: center; gap: 22px; }
.reel { position: relative; width: min(64vw, 300px); aspect-ratio: 1; display: grid; place-items: center; color: var(--cream); background: #ad3020; border-radius: 50%; }
.reel svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.reel .num { position: relative; font-family: var(--display); font-size: clamp(6rem, 24vw, 8rem); line-height: 1; color: var(--cream); animation: pop .9s var(--ease) both; }
.reel .sweep { transform-origin: 50% 50%; animation: sweep 1s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(1.4); opacity: 0; } to { transform: none; opacity: 1; } }
.leader .line { font-size: clamp(1.4rem, 5vw, 2.2rem); }
.leader .icard { --card: transparent; }

/* ---------- make ---------- */
.make { gap: 14px; }
.topbar { width: min(100%, 720px); display: flex; align-items: center; gap: 12px; font-size: .92rem; color: var(--cream-dim); }
.topbar .step { white-space: nowrap; }
.topbar .step b { color: var(--cream); font-weight: 700; }
.timebar { flex: 1; height: 8px; background: var(--card); border-radius: 2px; overflow: hidden; }
.timebar i { display: block; height: 100%; width: 100%; background: var(--sun); transform-origin: right center; transition: transform .25s linear; }
.clock { font-variant-numeric: tabular-nums; min-width: 3.2ch; text-align: end; font-weight: 700; color: var(--cream); }
.task { width: min(100%, 720px); min-height: clamp(200px, 32vh, 300px); display: grid; align-content: center; }
.task .tp { margin-top: 14px; }
.task .line { font-family: var(--ui); font-weight: 500; font-size: clamp(1.05rem, 3.4vw, 1.3rem); color: var(--cream-dim); }
.task .quote { font-size: clamp(1.8rem, 6.2vw, 3rem); color: var(--cream); }
.rec { width: min(100%, 720px); display: grid; justify-items: center; gap: 10px; padding-top: 40px; }
.clap { width: clamp(130px, 36vw, 170px); position: relative; color: var(--cream); transition: transform .12s var(--ease); }
.clap .clapper { width: 100%; display: block; overflow: visible; }
.clap .arm { transform: rotate(-24deg); transition: transform .09s ease-in; }
.clap.rec .arm, .clap.closed .arm { transform: rotate(0deg); }
.clap:active { transform: scale(.97); }
.rec-label { font-weight: 700; font-size: 1.2rem; min-height: 1.6em; display: flex; align-items: center; gap: 10px; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: #ff5a3c; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: .5; } }
.meter { width: min(80%, 300px); height: 10px; background: var(--card); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 100%; background: var(--sun); transform: scaleX(0); transform-origin: right center; transition: transform .06s linear; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.crew { width: min(100%, 720px); display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding-top: 8px; }
.crew::before { content: 'מי כבר הקליט'; flex-basis: 100%; text-align: center; font-size: .85rem; color: var(--cream-dim); }
.crew .c { display: grid; justify-items: center; gap: 3px; font-size: .8rem; color: var(--cream-dim); max-width: 64px; }
.crew .c .pips { display: flex; gap: 3px; }
.crew .c .pips i { width: 12px; height: 9px; border: 1px solid var(--cream-dim); border-radius: 1px; }
.crew .c .pips i.on { background: var(--sun); border-color: var(--sun); }
.crew .c.off { opacity: .4; }
.crew .c .nm2 { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew .portrait { width: 44px; height: 50px; }
.wait-dots::after { content: ''; animation: dots 1.4s steps(1) infinite; }
@keyframes dots { 0% { content: '.' } 33% { content: '..' } 66% { content: '...' } }

/* ---------- stage (the film) ---------- */
.show { padding: 0; justify-content: center; }
.stage { position: fixed; inset: 0; z-index: 5; background: var(--bg); transition: background-color .6s; display: grid; place-items: center; overflow: hidden; }
.stage .layer { position: absolute; inset: 0; display: grid; place-items: center; }
.stage .st-card { padding: clamp(20px, 5vw, 60px); }
.stage .st-card .icard { width: min(100%, 980px); min-height: min(60vh, 460px); display: grid; place-items: center; align-content: center; padding: clamp(30px, 6vw, 56px); }
/* the one ornament left: a single rule inside the film's own title cards */
.stage .st-card .icard::before { content: ''; position: absolute; inset: 10px; border: 2px solid var(--rule); border-radius: 2px; pointer-events: none; }
.stage .st-card .icard.in { animation: cardin .5s var(--ease) both; }
.stage .st-card .icard.out { animation: cardout .28s ease-in both; }
@keyframes cardin { from { opacity: 0; transform: scale(1.04); clip-path: circle(0% at 50% 50%); } to { opacity: 1; transform: none; clip-path: circle(90% at 50% 50%); } }
@keyframes cardout { to { opacity: 0; } }
.who-name { display: block; font-family: var(--ui); font-weight: 700; font-size: 1rem; color: var(--rule); margin-bottom: 6px; }
.stage .st-frame { padding: 0 var(--pad); }
.frame { width: min(100%, calc((100dvh - 190px) * 4 / 3), 980px); }
.frame.in { animation: frin .55s var(--ease) both; }
.frame.out { animation: cardout .25s ease-in both; }
@keyframes frin { from { opacity: 0; clip-path: circle(0% at 50% 50%); } to { opacity: 1; clip-path: circle(90% at 50% 50%); } }
.pic { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r); background: var(--ink); isolation: isolate; border: 3px solid var(--cream); }
.pic .backdrop { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pic .shade { display: none; }
.pic .who { position: absolute; bottom: -2%; width: 44%; z-index: 2; }
.pic .who.right { right: 4%; } .pic .who.left { left: 4%; }
.pic .figure { transition: filter .35s, transform .35s var(--ease); filter: brightness(.9) saturate(.9); transform-origin: 50% 100%; }
.pic .figure.on { filter: none; transform: translateY(-3%) scale(1.07); }
.pic .who.right .figure { transform: rotate(-3deg); } .pic .who.left .figure { transform: rotate(3deg); }
.pic .who.right .figure.on { transform: rotate(-1deg) translateY(-3%) scale(1.07); } .pic .who.left .figure.on { transform: rotate(1deg) translateY(-3%) scale(1.07); }
.pic .figure .char { width: 100%; display: block; overflow: visible; }
.char .mouth { transform-box: fill-box; transform-origin: 50% 20%; transform: scaleY(calc(.2 + var(--talk, 0) * 1.6)) scaleX(calc(.92 + var(--talk, 0) * .16)); transition: transform .05s linear; }
.char .head { transform-origin: 100px 150px; transform: rotate(calc((var(--talk, 0) - .25) * 2.6deg)) translateY(calc(var(--talk, 0) * -2px)); transition: transform .08s linear; }
.char .body { transform: translateY(calc(var(--talk, 0) * 2px)); }
.char .eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: blinkeye 4.6s steps(1) infinite; }
@keyframes blinkeye { 0%, 93%, 100% { transform: scaleY(1) } 95% { transform: scaleY(.1) } }
.caption { margin-top: 12px; text-align: center; font-family: var(--display); font-size: clamp(1.2rem, 3.8vw, 1.8rem); min-height: 1.4em; color: var(--cream); }
.caption b { font-weight: 400; color: var(--rule); }
.scene-hud { position: fixed; z-index: 12; top: 10px; inset-inline-start: 12px; display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--cream-dim); }
.scene-hud .btn { font-size: .9rem; font-weight: 500; border-width: 1px; border-color: var(--line); min-height: 40px; padding: 4px 14px; background: rgba(10, 11, 32, .45); }

/* ---------- faces: every character carries all the moods, [data-mood] on the figure picks one ---------- */
.char .brow, .char .look, .char .pupil, .char .gaze { transform-box: fill-box; transform-origin: 50% 50%; transition: transform .22s var(--ease); }
.char .mm, .char .joy, .char .mark { display: none; }
[data-mood=curious] .brow.r { transform: translateY(-6px) rotate(-8deg); }
[data-mood=smile] .brow { transform: translateY(-3px); }
[data-mood=shock] .brow { transform: translateY(-9px); }
[data-mood=shock] .look { transform: scale(1.14); }
[data-mood=shock] .pupil { transform: scale(.6); }
[data-mood=shock] .jolt { display: block; }
[data-mood=laugh] .brow { transform: translateY(-5px); }
[data-mood=laugh] .look { display: none; }
[data-mood=laugh] .joy { display: block; }
[data-mood=angry] .brow.l { transform: translateY(6px) rotate(18deg); }
[data-mood=angry] .brow.r { transform: translateY(6px) rotate(-18deg); }
[data-mood=angry] .look { transform: scaleY(.76); }
[data-mood=angry] .vein { display: block; }
[data-mood=sus] .brow.l { transform: translateY(5px) rotate(6deg); }
[data-mood=sus] .brow.r { transform: translateY(-5px) rotate(-8deg); }
[data-mood=sus] .look { transform: scaleY(.68); }
[data-mood=sad] .brow.l { transform: translateY(-2px) rotate(-16deg); }
[data-mood=sad] .brow.r { transform: translateY(-2px) rotate(16deg); }
[data-mood=nervous] .brow.l { transform: rotate(-10deg); }
[data-mood=nervous] .brow.r { transform: rotate(10deg); }
[data-mood=nervous] .drop { display: block; }
/* the listener looks at whoever is talking */
.who.left .figure[data-mood]:not(.on) .gaze { transform: translateX(4px); }
.who.right .figure[data-mood]:not(.on) .gaze { transform: translateX(-4px); }
/* closed-mouth shapes, only while this figure is not the one speaking */
.figure:not(.on):is([data-mood=smile], [data-mood=shock], [data-mood=laugh], [data-mood=angry], [data-mood=sad], [data-mood=sus], [data-mood=nervous]) .mouth { display: none; }
.figure:not(.on)[data-mood=smile] .m-smile, .figure:not(.on)[data-mood=shock] .m-o, .figure:not(.on)[data-mood=laugh] .m-grin,
.figure:not(.on)[data-mood=angry] .m-frown, .figure:not(.on)[data-mood=sad] .m-frown, .figure:not(.on)[data-mood=sus] .m-skew, .figure:not(.on)[data-mood=nervous] .m-wavy { display: block; }
/* the body reacts too */
.stage .figure[data-mood=laugh]:not(.on) .char { animation: giggle .26s ease-in-out infinite alternate; }
.stage .figure[data-mood=shock]:not(.on) .char { animation: jolt .45s var(--ease) 1; }
.stage .figure[data-mood=nervous]:not(.on) .char { animation: tremble .1s linear infinite alternate; }
@keyframes giggle { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@keyframes jolt { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-12px) scale(1.03); } 100% { transform: none; } }
@keyframes tremble { from { transform: translateX(-1.2px); } to { transform: translateX(1.2px); } }

/* the small moving details inside the painted backdrops */
.backdrop .drift { animation: bd-drift 30s ease-in-out infinite alternate; }
.backdrop .drift.b { animation-duration: 44s; animation-direction: alternate-reverse; }
.backdrop .bob { transform-box: fill-box; transform-origin: 50% 100%; animation: bd-bob 3.2s ease-in-out infinite alternate; }
.backdrop .swell { animation: bd-swell 2.6s ease-in-out infinite alternate; }
.backdrop .tw { animation: bd-tw 2.3s ease-in-out infinite alternate; }
.backdrop .tw.b { animation-duration: 3.1s; animation-delay: -1.2s; }
.backdrop .tw.c { animation-duration: 1.7s; animation-delay: -.6s; }
.backdrop .sway { transform-box: fill-box; transform-origin: 50% 0; animation: bd-sway 3.8s ease-in-out infinite alternate; }
.backdrop .steam { animation: bd-steam 2.8s ease-out infinite; }
@keyframes bd-drift { from { transform: translateX(-14px); } to { transform: translateX(22px); } }
@keyframes bd-bob { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(4deg) translateY(3px); } }
@keyframes bd-swell { from { transform: translateX(-5px); } to { transform: translateX(5px); } }
@keyframes bd-tw { from { opacity: 1; } to { opacity: .25; } }
@keyframes bd-sway { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes bd-steam { from { opacity: 0; transform: translateY(8px); } 30% { opacity: .8; } to { opacity: 0; transform: translateY(-16px); } }
.strip .backdrop *, .strip .char, .strip .char .eyes { animation: none; }

/* ---------- vote / result ---------- */
.vote, .result, .end { gap: 16px; justify-content: flex-start; }
.vote > .icard, .result > .icard, .end > .icard { width: min(100%, 880px); }
.vote > .icard:first-child, .result > .icard:first-child { background: none; padding: 0; }
.vote .line, .result .line, .end .line { font-size: clamp(1.4rem, 4.6vw, 2.1rem); }
.strips { width: min(100%, 980px); display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 14px; padding-bottom: 20px; }
.strips .strip { width: min(100%, 300px); }
.strip { position: relative; background: var(--card); padding: 8px 8px 10px; border-radius: 6px; border: 3px solid transparent; text-align: center; transition: transform .2s var(--ease), border-color .2s; }
.strip .pic { border: 0; }
.strip .pic .who { width: 46%; }
.strip .pic .figure { filter: none; transform: none; }
.strip button.pick { all: unset; display: block; cursor: pointer; width: 100%; }
.strip button.pick:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.strip[data-own] { opacity: .7; }
.own-tag { position: absolute; z-index: 6; top: 14px; inset-inline-end: 14px; background: var(--ink); border-radius: 2px; padding: 1px 8px; font-size: .8rem; color: var(--cream); }
.strip:has(button.pick):hover { transform: translateY(-3px); border-color: var(--cream); }
.strip .names { font-weight: 700; font-size: 1rem; margin-top: 8px; line-height: 1.25; }
.strip .names span { display: block; font-size: .85rem; font-weight: 400; color: var(--cream-dim); }
.strip[data-voted] { border-color: var(--sun); }
.stamp { position: absolute; inset-inline: 0; top: 34%; margin: auto; width: max-content; z-index: 6; font-family: var(--display); font-size: 1.4rem; color: var(--stamp); border: 3px solid var(--stamp); border-radius: 3px; padding: 0 12px; transform: rotate(-6deg); background: var(--cream); animation: stampin .38s var(--ease) both; }
@keyframes stampin { from { transform: rotate(-6deg) scale(2.2); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: 1; } }
.strips .strip.winner { width: min(100%, 460px); border-color: var(--sun); }
.stamp.win { top: 38%; font-size: 1.8rem; padding: 0 16px; }
.tally { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 6; font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; background: var(--sun); color: var(--ink); border-radius: 2px; padding: 0 9px; }
.board { width: min(100%, 520px); margin-inline: auto; list-style: none; padding: 0; display: grid; gap: 6px; text-align: start; }
.board li { display: grid; grid-template-columns: 2ch 46px 1fr auto; gap: 12px; align-items: center; padding: 6px 12px; background: var(--card-2); border-radius: var(--r); font-weight: 700; font-size: 1.15rem; }
.board li:first-child { box-shadow: inset 0 0 0 2px var(--sun); }
.board li:first-child .pt { color: var(--sun); }
.board .rk, .board .pt { font-variant-numeric: tabular-nums; } .board .rk { color: var(--cream-dim); }
.board .dl { font-size: .85rem; font-weight: 500; color: var(--sun); margin-inline-start: 8px; }
.board .portrait { width: 44px; height: 50px; }
.the-end { font-family: var(--display); font-size: clamp(4rem, 20vw, 6rem); line-height: 1; color: var(--sun); }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- dressing room ---------- */
.dress { text-align: center; }
.dress > summary { list-style: none; cursor: pointer; display: inline-flex; }
.dress > summary::-webkit-details-marker { display: none; }
.dress[open] > summary { background: var(--cream); color: var(--ink); }
.dress-prev { display: flex; justify-content: center; margin: 14px 0 8px; }
.dress-prev .portrait { width: 112px; height: 128px; }
.dress-av { display: grid; grid-template-columns: repeat(8, auto); gap: 6px; justify-content: center; margin: 6px 0 12px; }
.dress-av .pt { all: unset; cursor: pointer; border-radius: 50%; }
.dress-av .pt:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.dress-av .pt .portrait { transition: transform .15s var(--ease); }
.dress-av .pt:hover .portrait { transform: translateY(-2px); }
.dress-av .pt[aria-pressed=true] .portrait { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--sun); }
.dress-av .portrait { width: 44px; height: 50px; }
.dress-opts { display: flex; gap: 12px 18px; flex-wrap: wrap; justify-content: center; }
.dress-opts .grp { display: grid; gap: 4px; justify-items: center; }

/* the character picker on the home panel */
.home-dress { display: grid; justify-items: center; gap: 4px; }
.home-dress .dress-prev { margin: 0 0 4px; }
.home-dress .dress-prev .portrait { width: 104px; height: 118px; }
.home-dress .dress-av { grid-template-columns: repeat(4, auto); gap: 10px 8px; margin: 4px 0; }
.home-dress .dress-av .portrait { width: 46px; height: 52px; }
.home-dress .more { text-align: center; }
.home-dress .more > summary { list-style: none; cursor: pointer; display: inline-block; }
.home-dress .more > summary::-webkit-details-marker { display: none; }
.home-dress .more .dress-opts { margin-top: 8px; max-width: 250px; }

/* ---------- title vote ---------- */
.lines { width: min(100%, 640px); display: grid; gap: 12px; padding-bottom: 24px; }
.linecard { position: relative; border: 3px solid transparent; border-radius: 6px; padding: 16px; text-align: center; display: grid; gap: 10px; background: var(--card); }
.linecard.own { opacity: .7; }
.linecard.picked { border-color: var(--sun); }
.linecard .quote.sm { font-size: clamp(1.3rem, 4.4vw, 2rem); margin: 0; }
.linecard .stamp { top: 8px; inset-inline-end: 12px; inset-inline-start: auto; margin: 0; font-size: 1.1rem; z-index: 4; }
.wave { display: flex; align-items: center; justify-content: center; gap: 3px; height: 34px; }
.wave i { width: 3px; background: var(--cream-dim); border-radius: 1px; }

@media (max-width: 600px) {
  .home { justify-content: flex-start; gap: 12px; }
  .who-am-i { grid-template-columns: 1fr; gap: 12px; }
  .fields { justify-items: stretch; order: -1; }
  .fields .field { margin-bottom: 6px; }
  .home-dress .dress-prev .portrait { width: 80px; height: 92px; }
  .home-dress .dress-av { grid-template-columns: repeat(8, auto); gap: 4px; }
  .home-dress .dress-av .portrait { width: 36px; height: 41px; }
  .form { gap: 12px; }
  .enter { padding-top: 12px; gap: 10px; }
  .fields .seg { justify-self: start; }
  .enter { grid-template-columns: 1fr; }
  .cast { gap: 8px; }
  .member { flex-basis: calc((100% - 16px) / 3); }
  .member.ghost { min-height: 0; padding: 14px 4px; }
  .portrait { width: 62px; height: 70px; }
  .room-invite { justify-items: start; }
  .strips { gap: 8px; }
  .strips .strip { width: calc(50% - 4px); }
  .strips .strip.winner { width: 100%; }
  .strip { padding: 5px 5px 8px; }
  .strip .names { font-size: .92rem; margin-top: 6px; }
  .stamp { font-size: 1.05rem; border-width: 2px; }
  .tally { top: 10px; inset-inline-end: 10px; font-size: 1rem; }
  .lobby #go { position: sticky; bottom: 0; background: var(--card); padding-bottom: 10px; margin-bottom: -10px; z-index: 3; }
  .lobby .dress-av { grid-template-columns: repeat(4, auto); gap: 8px; }
}
/* portrait phones: a taller frame so the faces are bigger */
@media (max-aspect-ratio: 3/4) {
  .stage .pic { aspect-ratio: 5 / 6; }
  .stage .pic .who { width: 50%; }
  .stage .pic .who.right { right: 1%; } .stage .pic .who.left { left: 1%; }
  .frame { width: min(100%, calc((100dvh - 190px) * 5 / 6), 980px); }
}
@media (max-height: 560px) and (orientation: landscape) {
  .frame { width: min(100%, calc((100dvh - 110px) * 4 / 3)); }
  .reel { width: 36vh; }
  .reel .num { font-size: 16vh; }
  .home { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .fx .grain { animation: none; }
  #view > .screen { animation: none !important; }
  .backdrop *, .stage .figure .char { animation: none !important; }
}
