@font-face { font-family: 'Cinzel Decorative'; font-weight: 700; font-display: swap; src: url(fonts/cinzel-decorative-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Cinzel Decorative'; font-weight: 900; font-display: swap; src: url(fonts/cinzel-decorative-latin-900-normal.woff2) format('woff2'); }
@font-face { font-family: 'IM Fell English'; font-style: normal; font-display: swap; src: url(fonts/im-fell-english-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IM Fell English'; font-style: italic; font-display: swap; src: url(fonts/im-fell-english-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'Creepster'; font-display: swap; src: url(fonts/creepster-latin-400-normal.woff2) format('woff2'); }

:root {
  --ink: #e8dcc0;
  --ink-dim: #a8957a;
  --gold: #d4a94f;
  --gold-hi: #ffe2a0;
  --blood: #a3101c;
  --blood-hi: #ff2b3a;
  --ecto: #7dffb4;
  --hex: #a65cff;
  --salt: #f2f6ff;
  --bg: #050304;
  --panel: rgba(16, 9, 8, .92);
  --card-w: min(19vw, 92px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; overscroll-behavior: none; }
body { font-family: 'IM Fell English', Georgia, serif; font-size: 17px; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button { font: inherit; color: inherit; }
input { font: inherit; -webkit-user-select: text; user-select: text; }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
#vignette { position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 35%, rgba(0,0,0,.55) 70%, rgba(0,0,0,.92) 100%);
  animation: flicker 6s infinite steps(1); }
#flash { position: fixed; inset: 0; z-index: 60; pointer-events: none; background: #fff; opacity: 0; }
@keyframes flicker { 0%,100% { opacity: 1 } 41% { opacity: .85 } 42% { opacity: 1 } 77% { opacity: .9 } 78% { opacity: 1 } 79% { opacity: .8 } 80% { opacity: 1 } }

#app { position: fixed; inset: 0; z-index: 2; }
#app.shake { animation: shake .5s cubic-bezier(.36,.07,.19,.97) both; }
#app.shake-hard { animation: shake-hard .9s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake { 10%,90% { transform: translate3d(-2px,1px,0) } 20%,80% { transform: translate3d(4px,-2px,0) } 30%,50%,70% { transform: translate3d(-7px,3px,0) rotate(-.6deg) } 40%,60% { transform: translate3d(7px,-3px,0) rotate(.6deg) } }
@keyframes shake-hard { 0%,100% { transform: none } 10% { transform: translate(-14px,6px) rotate(-2deg) scale(1.03) } 20% { transform: translate(12px,-10px) rotate(2deg) } 30% { transform: translate(-16px,4px) rotate(-1deg) scale(1.05) } 40% { transform: translate(10px,12px) rotate(2deg) } 50% { transform: translate(-8px,-6px) } 60% { transform: translate(6px,4px) rotate(-1deg) } 75% { transform: translate(-3px,2px) } }

.screen { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; overflow: hidden; }
.screen.active { display: flex; animation: fadein .8s ease both; }
@keyframes fadein { from { opacity: 0; filter: blur(6px) } to { opacity: 1; filter: none } }

/* ---------- buttons ---------- */
.btn { border: 0; cursor: pointer; padding: 12px 22px; border-radius: 10px; letter-spacing: .04em; position: relative; transition: transform .12s, filter .2s, opacity .3s; font-family: 'Cinzel Decorative', serif; font-weight: 700; font-size: 15px; }
.btn:active { transform: scale(.95); }
.btn:disabled { opacity: .35; filter: grayscale(1); pointer-events: none; }
.btn.big { font-size: 18px; padding: 16px 26px; }
.btn-blood { color: #ffe9e4; background: linear-gradient(180deg, #c3182a, #6d0710 70%, #3e0308); box-shadow: 0 0 0 1px #ff5a5a55 inset, 0 2px 0 #ff8a8a44 inset, 0 8px 24px rgba(200,0,20,.45), 0 0 40px rgba(255,0,30,.15); text-shadow: 0 1px 2px #000; }
.btn-gold { color: #2a1708; background: linear-gradient(180deg, #ffe39c, #d4a94f 45%, #8a5f1f); box-shadow: 0 0 0 1px #fff3 inset, 0 8px 22px rgba(212,169,79,.35); text-shadow: 0 1px 0 #ffeebb88; }
.btn-ghost { color: var(--ink); background: rgba(255,255,255,.04); box-shadow: 0 0 0 1px rgba(232,220,192,.25) inset; backdrop-filter: blur(4px); }
.btn-link { background: none; color: var(--ink-dim); font-family: 'IM Fell English', serif; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 1px #ff5a5a55 inset, 0 8px 24px rgba(200,0,20,.45), 0 0 30px rgba(255,0,30,.15) } 50% { box-shadow: 0 0 0 1px #ff5a5a99 inset, 0 8px 34px rgba(255,0,30,.7), 0 0 70px rgba(255,0,30,.35) } }

/* ---------- title + menu ---------- */
.title-art { position: absolute; inset: 0; background: #000 url(art/title.webp) center/cover no-repeat; animation: slowzoom 40s ease-in-out infinite alternate; }
.title-art.dim { filter: brightness(.45) saturate(.8); }
.title-art.dimmer { filter: brightness(.25) blur(2px); }
@keyframes slowzoom { from { transform: scale(1.02) } to { transform: scale(1.15) translateY(-2%) } }
.title-inner, .menu-inner, .lobby-inner { position: relative; z-index: 2; width: 100%; max-width: 440px; padding: calc(28px + var(--safe-t)) 22px calc(24px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; height: 100%; }
.title-inner { justify-content: space-between; }
.logo { margin: 7vh 0 0; font-family: 'Cinzel Decorative', serif; font-weight: 900; text-align: center; line-height: .9; display: flex; flex-direction: column;
  font-size: clamp(48px, 16vw, 78px); color: #f3e3c3; letter-spacing: .02em;
  text-shadow: 0 0 6px #ff3a2a, 0 0 22px #b3000f, 0 0 60px #6d0008, 0 4px 0 #2a0004; animation: logo-flicker 7s infinite; }
.logo span:last-child { font-size: .78em; letter-spacing: .18em; color: #e9c98a; }
.logo.small { margin-top: 2vh; font-size: clamp(34px, 11vw, 50px); }
@keyframes logo-flicker { 0%,100% { opacity: 1 } 3% { opacity: .4 } 4% { opacity: 1 } 5% { opacity: .6 } 6% { opacity: 1 } 60% { opacity: 1 } 61% { opacity: .5; filter: blur(1px) } 62% { opacity: 1; filter: none } }
.tagline { font-style: italic; color: #e8dcc0; text-align: center; margin: 10px 0 auto; font-size: 18px; text-shadow: 0 0 6px #000, 0 0 14px #000, 0 2px 4px #000; padding: 2px 10px; border-radius: 8px; background: rgba(0,0,0,.35); }
.hint { color: #8a7a64; font-size: 14px; margin: 14px 0 0; }
.menu-inner { gap: 12px; justify-content: center; overflow-y: auto; }
.field { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; color: var(--ink-dim); letter-spacing: .08em; text-transform: uppercase; }
.field input, .join-row input { width: 100%; padding: 14px 16px; border-radius: 10px; border: 1px solid #5a4630; background: rgba(10,6,5,.75); color: var(--ink); font-size: 19px; outline: none; }
.field input:focus, .join-row input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px #d4a94f33; }
.avatars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-height: 30vh; overflow-y: auto; padding: 3px; }
.avatars button { aspect-ratio: 1; font-size: 22px; padding: 0; border-radius: 12px; border: 1px solid #3d2f22; background: rgba(10,6,5,.7); cursor: pointer; transition: transform .15s, box-shadow .2s; }
.avatars button.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset, 0 0 18px #d4a94f88; transform: scale(1.07); }
#btn-create { width: 100%; margin-top: 6px; }
.join-row { display: flex; gap: 8px; width: 100%; }
.join-row input { text-transform: uppercase; letter-spacing: .4em; text-align: center; font-family: 'Cinzel Decorative', serif; font-weight: 700; }
.join-row .btn { flex: 0 0 auto; }
.err { color: var(--blood-hi); min-height: 1.3em; margin: 0; text-align: center; text-shadow: 0 0 8px #f004; }

/* ---------- lobby ---------- */
.lobby-inner { gap: 10px; overflow-y: auto; }
.eyebrow { margin: 4px 0 0; letter-spacing: .3em; text-transform: uppercase; font-size: 13px; color: var(--ink-dim); }
.code { font-family: 'Cinzel Decorative', serif; font-weight: 900; font-size: 58px; letter-spacing: .18em; color: #f3e3c3; text-shadow: 0 0 18px #ff2a2a88, 0 0 2px #fff; line-height: 1; }
.qr-wrap { display: flex; flex-direction: column; align-items: center; }
.qr-wrap img { width: 128px; height: 128px; padding: 8px; border-radius: 10px; background: rgba(0,0,0,.6); box-shadow: 0 0 0 1px #5a4630; }
.qr-wrap p { margin: 4px 0 0; font-size: 13px; color: var(--ink-dim); }
.lobby-players { list-style: none; padding: 0; margin: 8px 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.lobby-players li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: linear-gradient(90deg, rgba(40,20,14,.8), rgba(14,8,7,.7)); box-shadow: 0 0 0 1px #3d2f22 inset; animation: rise .5s ease both; }
.lobby-players li .av { font-size: 26px; filter: drop-shadow(0 0 6px #ff6a3a66); }
.lobby-players li .nm { flex: 1; font-size: 19px; }
.lobby-players li .tag { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.lobby-players li .tag.off { color: #776; }
.lobby-players li .kick { background: none; border: 0; color: #a66; font-size: 20px; cursor: pointer; }
@keyframes rise { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }
.host-tools { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: auto; }
.wait { color: var(--ink-dim); font-style: italic; text-align: center; animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45 } }

/* ---------- game ---------- */
.table-bg { position: absolute; inset: 0; background: #000 url(art/bg-table.webp) center/cover no-repeat; filter: brightness(.55) saturate(.9); }
.table-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 52%, rgba(255,140,40,.10), transparent 55%); animation: candle 3.2s infinite alternate ease-in-out; }
@keyframes candle { 0% { opacity: .6 } 30% { opacity: 1 } 45% { opacity: .75 } 70% { opacity: .95 } 100% { opacity: .7 } }

.opponents { position: relative; z-index: 2; width: 100%; display: flex; gap: 8px; padding: calc(8px + var(--safe-t)) 52px 6px 10px; overflow-x: auto; scrollbar-width: none; flex: 0 0 auto; }
.opponents::-webkit-scrollbar { display: none; }
.opp { flex: 0 0 auto; min-width: 64px; max-width: 84px; padding: 6px 6px 5px; border-radius: 12px; text-align: center; background: rgba(12,7,6,.72); box-shadow: 0 0 0 1px #3a2b1e inset; position: relative; transition: box-shadow .3s, transform .3s; }
.opp .av { font-size: 22px; line-height: 1.1; display: block; }
.opp .nm { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp .sc { display: block; font-family: 'Cinzel Decorative', serif; font-weight: 900; font-size: 16px; color: var(--gold-hi); }
.opp .salt-dot { position: absolute; top: 3px; right: 4px; font-size: 11px; }
.opp.me { box-shadow: 0 0 0 1px #8c6a3a inset; }
.opp.turn { box-shadow: 0 0 0 2px var(--blood-hi) inset, 0 0 18px #ff1a2a88; transform: translateY(2px) scale(1.04); }
.opp.turn::after { content: '🕯️'; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); font-size: 12px; animation: bob 1.4s ease-in-out infinite; }
.opp.off { opacity: .45; }
.opp .react { position: absolute; left: 50%; top: 50%; font-size: 30px; transform: translate(-50%,-50%); animation: pop-react 1.4s ease-out forwards; pointer-events: none; }
@keyframes pop-react { 0% { transform: translate(-50%,-50%) scale(.2); opacity: 0 } 20% { transform: translate(-50%,-80%) scale(1.3); opacity: 1 } 100% { transform: translate(-50%,-180%) scale(1); opacity: 0 } }
@keyframes bob { 50% { transform: translateX(-50%) translateY(-3px) } }

.table { position: relative; z-index: 2; flex: 1 1 auto; width: 100%; display: flex; flex-direction: column; min-height: 0; }
.table-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 14px 0; gap: 8px; }
.clock { width: 62px; text-align: center; position: relative; }
.clock svg { width: 58px; height: 58px; filter: drop-shadow(0 0 8px #000); }
.clock-label { display: block; font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-dim); }
.clock.danger svg { animation: clock-danger 1s ease-in-out infinite; }
.clock.danger .clock-label { color: var(--blood-hi); }
@keyframes clock-danger { 50% { filter: drop-shadow(0 0 14px #ff1a1a) } }
#clock-hand { transition: transform 1.2s cubic-bezier(.5,1.6,.4,1); transform-origin: 50px 50px; }
.turn-banner { flex: 1; text-align: center; font-size: 17px; line-height: 1.2; text-shadow: 0 2px 6px #000, 0 0 12px #000; min-height: 2.4em; display: flex; align-items: center; justify-content: center; }
.turn-banner b { font-family: 'Cinzel Decorative', serif; color: var(--gold-hi); }
.turn-banner.mine b { color: var(--blood-hi); text-shadow: 0 0 12px #ff1a2a; }
.deck { width: 62px; position: relative; text-align: center; }
.deck-stack { position: relative; width: 44px; height: 60px; margin: 0 auto; }
.deck-stack .cardback { position: absolute; inset: 0; border-radius: 5px; background: #120a08 url(art/card-back.webp) center/cover; box-shadow: 0 0 0 1px #8c6a3a, 0 3px 8px #000; }
.deck-stack .cardback:nth-child(1) { transform: translate(3px,3px) rotate(4deg); }
.deck-stack .cardback:nth-child(2) { transform: translate(-2px,1px) rotate(-3deg); }
.deck.can .deck-stack { animation: deck-glow 1.6s ease-in-out infinite; }
@keyframes deck-glow { 50% { filter: drop-shadow(0 0 12px #ff3a2a) } }
.deck-count { display: block; font-size: 11px; color: var(--ink-dim); margin-top: 3px; letter-spacing: .1em; }

.ring { position: relative; flex: 1 1 auto; min-height: 0; }
.ring-chalk { position: absolute; left: 50%; top: 50%; width: 76%; height: 74%; transform: translate(-50%,-50%); border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(240,230,210,.18), 0 0 0 9px rgba(240,230,210,.04), 0 0 40px rgba(255,120,60,.12) inset, 0 0 30px rgba(255,80,40,.08);
  background: radial-gradient(ellipse, rgba(0,0,0,.35), transparent 70%); animation: ring-breathe 5s ease-in-out infinite; }
.ring.hot .ring-chalk { box-shadow: 0 0 0 2px rgba(255,60,60,.5), 0 0 0 9px rgba(255,40,40,.08), 0 0 60px rgba(255,20,20,.25) inset, 0 0 40px rgba(255,0,0,.25); }
@keyframes ring-breathe { 50% { transform: translate(-50%,-50%) scale(1.02) rotate(1deg) } }
.ring-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); text-align: center; pointer-events: none; }
.ring-value { font-family: 'Cinzel Decorative', serif; font-weight: 900; font-size: 46px; line-height: 1; color: var(--gold-hi); text-shadow: 0 0 18px #d4a94f88, 0 2px 0 #000; transition: transform .3s; }
.ring-value.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.35) } }
.ring-sub { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); text-shadow: 0 1px 4px #000; }
.risk { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-dim); }
.eye { width: 30px; height: 16px; border-radius: 50% / 50%; background: #e8dcc0; position: relative; overflow: hidden; box-shadow: 0 0 8px #000; transition: height .5s, background .5s; clip-path: ellipse(50% 50%); }
.eye .iris { position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle, #000 30%, #6d0710 32%, #1a0002 75%); transform: translate(-50%,-50%); animation: look 5s ease-in-out infinite; }
@keyframes look { 0%,100% { transform: translate(-50%,-50%) } 30% { transform: translate(-90%,-50%) } 60% { transform: translate(-10%,-50%) } }
.risk[data-lvl="0"] .eye { height: 3px; }
.risk[data-lvl="1"] .eye { height: 9px; }
.risk[data-lvl="2"] .eye { height: 14px; background: #f0d8c8; }
.risk[data-lvl="3"] .eye { height: 18px; background: #ffd0c0; box-shadow: 0 0 14px #ff2020; }
.risk[data-lvl="3"] { color: var(--blood-hi); }

.ring-cards { position: absolute; inset: 0; }
.ring-cards .card { position: absolute; left: 0; top: 0; transition: transform .6s cubic-bezier(.2,.9,.3,1.1); }
.ring-cards .card.enter { animation: card-enter .55s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes card-enter { from { opacity: 0; filter: brightness(3) blur(4px) } to { opacity: 1; filter: none } }
.ring-cards .card.doomed { animation: doomed .5s ease-in-out infinite alternate; }
@keyframes doomed { to { filter: drop-shadow(0 0 16px #ff0000) brightness(1.4) hue-rotate(-20deg); } }
.ring-cards .card.burn { animation: burn 1.3s ease-in forwards !important; }
@keyframes burn { 0% { filter: brightness(1) } 30% { filter: brightness(2.5) sepia(1) hue-rotate(-40deg) saturate(4) } 100% { filter: brightness(0) blur(6px); opacity: 0; transform: var(--t) translateY(-30px) scale(.6) rotate(20deg) } }
.ring-cards .card.bank { animation: bank .9s ease-in forwards !important; }
@keyframes bank { 30% { filter: brightness(1.8) drop-shadow(0 0 18px #ffd27a) } 100% { opacity: 0; transform: translate(var(--bx), var(--by)) scale(.2) } }

/* ---------- card ---------- */
.card { width: var(--card-w); aspect-ratio: 5 / 7; border-radius: 7px; position: relative; perspective: 800px; cursor: pointer; }
.card .face { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.card .front { background: #120a08 center/cover no-repeat; box-shadow: 0 0 0 1px #000, 0 0 0 3px var(--frame, #8c6a3a), 0 0 0 4px #000, 0 6px 16px rgba(0,0,0,.8); }
.card .front::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, transparent 25%, transparent 60%, rgba(0,0,0,.92) 100%), radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(0,0,0,.55)); }
.card .front::after { content: ''; position: absolute; inset: 3px; border-radius: 5px; border: 1px solid var(--frame-hi, #d4a94f88); pointer-events: none; }
.card .nm { position: absolute; left: 0; right: 0; bottom: 4%; text-align: center; font-family: 'Cinzel Decorative', serif; font-weight: 700; font-size: calc(var(--card-w) * .105); line-height: 1.05; padding: 0 6%; color: var(--ink); text-shadow: 0 1px 3px #000, 0 0 6px #000; z-index: 2; }
.card .val { position: absolute; left: 6%; top: 4%; width: 30%; aspect-ratio: 1; border-radius: 50%; z-index: 2; display: grid; place-items: center; font-family: 'Cinzel Decorative', serif; font-weight: 900; font-size: calc(var(--card-w) * .2); color: #2a1306;
  background: radial-gradient(circle at 35% 30%, #ffe9b0, #d4a94f 50%, #7a4f14); box-shadow: 0 2px 4px #000, 0 0 0 1px #3a2208; }
.card .sig { position: absolute; right: 6%; top: 4%; font-size: calc(var(--card-w) * .17); z-index: 2; filter: drop-shadow(0 0 4px #000); }
.card .back { background: #120a08 url(art/card-back.webp) center/cover; transform: rotateY(180deg); box-shadow: 0 0 0 1px #000, 0 0 0 3px #8c6a3a, 0 0 0 4px #000; }
.card .inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3,1.3,.5,1); border-radius: inherit; }
.card.flipped .inner { transform: rotateY(180deg); }
.card.relic { --frame: #b8893a; --frame-hi: #ffd88a99; }
.card.relic .front { box-shadow: 0 0 0 1px #000, 0 0 0 3px #b8893a, 0 0 0 4px #000, 0 6px 16px rgba(0,0,0,.8), 0 0 14px rgba(255,200,90,.25); }
.card.relic .shine { position: absolute; inset: 0; z-index: 3; background: linear-gradient(115deg, transparent 35%, rgba(255,240,200,.35) 48%, transparent 60%); background-size: 250% 100%; animation: shine 4s ease-in-out infinite; mix-blend-mode: overlay; }
@keyframes shine { 0% { background-position: 130% 0 } 60%,100% { background-position: -130% 0 } }
.card.spirit { --frame: #3f8a63; --frame-hi: #7dffb488; }
.card.spirit .front { box-shadow: 0 0 0 1px #000, 0 0 0 3px #2f6a4c, 0 0 0 4px #000, 0 6px 16px rgba(0,0,0,.8), 0 0 16px rgba(125,255,180,.25); animation: spirit-shiver 3.5s infinite; }
@keyframes spirit-shiver { 0%,92%,100% { transform: none } 93% { transform: translateX(-1px) skewX(-1deg) } 95% { transform: translateX(1.5px) skewX(1deg) } 97% { transform: translateX(-1px) } }
.card.salt { --frame: #c8d2e6; --frame-hi: #ffffffaa; }
.card.hex { --frame: #7a3fc4; --frame-hi: #c99bff99; }
.card.planchette { --frame: #b8743a; --frame-hi: #ffb87a99; }
.card.bell { --frame: #a3101c; --frame-hi: #ff5a5a99; }

/* ---------- reveal (big card center screen) ---------- */
.reveal { position: fixed; inset: 0; z-index: 40; pointer-events: none; display: grid; place-items: center; }
.reveal .card { --card-w: min(56vw, 250px); }
.reveal .card .nm { font-size: calc(var(--card-w) * .085); }
.reveal .glow { position: absolute; width: 140vmin; height: 140vmin; border-radius: 50%; opacity: 0; }
.reveal.show .glow { animation: glowburst 1.2s ease-out both; }
@keyframes glowburst { 0% { opacity: 0; transform: scale(.2) } 30% { opacity: .9 } 100% { opacity: 0; transform: scale(1) } }
.reveal-card { animation: reveal-in .55s cubic-bezier(.2,1.2,.4,1) both; }
.reveal-card.out { animation: reveal-out .45s cubic-bezier(.6,0,.8,.4) forwards; }
.reveal-card.out.burnout { animation: reveal-burn .7s ease-in forwards; }
@keyframes reveal-in { from { transform: translate(var(--fx, 30vw), var(--fy, -30vh)) scale(.25) rotate(25deg); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes reveal-out { to { transform: translate(var(--tx, 0), var(--ty, 10vh)) scale(.3); opacity: 0 } }
@keyframes reveal-burn { 40% { filter: brightness(3) sepia(1) saturate(5) hue-rotate(-30deg) } to { opacity: 0; filter: brightness(0) blur(10px); transform: scale(1.4) } }
.reveal-caption { position: absolute; bottom: 16vh; left: 0; right: 0; text-align: center; font-family: 'Cinzel Decorative', serif; font-weight: 900; font-size: 26px; letter-spacing: .06em; text-shadow: 0 0 12px #000, 0 2px 0 #000; animation: caption 1.6s ease both; padding: 0 16px; }
.reveal-caption small { display: block; font-family: 'IM Fell English', serif; font-weight: 400; font-style: italic; font-size: 17px; color: var(--ink-dim); letter-spacing: 0; margin-top: 4px; }
@keyframes caption { 0% { opacity: 0; transform: translateY(14px); letter-spacing: .4em } 25% { opacity: 1; transform: none; letter-spacing: .06em } 85% { opacity: 1 } 100% { opacity: 0 } }

/* ---------- jump scare ---------- */
.scare { position: fixed; inset: 0; z-index: 80; pointer-events: none; display: none; background: #000; overflow: hidden; }
.scare.on { display: block; }
.scare-img { position: absolute; inset: -6%; background: center/cover no-repeat; }
.scare.on .scare-img.a { animation: scare-lunge .9s cubic-bezier(.1,.9,.2,1) both, glitch-a .18s steps(2) infinite; }
.scare.on .scare-img.b { mix-blend-mode: screen; opacity: .7; filter: url(#none) sepia(1) saturate(8) hue-rotate(-50deg); animation: scare-lunge .9s cubic-bezier(.1,.9,.2,1) both, glitch-b .13s steps(2) infinite; }
.scare.on .scare-img.c { mix-blend-mode: screen; opacity: .5; filter: sepia(1) saturate(6) hue-rotate(140deg); animation: scare-lunge .9s cubic-bezier(.1,.9,.2,1) both, glitch-c .21s steps(3) infinite; }
@keyframes scare-lunge { 0% { transform: scale(.55); filter: brightness(0) } 8% { transform: scale(1); filter: brightness(1.6) contrast(1.4) } 15% { transform: scale(1.08) } 100% { transform: scale(1.32) } }
@keyframes glitch-a { 0% { clip-path: inset(0 0 0 0) } 50% { clip-path: inset(12% 0 30% 0); translate: -8px 0 } }
@keyframes glitch-b { 0% { translate: 9px -3px } 50% { translate: -6px 4px; clip-path: inset(40% 0 20% 0) } }
@keyframes glitch-c { 0% { translate: -10px 2px } 33% { translate: 7px -5px; clip-path: inset(0 0 60% 0) } 66% { translate: 0 6px; clip-path: inset(55% 0 0 0) } }
.scare::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.35) 0 2px, transparent 2px 4px); mix-blend-mode: multiply; }
.scare-text { position: absolute; left: 0; right: 0; bottom: 12%; text-align: center; font-family: 'Creepster', 'Cinzel Decorative', cursive; font-size: clamp(52px, 17vw, 96px); color: #ff1a2a; text-shadow: 0 0 20px #f00, 0 0 50px #900, 4px 4px 0 #000; z-index: 3; animation: scare-text .9s ease both; letter-spacing: .04em; }
.scare-text small { display: block; font-family: 'IM Fell English', serif; font-size: 22px; color: #ffd9d0; text-shadow: 0 2px 6px #000; letter-spacing: 0; }
@keyframes scare-text { 0% { transform: scale(3) rotate(-8deg); opacity: 0 } 25% { transform: scale(1) rotate(2deg); opacity: 1 } 35% { transform: rotate(-1deg) } }

/* red possession flash for spectators */
.blood-flash { position: fixed; inset: 0; z-index: 70; pointer-events: none; background: radial-gradient(ellipse, rgba(120,0,0,.2), rgba(90,0,0,.85)); animation: bloodflash 1.6s ease-out forwards; }
@keyframes bloodflash { 0% { opacity: 0 } 10% { opacity: 1 } 100% { opacity: 0 } }
.blood-flash span { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-family: 'Creepster', cursive; font-size: clamp(40px, 13vw, 72px); color: #ff2a2a; text-shadow: 0 0 20px #f00, 3px 3px 0 #000; animation: scare-text 1s ease both; }

/* ---------- controls ---------- */
.controls { position: relative; z-index: 4; width: 100%; padding: 0 14px calc(10px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; background: linear-gradient(0deg, rgba(0,0,0,.85), rgba(0,0,0,.5) 70%, transparent); }
.visions { display: flex; justify-content: center; gap: 6px; min-height: 0; }
.visions:not(:empty)::before { content: 'Visions:'; align-self: center; font-size: 13px; font-style: italic; color: #ffb87a; }
.visions .vis { width: 30px; height: 42px; border-radius: 4px; background: center/cover; box-shadow: 0 0 0 1px #ffb87a, 0 0 10px #ffb87a66; position: relative; animation: rise .4s both; }
.visions .vis:first-of-type { box-shadow: 0 0 0 2px #ffe0b0, 0 0 14px #ffb87a; }
.me-row { display: flex; align-items: center; gap: 10px; }
.me-badge { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-dim); min-height: 34px; }
.me-badge .sc { font-family: 'Cinzel Decorative', serif; font-weight: 900; font-size: 24px; color: var(--gold-hi); text-shadow: 0 0 10px #d4a94f66; }
.me-badge .relic-icons { display: flex; gap: 2px; }
.me-badge .relic-icons i { width: 16px; height: 22px; border-radius: 2px; background: center/cover; box-shadow: 0 0 0 1px #8c6a3a; }
.me-badge .salt-pill { padding: 2px 8px; border-radius: 99px; background: rgba(242,246,255,.12); color: #f2f6ff; font-size: 13px; box-shadow: 0 0 10px #ffffff33; }
.timer { width: 38px; height: 38px; position: relative; opacity: 0; transition: opacity .3s; }
.timer.on { opacity: 1; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer .t-bg { fill: rgba(0,0,0,.5); stroke: #3a2b1e; stroke-width: 3; }
.timer .t-arc { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 97.4; transition: stroke .3s; }
.timer.low .t-arc { stroke: var(--blood-hi); }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: bold; }
.actions { display: flex; gap: 10px; }
.actions .btn { flex: 1; padding-left: 8px; padding-right: 8px; }
.actions.hidden { display: none; }
#btn-draw.hot { animation: pulse 1.2s ease-in-out infinite; }
.reacts { display: flex; justify-content: space-around; }
.reacts button { background: rgba(255,255,255,.04); border: 0; border-radius: 50%; width: 42px; height: 42px; font-size: 22px; cursor: pointer; transition: transform .1s; }
.reacts button:active { transform: scale(1.3); }
.corner-btn { position: absolute; z-index: 5; top: calc(10px + var(--safe-t)); right: 10px; width: 38px; height: 38px; border-radius: 10px; border: 0; background: rgba(0,0,0,.6); box-shadow: 0 0 0 1px #3a2b1e inset; font-size: 18px; cursor: pointer; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(0,0,0,.72); backdrop-filter: blur(5px); padding: 16px; }
.overlay.on { display: grid; animation: fadein .4s both; }
.panel { width: 100%; max-width: 420px; max-height: 92dvh; overflow-y: auto; background: var(--panel); border-radius: 16px; padding: 22px 20px; text-align: center; box-shadow: 0 0 0 1px #5a4630 inset, 0 0 0 4px #0008, 0 20px 60px #000, 0 0 80px rgba(160,20,20,.2); display: flex; flex-direction: column; gap: 12px; }
.panel h2 { margin: 0; font-family: 'Cinzel Decorative', serif; font-weight: 900; color: var(--gold-hi); font-size: 26px; text-shadow: 0 0 14px #d4a94f55; }
.panel p { margin: 0; color: var(--ink-dim); }
.hex-panel { box-shadow: 0 0 0 1px #7a3fc4 inset, 0 20px 60px #000, 0 0 80px rgba(160,80,255,.35); }
.hex-panel h2 { color: #d8b8ff; text-shadow: 0 0 14px #a65cff; }
.hex-targets { display: flex; flex-direction: column; gap: 8px; }
.hex-targets button { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; border: 0; background: rgba(166,92,255,.12); box-shadow: 0 0 0 1px #7a3fc4 inset; cursor: pointer; font-size: 18px; }
.hex-targets button span:nth-child(2) { flex: 1; text-align: left; }
.hex-targets button b { font-family: 'Cinzel Decorative', serif; color: var(--gold-hi); }
.planchette-panel { box-shadow: 0 0 0 1px #b8743a inset, 0 20px 60px #000, 0 0 80px rgba(255,160,80,.3); }
.planchette-cards { display: flex; justify-content: center; gap: 10px; padding: 8px 0; }
.planchette-cards .card { --card-w: min(26vw, 110px); }
.planchette-cards .card .num { position: absolute; top: -22px; left: 0; right: 0; text-align: center; font-size: 13px; color: #ffb87a; }
.end-panel { box-shadow: 0 0 0 1px #a3101c inset, 0 20px 60px #000, 0 0 100px rgba(200,0,20,.4); }
.end-bell { font-size: 54px; animation: toll 1.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes toll { 0%,100% { transform: rotate(0) } 25% { transform: rotate(18deg) } 75% { transform: rotate(-18deg) } }
.end-panel h2 { font-size: 40px; color: #ff4a4a; text-shadow: 0 0 20px #f00, 0 0 60px #800; }
.end-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.end-list li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,.04); animation: rise .6s both; }
.end-list li .rank { font-family: 'Cinzel Decorative', serif; width: 26px; color: var(--ink-dim); }
.end-list li .nm { flex: 1; font-size: 18px; }
.end-list li .sc { font-family: 'Cinzel Decorative', serif; font-weight: 900; color: var(--gold-hi); font-size: 20px; }
.end-list li .ex { font-size: 12px; color: var(--ink-dim); display: block; }
.end-list li.win { background: linear-gradient(90deg, rgba(212,169,79,.3), rgba(212,169,79,.05)); box-shadow: 0 0 0 1px var(--gold) inset, 0 0 24px #d4a94f44; }
.end-list li.win .rank::before { content: '👑'; }
.end-list li.win .rank { font-size: 0; }
.end-list li.win .rank::before { font-size: 20px; }
.rules-panel { text-align: left; }
.rules-panel h2 { text-align: center; }
.rules-body p { color: var(--ink); margin: 0 0 10px; line-height: 1.35; }
.rule-cards { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; }
.rule-cards > div { display: flex; gap: 10px; align-items: flex-start; line-height: 1.3; }
.rc { flex: 0 0 34px; height: 46px; border-radius: 4px; background: center/cover; box-shadow: 0 0 0 2px #8c6a3a, 0 2px 6px #000; }
.rc.relic { background-image: url(art/relic-chalice.webp); }
.rc.spirit { background-image: url(art/spirit-bride.webp); box-shadow: 0 0 0 2px #2f6a4c; }
.rc.salt { background-image: url(art/ward-salt.webp); box-shadow: 0 0 0 2px #c8d2e6; }
.rc.hex { background-image: url(art/hex-curse.webp); box-shadow: 0 0 0 2px #7a3fc4; }
.rc.planchette { background-image: url(art/planchette.webp); box-shadow: 0 0 0 2px #b8743a; }
.rc.bell { background-image: url(art/bell-midnight.webp); box-shadow: 0 0 0 2px #a3101c; }
.t-blood { color: var(--blood-hi); } .t-gold { color: var(--gold-hi); }
.toggle { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 10px; background: rgba(255,255,255,.04); font-size: 18px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--blood); }

.toast { position: fixed; left: 50%; top: calc(96px + var(--safe-t)); z-index: 45; transform: translate(-50%, -20px); padding: 10px 16px; border-radius: 10px; background: rgba(10,6,5,.92); box-shadow: 0 0 0 1px #5a4630 inset, 0 8px 24px #000; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; max-width: 90vw; text-align: center; font-size: 16px; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.floaters { position: fixed; inset: 0; z-index: 46; pointer-events: none; }
.floater { position: absolute; font-size: 34px; animation: float-up 2.2s ease-out forwards; }
@keyframes float-up { 0% { transform: translateY(0) scale(.4); opacity: 0 } 15% { transform: translateY(-20px) scale(1.2); opacity: 1 } 100% { transform: translateY(-46vh) translateX(var(--dx)) scale(1); opacity: 0 } }
.conn { position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); z-index: 90; padding: 8px 14px; border-radius: 99px; background: #3e0308; box-shadow: 0 0 20px #f004; font-size: 14px; display: none; }
.conn.on { display: block; animation: breathe 1.6s infinite; }

/* card inspect */
.inspect { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; background: rgba(0,0,0,.75); animation: fadein .25s both; }
.inspect .card { --card-w: min(64vw, 280px); animation: reveal-in .4s cubic-bezier(.2,1.2,.4,1) both; --fx: 0; --fy: 10vh; }
.inspect .card .nm { font-size: calc(var(--card-w) * .085); }
.inspect p { position: absolute; bottom: 12vh; left: 20px; right: 20px; text-align: center; color: var(--ink); font-size: 17px; }

@media (min-height: 760px) { :root { --card-w: min(20vw, 96px); } }
@media (max-height: 640px) { .reacts { display: none; } :root { --card-w: min(16vw, 70px); } .ring-value { font-size: 36px; } }
@media (prefers-reduced-motion: reduce) { .title-art, #vignette { animation: none; } }

/* ---------- modes + medium ---------- */
.mode-box { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.mode { text-align: left; padding: 12px 14px; border-radius: 12px; border: 0; cursor: pointer; background: rgba(12,7,6,.75); box-shadow: 0 0 0 1px #3d2f22 inset; display: flex; flex-direction: column; gap: 3px; transition: box-shadow .25s, transform .2s, opacity .3s; }
.mode b { font-family: 'Cinzel Decorative', serif; font-size: 15px; color: var(--ink); }
.mode span { font-size: 14px; color: var(--ink-dim); line-height: 1.25; }
.mode.sel { box-shadow: 0 0 0 2px var(--blood-hi) inset, 0 0 22px rgba(255,30,40,.35); transform: scale(1.01); }
.mode.sel b { color: var(--gold-hi); }
.mode-box.locked .mode { pointer-events: none; }
.mode-box.locked .mode:not(.sel) { display: none; }
.medium { margin: 4px 14px 0; padding: 7px 12px; border-radius: 12px; display: flex; gap: 8px; align-items: center; background: linear-gradient(90deg, rgba(60,20,80,.55), rgba(10,6,12,.55)); box-shadow: 0 0 0 1px rgba(166,92,255,.3) inset, 0 0 18px rgba(120,40,200,.2); min-height: 40px; }
.medium .m-icon { font-size: 20px; filter: drop-shadow(0 0 8px #a65cff); animation: bob2 3s ease-in-out infinite; }
@keyframes bob2 { 50% { transform: translateY(-2px) scale(1.06) } }
.medium p { margin: 0; font-style: italic; font-size: 15px; line-height: 1.25; color: #e6d8ff; text-shadow: 0 1px 3px #000; }
.medium p b { font-style: normal; color: var(--gold-hi); }
.opp.house { background: linear-gradient(180deg, rgba(90,0,10,.7), rgba(20,0,4,.8)); box-shadow: 0 0 0 1px #a3101c inset, 0 0 14px rgba(255,0,20,.25); }
.opp.house .sc { color: #ff6a6a; }
.coop-bar { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.coop-bar .vs { color: var(--ink-dim); font-style: italic; }
.coop-bar .team { font-family: 'Cinzel Decorative', serif; font-weight: 900; color: var(--gold-hi); font-size: 20px; }
.coop-bar .hs { font-family: 'Cinzel Decorative', serif; font-weight: 900; color: #ff5a5a; font-size: 20px; }
.awards { display: flex; flex-direction: column; gap: 4px; text-align: left; font-size: 15px; }
.awards div { padding: 6px 10px; border-radius: 8px; background: rgba(166,92,255,.1); }
.spectating { text-align: center; font-style: italic; color: var(--ink-dim); padding: 8px; }

/* ---------- roles, votes, rules extras ---------- */
.speaker-note { font-size: 13px; color: var(--ink-dim); text-align: center; margin: 0; }
.rules-body h3 { font-family: 'Cinzel Decorative', serif; color: var(--gold); font-size: 16px; margin: 16px 0 6px; }
.rules-body .lead { font-size: 18px; }
.two-btn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.pill { padding: 3px 10px; border-radius: 99px; font-family: 'Cinzel Decorative', serif; font-weight: 700; font-size: 13px; }
.pill.blood { background: var(--blood); color: #fff; }
.pill.gold { background: var(--gold); color: #2a1708; }
.role-panel .role-icon { font-size: 72px; animation: bob2 3s ease-in-out infinite; }
.role-panel.traitor { box-shadow: 0 0 0 1px #a3101c inset, 0 20px 60px #000, 0 0 120px rgba(255,0,30,.5); }
.role-panel.traitor h2 { color: #ff4a4a; text-shadow: 0 0 18px #f00; }
.vote-panel { box-shadow: 0 0 0 1px #a3101c inset, 0 20px 60px #000, 0 0 100px rgba(200,0,20,.35); }
.vote-targets button.sel, #vote-targets button.sel { box-shadow: 0 0 0 2px var(--blood-hi) inset, 0 0 18px #ff1a2a88; background: rgba(163,16,28,.3); }
#vote-targets button { background: rgba(163,16,28,.1); box-shadow: 0 0 0 1px #6d0710 inset; }
.opp.traitor-mark::before { content: '🎭'; position: absolute; top: 2px; left: 4px; font-size: 11px; }

/* ---------- update 2 ---------- */
.corner-btn.full { right: 54px; }
.vote-clock { font-family: 'Cinzel Decorative', serif; font-weight: 900; font-size: 26px; color: var(--gold-hi); text-shadow: 0 0 12px #d4a94f66; }
.vote-clock.hurry { color: #ff4a4a; text-shadow: 0 0 16px #f00; animation: pulse-text .8s ease-in-out infinite; }
@keyframes pulse-text { 50% { transform: scale(1.12) } }
.hex-targets button small { display: block; font-size: 13px; color: var(--ink-dim); }
/* the traitor's secret option looks like the others, so nobody can spot it from across the table */
.opponents { padding-right: 96px; }

/* ---------- phased modes ---------- */
.ph-head { position: relative; z-index: 2; width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 2px 16px 0; }
.ph-title b { display: block; font-family: 'Cinzel Decorative', serif; font-size: 22px; color: var(--gold-hi); text-shadow: 0 0 12px #000; }
.ph-title span { font-size: 14px; color: var(--ink-dim); }
.ph-timer { font-family: 'Cinzel Decorative', serif; font-weight: 900; font-size: 24px; color: var(--gold-hi); min-width: 60px; text-align: right; }
.ph-timer.low { color: #ff4a4a; text-shadow: 0 0 12px #f00; animation: pulse-text .8s infinite; }
#s-phase .medium { width: calc(100% - 28px); position: relative; z-index: 2; }
.ph-body { position: relative; z-index: 2; flex: 1; width: 100%; max-width: 560px; overflow-y: auto; padding: 10px 14px calc(18px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
.ph-ask { margin: 2px 0; text-align: center; color: var(--ink); }
.ph-wait { text-align: center; font-style: italic; color: var(--ink-dim); padding: 6px; }
.ph-note { padding: 10px 12px; border-radius: 10px; background: rgba(12,7,6,.8); box-shadow: 0 0 0 1px #5a4630 inset; line-height: 1.35; }
.ph-note.evil { box-shadow: 0 0 0 1px #a3101c inset, 0 0 16px rgba(255,0,20,.2); }
.ph-banner { text-align: center; font-size: 18px; padding: 10px; border-radius: 10px; background: rgba(90,0,10,.5); box-shadow: 0 0 0 1px #a3101c inset; }
.opp .sc.wins { font-size: 12px; }
.opp.done { box-shadow: 0 0 0 2px #3f8a63 inset; }
.role-card { display: flex; gap: 12px; padding: 10px; border-radius: 14px; background: rgba(12,7,6,.85); box-shadow: 0 0 0 1px #8c6a3a inset, 0 10px 30px #000; animation: rise .5s both; }
.role-card.possessed { box-shadow: 0 0 0 2px #a3101c inset, 0 0 30px rgba(255,0,20,.35); }
.role-card.spirit { box-shadow: 0 0 0 2px #7dffb4 inset, 0 0 30px rgba(125,255,180,.25); }
.rc-art { flex: 0 0 34%; aspect-ratio: 3/4; border-radius: 10px; background: center/cover; box-shadow: 0 0 0 1px #000; }
.role-card.small .rc-art { flex-basis: 54px; }
.rc-body b { display: block; font-family: 'Cinzel Decorative', serif; font-size: 19px; color: var(--gold-hi); }
.role-card.possessed .rc-body b { color: #ff5a5a; }
.rc-team { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.rc-body p { margin: 6px 0 0; line-height: 1.35; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pick-list button { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; border: 0; background: rgba(12,7,6,.8); box-shadow: 0 0 0 1px #3d2f22 inset; cursor: pointer; font-size: 17px; text-align: left; }
.pick-list button.sel { box-shadow: 0 0 0 2px var(--blood-hi) inset, 0 0 18px #ff1a2a66; background: rgba(163,16,28,.25); }
.candle-btn { align-self: center; width: 120px; height: 120px; border-radius: 50%; border: 0; font-size: 64px; cursor: pointer; background: radial-gradient(circle, rgba(255,180,80,.35), rgba(0,0,0,.6) 70%); box-shadow: 0 0 40px rgba(255,160,60,.4); animation: breathe 2.4s infinite; }
.roles-in-play { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.rip { padding: 4px 10px; border-radius: 99px; font-size: 13px; background: rgba(255,255,255,.06); box-shadow: 0 0 0 1px #5a4630 inset; }
.rip.possessed { box-shadow: 0 0 0 1px #a3101c inset; color: #ff9a9a; }
.rip.spirit { box-shadow: 0 0 0 1px #3f8a63 inset; color: #b8ffd8; }
.reveal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.rv { text-align: center; padding: 6px; border-radius: 10px; background: rgba(12,7,6,.85); box-shadow: 0 0 0 1px #5a4630 inset; animation: rise .5s both; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.rv.possessed { box-shadow: 0 0 0 2px #a3101c inset; }
.rv.spirit { box-shadow: 0 0 0 2px #3f8a63 inset; }
.rv.exiled { transform: scale(1.05); box-shadow: 0 0 0 3px var(--gold) inset, 0 0 24px #d4a94f88; }
.rv-art { aspect-ratio: 3/4; border-radius: 6px; background: center/cover; }
.rv b { font-size: 14px; } .rv small { color: var(--ink-dim); }
.ph-mine { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(12,7,6,.8); font-size: 14px; }
.ph-mine .skulls { margin-left: auto; color: var(--gold-hi); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 99px; background: rgba(255,255,255,.06); font-size: 13px; }
.chip i { width: 18px; height: 24px; border-radius: 3px; background: center/cover; }
.dim { color: var(--ink-dim); font-style: italic; }
.hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.dcard { display: flex; flex-direction: column; gap: 3px; padding: 5px; border: 0; border-radius: 10px; background: rgba(12,7,6,.9); box-shadow: 0 0 0 1px #5a4630 inset; cursor: pointer; text-align: center; transition: transform .15s, box-shadow .2s; animation: rise .35s both; }
.dcard b { font-family: 'Cinzel Decorative', serif; font-size: 12px; color: var(--ink); }
.dcard small { font-size: 11px; color: var(--ink-dim); line-height: 1.15; }
.dc-art { position: relative; aspect-ratio: 3/4; border-radius: 7px; background: center/cover; }
.dc-art .val { position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: 'Cinzel Decorative', serif; font-weight: 900; color: #2a1306; background: radial-gradient(circle at 35% 30%, #ffe9b0, #d4a94f 50%, #7a4f14); font-size: 14px; }
.dcard.curse { box-shadow: 0 0 0 1px #7a3fc4 inset; }
.dcard.spirit { box-shadow: 0 0 0 1px #2f6a4c inset; }
.dcard.sel { transform: translateY(-4px) scale(1.04); box-shadow: 0 0 0 2px var(--blood-hi) inset, 0 0 20px #ff1a2a66; }
.dcard.kept { box-shadow: 0 0 0 2px var(--gold) inset, 0 0 20px #d4a94f88; }
.dcard.dim { opacity: .35; }
.score-panel .sc-line { display: flex; justify-content: space-between; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; }
.score-panel .sc-line b { font-family: 'Cinzel Decorative', serif; color: var(--gold-hi); }
.score-panel .sc-line b.neg { color: #ff5a5a; }
.score-panel .sc-line.total { border: 0; font-size: 19px; }
small.wins { color: var(--gold-hi); }

/* ---------- voice, cast, lite, tv ---------- */
.mic-btn { position: fixed; z-index: 48; right: 12px; bottom: calc(120px + var(--safe-b)); width: 52px; height: 52px; border-radius: 50%; border: 0; font-size: 24px; place-items: center; cursor: pointer; background: linear-gradient(180deg, #2f6a4c, #0f2a1c); box-shadow: 0 0 0 2px #7dffb4 inset, 0 6px 20px #000, 0 0 20px rgba(125,255,180,.35); }
.mic-btn.muted { background: linear-gradient(180deg, #6d0710, #2a0004); box-shadow: 0 0 0 2px #ff5a5a inset, 0 6px 20px #000; }
.cast-steps p { text-align: left; color: var(--ink); margin: 0 0 8px; line-height: 1.35; }
.cast-link { word-break: break-all; }
.tv-join { display: none; }

/* lite: drop the expensive stuff */
body.lite #vignette, body.lite .title-art, body.lite .logo, body.lite .ring-chalk, body.lite .table-bg::after, body.lite .medium .m-icon { animation: none !important; }
body.lite .overlay, body.lite .field input, body.lite .btn-ghost { backdrop-filter: none !important; }
body.lite .card .shine, body.lite .scare-img.b, body.lite .scare-img.c, body.lite .scare::after { display: none !important; }
body.lite .card.spirit .front { animation: none !important; }
body.lite .card .front { box-shadow: 0 0 0 3px var(--frame, #8c6a3a); }

/* tv: big screen layout */
body.tv { font-size: 20px; }
body.tv .tv-join { display: flex; position: absolute; z-index: 5; left: 14px; bottom: 14px; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(0,0,0,.75); box-shadow: 0 0 0 1px #5a4630 inset; font-size: 18px; }
body.tv .tv-join img { width: 110px; height: 110px; }
body.tv .controls .actions, body.tv .reacts, body.tv .me-row { display: none !important; }
body.tv .opponents { flex-wrap: wrap; justify-content: center; overflow: visible; }
body.tv .opp { min-width: 92px; max-width: 120px; }
body.tv .opp .av { font-size: 30px; } body.tv .opp .nm { font-size: 16px; } body.tv .opp .sc { font-size: 22px; }
body.tv .medium p { font-size: 22px; }
body.tv .turn-banner { font-size: 26px; }
@media (min-aspect-ratio: 4/3) {
  body.tv { --card-w: min(9vw, 150px); }
  body.tv .ring-value { font-size: 72px; }
  body.tv .clock svg { width: 90px; height: 90px; } body.tv .clock { width: 96px; }
  body.tv .deck-stack { width: 66px; height: 92px; } body.tv .deck { width: 96px; }
  body.tv .ph-body { max-width: 1100px; }
  body.tv .reveal-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

#dr-keep { position: sticky; bottom: 6px; z-index: 3; box-shadow: 0 0 0 1px #ff5a5a55 inset, 0 8px 30px #000, 0 0 30px rgba(255,0,30,.3); }

.tv-big { text-align: center; font-size: 22px; padding: 18px; border-radius: 14px; background: rgba(12,7,6,.8); box-shadow: 0 0 0 1px #5a4630 inset; }
.tv-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tvp { padding: 10px; border-radius: 12px; background: rgba(12,7,6,.85); box-shadow: 0 0 0 1px #5a4630 inset; display: flex; flex-direction: column; gap: 6px; }
.tvp.done { box-shadow: 0 0 0 2px #3f8a63 inset; }
.tvp-head { display: flex; justify-content: space-between; font-size: 18px; }
.tvp-head b { font-family: 'Cinzel Decorative', serif; color: var(--gold-hi); }
.tvp-cards { display: flex; flex-wrap: wrap; gap: 4px; }
.tvp small { color: var(--ink-dim); }
body.tv .ph-body { padding-bottom: 150px; }

.whisper-panel { box-shadow: 0 0 0 1px #a3101c inset, 0 20px 60px #000, 0 0 120px rgba(120,0,40,.5); }
.whisper-panel h2 { color: #ff6a8a; text-shadow: 0 0 18px #f04; }
.whisper-eye { font-size: 48px; animation: breathe 2.4s infinite; filter: drop-shadow(0 0 14px #f04); }
#whisper-body p { color: var(--ink); line-height: 1.4; }
#whisper-body .candle-btn { margin: 6px auto; display: block; }

/* ---------- rules ---------- */
.rules-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; flex: 0 0 auto; }
.rules-tabs::-webkit-scrollbar { display: none; }
.rules-tabs button { flex: 0 0 auto; padding: 8px 12px; border-radius: 99px; border: 0; background: rgba(255,255,255,.06); box-shadow: 0 0 0 1px #5a4630 inset; font-size: 14px; cursor: pointer; white-space: nowrap; }
.rules-tabs button.sel { background: var(--blood); color: #fff; box-shadow: 0 0 14px rgba(255,30,40,.4); }
.rules-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.rules-panel { max-height: 94dvh; }
.rules-mode h3 { font-family: 'Cinzel Decorative', serif; color: var(--gold-hi); margin: 4px 0 2px; font-size: 20px; text-align: left; }
.rules-mode h4, .mode-howto h4 { font-family: 'Cinzel Decorative', serif; color: var(--gold); margin: 14px 0 6px; font-size: 15px; text-align: left; }
.rule-players { color: var(--ink-dim) !important; font-size: 14px; margin: 0 0 8px !important; }
.howto-goal { padding: 10px 12px; border-radius: 10px; background: rgba(212,169,79,.1); box-shadow: 0 0 0 1px rgba(212,169,79,.35) inset; text-align: left; line-height: 1.35; }
.rule-steps { margin: 8px 0 0; padding-left: 0; list-style: none; counter-reset: step; text-align: left; }
.rule-steps li { counter-increment: step; position: relative; padding: 6px 0 8px 38px; line-height: 1.38; color: var(--ink); }
.rule-steps li::before { content: counter(step); position: absolute; left: 0; top: 4px; width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; font-family: 'Cinzel Decorative', serif; font-weight: 900; font-size: 14px; color: #2a1306; background: radial-gradient(circle at 35% 30%, #ffe9b0, #d4a94f 50%, #7a4f14); }
.say-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.say { display: flex; flex-direction: column; gap: 5px; padding: 10px; border-radius: 10px; font-size: 14px; text-align: left; line-height: 1.3; }
.say.yes { background: rgba(63,138,99,.15); box-shadow: 0 0 0 1px #3f8a63 inset; }
.say.no { background: rgba(163,16,28,.15); box-shadow: 0 0 0 1px #a3101c inset; }
.role-list { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.role-list div { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.04); }
.role-list b { color: var(--gold-hi); } .role-list span { font-size: 14px; color: var(--ink); line-height: 1.3; }
.rule-tips { text-align: left; padding-left: 20px; margin: 0; } .rule-tips li { margin-bottom: 6px; line-height: 1.35; }
.mode-howto { width: 100%; padding: 12px; border-radius: 12px; background: rgba(12,7,6,.82); box-shadow: 0 0 0 1px #5a4630 inset; }
.mode-howto h4 { margin-top: 0; }
.mode-howto .rule-steps li { font-size: 15px; padding-top: 4px; padding-bottom: 6px; }
.corner-btn.help { right: 98px; font-family: 'Cinzel Decorative', serif; font-weight: 900; }
.opponents { padding-right: 140px; }
.ph-guide { padding: 10px 12px; border-radius: 10px; background: rgba(60,20,80,.6); box-shadow: 0 0 0 1px rgba(166,92,255,.45) inset; line-height: 1.35; }
.ph-guide.talk { background: rgba(63,138,99,.22); box-shadow: 0 0 0 1px #3f8a63 inset; }
.ph-goal { font-size: 15px; padding: 2px 4px; color: var(--gold-hi); line-height: 1.35; }
.ph-small { margin: 0; text-align: center; font-size: 13px; color: var(--ink-dim); font-style: italic; }
/* TV join box: big and never cut off */
body.tv .tv-join { max-width: min(46vw, 560px); align-items: center; }
body.tv .tv-join img { width: 140px; height: 140px; flex: 0 0 auto; }
.tvj-head { font-family: 'Cinzel Decorative', serif; font-size: 20px; color: var(--gold-hi); }
.tvj-url { font-size: 22px; font-weight: bold; color: #fff; word-break: break-all; line-height: 1.2; margin: 4px 0; }
.tvj-code { font-size: 20px; } .tvj-code b { font-family: 'Cinzel Decorative', serif; letter-spacing: .15em; color: var(--gold-hi); }
.qr-wrap p { word-break: break-all; text-align: center; }

/* keep the player strip clear of the three corner buttons */
.opponents { width: calc(100% - 136px) !important; align-self: flex-start; padding-right: 8px !important; }
body.tv .opponents { width: calc(100% - 150px) !important; }

/* TV: the board stops above the join box */
body.tv .ph-body { margin-bottom: 175px; padding-bottom: 10px; }
body.tv #s-game .table { margin-bottom: 150px; }

/* ---------- TV layout v2: overscan-safe, join panel on the right ---------- */
body.tv #app { top: 3vh; bottom: 3vh; left: 3vw; right: calc(3vw + 300px); }
.tv-panel { display: none; }
body.tv .tv-join { display: none !important; }
body.tv .tv-panel { display: flex; position: fixed; z-index: 30; top: 4vh; right: 2.5vw; width: 290px;
  flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 16px; border-radius: 16px; background: rgba(8,4,4,.88); box-shadow: 0 0 0 1px #8c6a3a inset, 0 10px 40px #000; }
body.tv .tv-panel:empty { display: none; }
body.tv .tv-panel img { width: 220px; height: 220px; }
body.tv .tvj-url { font-size: 20px; }
body.tv .ph-body, body.tv #s-game .table { margin-bottom: 0; }
body.tv .corner-btn { display: none; }
body.tv .opponents { width: 100% !important; }

/* one global menu button, top-right, on every screen */
.menu-global { position: fixed; z-index: 47; top: calc(10px + var(--safe-t)); right: 10px; }
.opponents { width: calc(100% - 56px) !important; }
body.tv .menu-global { display: none; }

/* Seancery logo: one word plus a small tagline */
.logo span:first-child { letter-spacing: .03em; }
.logo span:last-child { font-family: 'IM Fell English', serif; font-style: italic; font-weight: 400; font-size: .3em; letter-spacing: .12em; text-transform: lowercase; color: #e9c98a; margin-top: .35em; text-shadow: 0 0 10px #000, 0 2px 4px #000; }
.logo.small span:last-child { font-size: .34em; }

.hint.warn { margin-top: 4px; font-size: 12px; opacity: .8; text-align: center; }

/* quick mute, next to the menu, on the title / menu / lobby screens */
.sound-global { position: fixed; z-index: 47; top: calc(10px + var(--safe-t)); right: 56px; }
.sound-global.muted { opacity: .7; box-shadow: 0 0 0 1px #a3101c inset; }
.sound-global { display: none; }
body[data-screen="s-menu"] .sound-global, body[data-screen="s-lobby"] .sound-global { display: block; }
body.tv .sound-global { display: none !important; }

/* readable over the bright title art */
.title-inner .hint { color: #e8dcc0; text-shadow: 0 0 6px #000, 0 1px 3px #000; background: rgba(0,0,0,.55); padding: 3px 10px; border-radius: 8px; }
