/* AVALON — one stylesheet for the phone client and the dev table's panels.
   Theme: "candlelit hall" — deep teal stone, parchment text, gold accents; the
   art (teal & gold costumes, gold tokens) sits on it natively.
   Alignment colours (good/evil) appear ONLY in .over / .rolelist / .evilteam /
   .howto team blocks, i.e. where alignment is already public (§9.3). */
:root {
  --bg: #0b1a21; --bg2: #112730; --card: #15313b; --line: #26505b; --ink: #f4ecd8; --mut: #9fb9be;
  --gold: #d9a441; --gold2: #f3c86b; --gold-ink: #24170a; --teal: #2fb8a6; --teal-dk: #1b6f66;
  --ok: #3ad29a; --no: #ff5c74; --good: #5aa9ff; --evil: #ff5c74; --warn: #ffb43a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Thai", "Sarabun", Helvetica, Arial, sans-serif;
  background: radial-gradient(900px 640px at 50% -10%, #1c4350, var(--bg) 70%);
  color: var(--ink); -webkit-font-smoothing: antialiased; min-height: 100vh;
}
.app { max-width: 560px; margin: 0 auto; padding: 14px 16px 56px; }
.client { position: relative; }
button { font: inherit; font-weight: 800; border: 0; border-radius: 14px; padding: 14px 18px; cursor: pointer; background: linear-gradient(180deg, var(--gold2), var(--gold)); color: var(--gold-ink); font-size: 17px; min-height: 44px; box-shadow: 0 2px 0 #8a6420, 0 6px 16px rgba(0,0,0,.35); }
button:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
button.big { width: 100%; font-size: 20px; padding: 17px; margin-top: 10px; }
button.sec { background: var(--bg2); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
button.danger { background: linear-gradient(180deg, #ff7a8d, var(--no)); color: #2a0710; box-shadow: 0 2px 0 #8a2030, 0 6px 16px rgba(0,0,0,.35); }
button.small-btn { padding: 10px 14px; font-size: 15px; margin-top: 8px; }
button.mini { padding: 4px 6px; min-height: 30px; min-width: 30px; background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }
button.mini.x { color: var(--mut); }
.linkish { background: transparent; color: var(--mut); padding: 6px 8px; font-size: 14px; font-weight: 700; min-height: 32px; box-shadow: none; }
.linkish.warnlink { color: var(--warn); }
input { font: inherit; width: 100%; background: var(--bg); color: var(--ink); border: 2px solid var(--line); border-radius: 12px; padding: 13px 15px; font-size: 18px; }
input:focus { outline: none; border-color: var(--gold); }
input.codein { text-transform: uppercase; letter-spacing: .25em; font-weight: 800; }
.mut { color: var(--mut); }
.small { font-size: 13px; }
.center { text-align: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 12px 0; }
.tag { font-size: 12px; color: var(--mut); text-transform: uppercase; letter-spacing: .14em; font-weight: 800; margin-bottom: 8px; }
label.tag { display: block; }
.orr { text-align: center; color: var(--mut); font-size: 13px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; margin: 22px 0 10px; }
.grid { display: grid; gap: 10px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.one { grid-template-columns: 1fr; }
.ic { width: 1.05em; height: 1.05em; vertical-align: -.16em; fill: currentColor; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-family: Georgia, "Times New Roman", serif; font-size: 30px; letter-spacing: .04em; margin: 0; font-weight: 700; color: var(--gold2); text-shadow: 0 2px 12px rgba(217,164,65,.35); }
.brand .logo { width: 28px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(243,200,107,.5)); }
.brand.small h1 { font-size: 19px; }
.brand.small .logo { width: 20px; height: 20px; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.top-r { display: flex; align-items: center; gap: 6px; }
.codechip { font-weight: 900; letter-spacing: .18em; color: var(--gold2); background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.code { font-family: Georgia, serif; font-size: 52px; font-weight: 700; letter-spacing: .2em; color: var(--gold2); background: var(--bg2); border: 2px solid var(--line); border-radius: 16px; padding: 10px 20px; display: inline-block; margin: 4px 0 10px; }
.hero { display: block; width: 100%; max-width: 480px; margin: -6px auto 4px; filter: drop-shadow(0 12px 30px rgba(0,0,0,.5)); }
.hero.small { max-width: 300px; margin: 0 auto 2px; }
.qr { display: block; margin: 6px auto; border-radius: 12px; background: #fff; padding: 8px; }
.link { font-size: 14px; font-weight: 700; word-break: break-all; color: var(--mut); margin: 6px 0 10px; }
.notice, .awaybar { background: #3a2a00; border: 1px solid var(--warn); color: var(--warn); border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px; margin: 10px 0; text-align: center; }
.warn { color: var(--warn); font-weight: 700; font-size: 14px; margin: 8px 0; }
.summary { margin: 10px 0 0; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px); background: var(--card); border: 1px solid var(--gold); color: var(--ink); padding: 12px 18px; border-radius: 12px; font-weight: 800; opacity: 0; pointer-events: none; transition: .25s; z-index: 90; box-shadow: 0 10px 28px rgba(0,0,0,.45); max-width: 88vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.foot { margin-top: 18px; }
.hidden { display: none; }

/* avatars */
.av { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: radial-gradient(circle at 50% 40%, #234c57, #122630); border: 2px solid var(--line); display: inline-block; vertical-align: middle; }
.av.sm { width: 38px; height: 38px; }
.av.xs { width: 26px; height: 26px; border-width: 1px; }

/* lobby: seats */
.seatlist { display: flex; flex-direction: column; gap: 6px; }
.seat { display: flex; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; min-height: 52px; touch-action: pan-y; }
.seat.away { opacity: .5; }
.seat.dragging { outline: 2px solid var(--gold); }
.seat .num { width: 20px; color: var(--mut); font-weight: 800; font-size: 13px; text-align: center; }
.seat .nm { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .nm em { color: var(--mut); font-style: normal; font-size: 12px; }
.seat .botlbl { border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.hostlbl { color: var(--gold); display: inline-flex; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.off { background: var(--line); }
.seatctl { display: flex; align-items: center; gap: 4px; }
.handle { color: var(--mut); padding: 6px 4px; cursor: grab; touch-action: none; display: inline-flex; }
.handle .ic { width: 1.2em; height: 1.2em; }
.avgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.avpick { background: var(--bg2); border: 2px solid var(--line); padding: 4px; border-radius: 14px; min-height: 0; box-shadow: none; }
.avpick .av { width: 100%; height: auto; aspect-ratio: 1; border: 0; }
.avpick.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(217,164,65,.35); }
.avpick.taken { opacity: .3; }
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.roletog { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--bg2); border: 2px solid var(--line); border-radius: 14px; padding: 8px 4px; color: var(--mut); font-weight: 800; font-size: 13px; min-height: 0; box-shadow: none; }
.roletog img { width: 46px; height: 46px; object-fit: contain; filter: grayscale(1) brightness(.6); }
.roletog.on { color: var(--ink); border-color: var(--gold); }
.roletog.on img { filter: none; }
.roletog.locked { border-style: dashed; }
.roletog small { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--mut); }
.dial { margin: 8px 0; }
.dlabel { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button, .seg span { padding: 8px 12px; font-size: 14px; border-radius: 10px; min-height: 36px; font-weight: 800; display: inline-flex; align-items: center; box-shadow: none; }
.seg .on { background: var(--teal-dk); color: #fff; border: 1px solid var(--teal); }
.seg .off { background: var(--bg2); color: var(--mut); border: 1px solid var(--line); }
.lead-list { display: flex; flex-direction: column; }
.lead { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
.lead:last-child { border-bottom: 0; }
.lead .nm { flex: 1; }
.lead b { color: var(--gold2); }
.lead.gone { opacity: .5; }

/* tokens & art */
.tok { width: 22px; height: 22px; object-fit: contain; display: inline-block; vertical-align: middle; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.tok.big { width: 48px; height: 48px; }
.crownimg { width: 30px; height: 26px; object-fit: contain; }
.grail { width: 34px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }

/* the board */
.qtrack { display: flex; justify-content: space-between; gap: 6px; margin: 8px 0 4px; }
.qn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.qcirc { width: 50px; height: 50px; border-radius: 50%; border: 3px solid var(--line); background: var(--bg2); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--mut); }
.qn.cur .qcirc { border-color: var(--gold); color: var(--gold2); animation: glow 1.8s infinite; }
.qn.success .qcirc { border-color: var(--ok); background: rgba(58,210,154,.12); }
.qn.fail .qcirc { border-color: var(--no); background: rgba(255,92,116,.12); }
.qlbl { font-size: 11px; color: var(--mut); font-weight: 800; min-height: 14px; }
.qlbl .o { font-weight: 900; }
.qn.success .qlbl .o { color: var(--ok); } .qn.fail .qlbl .o { color: var(--no); }
.twofail { background: var(--bg2); border: 1px solid var(--no); color: var(--no); border-radius: 6px; padding: 0 4px; margin-left: 3px; font-size: 10px; }
@keyframes glow { 0%,100% { box-shadow: 0 0 8px rgba(217,164,65,.3); } 50% { box-shadow: 0 0 18px rgba(217,164,65,.7); } }
.vtrack { display: flex; align-items: center; gap: 6px; margin: 6px 0 4px; flex-wrap: wrap; }
.vlbl { font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .1em; font-weight: 800; margin-right: 4px; }
.pip { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: transparent; }
.pip.on { background: var(--no); border-color: var(--no); }
.vtrack.alarm .pip.on { animation: pulse 1s infinite; }
.vwarn { color: var(--no); font-weight: 800; font-size: 13px; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.ring { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 62px; padding: 10px 2px 4px; border-radius: 14px; background: transparent; border: 2px solid transparent; color: var(--ink); font-weight: 700; min-height: 0; box-shadow: none; }
.tile .tnm { font-size: 11px; max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.away { opacity: .45; }
.tile.team { border-color: var(--teal); background: rgba(47,184,166,.14); }
.tile.sel { border-color: var(--gold); background: rgba(217,164,65,.18); }
.tile .crown { display: none; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); filter: drop-shadow(0 2px 3px rgba(0,0,0,.7)); z-index: 1; }
.tile.leader .crown { display: block; }
.tile.leader .av { border-color: var(--gold); }
.tile.me .tnm { text-decoration: underline; text-decoration-color: var(--gold); }
.ring.picking .tile { background: var(--bg2); border-color: var(--line); cursor: pointer; }
.ring.picking .tile.sel { border-color: var(--gold); background: rgba(217,164,65,.22); }
.vbadge { position: absolute; right: -2px; bottom: 14px; }
.vbadge .tok { width: 26px; height: 26px; }

.phase .q { font-size: 20px; font-weight: 800; line-height: 1.3; margin: 6px 0 12px; }
.strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 4px; font-weight: 700; font-size: 14px; }
.strip.evilteam .chip { border-color: var(--evil); }
.votebtns { margin: 8px 0; }
button.vote { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 10px; font-size: 18px; border: 3px solid transparent; min-height: 120px; background: var(--bg2); color: var(--ink); box-shadow: none; }
button.vote .tok { width: 64px; height: 64px; transition: transform .15s; }
button.vote.ap { border-color: rgba(58,210,154,.35); }
button.vote.rj { border-color: rgba(255,92,116,.35); }
button.vote.ap.on { border-color: var(--ok); background: rgba(58,210,154,.18); }
button.vote.rj.on { border-color: var(--no); background: rgba(255,92,116,.18); }
button.vote.on .tok { transform: scale(1.12); }
.peekrow { width: 100%; background: var(--bg2); color: var(--ink); border: 1px solid var(--line); padding: 12px; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: none; }
.rolebox { cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0 10px; }
.cardback { width: 160px; height: auto; border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.5); animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
.tapnote { color: var(--mut); font-size: 13px; font-weight: 700; }
.confirm { background: var(--bg2); border: 1px solid var(--no); border-radius: 14px; padding: 12px; margin-top: 8px; }

/* overlays: role card, vote reveal, quest reveal, how to play */
.overlay { position: fixed; inset: 0; background: rgba(6,14,18,.97); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 60; display: flex; flex-direction: column; align-items: center; padding: 16px; overflow: auto; }
.overlay > * { margin: auto 0; flex: none; }
.client.embedded .overlay { position: absolute; }
.rolecard { width: 100%; max-width: 360px; background: linear-gradient(180deg, #1c4350, #112730); border: 3px solid var(--gold); border-radius: 22px; padding: 14px 16px 12px; text-align: center; box-shadow: 0 0 40px rgba(217,164,65,.25), 0 20px 60px rgba(0,0,0,.6); animation: pop .35s cubic-bezier(.2,1.4,.4,1) both; }
.rolecard .art { width: 100%; max-height: 240px; object-fit: contain; filter: drop-shadow(0 8px 20px rgba(255,190,90,.25)); }
.rname { font-family: Georgia, serif; font-size: 30px; font-weight: 700; color: var(--gold2); letter-spacing: .04em; margin-top: 4px; }
.rdesc { font-size: 15px; line-height: 1.4; margin: 6px 0 8px; }
.know { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px; text-align: left; }
.klbl { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--mut); font-weight: 800; margin-bottom: 6px; }
.know .strip { justify-content: center; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } }
.reveal { text-align: center; max-width: 420px; width: 100%; animation: pop .4s both; }
.rbig { display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.rbig .tok { width: 130px; height: 130px; filter: drop-shadow(0 10px 24px rgba(0,0,0,.6)); }
.rbig .grail { width: 120px; height: 170px; filter: drop-shadow(0 10px 24px rgba(0,0,0,.6)); }
.rtitle { font-family: Georgia, serif; font-size: 36px; font-weight: 700; }
.reveal.ok .rtitle { color: var(--ok); } .reveal.no .rtitle { color: var(--no); } .reveal.beat .rtitle { color: var(--gold2); }
.rsub { color: var(--mut); font-weight: 700; margin-top: 4px; }
.votegrid { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.vg { position: relative; padding: 6px; border-radius: 12px; border: 2px solid transparent; }
.vg.team { border-color: var(--teal); }
.vb { position: absolute; right: -2px; bottom: -2px; }
.vb .tok { width: 26px; height: 26px; }
.dots { font-size: 40px; color: var(--gold2); display: flex; justify-content: center; gap: 12px; }
.dots span { animation: blink 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: .4s; } .dots span:nth-child(3) { animation-delay: .8s; }
@keyframes blink { 0%,100% { opacity: .2; } 50% { opacity: 1; } }
.failcards { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.fc { width: 48px; height: 64px; border-radius: 8px; display: flex; align-items: center; justify-content: center; border: 2px solid; background: var(--bg2); animation: pop .5s both; }
.fc.fail { border-color: var(--no); } .fc.ok { border-color: var(--ok); }
.fc .tok { width: 34px; height: 34px; }

/* history grid */
.hist { padding: 10px 8px; }
.hscroll { overflow-x: auto; }
.hgrid { border-collapse: separate; border-spacing: 2px; font-size: 12px; margin: 0 auto; }
.hgrid th, .hgrid td { text-align: center; padding: 1px; }
.hgrid th .av { display: block; margin: 0 auto; }
.hl { color: var(--mut); font-weight: 800; padding-right: 4px !important; white-space: nowrap; }
.hc { width: 30px; height: 30px; border-radius: 8px; background: var(--bg2); border: 2px solid transparent; }
.hc.team { border-color: var(--teal); }
.hc.lead { box-shadow: inset 0 0 0 2px var(--gold); }
.hv { display: inline-flex; align-items: center; justify-content: center; }
.hv .tok { width: 20px; height: 20px; }
.hv.none { color: var(--mut); }
.ho { padding-left: 6px !important; white-space: nowrap; }
.qo { display: inline-flex; align-items: center; justify-content: center; margin-left: 3px; }
.qo .grail { width: 16px; height: 22px; }

/* game over — alignment colours are allowed here */
.over { text-align: center; padding: 8px 0 12px; }
.banner { width: 100%; max-width: 420px; display: block; margin: -4px auto 4px; filter: drop-shadow(0 0 22px rgba(243,200,107,.28)) drop-shadow(0 12px 28px rgba(0,0,0,.55)); animation: pop .5s both; }
.over.good .rtitle { color: var(--good); } .over.evil .rtitle { color: var(--evil); }
.rolelist { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.rl { display: flex; align-items: center; gap: 10px; background: var(--bg2); border-radius: 12px; padding: 5px 10px; border-left: 5px solid; }
.rl.good { border-color: var(--good); } .rl.evil { border-color: var(--evil); }
.rl .nm { flex: 1; font-weight: 800; }
.rl .rn { color: var(--mut); font-weight: 700; font-size: 14px; }
.mini-art { width: 34px; height: 34px; object-fit: contain; }
.gain { color: var(--gold2); margin-left: 6px; }

/* how to play */
.howto { width: 100%; max-width: 440px; background: var(--card); border: 2px solid var(--gold); border-radius: 20px; padding: 16px; animation: pop .3s both; }
.howto h2 { font-family: Georgia, serif; color: var(--gold2); font-size: 24px; margin: 0 0 4px; }
.howto h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .12em; color: var(--mut); margin: 18px 0 8px; }
.howto p { margin: 6px 0; line-height: 1.45; font-size: 15px; }
.howto .teamrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.howto .rolecell { background: var(--bg2); border-radius: 12px; padding: 8px 6px; text-align: center; font-size: 12px; border-top: 4px solid var(--line); }
.howto .rolecell img { width: 64px; height: 64px; object-fit: contain; display: block; margin: 0 auto 4px; }
.howto .rolecell b { display: block; font-size: 13px; }
.howto .good .rolecell { border-color: var(--good); } .howto .evil .rolecell { border-color: var(--evil); }
.howto .steps { display: flex; flex-direction: column; gap: 8px; }
.howto .step { display: flex; align-items: center; gap: 12px; background: var(--bg2); border-radius: 12px; padding: 8px 10px; }
.howto .step .n { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); font-weight: 900; display: flex; align-items: center; justify-content: center; flex: none; }
.howto .step img { width: 40px; height: 44px; object-fit: contain; flex: none; }
.howto .step .txt { font-size: 14px; line-height: 1.35; }
.howto .wins { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.howto .win { border-radius: 12px; padding: 10px; background: var(--bg2); border-top: 4px solid; font-size: 13px; }
.howto .win.good { border-color: var(--good); } .howto .win.evil { border-color: var(--evil); }
.howto .win b { display: block; font-size: 15px; margin-bottom: 4px; }
.howto .win img { width: 34px; height: 40px; object-fit: contain; display: block; margin: 0 0 6px; }
.howto .close { margin-top: 14px; width: 100%; }

/* read-only mirror (dev table "remote" seats) */
.client.readonly [data-act]:not([data-act="lang"]):not([data-act="howto"]):not([data-act="close-howto"]) { pointer-events: none; }
.client.readonly .ring.picking .tile { cursor: default; }
.reveal .strip { justify-content: center; }
.reveal .tag { margin-top: 10px; }

/* ── cinematic flow: one big thing per screen ─────────────────────────────── */
.strip-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 10px; }
.qmini { display: flex; gap: 6px; }
.qm { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg2); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: var(--mut); font-weight: 800; }
.qm .grail { width: 18px; height: 24px; }
.qm.cur { border-color: var(--gold); color: var(--gold2); animation: glow 1.8s infinite; }
.qm.success { border-color: var(--ok); } .qm.fail { border-color: var(--no); }
.vmini { display: flex; gap: 5px; }
.vmini .pip { width: 11px; height: 11px; }
.vmini.alarm .pip.on { animation: pulse 1s infinite; }
.rows { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.scene { min-height: 52vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px 0; animation: fadein .35s both; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--mut); font-weight: 800; margin-bottom: 10px; }
.big-title { font-family: Georgia, serif; font-size: 26px; line-height: 1.2; color: var(--ink); margin: 10px 0 12px; max-width: 420px; }
.talk { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--gold2); font-weight: 800; font-size: 15px; margin: 6px 0 10px; }
.talk .ic { width: 1.3em; height: 1.3em; }
.stage-sub { color: var(--mut); font-weight: 700; margin-top: 10px; font-size: 16px; }
.scene .ring { margin: 6px 0 10px; }
.scene .votebtns { width: 100%; max-width: 420px; }
.scene .grid.one { max-width: 260px; }
.cardin { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; font-size: 18px; margin: 10px 0; }
.cardin .grail { width: 70px; height: 96px; }

.bigav { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; margin: 6px 0; }
.bigav .av.huge { width: 128px; height: 128px; border-width: 4px; border-color: var(--gold); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.bigav.sm .av.huge { width: 72px; height: 72px; border-width: 3px; }
.bigav .crownimg.big { width: 64px; height: 54px; position: absolute; top: -34px; left: 50%; transform: translateX(-50%); filter: drop-shadow(0 4px 6px rgba(0,0,0,.7)); }
.bigav.sm .crownimg.big { width: 40px; height: 34px; top: -22px; }
.bigav .banm { font-weight: 900; font-size: 20px; }
.bigav.sm .banm { font-size: 15px; }
.faces { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 8px 0; }
.face { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 800; font-size: 13px; animation: pop .45s both; }
.faces.lg .face .av { width: 96px; height: 96px; border-width: 3px; border-color: var(--teal); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.faces.md .face .av { width: 68px; height: 68px; border-color: var(--teal); }
.faces.sm .face .av { width: 44px; height: 44px; }
.faces .face:nth-child(2) { animation-delay: .12s; } .faces .face:nth-child(3) { animation-delay: .24s; } .faces .face:nth-child(4) { animation-delay: .36s; } .faces .face:nth-child(5) { animation-delay: .48s; }

.stage { position: fixed; inset: 0; z-index: 55; background-color: var(--bg); background-image: radial-gradient(700px 500px at 50% 30%, #1c4350, var(--bg) 75%); display: flex; align-items: center; justify-content: center; padding: 24px 18px; overflow: auto; cursor: pointer; }
.client.embedded .stage { position: absolute; }
.stage-in { width: 100%; max-width: 440px; text-align: center; display: flex; flex-direction: column; align-items: center; animation: fadein .3s both; margin: auto 0; }
.stage .skip { margin-top: 26px; opacity: .6; }
.drum .big-title { font-size: 30px; }
.tok.huge { width: 150px; height: 150px; filter: drop-shadow(0 14px 30px rgba(0,0,0,.6)); }
.grail.huge { width: 130px; height: 180px; filter: drop-shadow(0 14px 30px rgba(0,0,0,.6)); }
.voter { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: pop .4s cubic-bezier(.2,1.4,.4,1) both; }
.voter .vname { font-family: Georgia, serif; font-size: 34px; font-weight: 700; }
.vword { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 30px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; animation: pop .35s .15s both; }
.vword.approve { color: var(--ok); } .vword.reject { color: var(--no); }
.vdots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 22px; }
.vd { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; }
.vd .tok { width: 22px; height: 22px; }
.vd.approve { border-color: var(--ok); } .vd.reject { border-color: var(--no); }
.tally { display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 44px; font-weight: 900; margin: 10px 0 14px; }
.tally .tok { width: 44px; height: 44px; margin-right: 6px; }
.tally .ap { color: var(--ok); } .tally .rj { color: var(--no); } .tally .vs { color: var(--mut); font-size: 20px; font-weight: 700; }
.tally.big { font-size: 30px; }
.stage .votegrid .vg em { display: block; font-style: normal; font-size: 10px; color: var(--mut); max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verdict { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: pop .5s cubic-bezier(.2,1.4,.4,1) both; margin-bottom: 14px; }
.verdict .rtitle { font-size: 42px; }
.verdict.ok .rtitle { color: var(--ok); } .verdict.no .rtitle { color: var(--no); }
.bigcards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 14px 0; }
.bc { width: 84px; height: 118px; border-radius: 12px; border: 3px solid var(--line); background: var(--bg2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 800; font-size: 12px; transition: transform .3s; }
.bc .minicard { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.bc.down { padding: 0; border-color: transparent; }
.bc .grail { width: 44px; height: 60px; }
.bc.up.success { border-color: var(--ok); color: var(--ok); background: rgba(58,210,154,.12); }
.bc.up.fail { border-color: var(--no); color: var(--no); background: rgba(255,92,116,.14); }
.bc.fresh { animation: flipin .6s cubic-bezier(.2,1.2,.4,1) both; }
@keyframes flipin { 0% { transform: rotateY(90deg) scale(.8); opacity: 0; } 100% { transform: none; opacity: 1; } }
.scoretrack { display: flex; justify-content: center; gap: 10px; margin: 10px 0; }
.st { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--line); background: var(--bg2); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--mut); font-weight: 800; }
.st .grail { width: 28px; height: 38px; }
.st.success { border-color: var(--ok); } .st.fail { border-color: var(--no); }
.st.just { animation: pop .7s .2s cubic-bezier(.2,1.4,.4,1) both; box-shadow: 0 0 24px rgba(243,200,107,.5); }
.sheet { width: 100%; max-width: 480px; background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 14px; animation: pop .3s both; }
.sheet .close { margin-top: 12px; width: 100%; }
.sheet .hist { margin: 8px 0 0; }

/* lobby: house dials collapsed by default */
.dialsrow { flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 10px 14px; margin: 12px 0; }
.dialsrow .tag { margin: 0; display: flex; align-items: center; gap: 6px; }
.dialsrow .dsum { font-size: 13px; color: var(--mut); font-weight: 600; line-height: 1.35; }
.dialsrow .ic { position: absolute; right: 12px; top: 12px; color: var(--mut); }
.dialsrow { position: relative; }
.dialsclose { width: 100%; text-align: left; padding: 0 0 8px; color: var(--mut); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; }
