@font-face {
  font-family: Manrope;
  src: url('/assets/peonies-identity/references/manrope-500.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url('/assets/peonies-identity/references/manrope-800.woff2') format('woff2');
  font-weight: 650 900;
  font-display: swap;
}
@font-face {
  font-family: ArchiveArabic;
  src: url('/assets/peonies-identity/references/arabic-600.woff2') format('woff2');
  font-weight: 400 650;
  font-display: swap;
}
@font-face {
  font-family: ArchiveArabic;
  src: url('/assets/peonies-identity/references/arabic-800.woff2') format('woff2');
  font-weight: 700 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ink: #f6eee0;
  --muted: #c9beb0;
  --sub: #af9d89;
  --panel: rgba(32, 29, 27, 0.91);
  --solid: #25211e;
  --inner: rgba(251, 236, 212, 0.06);
  --edge: rgba(231, 211, 181, 0.23);
  --strong: rgba(250, 224, 187, 0.47);
  --action: #ecd8b5;
  --action-ink: #2a231c;
  --mark: #ffdf9d;
  --danger: #ffc1b2;
  --shadow: 0 14px 36px #09070638;
  --radius: 3px;
  --space: clamp(18px, 2.2vw, 32px);
  --frame: min(1264px, calc(100% - clamp(32px, 8vw, 144px)));
  font:
    500 16px/1.55 Manrope,
    ArchiveArabic,
    system-ui,
    sans-serif;
  background: #141211;
  color: var(--ink);
}
:root[data-theme='light'] {
  color-scheme: light;
  --ink: #251f1a;
  --muted: #544a41;
  --sub: #6c5542;
  --panel: rgba(239, 230, 215, 0.93);
  --solid: #eee4d5;
  --inner: rgba(74, 52, 31, 0.06);
  --edge: rgba(80, 59, 39, 0.24);
  --strong: #8d7660;
  --action: #503b30;
  --action-ink: #fff6e9;
  --mark: #74432b;
  --danger: #871e19;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid #eac58c;
  outline-offset: 3px;
}
button {
  color: inherit;
}
button svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
button[hidden],
[hidden] {
  display: none !important;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.archive-scene,
.archive-shade {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.archive-scene {
  z-index: -2;
}
.archive-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.archive-shade {
  background:
    linear-gradient(
      0deg,
      rgba(14, 12, 10, 0.72),
      rgba(17, 13, 12, 0.08) 60%,
      rgba(16, 12, 10, 0.42)
    ),
    linear-gradient(90deg, rgba(25, 21, 19, 0.49), transparent 65%);
}
.topbar {
  width: var(--frame);
  margin: auto;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f7eee2;
  gap: 16px;
  text-shadow: 0 2px 6px #17120f;
}
.publisher,
.utility,
.phase-actions,
.entry-actions,
.actions,
.join-code,
.facts {
  display: flex;
  align-items: center;
  gap: 12px;
}
.publisher {
  gap: 9px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.045em;
}
.publisher img {
  width: 28px;
  height: 28px;
}
.utility {
  gap: 6px;
}
.icon-button,
.language,
.hub-link,
.more {
  border: 1px solid transparent;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}
.language,
.hub-link {
  width: auto;
  min-width: 44px;
  border-radius: 10px;
  padding-inline: 8px;
  letter-spacing: 0;
  font-size: 0.9rem;
}
.hub-link {
  margin-inline-start: 6px;
  font-size: 0.8rem;
  color: #eadcca;
}
.icon-button:hover,
.language:hover,
.more:hover,
.hub-link:hover {
  color: #ffdfa9;
}
.entry-frame {
  width: var(--frame);
  max-width: 1152px;
  margin: auto;
  min-height: calc(100svh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.88fr);
  align-items: center;
  column-gap: clamp(22px, 5vw, 96px);
  padding-block: clamp(42px, 8vh, 100px);
  color: #f6eee0;
  text-shadow: 0 2px 13px #100c08;
}
.opening-copy {
  position: relative;
  z-index: 1;
}
.opening-mark {
  width: min(100%, 560px);
  height: auto;
  display: block;
  filter: drop-shadow(0 5px 14px #17130f75);
}
.opening-copy .lead {
  font-size: clamp(1.02rem, 1.45vw, 1.24rem);
  line-height: 1.64;
  color: #eee3d4;
  max-width: 44ch;
  margin-block: 24px 30px;
}
.kicker,
.score-label,
.room-code {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--sub);
}
.opening-copy .kicker {
  margin: 0 0 22px;
  color: #e1c8a1;
}
.opening-copy h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 20px 0 12px;
}
.cassette {
  position: relative;
  display: grid;
  place-items: center;
  align-self: center;
}
.cassette img {
  display: block;
  width: min(100%, 460px);
  height: auto;
  filter: drop-shadow(0 16px 25px #0a08088a);
}
.entry-actions,
.actions {
  flex-wrap: wrap;
}
.entry-actions,
.entry-frame [data-action='agree'] {
  text-shadow: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.04em;
}
h1 {
  font-size: clamp(1.85rem, 4vw, 3.2rem);
}
h2 {
  font-size: clamp(1.28rem, 2vw, 1.7rem);
}
h3 {
  font-size: 1.08rem;
}
p {
  overflow-wrap: anywhere;
}
bdi {
  unicode-bidi: isolate;
}
small,
.hint {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
}
.hint {
  margin-block: 8px;
}
.chalk,
.quiet,
.minor,
.primary,
.subtle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 7px 3px;
  border: 0;
  border-radius: 0;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}
.chalk {
  color: #ffe1ad;
  background: transparent;
}
.quiet {
  background: transparent;
  border-color: transparent;
  color: inherit;
}
.minor,
.subtle {
  color: var(--ink);
  background: transparent;
}
.primary {
  color: var(--mark);
  background: transparent;
}
.entry-actions .quiet {
  color: #efe6d8;
}
.primary:disabled,
.minor:disabled,
.subtle:disabled {
  opacity: 0.48;
}
.chalk:hover,
.primary:not(:disabled):hover {
  filter: brightness(1.055);
}
.quiet:hover,
.minor:not(:disabled):hover,
.subtle:not(:disabled):hover {
  border-color: var(--strong);
}
.glass,
.entry-form,
dialog {
  color: var(--ink);
  border: 0;
}
.glass {
  padding: 0;
}
.entry-form {
  width: min(100%, 432px);
  display: grid;
  gap: 14px;
  padding: 20px;
  text-shadow: none;
}
.entry-form button.primary {
  justify-self: start;
}
.field,
label {
  display: grid;
  gap: 6px;
  font-size: 0.87rem;
  font-weight: 800;
}
.field > span,
.glass label,
.entry-form label,
dialog label {
  color: var(--muted);
}
input,
select {
  color: var(--ink);
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--strong);
  background: transparent;
  padding: 8px 2px;
  width: 100%;
  min-width: 0;
  border-radius: 0;
  line-height: 1.35;
}
select {
  font-size: 0.91rem;
}
select option { background: var(--solid); color: var(--ink); }
input::placeholder {
  color: var(--sub);
}
input:hover,
select:not(:disabled):hover {
  border-color: var(--strong);
}
.segments {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.segments button {
  min-width: 0;
  min-height: 44px;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.24;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 2px;
}
.segments button[aria-pressed='true'] {
  color: var(--mark);
}
.segments button[aria-pressed='true']::before {
  content: '•';
  margin-inline-end: 0.35em;
}
.phase-shell {
  width: var(--frame);
  margin: auto;
  padding-block: clamp(18px, 3.15vh, 46px) clamp(32px, 6vh, 72px);
}
.room-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  color: #f7eee2;
}
.room-title {
  margin-inline-end: auto;
}
.room-title .case-mark {
  width: clamp(190px, 23vw, 310px);
  display: block;
}
.room-header .minor,
.phase-actions .subtle,
.phase-actions .more {
  background: transparent;
  color: inherit;
  border: 0;
}
.join-code {
  gap: 6px;
  flex-direction: column;
  align-items: flex-start;
  color: #eadbc6;
  font-size: 0.72rem;
  line-height: 1.1;
}
.join-code bdi {
  font-size: 1rem;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: #fff5e4;
}
.lobby-grid {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(180px, 0.77fr) minmax(240px, 1.26fr) minmax(220px, 0.95fr);
  gap: clamp(12px, 1.55vw, 24px);
  padding-block: clamp(20px, 5vh, 65px);
}
.lobby-aside {
  display: grid;
  gap: 16px;
}
.glass h2 {
  margin-bottom: 14px;
}
.members,
.cast-list,
.ranks,
.proofs {
  list-style: none;
  padding: 0;
  margin: 0;
}
.member,
.cast-list li,
.ranks li {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--edge);
  padding-block: 10px;
}
.members li:last-child,
.ranks li:last-child,
.cast-list li:last-child {
  border-bottom: 0;
}
.badge {
  display: inline-grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  flex: none;
}
.badge img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 1px #0b080849) drop-shadow(0 5px 4px #0b080840);
}
.badge.large {
  width: 84px;
}
.person {
  min-width: 0;
  display: grid;
}
.person strong {
  overflow-wrap: anywhere;
}
.person strong small {
  color: var(--sub);
}
.meter {
  font-size: 0.7rem;
  vertical-align: middle;
  color: var(--sub);
  letter-spacing: 0;
}
.roster .actions {
  margin-top: 16px;
  gap: 4px;
}
.feature {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 18px;
  min-height: clamp(295px, 42vh, 416px);
}
.feature .case-mark {
  width: min(100%, 282px);
}
:root[data-theme='light'] .feature .case-mark {
  filter: brightness(0.19);
}
.feature-description {
  font-size: clamp(1.02rem, 1.42vw, 1.2rem);
  max-width: 36ch;
  line-height: 1.5;
}
.facts {
  font-size: 0.77rem;
  color: var(--sub);
  gap: 12px;
  font-weight: 800;
}
.facts span + span {
  border-inline-start: 1px solid var(--edge);
  padding-inline-start: 12px;
}
.feature .hint {
  margin: 0;
}
.feature .quiet {
  padding-inline: 0;
  min-height: 36px;
}
.room-options {
  display: grid;
  gap: 14px;
}
.room-options h2,
.room-options .hint {
  margin: 0;
}
.chat-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.chat-card h2 {
  margin: 0;
}
.invite-alert {
  background: var(--solid);
  color: var(--ink);
  border-radius: 10px;
  border: 1px solid var(--edge);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.phase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  color: #f6ebda;
}
.phase-head h1 {
  margin-top: 4px;
}
.room-code {
  color: #dbc9b3;
}
.timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  color: inherit;
}
.timer svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.timer[data-urgent='true'] {
  color: #ffc9b6;
  border-color: #ce8977;
}
.brief-grid,
.results {
  display: grid;
  gap: var(--space);
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.45fr);
  align-items: start;
}
.role-card,
.tape-card,
.ballot,
.solution {
  display: grid;
  gap: 14px;
}
.role-card h2,
.tape-card h2,
.ballot h2,
.solution h2 {
  margin: 0;
}
.role-card button,
.tape-card button,
.ballot .primary {
  justify-self: start;
}
.case-text {
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.case-text:is(h2, h3) {
  line-height: 1.28;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.ballot h2.case-text,
.solution h2.case-text {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}
.tape-card audio {
  width: 100%;
  height: 48px;
}
.transcript summary,
details summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  min-height: 44px;
  align-content: center;
}
.transcript .case-text,
.finding p,
.proofs p {
  color: var(--muted);
}
details {
  border-top: 1px solid var(--edge);
  padding-top: 4px;
}
.cast-list li {
  justify-content: space-between;
  align-items: start;
}
.role-card #private-role {
  color: var(--mark);
  font:
    700 1.7rem/1.2 Manrope,
    ArchiveArabic,
    sans-serif;
}
.ballot {
  max-width: 760px;
  margin-inline: auto;
}
.answer-options {
  display: grid;
  gap: 8px;
}
.answer-options button {
  display: flex;
  align-items: center;
  text-align: start;
  gap: 12px;
  border: 0;
  background: transparent;
  min-height: 54px;
  padding: 8px 0;
}
.answer-options i {
  font-style: normal;
  min-width: 27px;
  text-align: center;
  color: var(--sub);
  font-weight: 800;
}
.answer-options button[aria-pressed='true'] {
  color: var(--mark);
  font-weight: 800;
}
.answer-options button[aria-pressed='true'] i {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}
.answer-options button:not(:disabled):hover {
  border-color: var(--strong);
}
.finding {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 8px 16px;
  margin-top: 12px;
}
.finding summary span {
  color: var(--sub);
  font-size: 0.85rem;
  margin-inline-start: 5px;
}
.finding dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  font-size: 0.9rem;
}
.finding dt {
  color: var(--sub);
}
.finding dd {
  margin: 0;
}
.verdict-select {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.verdict-select select {
  flex: 1;
  width: 0;
}
.verdict-select button {
  font-size: 0.85rem;
}
.board-return {
  margin-bottom: 12px;
}
.results {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
}
.answers-review {
  grid-column: 1/-1;
}
.rank {
  border: 1px solid var(--edge);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.8rem;
}
.ranks li > span {
  flex: 1;
}
.ranks li small {
  display: block;
}
.social {
  color: var(--mark);
  font-weight: 800;
}
.timeline,
.instructions {
  padding-inline-start: 1.35em;
  margin: 0;
}
.timeline li,
.instructions li {
  padding: 6px 0 6px 4px;
}
.results .primary {
  margin-top: 12px;
}
dialog {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100svh - 38px);
  padding: 20px;
  overflow: auto;
  color: var(--ink);
  background: var(--solid);
}
dialog::backdrop {
  background: rgba(14, 12, 11, 0.72);
}
body:has(dialog[open]) {
  overflow: hidden;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
#sheet-content {
  display: grid;
  gap: 16px;
}
.chat-series {
  display: grid;
  gap: 10px;
  min-height: 80px;
  max-height: 45svh;
  overflow: auto;
  align-content: start;
}
.chat-series p {
  display: grid;
  gap: 2px;
}
.chat-series b {
  color: var(--sub);
  font-size: 0.8rem;
}
#chat-form {
  display: flex;
  gap: 6px;
}
#chat-form input {
  flex: 1;
}
#toast {
  position: fixed;
  inset: auto 16px max(18px, env(safe-area-inset-bottom));
  z-index: 15;
  width: max-content;
  max-width: calc(100% - 32px);
  margin-inline: auto;
  background: var(--solid);
  color: var(--ink);
  border: 1px solid var(--strong);
  border-radius: 10px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}
