/* Картки довіри — evening blue, beeswax, a paper card on the table.
   1. fonts  2. tokens  3. base  4. pages  5. room (phone)  6. shared pieces  7. screen  8. chronicle  9. motion */

/* 1. fonts (self-hosted, Latin + Cyrillic) */
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope-latin.woff2') format('woff2'); font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope-cyrillic.woff2') format('woff2'); font-weight: 200 800; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant'; src: url('/fonts/cormorant-latin.woff2') format('woff2'); font-weight: 300 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cormorant'; src: url('/fonts/cormorant-cyrillic.woff2') format('woff2'); font-weight: 300 700; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

/* 2. tokens */
:root {
  --night: #161c33;      /* the room in the evening */
  --night-2: #1e2643;    /* raised surfaces */
  --night-3: #2b3459;    /* controls, hairlines */
  --ink: #f1ead9;        /* text on night */
  --ink-soft: #b9b5c6;
  --ink-faint: #8a8aa3;
  --wax: #f0cf7e;        /* beeswax: the one accent */
  --wax-deep: #d6a743;
  --on-wax: #231a05;
  --ember: #ee7a3c;      /* fire only */
  --linen: #f4ecda;      /* the paper card */
  --linen-ink: #231f18;
  --linen-soft: #6b6152;
  --ok: #9cc9b0;
  --warn: #f2a07b;
  --cat-fun: #e3b23c;
  --cat-real: #6fae8d;
  --cat-faith: #6f8fd8;
  --cat-together: #d57f86;
  --cat-special: #b98be0;
  --cat-box: #c9a46a;
  --radius: 18px;
  --radius-s: 10px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Cormorant', 'Iowan Old Style', Georgia, serif;
  --shadow-card: 0 1px 0 rgba(255,255,255,.6) inset, 0 18px 40px -12px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.25);
  color-scheme: dark;
}

/* 3. base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--ink); font: 400 1rem/1.55 var(--font); min-height: 100vh; min-height: 100dvh; }
a { color: var(--wax); text-underline-offset: 3px; }
a:hover { color: #fff1c4; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.005em; color: #fbf4e2; }
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 4vw, 2.1rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--wax); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); font-size: .9rem; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 32px, 980px); margin-inline: auto; }
.narrow { width: min(100% - 32px, 560px); margin-inline: auto; }
hr { border: 0; border-top: 1px solid var(--night-3); margin: 2rem 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: .7em 1.25em; border-radius: 999px;
  border: 1px solid var(--night-3); background: var(--night-2); color: var(--ink); font: 600 1rem/1.2 var(--font); cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.btn:hover { border-color: var(--wax-deep); color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.btn-wax { background: var(--wax); border-color: var(--wax); color: var(--on-wax); }
.btn-wax:hover { background: #f7dc97; color: var(--on-wax); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-soft); padding-inline: .8em; }
.btn-quiet:hover { color: var(--ink); border-color: var(--night-3); }
.btn-block { display: flex; width: 100%; }
.btn-small { min-height: 38px; padding: .45em .95em; font-size: .92rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > .btn { flex: 1 1 auto; }

input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; min-height: 48px; padding: .7em .9em; border-radius: var(--radius-s); border: 1px solid var(--night-3);
  background: #10152a; color: var(--ink); font: 400 1rem/1.4 var(--font); }
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--wax); box-shadow: 0 0 0 3px rgba(240,207,126,.22); }
label { display: block; font-weight: 600; margin-bottom: .35em; }
.field { margin-bottom: 1rem; }
.error-box { background: rgba(242,160,123,.12); border: 1px solid rgba(242,160,123,.4); color: #ffd9c6; padding: .8em 1em; border-radius: var(--radius-s); margin-bottom: 1rem; }

/* persona avatar: the animal in its own colour */
.ava { --h: 200; display: inline-grid; place-items: center; width: 2.4em; height: 2.4em; border-radius: 50%; flex: none;
  background: hsl(var(--h) 45% 32%); box-shadow: 0 0 0 2px hsl(var(--h) 60% 62% / .55); font-size: 1rem; line-height: 1; }
.ava > span { font-size: 1.3em; }
.ava.big { font-size: 2.2rem; }
.ava.off { filter: grayscale(.8) brightness(.7); }
.who { display: inline-flex; align-items: center; gap: .55em; font-weight: 600; }
.who small { font-weight: 500; color: var(--ink-soft); }

