/* The Midnight Prediction Society: an envelope invitation that carries on into the party. Four panels, one on the screen at a time: the envelope and the invitation,
   the briefing, the gathering and the reply, the Society (the game). Lettering from the font library: Bellefair (titles), Federo (small deco capitals),
   Hanken Grotesk (everything a guest has to read or press). Midnight navy, black, ivory and champagne gold. No textures: smooth surfaces, light and fine gold line. */
:root {
  --navy: #0C1429; --deep: #060A16; --ink: #131B33; --ivory: #F6F1E6; --paper: #FBF8F1; --gold: #C9AE78; --pale: #E6D5AC; --dim: #6E5F3E; --mute: #4D5670; --red: #9A2B2B; --green: #2E6B4E;
  --disp: 'Bellefair', Georgia, 'Times New Roman', serif; --caps: 'Federo', Georgia, serif; --text: 'Hanken Grotesk', 'Segoe UI', Arial, sans-serif;
  /* the card's width decides every size: the card, the envelope (86% of it, a 5 by 7 portrait) and the lettering */
  --cw: max(280px, min(92vw, 480px, calc((100svh - 150px) / 1.4)));
  --ew: calc(var(--cw) * .86); --eh: calc(var(--ew) * 1.4);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--deep); color: var(--ink); font-family: var(--text); font-size: 16px; line-height: 1.5; overflow-x: clip; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.card :focus-visible { outline-color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 9100; background: #fff; color: #000; padding: 10px 14px; border-radius: 4px; }
.skip:focus { top: 8px; }
.pic { display: block; } .pic svg { display: block; width: 100%; height: 100%; }
[hidden] { display: none !important; }

/* ---------- the room: behind (the study and its turning ring of stars), beside (the candle), in front (a few motes of gold) ---------- */
#bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--navy); }
.bg-art { position: absolute; inset: 0; }
.bg-art svg { display: block; width: 100%; height: 100%; }
.rm-map { animation: turn 240s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.rm-glow { transition: opacity 1s ease; }
.rm-glow.g1 { opacity: .55; }
body:not(.lit) .rm-glow.g2 { opacity: 0; }
.candle { position: fixed; z-index: 1; right: clamp(2px, 5vw, 90px); bottom: clamp(18px, 9svh, 90px); width: clamp(46px, 8vw, 96px); aspect-ratio: 120 / 300; padding: 0; border: 0; background: none; }
.candle .flame, .candle .halo { opacity: 0; transition: opacity .5s ease; transform-box: fill-box; transform-origin: 50% 80%; }
body.lit .candle .flame, body.lit .candle .halo { opacity: 1; }
body.lit .candle .flame { animation: flick 2.6s ease-in-out infinite; }
@keyframes flick { 0%, 100% { transform: scale(1, 1) rotate(0deg); } 30% { transform: scale(.96, 1.05) rotate(-1.5deg); } 62% { transform: scale(1.03, .96) rotate(1.4deg); } }
#motes { position: fixed; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
#motes i { position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; background: var(--pale); opacity: 0; animation: mote 19s linear infinite; }
#motes i:nth-child(1) { left: 8%; animation-delay: 0s; } #motes i:nth-child(2) { left: 24%; animation-delay: 6s; width: 2px; height: 2px; } #motes i:nth-child(3) { left: 47%; animation-delay: 11s; }
#motes i:nth-child(4) { left: 66%; animation-delay: 3s; width: 2px; height: 2px; } #motes i:nth-child(5) { left: 83%; animation-delay: 14s; } #motes i:nth-child(6) { left: 93%; animation-delay: 8s; width: 2px; height: 2px; }
@keyframes mote { 0% { transform: translate3d(0, 0, 0); opacity: 0; } 12% { opacity: .55; } 80% { opacity: .35; } 100% { transform: translate3d(26px, -104svh, 0); opacity: 0; } }
body.rm .rm-map, body.rm .candle .flame, body.rm #motes i { animation: none; }
body.rm #motes { display: none; }
@media (prefers-reduced-motion: reduce) { .rm-map, .candle .flame, #motes i { animation: none; } #motes { display: none; } }

/* ---------- the two controls at the top ---------- */
#menu-wrap { position: fixed; left: 10px; top: 10px; z-index: 9040; }
#b-menu { min-height: 44px; padding: 0 16px; border: 1px solid rgba(201, 174, 120, .6); border-radius: 2px; background: rgba(12, 20, 41, .9); color: var(--pale); font-family: var(--caps); letter-spacing: .14em; font-size: 14px; }
#menu { margin-top: 8px; display: grid; gap: 2px; padding: 8px; min-width: 262px; background: #101A33; border: 1px solid var(--gold); box-shadow: 0 14px 34px rgba(0, 0, 0, .5); }
#menu button { min-height: 46px; text-align: left; padding: 0 12px; border: 0; background: none; color: var(--ivory); font-size: 16px; }
#menu button:hover { background: #1C2748; }
#menu button[aria-pressed="true"] { background: var(--gold); color: var(--deep); }
#snd-hint { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 9030; margin: 0; padding: 5px 12px; background: rgba(12, 20, 41, .9); color: var(--pale); border: 1px solid rgba(201, 174, 120, .4); font-family: var(--caps); letter-spacing: .12em; font-size: 11px; white-space: nowrap; transition: opacity .4s; pointer-events: none; }
#snd-hint.gone { opacity: 0; }

/* ---------- a panel: one composition, centred; taller than the screen, it simply scrolls ---------- */
#story { position: relative; z-index: 2; pointer-events: none; }
.panel > * { pointer-events: auto; }
.panel { min-height: 100svh; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 66px 16px 46px; }
.await { margin: 0; font-family: var(--caps); letter-spacing: .3em; font-size: max(12px, calc(var(--cw) * .032)); color: var(--pale); text-align: center; transition: opacity .4s ease; }
.panel.opened .await { opacity: 0; }
.envwrap { display: grid; place-items: center; isolation: isolate; position: relative; }
.envwrap > * { grid-area: 1 / 1; }

/* ---------- the envelope: under (the liner), [the card], front (the pocket), the flap, the seal ---------- */
.envframe { position: relative; width: var(--ew); height: var(--eh); transition: opacity .7s ease, transform .9s cubic-bezier(.4, 0, .2, 1); }
.ev { position: absolute; display: block; }
.ev svg { display: block; width: 100%; height: 100%; }
.env-under { inset: 0; z-index: 1; border-radius: 1.4%; box-shadow: 0 0 0 1px rgba(201, 174, 120, .28), 0 calc(var(--ew) * .06) calc(var(--ew) * .11) rgba(0, 0, 0, .6), 0 calc(var(--ew) * .012) calc(var(--ew) * .02) rgba(0, 0, 0, .5); }
.env-front { inset: 0; z-index: 3; }
.env-flapbox { left: 0; top: 0; width: 100%; height: 44%; z-index: 4; perspective: 1600px; perspective-origin: 50% 0; }
.flap { position: absolute; inset: 0; transform-origin: 50% 0; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.45, .05, .3, 1); }
.ff, .fb { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.ff { filter: drop-shadow(0 calc(var(--ew) * .01) calc(var(--ew) * .012) rgba(0, 0, 0, .5)); }
.fb { transform: rotateX(180deg) scaleY(-1); }
.seal { position: absolute; left: 50%; top: 97.4%; width: 27%; aspect-ratio: 1; transform: translate(-50%, -50%) translateZ(1px); backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .4s ease, filter .4s ease; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
.seal svg { display: block; width: 100%; height: 100%; }
.seal .glint { transition: opacity .4s ease; }
.open { inset: 0; z-index: 6; padding: 0; border: 0; background: none; }
.cue { position: absolute; left: 50%; top: calc(100% + 14px); transform: translateX(-50%); white-space: nowrap; font-family: var(--caps); letter-spacing: .26em; font-size: max(13px, calc(var(--cw) * .033)); color: var(--pale); padding-bottom: 5px; border-bottom: 1px solid var(--gold); }
/* nothing on the sealed envelope moves or changes under the pointer (the user, 2026-11-17: the seal shrank and grew on hover, because the flap it sits on tilted) */
/* opening, one step after another (the script adds the classes): the seal lets go, the flap lifts and falls back, the card slides up */
.s-release .seal { transform: translate(-50%, -54%) translateZ(1px) scale(1.07); }
.s-flap .flap { transform: rotateX(178deg); }
.s-back .env-flapbox { z-index: 1; }
.envwrap:not(.sealed) .open { display: none; }

/* ---------- the card: heavy ivory stock with a hairline of champagne foil ---------- */
.card { position: relative; z-index: 2; width: var(--cw); min-height: calc(var(--cw) * 1.4); background: linear-gradient(158deg, #FDFBF5, #F1EADB); color: var(--ink); text-align: center;
  box-shadow: 0 1px 0 #fff inset, 0 2px 0 #CFC2A4, 0 26px 54px rgba(0, 0, 0, .55), 0 6px 14px rgba(0, 0, 0, .35); }
.frame { position: absolute; inset: calc(var(--cw) * .035); border: 1px solid var(--gold); pointer-events: none; }
.frame::after { content: ''; position: absolute; inset: 5px; border: 1px solid rgba(255, 255, 255, .95); box-shadow: 1px 1px 0 rgba(110, 95, 62, .28), -1px -1px 0 rgba(110, 95, 62, .1) inset; }
.in { position: relative; padding: calc(var(--cw) * .12) calc(var(--cw) * .1) calc(var(--cw) * .1); }
/* inside the envelope the card is the same card, held at the envelope's size, blank until it is out */
.envwrap:not(.letter) > .card { height: calc(var(--cw) * 1.4); overflow: hidden; box-shadow: none; transform: scale(.808); transition: transform .8s cubic-bezier(.3, 0, .2, 1); }
.envwrap:not(.letter) > .card .in { opacity: 0; }
.envwrap.sealed > .card { visibility: hidden; }
/* The envelope steps down as its flap opens, so the open flap and the rising card stay on the screen. The WHOLE group moves (envelope and card together): moving the envelope alone
   would put its layers in a group of their own, and the card, which lies between the liner and the pocket, would be drawn on top of the whole envelope. */
.envwrap:not(.letter) { transition: transform .9s cubic-bezier(.4, 0, .2, 1); }
.envwrap.s-flap:not(.letter) { transform: translateY(calc(var(--eh) * .28)); }
.envwrap.s-out:not(.letter) > .card { transform: translateY(calc(var(--eh) * -.6)) scale(.808); }
/* once the card is the letter the envelope sinks away from where it stood (the step down is kept, so it does not jump) */
.envwrap.letter > .envframe { animation: envgo .8s ease both; }
@keyframes envgo { from { opacity: 1; transform: translateY(calc(var(--eh) * .28)); } to { opacity: 0; transform: translateY(calc(var(--eh) * .42)) scale(.96); } }
body.rm .envwrap.letter > .envframe, body.editing .envwrap.letter > .envframe { animation: none; }
.skipanim { position: relative; z-index: 7; }
.envwrap.letter > .card { z-index: 5; }
.envwrap.letter > .envframe { position: absolute; opacity: 0; transform: translateY(14%) scale(.96); pointer-events: none; }
.envwrap.letter.gone > .envframe { visibility: hidden; }
.envwrap.letter > .card .in > * { animation: rise .7s ease both; }
.envwrap.letter > .card .in > :nth-child(2) { animation-delay: .07s; } .envwrap.letter > .card .in > :nth-child(3) { animation-delay: .14s; } .envwrap.letter > .card .in > :nth-child(4) { animation-delay: .21s; }
.envwrap.letter > .card .in > :nth-child(5) { animation-delay: .28s; } .envwrap.letter > .card .in > :nth-child(6) { animation-delay: .35s; } .envwrap.letter > .card .in > :nth-child(n+7) { animation-delay: .42s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body.editing .envwrap.letter > .card .in > *, body.rm .envwrap.letter > .card .in > * { animation: none; }

.eyebrow { margin: 0; font-family: var(--caps); letter-spacing: .26em; font-size: max(11px, calc(var(--cw) * .028)); color: var(--dim); text-wrap: balance; }
.motif { width: 58%; margin: 0 auto calc(var(--cw) * .03); aspect-ratio: 240 / 84; }
.motif svg { display: block; width: 100%; height: 100%; }
.card h1, .card h2 { margin: 0; font-family: var(--disp); font-weight: 400; line-height: 1.1; letter-spacing: .01em; text-wrap: balance; }
.card h1 { font-size: max(31px, calc(var(--cw) * .1)); }
.card h2 { font-size: max(28px, calc(var(--cw) * .084)); margin-top: .3em; }
.card h3 { margin: 0 0 .4em; font-family: var(--disp); font-weight: 400; font-size: max(23px, calc(var(--cw) * .06)); line-height: 1.15; text-wrap: balance; }
.card h4 { margin: 1.4em 0 .5em; font-family: var(--caps); font-weight: 400; letter-spacing: .16em; font-size: 13px; color: var(--dim); text-transform: uppercase; }
.lead { margin: .9em 0 0; font-family: var(--disp); font-size: max(18px, calc(var(--cw) * .047)); line-height: 1.35; text-wrap: balance; }
.sub { margin: .7em 0 0; font-size: 16px; color: var(--mute); text-wrap: pretty; }
.sub:empty, .when1:empty, #t-prize:empty { display: none; }
.rule { height: 1px; width: 38%; margin: 1.2em auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); position: relative; }
.rule i { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; background: var(--gold); transform: translate(-50%, -50%) rotate(45deg); }
.body { margin: 0; font-size: 16px; line-height: 1.6; text-wrap: pretty; }
.when1 { margin: 1.1em 0 0; font-family: var(--caps); letter-spacing: .16em; font-size: max(12px, calc(var(--cw) * .03)); color: var(--dim); }
.only { margin: 1.2em 0 0; font-family: var(--disp); font-style: italic; font-size: max(18px, calc(var(--cw) * .046)); }
.fine { margin: .8em 0 0; font-size: 13.5px; line-height: 1.5; color: var(--mute); text-wrap: pretty; }
.fine:empty { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; margin: 1.2em auto 0; padding: 10px 22px; border: 1px solid var(--ink); border-radius: 2px; background: var(--ink); color: var(--ivory); font-family: var(--caps); letter-spacing: .12em; font-size: 14px; line-height: 1.3; text-wrap: balance; box-shadow: 0 0 0 1px var(--gold) inset; transition: background .2s; }
.btn:hover { background: #1F2B52; }
.btn.ghost { background: none; color: var(--ink); box-shadow: none; border-color: rgba(19, 27, 51, .45); }
.btn.ghost:hover { background: rgba(19, 27, 51, .06); }
.btn:disabled { opacity: .5; cursor: default; }
.linkish { display: block; margin: .6em auto 0; min-height: 44px; padding: 0 8px; border: 0; background: none; font-size: 15px; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 5px; }
.linkish.back { margin: 0 auto .4em; color: var(--mute); }
.skipanim { color: var(--pale); }
.acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 1em; }
.acts .btn { margin: 0; }
.acts.foot { margin-top: 2em; padding-top: 1.2em; border-top: 1px solid rgba(201, 174, 120, .5); }

/* ---------- 2: the briefing ---------- */
.steps { list-style: none; counter-reset: st; margin: 1.4em 0 0; padding: 0; display: grid; gap: 14px; text-align: left; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; align-items: start; }
.steps li::before { content: counter(st, upper-roman); grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--gold); border-radius: 50%; font-family: var(--disp); font-size: 19px; color: var(--dim); }
.steps b { font-family: var(--caps); font-weight: 400; letter-spacing: .14em; font-size: 13px; text-transform: uppercase; }
.steps span { font-size: 15.5px; line-height: 1.45; }

/* ---------- 3: the gathering ---------- */
.event { margin: 0; font-family: var(--disp); font-size: max(22px, calc(var(--cw) * .058)); line-height: 1.2; text-wrap: balance; }
.when { margin: .6em 0 0; font-weight: 600; text-wrap: balance; }
.where, .with { margin: .3em 0 0; text-wrap: balance; }
.note { margin: 1em 0 0; font-family: var(--disp); font-style: italic; font-size: 18px; line-height: 1.45; white-space: pre-line; text-wrap: pretty; }
.more { margin: 1.1em 0 0; display: grid; gap: 6px; text-align: left; font-size: 15px; }
.more:empty { display: none; }
.more div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding-top: 6px; border-top: 1px solid rgba(201, 174, 120, .45); }
.more dt { font-family: var(--caps); letter-spacing: .1em; font-size: 12px; color: var(--dim); text-transform: uppercase; padding-top: 2px; }
.more dd { margin: 0; }
.stakes, #rsvp, .door { margin-top: 2em; padding-top: 1.5em; border-top: 1px solid rgba(201, 174, 120, .6); }
.stakes { background: var(--ink); color: var(--ivory); margin-left: calc(var(--cw) * -.045); margin-right: calc(var(--cw) * -.045); padding: 1.4em 1.2em 1.3em; border: 1px solid var(--gold); box-shadow: 0 0 0 4px var(--ink), 0 0 0 5px rgba(201, 174, 120, .5); }
.stakes h3 { color: var(--pale); }
.st-line { margin: 0; font-size: 15.5px; text-wrap: pretty; }
.st-prize { margin: .8em 0 0; font-family: var(--disp); font-size: 20px; line-height: 1.3; color: var(--pale); text-wrap: balance; }
.stakes .fine { color: #AEB6CC; }
.by { margin: 0 0 .6em; font-size: 14.5px; color: var(--mute); }
form { text-align: left; }
.f { display: grid; gap: 6px; margin-top: 14px; font-size: 14.5px; }
.f input[type="text"], .f textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid rgba(19, 27, 51, .4); border-radius: 2px; background: #fff; font-size: 16px; }
.ans { margin: 14px 0 0; padding: 0; border: 0; display: grid; gap: 8px; }
.ans label, .opt { position: relative; display: block; }
.ans input, .opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ans span, .opt span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 14px; border: 1px solid rgba(19, 27, 51, .4); border-radius: 2px; background: #fff; text-align: center; line-height: 1.25; transition: background .15s, color .15s; }
.ans input:checked + span, .opt input:checked + span { background: var(--ink); color: var(--ivory); border-color: var(--ink); box-shadow: 0 0 0 1px var(--gold) inset; }
.ans input:focus-visible + span, .opt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.opt input:disabled + span { opacity: .55; cursor: default; }
.opt input:disabled:checked + span { opacity: 1; }
.step { display: inline-flex; align-items: center; gap: 14px; }
.step button { width: 46px; height: 46px; border: 1px solid rgba(19, 27, 51, .4); border-radius: 50%; background: #fff; font-size: 20px; }
.step output { min-width: 1.5em; text-align: center; font-weight: 600; font-size: 18px; }
#err, #q-err, #door-err { margin: 10px 0 0; min-height: 1.2em; font-size: 14.5px; text-align: center; }
#err.err, #q-err, #door-err { color: var(--red); }
#rsvp .btn, #dossier .btn { display: flex; width: 100%; }
#done { text-align: center; }
.check { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; margin: 1em 0 0; text-align: left; font-size: 14.5px; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; }
.door p { margin: 0; font-size: 15.5px; text-wrap: pretty; }

/* ---------- 4: the Society ---------- */
.notice { margin: 1em 0 0; padding: 10px 12px; border-left: 3px solid var(--gold); background: rgba(201, 174, 120, .16); text-align: left; font-size: 14.5px; }
.q { margin: 0; padding: 0; border: 0; min-width: 0; }
.q legend { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; width: 100%; padding: 0 0 10px; font-family: var(--disp); font-size: 20px; line-height: 1.25; text-align: left; }
.q legend i { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--gold); border-radius: 50%; font-style: normal; font-family: var(--text); font-size: 14px; color: var(--dim); }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.q-out, .q-room, .q-cause { margin: 8px 0 0; font-size: 14.5px; text-align: left; }
.q-out { padding: 7px 10px; border-left: 3px solid rgba(19, 27, 51, .3); background: rgba(19, 27, 51, .05); }
.q-out.hit { border-color: var(--green); background: rgba(46, 107, 78, .12); }
.q-out.miss { border-color: var(--red); background: rgba(154, 43, 43, .08); }
.q-out.wait, .q-room { color: var(--mute); }
.q-cause { font-family: var(--disp); font-style: italic; font-size: 16.5px; }
.sealed-line { margin: 1.2em 0 0; padding: 1em; border: 1px solid var(--gold); font-family: var(--disp); font-size: 19px; line-height: 1.4; text-wrap: balance; }
#asg, #live, #reckon { margin-top: 2em; padding-top: 1.5em; border-top: 1px solid rgba(201, 174, 120, .6); }
#reckon { margin-top: 1em; border-top: 0; padding-top: 0; }
/* the confidential assignment: a black card sealed with wax. The card itself is the control. */
.dossier { display: block; width: min(100%, 320px); aspect-ratio: 7 / 5; margin: .6em auto 0; padding: 0; border: 1px solid var(--gold); border-radius: 3px; background: linear-gradient(150deg, #1A1A20, #050507); color: var(--pale); box-shadow: 0 0 0 4px #0A0A0D, 0 0 0 5px rgba(201, 174, 120, .5), 0 14px 26px rgba(0, 0, 0, .4); }
.ds-front { display: grid; height: 100%; align-content: center; justify-items: center; gap: 8px; }
.ds-conf { margin: 0; font-family: var(--caps); letter-spacing: .2em; font-size: 12px; }
.ds-seal { width: 30%; aspect-ratio: 1; transition: transform .55s ease, opacity .55s ease; }
.ds-eyes { font-family: var(--disp); font-style: italic; font-size: 17px; }
.dossier.breaking .ds-seal { transform: scale(1.25) rotate(14deg); opacity: 0; }
.ds-open { margin: .6em 0 0; padding: 1.3em 1.1em; border: 1px solid var(--gold); border-radius: 3px; background: linear-gradient(150deg, #1A1A20, #050507); color: var(--ivory); box-shadow: 0 0 0 4px #0A0A0D, 0 0 0 5px rgba(201, 174, 120, .5); }
.ds-open .ds-conf { color: var(--gold); }
.ds-open h4 { margin: .5em 0 .3em; font-family: var(--disp); font-size: 27px; letter-spacing: 0; text-transform: none; color: var(--pale); }
.ds-open p { margin: .6em 0 0; text-wrap: pretty; }
.ds-done, .ds-rule { font-size: 14.5px; color: #C9CEDD; }
.ds-pts { font-family: var(--caps); letter-spacing: .12em; font-size: 13px; color: var(--gold); }
.ds-status { font-family: var(--disp); font-style: italic; font-size: 18px; color: var(--pale); }
.ds-status:empty { display: none; }
.ds-open .btn { background: var(--gold); color: var(--deep); border-color: var(--gold); box-shadow: none; }
.ds-open .btn.ghost { background: none; color: var(--ivory); border-color: rgba(230, 213, 172, .55); }
.ds-open :focus-visible { outline-color: var(--pale); }
/* the standings */
.board { list-style: none; margin: .6em 0 0; padding: 0; display: grid; gap: 4px; text-align: left; }
.board li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; background: rgba(19, 27, 51, .05); }
.board li.me { background: var(--ink); color: var(--ivory); box-shadow: 0 0 0 1px var(--gold) inset; }
.board .b-n { font-family: var(--disp); font-size: 20px; text-align: center; }
.board small { display: block; font-size: 12.5px; opacity: .75; }
.board b { font-family: var(--disp); font-weight: 400; font-size: 24px; }
/* the Reckoning: the clock's hands sweep to twelve, then the results */
.rk-clock { display: block; width: min(52%, 190px); aspect-ratio: 1; margin: 0 auto .8em; padding: 0; border: 0; background: none; border-radius: 50%; }
.rk-clock .hh { transform: rotate(-30deg); transition: transform 3.2s cubic-bezier(.5, 0, .2, 1); }
.rk-clock .mh { transform: rotate(-12deg); transition: transform 3.2s cubic-bezier(.5, 0, .2, 1); }
#reckon.go .hh, #reckon.done .hh { transform: rotate(0deg); }
#reckon.go .mh, #reckon.done .mh { transform: rotate(360deg); }
body.rm .rk-clock .hh, body.rm .rk-clock .mh { transition: none; }
#rk-line { margin: .4em 0 0; text-wrap: pretty; }
#rk-champ { margin-top: 1.4em; padding: 1.3em 1em; background: var(--ink); color: var(--ivory); border: 1px solid var(--gold); box-shadow: 0 0 0 4px var(--ink), 0 0 0 5px rgba(201, 174, 120, .5); }
#rk-champ .eyebrow { color: var(--gold); }
.champ { margin: .3em 0 0; font-family: var(--disp); font-size: max(34px, calc(var(--cw) * .1)); line-height: 1.1; text-wrap: balance; }
.champ.none { font-size: 21px; }
#rk-champ .fine { color: #AEB6CC; }
.award { margin: 1em 0 0; font-size: 17px; }
.award b { display: block; font-family: var(--caps); font-weight: 400; letter-spacing: .16em; font-size: 12.5px; color: var(--dim); text-transform: uppercase; }
.award small { display: block; font-size: 13px; color: var(--mute); }
.reveals { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; text-align: left; }
.reveals li { padding: 9px 10px; border-left: 3px solid var(--gold); background: rgba(19, 27, 51, .05); }
.reveals small { display: block; font-size: 13.5px; color: var(--mute); }
.reveals i { font-style: normal; font-family: var(--caps); letter-spacing: .08em; color: var(--dim); }
#rk-body > * { animation: rise .7s ease both; }
body.rm #rk-body > * { animation: none; }

/* a wide screen: the game and the gathering get a little more room than the letter */
@media (min-width: 760px) and (min-height: 700px) { .card.det, .card.soc, .card.brief { width: min(92vw, 560px); } }
@media (max-width: 380px) { .in { padding-left: calc(var(--cw) * .085); padding-right: calc(var(--cw) * .085); } .opts { grid-template-columns: 1fr 1fr; } .more div { grid-template-columns: 92px 1fr; } }

/* ---------- the Society as a stage, not a card: the game is played on the dark room itself ---------- */
.soc.stage { background: none; box-shadow: none; color: var(--ivory); width: min(96vw, 720px); min-height: 0; }
.soc.stage > .frame { display: none; }
.soc.stage .in { padding: 0 2px 10px; }
.soc.stage :focus-visible { outline-color: var(--pale); }
.soc.stage h2 { font-size: max(22px, calc(var(--cw) * .058)); color: var(--pale); }
.soc.stage h3 { color: var(--ivory); }
.soc.stage h4 { color: var(--gold); }
.soc.stage .eyebrow { color: var(--gold); }
.soc.stage .sub, .soc.stage .fine, .soc.stage .q-room, .soc.stage .award small, .soc.stage .reveals small { color: #B7BED2; }
.soc.stage .linkish { color: var(--pale); }
.soc.stage .btn { background: var(--gold); color: var(--deep); border-color: var(--gold); box-shadow: none; }
.soc.stage .btn:hover { background: var(--pale); }
.soc.stage .btn.ghost { background: none; color: var(--ivory); border-color: rgba(230, 213, 172, .55); }
.soc.stage .btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.soc.stage .notice { background: rgba(201, 174, 120, .14); color: var(--ivory); }
.soc.stage .board li { position: relative; overflow: hidden; background: rgba(255, 255, 255, .07); }
.soc.stage .board li.me { background: var(--gold); color: var(--deep); box-shadow: none; }
.board .bar { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--w); background: var(--gold); animation: grow 1.4s cubic-bezier(.2, .7, .2, 1) both; }
.board li.me .bar { background: var(--deep); }
@keyframes grow { from { width: 0; } }
.soc.stage .award b, .soc.stage .reveals i { color: var(--gold); }
.soc.stage .reveals li { background: rgba(255, 255, 255, .07); }
.soc.stage .sealed-line { color: var(--pale); background: rgba(12, 20, 41, .6); }
.soc.stage .q-out { margin: 0 auto; max-width: 30em; text-align: center; border-left: 0; border-radius: 2px; background: rgba(255, 255, 255, .08); color: var(--ivory); }
.soc.stage .q-out.hit { background: rgba(201, 174, 120, .9); color: var(--deep); }
.soc.stage .q-out.miss { background: rgba(255, 255, 255, .05); color: #B7BED2; }
.soc.stage .q-out.wait, .soc.stage .q-out.void { color: #B7BED2; }
.soc.stage .q-cause { color: var(--pale); text-align: center; }
.soc.stage .q-room { text-align: center; }
#q-err, #door-err { color: #FFB4A8; }
.door #door-err { color: var(--red); }

/* the question, then the clock */
.q-count { margin: 1em 0 0; font-family: var(--caps); letter-spacing: .26em; font-size: 12px; color: var(--gold); text-align: center; }
.soc.stage .q-text { display: grid; place-items: center; min-height: 2.4em; margin: .25em auto 0; max-width: 16em; font-size: clamp(25px, 5.6vw, 40px); line-height: 1.14; text-wrap: balance; text-align: center; }
.dial { position: relative; width: min(60vw, 44svh, 400px); aspect-ratio: 1; margin: clamp(40px, 8vw, 60px) auto clamp(38px, 7vw, 54px); }
.dial > .pic { position: absolute; inset: 0; }
.glyph { position: absolute; left: 50%; top: 50%; width: 40%; aspect-ratio: 1; transform: translate(-50%, -50%); opacity: .45; transition: opacity .4s ease, filter .4s ease; }
.glyph svg { display: block; width: 100%; height: 100%; }
.glyph.lit { opacity: 1; filter: drop-shadow(0 0 12px rgba(240, 200, 120, .75)); }
.glyph.dim { opacity: .2; }
.glyph.pop { animation: gpop .6s ease; }
@keyframes gpop { 35% { transform: translate(-50%, -50%) scale(1.28) rotate(-7deg); } }
/* your hand (gold) and, once the night has decided, the white hand of what really happened */
.hand { position: absolute; left: 50%; bottom: 50%; z-index: 2; width: 6px; height: 43%; margin-left: -3px; border-radius: 3px; background: linear-gradient(var(--pale), var(--gold)); transform-origin: 50% 100%; transition: transform .85s cubic-bezier(.3, 1.5, .5, 1); box-shadow: 0 0 12px rgba(240, 200, 120, .55); pointer-events: none; }
.hand::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--gold); }
.hand.idle { opacity: .55; animation: sway 3.4s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
.hand.fate { z-index: 1; width: 3px; height: 36%; margin-left: -1.5px; background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .9); }
.hand.fate::after { display: none; }
/* the answers: gold plaques round the dial. The one you chose fills with gold; the true one wears a white ring. */
.plaque { position: absolute; z-index: 3; transform: translate(-50%, -50%); min-width: 68px; min-height: 46px; max-width: 40vw; padding: 6px 15px; border: 1px solid var(--gold); border-radius: 99px; background: rgba(9, 15, 32, .94); color: var(--ivory); font-size: 15.5px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .2s, color .2s, box-shadow .2s, transform .2s; }
.plaque:hover:not(:disabled) { background: #1C2748; }
.plaque.on { background: var(--gold); color: var(--deep); font-weight: 600; box-shadow: 0 0 20px rgba(240, 200, 120, .7); transform: translate(-50%, -50%) scale(1.08); }
.plaque.true { outline: 2px solid #fff; outline-offset: 3px; }
.plaque:disabled { cursor: default; opacity: .55; }
.plaque.on:disabled, .plaque.true:disabled { opacity: 1; }
.roll { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-height: 32svh; overflow: auto; margin: 0 0 1em; padding: 6px; }
.roll .plaque { position: static; transform: none; max-width: 46vw; }
.roll .plaque.on { transform: none; }
/* the seals: one a prediction */
.seals { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(8px, 2.6vw, 16px); margin: 1.1em 0 0; padding: 0; }
.sealb { width: 48px; height: 48px; padding: 0; border: 1px solid rgba(201, 174, 120, .65); border-radius: 50%; background: rgba(9, 15, 32, .6); color: var(--pale); font-family: var(--disp); font-size: 19px; transition: transform .2s, filter .3s, box-shadow .3s; }
.sealb.done { border-color: transparent; background: radial-gradient(circle at 35% 30%, #F1DFB0, #C3A565 55%, #7E6634); color: #3A2C0E; box-shadow: 0 3px 7px rgba(0, 0, 0, .55), 0 0 0 1px rgba(126, 102, 52, .6) inset; }
.sealb[aria-current="true"] { outline: 2px solid var(--pale); outline-offset: 4px; }
.sealb.hit { box-shadow: 0 0 18px 5px rgba(255, 220, 140, .85); }
.sealb.miss { filter: grayscale(1) brightness(.55); }
.sealb.void { opacity: .35; }
.seals.stamped .sealb.done { animation: stamp .55s ease both; }
.seals.stamped li:nth-child(2) .sealb { animation-delay: .14s; } .seals.stamped li:nth-child(3) .sealb { animation-delay: .28s; } .seals.stamped li:nth-child(4) .sealb { animation-delay: .42s; }
.seals.stamped li:nth-child(5) .sealb { animation-delay: .56s; } .seals.stamped li:nth-child(6) .sealb { animation-delay: .7s; } .seals.stamped li:nth-child(7) .sealb { animation-delay: .84s; }
@keyframes stamp { 0% { transform: scale(1.7); opacity: .2; } 60% { transform: scale(.88); opacity: 1; } 100% { transform: none; } }
#dossier .btn { display: flex; width: min(100%, 360px); margin-left: auto; margin-right: auto; }
/* the oath: a wax seal to press and hold */
.oath { display: block; width: 128px; height: 128px; margin: 1.2em auto 0; padding: 0; border: 0; border-radius: 50%; background: none; touch-action: none; -webkit-user-select: none; user-select: none; transition: transform .25s ease, filter .25s ease; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); }
.oath:hover { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)) brightness(1.08); }
.oath.holding { animation: press 1.2s linear forwards; }
@keyframes press { to { transform: scale(.84); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)) brightness(1.2); } }
/* the bell at the door */
.bell { display: grid; justify-items: center; gap: 6px; margin: 0 auto; padding: 6px 14px; border: 0; background: none; color: var(--pale); font-family: var(--caps); letter-spacing: .12em; font-size: 14px; }
.bell .pic { width: 104px; aspect-ratio: 1; transform-origin: 50% 12%; }
.bell.ring .pic { animation: ring .95s ease; }
@keyframes ring { 15% { transform: rotate(16deg); } 35% { transform: rotate(-13deg); } 55% { transform: rotate(9deg); } 75% { transform: rotate(-5deg); } }
body.rm .hand, body.rm .hand.idle, body.rm .glyph.pop, body.rm .seals.stamped .sealb.done, body.rm .oath.holding, body.rm .bell.ring .pic, body.rm .board .bar { animation: none; transition: none; }
@media (prefers-reduced-motion: reduce) { .hand.idle, .glyph.pop, .seals.stamped .sealb.done, .bell.ring .pic, .board .bar { animation: none; } .hand { transition: none; } }
@media (max-width: 380px) { .plaque { font-size: 14px; padding: 6px 11px; min-width: 60px; } .dial { width: min(56vw, 42svh); } }

/* ---------- one thing at a time (the user, 2026-11-16: "all I see is a bunch of text") ----------
   The Chamber's first screen holds only the row of seals, the question and the clock, sized to fit the screen. The headings above it are kept for screen readers only;
   the closing date and the Seal button appear once every prediction has an answer; the way back and the small print live below the fold. */
#p4 { align-content: start; padding-top: 58px; }
.soc.stage #soc-phase, .soc.stage #t-soc, .soc.stage #soc-sub, .soc.stage .q-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#dossier { display: flex; flex-direction: column; justify-content: center; min-height: calc(100svh - 118px); }
.soc.stage .seals { margin: 0 0 clamp(10px, 2.4svh, 26px); gap: clamp(8px, 2.2vw, 14px); }
.soc.stage .sealb { width: 42px; height: 42px; font-size: 17px; }
.soc.stage .q-text { min-height: 0; max-width: 15em; font-size: clamp(29px, 6.6vw, 50px); line-height: 1.1; }
.dial { width: clamp(190px, min(62vw, calc(100svh - 380px)), 460px); margin: clamp(38px, 6svh, 58px) auto clamp(34px, 5svh, 50px); }
.plaque { min-width: 86px; min-height: 54px; padding: 8px 22px; font-size: 19px; font-weight: 600; }
.roll .plaque { min-width: 0; min-height: 46px; padding: 6px 14px; font-size: 15.500px; font-weight: 400; }
#q-deadline { text-align: center; }
/* a preview says so in a small tag, not a bar across the game */
.soc.stage .notice.tag { display: table; margin: 0 auto 8px; padding: 2px 12px; border: 1px solid rgba(201, 174, 120, .6); border-radius: 99px; background: none; color: var(--pale); font-family: var(--caps); letter-spacing: .12em; font-size: 11px; }
/* behind the question the room's own clock keeps its ring and numerals but loses its hands, so nothing crosses the words */
.rm-hands { transition: opacity .6s ease; }
body[data-panel="4"] .rm-hands { opacity: 0; }
@media (max-width: 380px) { .plaque { min-width: 70px; min-height: 50px; padding: 6px 14px; font-size: 16px; } }

/* many answers (names all the way round the clock): smaller plaques, set a little outside the ring so they do not crowd it */
.plaque.sm { min-width: 0; min-height: 42px; max-width: 9.500em; padding: 5px 13px; font-size: 15px; }
.plaque.sm.on { transform: translate(-50%, -50%) scale(1.12); }
.dial:has(.plaque.sm) { margin-top: clamp(48px, 8svh, 70px); margin-bottom: clamp(46px, 7svh, 64px); width: clamp(180px, min(54vw, calc(100svh - 420px)), 420px); }

/* the prize, named on the invitation card */
.stake1 { margin: .9em 0 0; padding: .55em .8em; border: 1px solid var(--gold); font-family: var(--caps); letter-spacing: .12em; font-size: max(12px, calc(var(--cw) * .03)); color: var(--ink); background: rgba(201, 174, 120, .2); text-wrap: balance; }
.stake1:empty { display: none; }

/* THE GRAND SOCIETY PRIZE: shown before anyone plays, the prize itself the largest line */
.stakes .eyebrow { color: var(--gold); text-transform: uppercase; }
.stakes h3 { margin: .2em 0 .5em; font-size: max(26px, calc(var(--cw) * .07)); text-transform: uppercase; letter-spacing: .04em; }
.stakes .st-prize { margin: .5em 0; font-size: max(23px, calc(var(--cw) * .06)); color: #fff; }
.stakes .st-line { color: #D8DCE8; }