:lang(ar)
  :is(
    .opening-copy,
    .roster,
    .feature,
    .room-options,
    .chat-card,
    .ballot,
    .role-card,
    .tape-card,
    .results aside,
    .dialog-head,
    #sheet-content,
    .phase-head > div:first-child,
    .finding,
    .answers-review,
    .join-code
  ) {
  direction: rtl;
  text-align: right;
}
:lang(ar) .kicker,
:lang(ar) .room-code {
  letter-spacing: 0;
}
:lang(ar) .case-text {
  direction: ltr;
  text-align: left;
}
:lang(ar) .entry-actions {
  justify-content: flex-start;
}
@media (prefers-reduced-motion: no-preference) {
  :root[data-effects='on'] .enter-animation {
    animation: unseal 0.3s cubic-bezier(0.22, 0.68, 0.24, 1) both;
  }
  :root[data-effects='on'] .opening-copy.enter-animation {
    animation-duration: 0.43s;
  }
  :root[data-effects='on'] :is(.primary, .chalk, .minor):active:not(:disabled) {
    transform: translateY(1px);
  }
}
@keyframes unseal {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.entrance-text .kicker {
  position: relative;
  width: max-content;
  max-width: 100%;
}
.entrance-text .kicker::after {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  height: 2px;
  background: #c97f72;
  transform: scaleX(0);
  transform-origin: left center;
}
#stage[data-advancing='true'] .kicker::after {
  transform: scaleX(1);
  transition: transform 0.16s ease-out;
}
.opening-copy .lead {
  min-height: 4.92em;
}
.cassette img {
  mask-image:
    linear-gradient(to right, transparent, #000 17%, #000 85%, transparent),
    linear-gradient(to bottom, transparent, #000 14%, #000 60%, transparent 83%),
    radial-gradient(ellipse 69% 48% at 51% 38%, #000 48%, transparent 100%);
  mask-composite: intersect;
}
.feature h1 {
  font-size: clamp(2rem, 3.5vw, 3.4rem);
  line-height: 1.03;
}
.chat-card::after {
  content: '›';
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font:
    500 1.35rem/1 Georgia,
    serif;
}
.chat-card {
  width: 100%;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: start;
}
.chat-card:hover {
  border-color: var(--strong);
}
:lang(ar) .chat-card::after {
  content: '‹';
}
.source-note h3 {
  font-size: 0.93rem;
  margin-top: 12px;
}
.source-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--ink);
  text-underline-offset: 3px;
}
@media (min-width: 1600px) {
  .entry-frame {
    max-width: 1320px;
  }
  .cassette img {
    width: min(100%, 520px);
  }
}
@media (max-width: 960px) {
  .lobby-grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.22fr);
  }
  .lobby-aside {
    grid-column: 1/-1;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .entry-frame {
    gap: 24px;
  }
  .feature {
    min-height: 300px;
  }
}
@media (max-width: 680px) {
  :root {
    --frame: calc(100% - 28px);
    --space: 16px;
    --radius: 14px;
  }
  .topbar {
    min-height: 60px;
  }
  .entry-frame {
    position: relative;
    grid-template-columns: 1fr;
    align-content: center;
    align-items: center;
    min-height: calc(100svh - 60px);
    padding-block: 24px 44px;
  }
  .cassette {
    order: -1;
    justify-self: center;
    width: min(52vw, 235px);
    margin-bottom: -12px;
  }
  .opening-copy {
    width: min(100%, 442px);
    margin-inline: auto;
  }
  .opening-mark {
    width: min(78%, 330px);
  }
  .opening-copy .kicker {
    margin-bottom: 10px;
  }
  .opening-copy .lead {
    font-size: 1rem;
    margin-block: 15px 20px;
  }
  .opening-copy h1 {
    font-size: 1.3rem;
    margin: 10px 0;
  }
  .entry-form {
    padding: 14px;
    gap: 10px;
    width: 100%;
  }
  html[data-phase='entry'] .cassette {
    display: none;
  }
  .utility {
    gap: 0;
  }
  .publisher {
    font-size: 17px;
  }
  .publisher img {
    width: 25px;
    height: 25px;
  }
  .phase-shell {
    padding-top: 12px;
  }
  .room-header {
    gap: 8px;
    padding-block: 8px;
  }
  .room-title .case-mark {
    width: clamp(108px, 33vw, 180px);
  }
  .room-header .minor {
    font-size: 0.8rem;
    padding-inline: 9px;
  }
  .join-code bdi {
    font-size: 0.88rem;
  }
  .lobby-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-block: 12px;
  }
  .feature {
    order: -1;
    min-height: auto;
    gap: 10px;
  }
  .feature .case-mark {
    width: min(55%, 220px);
  }
  .lobby-aside {
    grid-column: auto;
    grid-template-columns: 1fr;
  }
  .phase-head {
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
  }
  .phase-head h1 {
    font-size: clamp(1.4rem, 6vw, 2rem);
    line-height: 1.17;
  }
  .phase-actions {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 50%;
  }
  .phase-actions .subtle {
    min-height: 38px;
    font-size: 0.77rem;
    padding: 6px 9px;
  }
  .phase-actions .more {
    width: 38px;
    height: 38px;
  }
  .phase-actions .timer {
    font-size: 0.82rem;
    padding: 5px 7px;
  }
  .timer svg {
    width: 15px;
  }
  .brief-grid,
  .results {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .role-card {
    gap: 8px;
  }
  .role-card .badge.large {
    width: 60px;
  }
  .answers-review {
    grid-column: auto;
  }
  .action {
    gap: 6px;
  }
  .cassette img {
    max-height: 27svh;
    object-fit: contain;
  }
  .archive-shade {
    background: linear-gradient(
      0deg,
      rgba(16, 14, 12, 0.72),
      rgba(16, 13, 11, 0.28) 62%,
      rgba(16, 12, 10, 0.32)
    );
  }
}
@media (max-width: 375px) {
  .room-header {
    flex-wrap: wrap;
  }
  .phase-actions .more {
    display: none;
  }
}
@media (max-height: 640px) and (min-width: 681px) {
  .entry-frame {
    padding-block: 28px;
  }
  .phase-shell {
    padding-block: 14px 28px;
  }
  .lobby-grid {
    padding-top: 10px;
  }
  .topbar {
    min-height: 60px;
  }
  .entry-frame {
    min-height: calc(100svh - 60px);
  }
}