/* site header for pages outside a room */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 1.35rem/1 var(--display); }
.brand .seal { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--wax); color: var(--on-wax); font-size: 1.05rem; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { color: var(--ink-soft); text-decoration: none; padding: .5em .75em; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.top nav a:hover, .top nav a.on { color: var(--ink); background: var(--night-2); }
.foot { padding: 40px 0 32px; color: var(--ink-faint); font-size: .88rem; }
.foot a { color: var(--ink-soft); }

/* 4. pages */
.hero { padding: 6vh 0 4vh; text-align: center; position: relative; }
.hero::before { content: ''; position: absolute; inset: -10% 10% auto; height: 360px; background: radial-gradient(closest-side, rgba(240,207,126,.16), transparent); pointer-events: none; }
.hero h1 { font-size: clamp(2.6rem, 9vw, 4.6rem); font-weight: 500; margin-bottom: .25em; }
.hero p { color: var(--ink-soft); max-width: 34ch; margin-inline: auto; font-size: 1.08rem; }
.codebox { margin: 2.2rem auto 0; max-width: 360px; position: relative; }
.codebox label { color: var(--ink-soft); font-weight: 500; text-align: center; }
.codebox input { text-align: center; font: 600 2.6rem/1 var(--display); letter-spacing: .35em; text-transform: uppercase; height: 76px; padding-left: .35em; border-radius: var(--radius); background: #0f1428; }
.codebox .btn { margin-top: 12px; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 2.4rem 0; }
.tile { background: var(--night-2); border: 1px solid var(--night-3); border-radius: var(--radius); padding: 18px 20px; color: var(--ink); text-decoration: none; display: block; }
a.tile:hover { border-color: var(--wax-deep); color: var(--ink); }
.tile h3 { margin-bottom: .25em; }
.tile p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.tile .ico { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.panel { background: var(--night-2); border: 1px solid var(--night-3); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }

/* join: choose a persona */
.join-head { text-align: center; padding: 28px 0 8px; }
.join-head .place { color: var(--ink-soft); }
.persona-pick { display: grid; gap: 12px; margin: 18px 0; }
.persona-opt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--night-2); border: 2px solid var(--night-3); cursor: pointer; }
.persona-opt:has(input:checked) { border-color: var(--wax); background: #252c4b; }
.persona-opt input { accent-color: var(--wax); width: 20px; height: 20px; }
.persona-opt .nm { font: 600 1.45rem/1.1 var(--display); }
.persona-opt .sub { color: var(--ink-soft); font-size: .9rem; }
.persona-new { text-align: center; padding: 22px 16px; }
.persona-new .ava { font-size: 2.6rem; }
.persona-new .nm { font: 600 2rem/1.1 var(--display); margin: .4em 0 .1em; }
.reroll { margin-top: 10px; }

/* 5. room (phone) */
.game { min-height: 100dvh; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(22,28,51,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--night-3); }
.bar .who { min-width: 0; flex: 1; }
.bar .who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .code { font: 600 1.1rem/1 var(--display); letter-spacing: .18em; color: var(--ink-soft); }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--night-3); background: var(--night-2); color: var(--ink); cursor: pointer; flex: none; }
.iconbtn:hover { border-color: var(--wax-deep); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn.host { border-color: var(--wax-deep); }
.stage { flex: 1; padding: 16px 16px 120px; width: min(100%, 620px); margin-inline: auto; }
.reacts { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; justify-content: center; gap: 6px; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(22,28,51,1) 60%, rgba(22,28,51,0)); }
.reacts button { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--night-3); background: var(--night-2); font-size: 1.55rem; cursor: pointer; display: grid; place-items: center; transition: transform .12s; -webkit-tap-highlight-color: transparent; }
.reacts button:active { transform: scale(.86); }
.reacts[hidden] { display: none; }