/* The archive stays in shot. Only the sheet on the desk scrolls. */
:root {
  --scene-gutter: clamp(16px, 4vw, 72px);
  --scene-top: max(8px, env(safe-area-inset-top));
  --scene-bottom: max(14px, env(safe-area-inset-bottom));
  --paper-tint: rgba(29, 26, 23, 0.95);
  --paper-glow: rgba(184, 150, 102, 0.09);
}
:root[data-theme='light'] {
  --paper-tint: rgba(237, 226, 206, 0.96);
  --paper-glow: rgba(255, 249, 233, 0.58);
}
:root:not([data-phase='investigation']):not([data-wall='open']) body {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.topbar {
  width: auto;
  margin: 0;
  min-height: 44px;
  padding: var(--scene-top) max(var(--scene-gutter), env(safe-area-inset-right)) 0
    max(var(--scene-gutter), env(safe-area-inset-left));
  background: transparent;
}
.topbar :is(.icon-button, .language, .hub-link),
.phase-head .phase-actions .more,
.dialog-head .icon-button {
  height: auto;
  min-height: 44px;
  min-width: 44px;
  width: auto;
  padding: 3px 4px;
  font-size: 0.84rem;
  line-height: 1.3;
  border: 0;
  border-radius: 0;
}
:root:not([data-phase='investigation']):not([data-wall='open']) #stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  padding: 10px var(--scene-gutter) var(--scene-bottom);
  align-items: center;
  justify-items: center;
}
.entry-frame,
:root:not([data-phase='investigation']):not([data-wall='open']) .phase-shell {
  margin: 0;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--strong) transparent;
  scrollbar-width: thin;
}
.entry-frame {
  width: min(100%, 1120px);
  padding: clamp(14px, 3vh, 36px) 4px;
}
.entry-frame .opening-copy {
  text-shadow: 0 2px 5px #130d09, 0 0 24px #15100d;
}
.entry-frame .lead {
  min-height: 0;
}
.entry-frame .chalk {
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);
  text-shadow: inherit;
}
.entry-actions { column-gap: 1.6rem; }
.entrance-lead { display: grid; }
.entrance-lead > span { grid-area: 1 / 1; }
.entrance-measure { visibility: hidden; pointer-events: none; }
/* The second slate brings the tape closer while its slot and the controls stay anchored. */
:root[data-phase='audio'] .cassette img { transform: rotate(-3deg) scale(1.08); }
:root[data-phase='audio'] .cassette::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 48% 46%, #d2a06539, transparent 65%);
}
@media (prefers-reduced-motion: no-preference) {
  :root[data-effects='on'] .cassette img { transition: transform 360ms cubic-bezier(.2,.7,.2,1); }
}
.solo-desk {
  display: grid;
  grid-template: "intro options" auto "actions options" 1fr / minmax(0, 1fr) minmax(0, .9fr);
  gap: 16px clamp(20px, 5vw, 60px);
}
.solo-desk .feature, .solo-desk .room-options { min-width: 0; }
.solo-desk .feature { grid-area: intro; align-self: start; min-height: 0; align-content: start; }
.solo-desk .room-options { grid-area: options; }
.solo-actions { grid-area: actions; align-self: start; }
.solo-lobby .room-header { justify-content: space-between; }
.solo-desk select { width: 100%; min-width: 0; }
.frame-result { display: grid; gap: .65rem; margin-block: 1rem; }
.solo-score { font-size: clamp(1.6rem, 3vw, 2.5rem); font-variant-numeric: tabular-nums; font-weight: 800; }
@media (max-width: 759px) {
  .solo-desk { grid-template: "intro" auto "options" auto "actions" auto / minmax(0, 1fr); gap: 16px; }
  .solo-desk .feature :is(h1,p) { margin-block-end: .5rem; }
}
.entry-form, dialog:not(.ag-reader), :root:not([data-phase='investigation']):not([data-wall='open']) .phase-shell {
  background: radial-gradient(ellipse at 1% 0%, var(--paper-glow), transparent 63%), var(--paper-tint);
  box-shadow: 0 15px 62px #08060554;
  border-radius: var(--radius);
}
.entry-form { padding: clamp(18px, 3vw, 30px); }
dialog:not(.ag-reader) {
  width: min(460px, calc(100% - 28px));
  padding: clamp(20px, 3vw, 32px);
  overscroll-behavior: contain;
}
:root:not([data-phase='investigation']):not([data-wall='open']) .phase-shell {
  --sheet-padding: clamp(20px, 3vw, 40px);
  width: min(100%, 980px);
  padding: var(--sheet-padding);
}
:root[data-phase='question'] .phase-shell,
:root[data-phase='verdict']:not([data-wall='open']) .phase-shell {
  width: min(100%, 810px);
}
.lobby-shell .room-header,
.phase-shell .phase-head {
  color: var(--ink);
  padding: 0;
  margin: 0 0 clamp(16px, 3vh, 34px);
}
.room-title .case-mark {
  width: clamp(130px, 18vw, 242px);
}
:root[data-theme='light'] .room-title .case-mark { filter: brightness(0.2); }
.lobby-shell .join-code, .lobby-shell .join-code bdi,
.phase-shell .room-code { color: var(--sub); }
.lobby-shell .join-code bdi { color: var(--ink); }
.lobby-shell .lobby-grid {
  grid-template: "case roster" auto "options roster" auto / minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 24px clamp(30px, 5vw, 76px);
  padding: 0;
}
.lobby-grid .feature {
  grid-area: case;
  align-content: start;
  min-height: 0;
  gap: 10px;
}
.lobby-grid .feature h1,
.phase-head h1 {
  font-family: Georgia, ArchiveArabic, serif;
  font-weight: 500;
  line-height: 1.08;
}
.lobby-grid .feature h1 { font-size: clamp(2.3rem, 4vw, 3.7rem); }
.feature .feature-description { max-width: 42ch; }
.feature .primary, .role-card .primary, .tape-card .primary, .ballot .primary {
  font-size: 1.13rem;
}
.lobby-grid .roster { grid-area: roster; }
.lobby-grid .lobby-aside {
  grid-area: options;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.lobby-shell details.glass { border: 0; padding: 0; }
.lobby-shell details > summary {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  list-style: none;
}
.lobby-shell details > summary::-webkit-details-marker { display: none; }
.lobby-shell details > summary::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  flex: none;
  border-inline-end: 1.5px solid var(--sub);
  border-block-end: 1.5px solid var(--sub);
  transform: rotate(-45deg);
}
.lobby-shell :dir(rtl) > summary::before { transform: rotate(45deg); }
.lobby-shell details[open] > summary::before { transform: rotate(45deg); }
.lobby-shell details[open]:dir(rtl) > summary::before { transform: rotate(-45deg); }
.lobby-shell details > summary h2 {
  margin: 0;
  font-size: 1.14rem;
  letter-spacing: -0.025em;
}
.lobby-shell .room-options { display: block; }
.room-options > :is(label, .hint, .field) { margin: 6px 0; }
.lobby-grid .roster .actions { gap: 6px 16px; }
.chat-card {
  width: fit-content;
  min-height: 44px;
  padding: 4px 0;
  color: var(--ink);
  background: transparent;
  font-size: 0.95rem;
}
.chat-card::after { content: none; }
:lang(ar) .chat-card::after { content: none; }
.lobby-shell .member { padding-block: 7px; }
.lobby-shell .feature .quiet { min-height: 44px; }
.phase-actions .timer { font-family: 'Courier New', ArchiveArabic, monospace; }
:root[data-theme='light'] .timer[data-urgent='true'] { color: #8a291f; }
.phase-head h1 { font-size: clamp(1.65rem, 3.6vw, 2.8rem); }
.phase-shell .ballot { max-width: none; }
.brief-grid { grid-template-columns: minmax(190px, 0.62fr) minmax(0, 1.38fr); }
.tape-card .hint:empty, .ballot .hint:empty { display: none; }
.tape-transport {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 18px;
}
.tape-transport #tape-position {
  color: var(--sub);
  font: 0.82rem/1.5 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
}
.tape-transport details { border: 0; padding: 0; }
.tape-transport details[open] { flex-basis: 100%; }
.tape-transport summary { font-size: 0.85rem; }
.tape-transport audio { max-width: 33rem; }
:lang(ar) .lobby-aside .chat-card { justify-self: end; }
.ballot .answer-options { gap: 0; }
.solution .timeline { max-width: 66ch; }
.answers-review .finding {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
}
.answers-review .finding + .finding { margin-top: 16px; }
@media (max-width: 759px) {
  :root { --scene-gutter: clamp(12px, 3.6vw, 24px); --scene-bottom: max(12px, env(safe-area-inset-bottom)); }
  .lobby-shell .lobby-grid {
    grid-template: "case" auto "roster" auto "options" auto / minmax(0, 1fr);
    gap: 8px;
  }
  .lobby-shell .lobby-aside { gap: 0; }
  .lobby-grid .feature { padding-bottom: 8px; }
  .lobby-grid .feature h1 { font-size: 2.25rem; }
  .room-title .case-mark { width: clamp(104px, 29vw, 182px); }
  .lobby-shell .room-header { flex-wrap: wrap; }
  .phase-shell .phase-actions { max-width: 45%; }
  .brief-grid, .results { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .phase-head .phase-actions .subtle, .phase-head .phase-actions .more { min-height: 44px; }
  .phase-actions .more { display: inline-grid; }
  .entry-frame .cassette { max-height: 24dvh; }
}
@media (max-width: 500px) {
  .topbar { gap: 6px; }
  .topbar .publisher { gap: 6px; }
  .topbar .utility { flex-wrap: wrap; justify-content: flex-end; gap: 0 4px; }
  .topbar:has(.hub-link) .publisher > span { display: none; }
  :root:not([data-wall='open']) .phase-head { display: grid; gap: 4px; }
  :root:not([data-wall='open']) .phase-head .phase-actions {
    max-width: none;
    justify-content: flex-start;
    gap: 8px 12px;
  }
}
@media (max-height: 560px) {
  .entry-frame { grid-template-columns: minmax(0, 1fr) minmax(120px, 0.6fr); }
  .entry-frame .cassette { order: 0; width: auto; margin: 0; }
  .entry-frame .cassette img { max-height: 52dvh; object-fit: contain; }
  .entry-frame .opening-mark { width: min(100%, 300px); }
  .entry-frame .opening-copy .lead { margin-block: 12px; }
}
@media (max-height: 560px) and (max-width: 600px) {
  .entry-frame { display: block; }
  .entry-frame .cassette { display: none; }
}