.status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; color: var(--ink-soft); font-size: .92rem; }
.status b { color: var(--ink); }
.headline { font: 600 1.6rem/1.15 var(--display); margin: 4px 0 14px; color: #fbf4e2; }
.say { font-size: 1.05rem; color: var(--ink-soft); }
.block { margin: 18px 0; }
.block > h3 { font-size: 1.2rem; margin-bottom: .45em; }

/* 6. shared pieces */
/* the paper card */
.qcard { --cat: var(--cat-fun); position: relative; background: var(--linen); color: var(--linen-ink); border-radius: 16px; padding: 22px 22px 20px; box-shadow: var(--shadow-card); margin: 8px 0 18px; }
.qcard::after { content: ''; position: absolute; left: 10%; right: 10%; bottom: -26px; height: 30px; background: radial-gradient(closest-side, rgba(240,207,126,.28), transparent); pointer-events: none; z-index: -1; }
.qcard .meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .82rem; font-weight: 700; color: var(--linen-soft); margin-bottom: 12px; }
.qcard .cat { display: inline-flex; align-items: center; gap: 7px; }
.qcard .cat::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--cat); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat) 25%, transparent); }
.qcard .lv { display: inline-flex; gap: 4px; }
.qcard .lv i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--linen-soft); }
.qcard .lv i.on { background: var(--linen-soft); }
.qcard .text { font: 600 1.75rem/1.18 var(--display); margin: 0; text-wrap: balance; }
.qcard .note { margin: 10px 0 0; color: var(--linen-soft); font-size: .95rem; }
.qcard .type { margin-top: 12px; font-size: .82rem; color: var(--linen-soft); font-weight: 600; }
.qcard.c-fun { --cat: var(--cat-fun); } .qcard.c-real { --cat: var(--cat-real); } .qcard.c-faith { --cat: var(--cat-faith); }
.qcard.c-together { --cat: var(--cat-together); } .qcard.c-special { --cat: var(--cat-special); } .qcard.c-box { --cat: var(--cat-box); }
.qcard.pick { cursor: pointer; text-align: left; width: 100%; border: 0; font: inherit; transition: transform .15s; display: block; }
.qcard.pick:hover { transform: translateY(-2px); }
.qcard.pick .text { font-size: 1.4rem; }
.qcard.pick + .qcard.pick { margin-top: -4px; }
.banner { display: flex; align-items: center; gap: 10px; color: var(--wax); font-weight: 700; margin-bottom: 6px; }

/* candle timer */
.candle { display: flex; align-items: flex-end; gap: 12px; }
.candle .stick { position: relative; width: 16px; height: 64px; display: flex; align-items: flex-end; }
.candle .wax { width: 100%; height: calc(var(--left, 1) * 52px + 4px); background: linear-gradient(90deg, #efe2bd, #fff6dc 45%, #e1cf9c); border-radius: 4px 4px 2px 2px; transition: height 1s linear; position: relative; }
.candle .flame { position: absolute; left: 50%; bottom: 100%; width: 12px; height: 20px; margin-left: -6px; margin-bottom: 1px; border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 70%, #fff7d6 0 22%, #ffd36b 40%, #f08a2a 75%, transparent 76%); transform-origin: 50% 90%; animation: flick 1.6s ease-in-out infinite; }
.candle .time { font: 600 1.35rem/1 var(--display); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.candle.out .flame { animation: flickout .5s ease-in-out infinite; }
.candle .over { color: var(--wax); font-weight: 600; }

/* options to vote on */
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; padding: .7em 1.1em; border-radius: 14px; border: 1.5px solid var(--night-3); background: var(--night-2); color: var(--ink); font: 600 1.05rem/1.25 var(--font); cursor: pointer; text-align: left; }
.opt:hover { border-color: var(--wax-deep); }
.opt.on { border-color: var(--wax); background: #2e3557; }
.opt.on::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--wax); flex: none; }
.opts.scale { grid-template-columns: repeat(5, 1fr); }
.opts.scale .opt { justify-content: center; padding: .6em .2em; flex-direction: column; text-align: center; font-size: 1.25rem; }
.opts.scale .opt.on::after { display: none; }
.scale-ends { display: flex; justify-content: space-between; color: var(--ink-faint); font-size: .85rem; margin-top: 6px; }
.waiting { color: var(--ink-soft); font-size: .95rem; margin-top: 10px; }

/* poll results */
.bars { display: grid; gap: 10px; }
.barrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.barrow .lab { font-weight: 600; }
.barrow .n { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.barrow .track { grid-column: 1 / -1; height: 12px; border-radius: 999px; background: var(--night-3); overflow: hidden; }
.barrow .fill { height: 100%; width: var(--w); background: var(--wax); border-radius: 999px; transition: width .6s ease; }
.barrow.self .lab::after { content: ' · вибір відповідача'; color: var(--wax); font-weight: 500; }
.verdict { font: 600 1.4rem/1.2 var(--display); color: #fbf4e2; margin: 14px 0 0; }

/* word cloud and the wall of silent answers */
.cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .15em .7em; padding: 10px 0; }
.cloud span { font-family: var(--display); font-weight: 600; line-height: 1.1; color: var(--ink); }
.cloud span:nth-child(3n+1) { color: var(--wax); }
.cloud span:nth-child(5n+2) { color: #c9d6f7; }
.wall { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.wall p { margin: 0; background: var(--linen); color: var(--linen-ink); padding: 14px 16px; border-radius: 12px; font: 500 1.15rem/1.35 var(--display); box-shadow: var(--shadow-card); }
.wall p:nth-child(odd) { transform: rotate(-.6deg); }
.wall p:nth-child(even) { transform: rotate(.5deg); }

.people { display: flex; flex-wrap: wrap; gap: 10px; }
.people .who { background: var(--night-2); border: 1px solid var(--night-3); padding: 5px 12px 5px 5px; border-radius: 999px; font-size: .95rem; }
.people .who.speaking { border-color: var(--wax); }
.queue { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.notice { background: #252d4f; border: 1px solid var(--wax-deep); border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; }
.notice h3 { margin-bottom: .3em; }
.prompts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; padding: 0; list-style: none; }
.prompts li { background: var(--night-3); padding: .4em .8em; border-radius: 999px; font-size: .95rem; }
.tokens { display: inline-flex; gap: 4px; vertical-align: middle; }
.tokens i { width: 10px; height: 10px; border-radius: 50%; background: var(--wax); }
.tokens i.used { background: var(--night-3); }
.gift { display: flex; flex-wrap: wrap; gap: 8px; font-size: 1.2rem; }
.gift span { background: var(--night-2); border: 1px solid var(--night-3); border-radius: 999px; padding: .2em .7em; }

/* progress strip on the phone */
.strip { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--night-2); border: 1px solid var(--night-3); margin-bottom: 16px; }
.strip .meter { flex: 1; height: 8px; border-radius: 999px; background: var(--night-3); overflow: hidden; }
.strip .meter i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--ember), var(--wax)); border-radius: 999px; transition: width .5s; }
.strip b { font-family: var(--display); font-size: 1.15rem; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--night-3); }
.dots i.on { background: var(--wax); }

/* sheets: the menu and the host panel */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(8,10,22,.6); }
.sheet[hidden] { display: none; }
.sheet .in { width: min(100%, 620px); max-height: 88dvh; overflow: auto; background: var(--night-2); border-radius: 22px 22px 0 0; border: 1px solid var(--night-3); border-bottom: 0; padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); }
.sheet .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sheet .head h2 { margin: 0; font-size: 1.6rem; }
.sheet section { padding: 14px 0; border-top: 1px solid var(--night-3); }
.sheet section:first-of-type { border-top: 0; }
.sheet h3 { font-size: 1.1rem; margin-bottom: .5em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg { display: inline-flex; border: 1px solid var(--night-3); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--ink-soft); padding: .55em 1em; font: 600 .95rem var(--font); cursor: pointer; min-height: 42px; }
.seg button.on { background: var(--wax); color: var(--on-wax); }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list li { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: #1a2140; border-radius: 12px; padding: 8px 10px; }
.list li.hidden-note { opacity: .5; text-decoration: line-through; }
.list .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.copy { display: flex; gap: 8px; }
.copy input { font-size: .85rem; min-height: 42px; }
.toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 60; background: var(--wax); color: var(--on-wax); padding: .65em 1.1em; border-radius: 999px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100% - 32px); text-align: center; }
.toast[hidden] { display: none; }

/* flying reactions */
.fly { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.fly span { position: absolute; bottom: 80px; font-size: 2rem; animation: rise 2.6s ease-out forwards; }

/* calm moments: silence, thanks, prayer */
.calm { text-align: center; padding: 30px 0; }
.calm .glow { width: 120px; height: 120px; margin: 0 auto 20px; border-radius: 50%; background: radial-gradient(circle, rgba(255,214,120,.65), rgba(240,140,50,.2) 50%, transparent 70%); animation: breathe 6s ease-in-out infinite; }
.calm .big { font: 600 3rem/1 var(--display); font-variant-numeric: tabular-nums; color: var(--wax); }
.overlay { position: fixed; inset: 0; z-index: 45; background: rgba(12,15,32,.94); display: grid; place-items: center; padding: 24px; text-align: center; }
.overlay[hidden] { display: none; }

/* final */
.blesscard { background: var(--linen); color: var(--linen-ink); border-radius: 18px; padding: 24px; box-shadow: var(--shadow-card); }
.blesscard h3 { color: var(--linen-ink); font-size: 1.6rem; }
.blesscard blockquote { margin: 0 0 14px; font: 500 1.3rem/1.35 var(--display); }
.blesscard blockquote::before { content: '«'; } .blesscard blockquote::after { content: '»'; }
.blesscard .from { color: var(--linen-soft); font-size: .9rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--night-2); border: 1px solid var(--night-3); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font: 600 2rem/1 var(--display); color: #fbf4e2; }
.stat span { color: var(--ink-soft); font-size: .9rem; }

/* fire (shared screen and phone) */
.fire { --s: .5; position: relative; width: calc(260px * var(--s) + 60px); height: calc(320px * var(--s) + 60px); margin: 0 auto; }
.fire .logs { position: absolute; left: 50%; bottom: 0; width: 70%; height: 22px; transform: translateX(-50%); }
.fire .logs::before, .fire .logs::after { content: ''; position: absolute; bottom: 0; width: 100%; height: 14px; border-radius: 8px; background: #5b3a22; box-shadow: inset 0 -3px 0 #3d2616; }
.fire .logs::before { transform: rotate(10deg); } .fire .logs::after { transform: rotate(-10deg); }
.fire .f { position: absolute; left: 50%; bottom: 12px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; transform-origin: 50% 100%; mix-blend-mode: screen; }
.fire .f1 { width: 70%; height: 82%; margin-left: -35%; background: radial-gradient(ellipse at 50% 85%, #ffcf66 0 18%, #f47a2a 45%, rgba(214,60,20,.0) 70%); animation: flame 2.2s ease-in-out infinite; }
.fire .f2 { width: 48%; height: 64%; margin-left: -24%; background: radial-gradient(ellipse at 50% 85%, #fff4c9 0 18%, #ffc24d 45%, rgba(240,120,40,0) 70%); animation: flame 1.6s ease-in-out infinite reverse; }
.fire .f3 { width: 26%; height: 40%; margin-left: -13%; background: radial-gradient(ellipse at 50% 85%, #fff 0 20%, #ffe9a1 50%, rgba(255,200,90,0) 72%); animation: flame 1.2s ease-in-out infinite; }
.fire .halo { position: absolute; inset: -20%; background: radial-gradient(closest-side, rgba(255,170,70,calc(.12 + var(--s) * .16)), transparent); }
.fire.pillar::before { content: ''; position: absolute; left: 50%; bottom: 30%; width: 34%; height: 260%; transform: translateX(-50%); background: linear-gradient(to top, rgba(255,232,170,.75), rgba(255,240,200,0)); filter: blur(6px); border-radius: 50%; animation: breathe 5s ease-in-out infinite; }

/* Emmaus road */
.road { width: 100%; height: auto; display: block; }
.road .path { fill: none; stroke: #4a527a; stroke-width: 5; stroke-dasharray: 2 12; stroke-linecap: round; }
.road .done { fill: none; stroke: var(--wax); stroke-width: 5; stroke-linecap: round; }
.road .stop circle { fill: var(--night-2); stroke: #4a527a; stroke-width: 3; }
.road .stop.on circle { stroke: var(--wax); fill: #2b3459; }
.road .stop.here circle { fill: var(--wax); stroke: #fff1c4; }
.road text { fill: var(--ink-soft); font: 600 15px var(--font); }
.road .stop.on text, .road .stop.here text { fill: var(--ink); }
.road .icon { font-size: 22px; }

/* 7. the shared screen (laptop or TV) */
.scr { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; font-size: clamp(16px, 1.25vw, 26px); background: radial-gradient(ellipse at 50% 120%, #2a2a4a 0, var(--night) 60%); }
.scr-top { display: flex; justify-content: space-between; align-items: center; padding: 1.1em 1.6em; gap: 1em; }
.scr-top .place { font: 600 1.5em/1.1 var(--display); }
.scr-top .place small { display: block; font: 500 .55em/1.4 var(--font); color: var(--ink-soft); }
.scr-top .join { color: var(--ink-soft); text-align: right; }
.scr-top .join b { color: var(--wax); font: 600 1.6em/1 var(--display); letter-spacing: .15em; }
.scr-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 2em; align-items: center; padding: 0 2em; min-height: 0; }
.scr-main.road-mode { grid-template-columns: 1fr; grid-template-rows: auto 1fr; justify-items: center; gap: .5em; }
.scr-main.road-mode .scr-visual { width: min(100%, 60em); }
.scr-main.road-mode .scr-card { width: min(100%, 40em); }
.scr-main.solo { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.scr-visual { display: grid; place-items: center; min-height: 0; }
.scr-card { min-width: 0; }
.scr .qcard { padding: 1.4em 1.6em; border-radius: 22px; max-width: 30em; }
.scr .qcard .text { font-size: 2.6em; }
.scr .qcard .meta { font-size: .8em; }
.scr .headline { font-size: 1.6em; }
.scr .candle .stick { height: 90px; width: 22px; }
.scr .candle .wax { height: calc(var(--left, 1) * 74px + 6px); }
.scr .candle .time { font-size: 1.6em; }
.scr .bars { max-width: 28em; }
.scr .cloud span { font-size: calc(1.2em + var(--n) * .5em); }
.scr-bottom { padding: 1em 1.6em 1.3em; display: flex; justify-content: space-between; align-items: center; gap: 1em; }
.scr .people .who { font-size: .9em; }
.scr .ring { position: relative; width: 26em; height: 26em; max-width: 42vw; max-height: 56vh; }
.scr .ring .fire { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); }
.scr .ring .seat { position: absolute; transform: translate(-50%, -50%); text-align: center; font-size: .8em; width: 7em; }
.scr .ring .seat .ava { font-size: 1.3em; }
.scr .ring .seat.speaking .ava { box-shadow: 0 0 0 4px var(--wax), 0 0 30px rgba(240,207,126,.6); }
.scr .ring .seat small { display: block; color: var(--ink-soft); margin-top: .3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scr-lobby { display: grid; grid-template-columns: auto 1fr; gap: 3em; align-items: center; padding: 0 3em; }
.scr-lobby .qr { background: #fff; padding: 1em; border-radius: 20px; width: 15em; }
.scr-lobby .qr img { display: block; width: 100%; }
.scr-lobby .bigcode { font: 600 4.5em/1 var(--display); letter-spacing: .2em; color: var(--wax); }
.scr-lobby .rules { list-style: none; padding: 0; margin: 1.2em 0; display: grid; gap: .5em; font: 500 1.5em/1.2 var(--display); }
.scr-lobby .rules li::before { content: '🕯️ '; }
.scr .soundbtn { position: fixed; right: 14px; bottom: 14px; z-index: 30; opacity: .45; }
.scr .soundbtn:hover { opacity: 1; }
.scr .fly span { font-size: 3.4em; }
.scr .announce { position: fixed; inset: 0; display: grid; place-items: end center; padding-bottom: 7vh; z-index: 35; pointer-events: none; }
.scr .announce div { background: rgba(22,28,51,.92); border: 1px solid var(--wax-deep); padding: 1em 2em; border-radius: 30px; font: 600 2.6em/1.1 var(--display); color: var(--wax); animation: pop 6s ease forwards; }
.scr .hint { color: var(--wax); font-weight: 600; }

/* 8. chronicle */
.chron-head { padding: 24px 0 10px; }
.chron-head p { color: var(--ink-soft); max-width: 60ch; }
.totals { display: flex; flex-wrap: wrap; gap: 24px; margin: 18px 0 8px; }
.totals div b { display: block; font: 600 2.2rem/1 var(--display); color: var(--wax); }
.totals div span { color: var(--ink-soft); font-size: .9rem; }
.trail { position: relative; margin: 30px 0; padding-left: 46px; }
.trail::before { content: ''; position: absolute; left: 21px; top: 10px; bottom: 10px; border-left: 3px dashed #4a527a; }
.station { position: relative; margin-bottom: 26px; }
.station .pin { position: absolute; left: -46px; top: 6px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem;
  background: hsl(var(--h, 40) 40% 26%); box-shadow: 0 0 0 3px var(--night), 0 0 0 5px hsl(var(--h, 40) 60% 60% / .7); }
.station.future .pin { background: var(--night-2); box-shadow: 0 0 0 3px var(--night), 0 0 0 5px #4a527a; filter: grayscale(1); }
.station a.evcard { display: block; text-decoration: none; color: var(--ink); background: var(--night-2); border: 1px solid var(--night-3); border-radius: var(--radius); padding: 16px 18px; }
.station a.evcard:hover { border-color: hsl(var(--h, 40) 60% 60%); color: var(--ink); }
.evcard .when { color: var(--ink-soft); font-size: .9rem; }
.evcard h3 { margin: .15em 0 .3em; font-size: 1.55rem; }
.evcard .place { color: var(--ink-soft); }
.evcard .crowd { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.evcard .crowd .ava { font-size: .78rem; }
.evcard .nums { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; color: var(--ink-soft); font-size: .92rem; }
.station.future .evcard { background: transparent; border-style: dashed; color: var(--ink-soft); }
.ev-hero { --h: 40; border-radius: 26px; padding: 34px 24px; margin: 10px 0 24px; text-align: center; position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, hsl(var(--h) 55% 34%), hsl(var(--h) 35% 16%) 70%); border: 1px solid hsl(var(--h) 50% 45% / .5); }
.ev-hero .icon { font-size: 3.4rem; display: block; }
.ev-hero h1 { margin: .2em 0 .15em; }
.ev-hero .place { font: 500 1.25rem/1.3 var(--display); color: #f4e9cf; }
.ev-hero .when { color: #e2d9c4; margin-top: 8px; }
.chronicle-text { font: 500 1.35rem/1.5 var(--display); color: #f6efdc; max-width: 40em; margin: 0 auto 24px; text-align: center; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.badge { display: flex; gap: 12px; align-items: center; background: var(--night-2); border: 1px solid var(--night-3); border-radius: 14px; padding: 10px 12px; }
.badge .i { font-size: 1.6rem; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #2b3459; flex: none; }
.badge b { display: block; }
.badge span { color: var(--ink-soft); font-size: .88rem; }
.qlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.qlist li { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; background: var(--night-2); border-radius: 12px; }
.qlist li .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; transform: translateY(1px); }
.pager { display: flex; justify-content: space-between; gap: 10px; margin: 30px 0; }
.stamps { display: flex; flex-wrap: wrap; gap: 12px; }
.stamp { --h: 40; width: 112px; text-align: center; text-decoration: none; color: var(--ink); }
.stamp .ring { width: 92px; height: 92px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem;
  border: 3px double hsl(var(--h) 60% 62%); background: hsl(var(--h) 35% 20%); transform: rotate(-8deg); }
.stamp:nth-child(even) .ring { transform: rotate(6deg); }
.stamp small { display: block; color: var(--ink-soft); font-size: .8rem; line-height: 1.3; }

/* 9. motion */
@keyframes flick { 0%, 100% { transform: scaleY(1) rotate(-1deg); } 50% { transform: scaleY(1.12) rotate(2deg); } }
@keyframes flickout { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@keyframes flame { 0%, 100% { transform: scale(1, 1) skewX(0); } 33% { transform: scale(.96, 1.06) skewX(2deg); } 66% { transform: scale(1.03, .96) skewX(-2deg); } }
@keyframes rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 12% { opacity: 1; transform: translateY(-30px) scale(1.1); } 100% { transform: translateY(-70vh) scale(1); opacity: 0; } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes pop { 0% { transform: scale(.8); opacity: 0; } 8% { transform: scale(1.04); opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .fly span { display: none; }
}

@media (max-width: 720px) {
  .scr-main { grid-template-columns: 1fr; }
  .scr-lobby { grid-template-columns: 1fr; padding: 1em; }
}
@media (min-width: 760px) {
  .qcard .text { font-size: 2rem; }
}
