/* Kanlı Han v3 — 3D sahne üstü ince arayüz */
:root {
  --ink: #f3e9e4; --mute: #c2b1b8; --line: rgba(255, 255, 255, .12);
  --glass: rgba(14, 9, 12, .72); --glass2: rgba(255, 255, 255, .07);
  --blood: #c0182f; --blood2: #ff3b52; --gold: #f2b84b; --accent: var(--gold);
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px);
}
body[data-phase="night"] { --accent: #9fb0ff; }
body[data-phase="vote"] { --accent: var(--blood2); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: #0b0710; color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior: none; touch-action: manipulation; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
.mute { color: var(--mute); font-size: .88rem; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }

/* ---------- 3D sahne ---------- */
#stage { position: fixed; inset: 0; z-index: 0; background: radial-gradient(circle at 50% 30%, #3a1a28, #0b0710 70%); }
.s3-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.s3-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.s3-lbl { position: absolute; left: 0; top: 0; pointer-events: none; text-align: center; white-space: nowrap; will-change: transform; }
.s3-lbl b { display: inline-block; font-size: .74rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: rgba(10, 6, 8, .72); border: 1px solid rgba(255, 255, 255, .14); text-shadow: 0 1px 2px #000; transition: transform .2s var(--spring), background .2s; }
.s3-lbl i { display: block; font-style: normal; font-size: .66rem; color: var(--gold); margin-top: 2px; text-shadow: 0 1px 3px #000; }
.s3-lbl.pick { pointer-events: auto; cursor: pointer; }
.s3-lbl.pick b { border-color: rgba(255, 255, 255, .5); }
.s3-lbl.sel b { background: var(--gold); color: #1a0d05; text-shadow: none; transform: scale(1.12); }
.s3-lbl.mark b { border-color: var(--blood2); box-shadow: 0 0 10px rgba(255, 59, 82, .6); }
.s3-lbl.v b { border-color: rgba(255, 59, 82, .7); }
.s3-lbl.dead { opacity: .6; }
.s3-lbl.dead b { text-decoration: line-through; }
.s3-lbl.me b { background: rgba(60, 40, 10, .8); }

/* ---------- üst katman ---------- */
#app { position: fixed; inset: 0; z-index: 2; pointer-events: none; display: flex; flex-direction: column; }
#app > * { pointer-events: auto; }
#app > .mid { pointer-events: none; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 14px; overflow: hidden; min-height: 0; }
#app > .mid > * { pointer-events: auto; }
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
body.lite .glass, body.lite .bottom, body.lite .plate { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(14, 9, 12, .9); }

.top { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--st)) 10px 8px; background: linear-gradient(180deg, rgba(8, 5, 8, .85), rgba(8, 5, 8, 0)); }
.tb { position: relative; flex: none; height: 38px; min-width: 38px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(10, 6, 8, .6); font-weight: 800; letter-spacing: 1px; cursor: pointer; }
.tb i { position: absolute; top: -5px; right: -5px; font-style: normal; font-size: .62rem; background: var(--gold); color: #1a0d05; border-radius: 99px; padding: 1px 5px; letter-spacing: 0; }
.tt { flex: 1; min-width: 0; text-align: center; line-height: 1.15; text-shadow: 0 2px 6px #000; }
.tt b { display: block; font-size: 1.08rem; font-family: Georgia, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt small { color: var(--mute); font-size: .72rem; }
.tm { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.tm svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.tm .tr-bg { fill: rgba(10, 6, 8, .65); stroke: rgba(255, 255, 255, .12); stroke-width: 3; }
.tm .tr { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .3s linear; }
.tm span { position: relative; font-size: .72rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tm.low .tr { stroke: var(--blood2); }
.tm.low span { color: var(--blood2); animation: beat .5s ease-in-out infinite alternate; }
@keyframes beat { to { transform: scale(1.15); } }
.hostrow { align-self: center; display: flex; gap: 6px; align-items: center; padding: 0 10px; font-size: .9rem; }
.hostrow .chip { background: rgba(10, 6, 8, .7); }

.bottom { margin: 0 auto calc(10px + var(--sb)); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--glass); border: 1px solid var(--line); border-radius: 20px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: 560px; width: calc(100% - 20px); }
.bottom:empty { display: none; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.bottom h2 { font-size: 1.02rem; display: flex; align-items: center; gap: 6px; }
.act { display: flex; flex-direction: column; gap: 8px; }
.act.v h2 { color: #ff8a9a; }
.hint { font-size: .85rem; color: var(--mute); }
.hint b { color: var(--ink); }
.warn { font-size: .85rem; color: #ffb3bd; text-align: center; }
.waiting { text-align: center; color: var(--mute); padding: 6px; }
.dots i { font-style: normal; animation: dot 1.4s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 60%, 100% { opacity: .2; } 30% { opacity: 1; } }
.sleepbox { text-align: center; color: var(--mute); }
.zzz { display: inline-block; position: relative; width: 24px; height: 20px; }
.zzz i { position: absolute; left: 0; font-style: normal; font-weight: 800; color: #9fb0ff; animation: zzz 3s ease-in infinite; opacity: 0; }
.zzz i:nth-child(2) { animation-delay: 1s; } .zzz i:nth-child(3) { animation-delay: 2s; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 8px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -16px) scale(1.4); } }
.meter { height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .1); margin-top: 8px; overflow: hidden; }
.meter b { display: block; height: 100%; background: var(--accent); transition: width .5s var(--ease); }

/* ---------- düğmeler ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 14px; padding: 12px 14px; font-weight: 700; cursor: pointer; position: relative; overflow: hidden; transition: transform .15s var(--ease), opacity .2s; user-select: none; white-space: nowrap; }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(180deg, #e0283f, #9c0f22); box-shadow: 0 5px 0 #5e0814, 0 8px 20px rgba(192, 24, 47, .35); color: #fff; }
.btn.primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #5e0814; }
body[data-phase="night"] .btn.primary:not(.blood) { background: linear-gradient(180deg, #5d6fe0, #34409a); box-shadow: 0 5px 0 #1f2766, 0 8px 20px rgba(80, 100, 220, .35); }
body[data-phase="day"] .btn.primary, body[data-phase="over"] .btn.primary { background: linear-gradient(180deg, #f6b545, #c77a12); box-shadow: 0 5px 0 #7a4705; color: #2a1503; }
.btn.ghost { background: var(--glass2); border: 1px solid var(--line); }
.btn.ghost.on { background: var(--gold); color: #1a0d05; }
.btn.link { background: none; color: var(--mute); font-weight: 500; }
.btn.big { flex: 1; padding: 15px 14px; font-size: 1rem; border-radius: 16px; min-width: 0; text-overflow: ellipsis; }
.btn.sq { flex: none; width: 50px; padding: 12px 0; font-size: 1.15rem; }
.btn.glow::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-100%); animation: shine 2.4s ease-in-out infinite; }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.btn .fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .22); transition: width .5s var(--ease); }
.btn .lbl { position: relative; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; }
.chip { flex: none; border: 1px solid var(--line); background: var(--glass2); border-radius: 99px; padding: 7px 12px; font-size: .84rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform .15s; }
.chip:active { transform: scale(.94); }
.chip.on { background: var(--accent); color: #160a0c; border-color: transparent; }
.chip.v { border-color: rgba(255, 59, 82, .5); color: #ffb3bd; }
.chip-btn { background: rgba(10, 6, 8, .6); border: 1px solid var(--line); border-radius: 99px; padding: 7px 12px; font-size: .8rem; color: var(--mute); cursor: pointer; }
.pill { display: inline-block; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; font-size: .74rem; font-weight: 600; margin: 2px; }

/* ---------- ana ekran ---------- */
.home { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; padding: calc(20px + var(--st)) 16px calc(18px + var(--sb)); max-width: 480px; width: 100%; margin: 0 auto; }
.logo { text-align: center; margin-bottom: auto; padding-top: 4vh; }
.title { font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 15vw, 4.4rem); line-height: .95; text-shadow: 0 4px 0 #3b0710, 0 0 30px rgba(255, 40, 70, .5), 0 6px 30px #000; }
.title span { display: block; animation: drop .9s var(--spring) both; }
.title span:last-child { color: var(--blood2); animation-delay: .15s; }
@keyframes drop { from { opacity: 0; transform: translateY(-40px) scale(1.3); } }
.drips { position: relative; height: 26px; width: 160px; margin: -4px auto 0; }
.drips i { position: absolute; top: 0; width: 7px; border-radius: 0 0 6px 6px; background: var(--blood); animation: drip 3.6s ease-in infinite; }
.drips i:nth-child(1) { left: 18%; animation-delay: .4s; } .drips i:nth-child(2) { left: 52%; animation-delay: 1.6s; } .drips i:nth-child(3) { left: 80%; animation-delay: 2.5s; }
@keyframes drip { 0% { height: 0; opacity: 1; } 40% { height: 22px; } 70% { height: 22px; transform: translateY(0); opacity: 1; } 100% { height: 10px; transform: translateY(30px); opacity: 0; } }
.tagline { text-align: center; margin: 0; text-shadow: 0 2px 8px #000; }
.join-panel { padding: 14px; display: flex; flex-direction: column; gap: 10px; animation: up .6s .3s var(--ease) both; }
input { width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink); background: rgba(0, 0, 0, .4); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; outline: none; }
input:focus { border-color: var(--blood2); box-shadow: 0 0 0 3px rgba(255, 59, 82, .2); }
.nudge { animation: nudge .4s; border-color: var(--blood2) !important; }
@keyframes nudge { 25% { transform: translateX(-8px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }
.invite { text-align: center; color: var(--mute); }
.invite b { color: var(--ink); letter-spacing: 3px; font-size: 1.2rem; }
.code-row { display: flex; gap: 8px; }
.code-in { text-align: center; letter-spacing: 8px; font-weight: 800; text-transform: uppercase; }
.home-foot { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

/* ---------- lobi ---------- */
.plate { align-self: center; margin-top: 4px; padding: 10px 14px 12px; text-align: center; background: var(--glass); border: 1px solid var(--line); border-radius: 18px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.plate small { color: var(--mute); font-size: .74rem; }
.tiles { display: flex; gap: 6px; justify-content: center; margin: 4px 0 10px; }
.tiles span { width: 42px; height: 50px; display: grid; place-items: center; font-size: 1.6rem; font-weight: 900; border-radius: 10px; background: linear-gradient(180deg, #3a2414, #1d120a); border: 1px solid rgba(242, 184, 75, .4); color: #ffe2a8; text-shadow: 0 0 12px rgba(255, 180, 60, .6); }
.plate .row { justify-content: center; flex-wrap: wrap; }
body[data-phase="lobby"] .bottom { margin-top: auto; }

/* ---------- gündüz / son ---------- */
.subtitle { max-width: 520px; margin-top: auto; margin-bottom: 4px; padding: 8px 14px; border-radius: 14px; background: rgba(10, 6, 8, .6); font-family: Georgia, serif; font-style: italic; font-size: 1.02rem; text-align: center; text-shadow: 0 1px 3px #000; }
.scroll { max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 6px; cursor: pointer; max-height: 46vh; overflow-y: auto; }
.scroll small { text-align: center; font-size: .7rem; color: var(--mute); text-shadow: 0 1px 3px #000; }
.ann { background: linear-gradient(180deg, #f1e2c4, #dcc69c); color: #2b1b10; border-radius: 12px; padding: 9px 12px; font-size: .9rem; box-shadow: 0 6px 16px rgba(0, 0, 0, .45); border-left: 4px solid #8a1a22; transform-origin: top; }
@keyframes unroll { from { opacity: 0; transform: scaleY(.2) translateY(-10px); } }
.ann-btn { border: 1px solid rgba(242, 184, 75, .5); background: rgba(40, 25, 10, .8); border-radius: 99px; padding: 7px 14px; font-weight: 700; cursor: pointer; }
.ann-btn i { font-style: normal; background: var(--gold); color: #1a0d05; border-radius: 99px; padding: 0 6px; margin-left: 4px; font-size: .75rem; }
.winner { text-align: center; padding: 14px 22px; border-radius: 20px; background: rgba(20, 12, 4, .75); border: 1px solid rgba(242, 184, 75, .5); }
.winner.w-vampir { background: rgba(30, 4, 8, .8); border-color: rgba(255, 59, 82, .6); }
.w-ic { font-size: 3rem; animation: float 3s 1.2s ease-in-out infinite; }
.winner h1 { font-family: Georgia, serif; font-size: 1.5rem; color: var(--gold); letter-spacing: 1px; }
.w-vampir h1 { color: var(--blood2); }
.winner p { margin: 2px 0 0; color: var(--mute); font-size: .9rem; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes float { 50% { transform: translateY(-6px); } }

/* giriş animasyonları: sadece aşama değişince (#app.enter) */
.enter .bottom { animation: up .5s 1.6s var(--ease) both; }
.enter .plate { animation: up .5s .3s var(--ease) both; }
.enter .subtitle { animation: up .7s 2s var(--ease) both; }
.enter .ann { animation: unroll .6s var(--ease) both; animation-delay: calc(var(--i) * .3s + 1.8s); }
.enter .winner { animation: pop .8s 1.6s var(--spring) both; }

/* ---------- alt sayfa ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0); transition: background .25s; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap.on { background: rgba(0, 0, 0, .55); }
.sheet { width: 100%; max-width: 560px; max-height: 86vh; display: flex; flex-direction: column; background: #1a1119; border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform .3s var(--ease); }
.sheet-wrap.on .sheet { transform: none; }
.sheet .grab { width: 44px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .2); margin: 10px auto 4px; flex: none; }
.sheet-c { overflow-y: auto; padding: 6px 18px calc(18px + var(--sb)); display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.sheet h3 { font-size: 1.15rem; }
.sheet h3 small { font-weight: 400; color: var(--mute); font-size: .75rem; }
.sheet h4 { font-size: .95rem; margin-top: 4px; }
.set-h { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: rgba(0, 0, 0, .35); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: none; padding: 9px; font-weight: 700; border-radius: 9px; cursor: pointer; color: var(--mute); }
.seg button.on { background: var(--blood); color: #fff; }
.rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rtile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 12px; background: var(--glass2); border: 1px solid transparent; min-width: 0; }
.rtile.on { border-color: rgba(242, 184, 75, .5); background: rgba(242, 184, 75, .1); }
.rtile.on.v { border-color: rgba(255, 59, 82, .55); background: rgba(255, 59, 82, .12); }
.rtile .re { font-size: 1.2rem; cursor: help; }
.rtile .rn { flex: 1; font-size: .8rem; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: help; }
.step { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; }
.step button { width: 36px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); font-weight: 800; cursor: pointer; }
.step button:disabled { opacity: .3; }
.menu { display: flex; flex-direction: column; gap: 6px; }
.mi { text-align: left; border: 1px solid var(--line); background: var(--glass2); border-radius: 14px; padding: 14px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.mi small { color: var(--mute); letter-spacing: 2px; }
.mi.danger { color: #ff8a9a; border-color: rgba(255, 59, 82, .35); }
.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.rolelist { display: flex; flex-direction: column; gap: 8px; }
.rli { display: flex; gap: 10px; padding: 10px; border-radius: 12px; background: var(--glass2); }
.rli.v { background: rgba(192, 24, 47, .15); }
.rli .re { font-size: 1.6rem; }
.rli p { margin: 2px 0 0; font-size: .85rem; color: var(--mute); }
.note { padding: 8px 10px; border-left: 3px solid var(--gold); background: rgba(0, 0, 0, .3); border-radius: 0 10px 10px 0; font-size: .9rem; }
.note span { display: block; font-size: .7rem; color: var(--gold); text-transform: uppercase; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tok { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 14px; background: var(--glass2); border: 1.5px solid transparent; text-align: center; min-width: 0; cursor: pointer; }
.tok .av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; color: #fff; background: radial-gradient(circle at 35% 30%, hsl(var(--h, 0) 60% 58%), hsl(var(--h, 0) 50% 28%)); }
.tok .nm { font-size: .8rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tok .tg { font-size: .68rem; color: var(--gold); }
.tok.sel { border-color: var(--gold); background: rgba(242, 184, 75, .15); }
.tok.v { border-color: rgba(255, 59, 82, .5); background: rgba(192, 24, 47, .15); }
.tok.dead { opacity: .6; }
.flipcard { perspective: 900px; }
.fc-in { padding: 20px; border-radius: 18px; text-align: center; background: radial-gradient(circle at 50% 0%, #4a3a22, #1a1210 75%); border: 1px solid rgba(242, 184, 75, .45); animation: flip .7s var(--spring) both; }
.flipcard.v .fc-in { background: radial-gradient(circle at 50% 0%, #5a0f1e, #1d070c 75%); border-color: rgba(255, 59, 82, .55); }
@keyframes flip { from { transform: rotateY(-180deg); opacity: 0; } }
.fc-in .re { font-size: 3rem; }
.fc-in .rn { font-family: Georgia, serif; font-size: 1.5rem; font-weight: 700; color: var(--gold); }
.flipcard.v .rn { color: var(--blood2); }
.fc-in p { color: #e8dcd6; font-size: .92rem; }

/* ---------- aşama perdesi ---------- */
#curtain { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; pointer-events: none; opacity: 0; visibility: hidden; }
#curtain.on { visibility: visible; animation: curtain 2s ease both; }
#curtain::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(10, 6, 14, .85), #000); }
#curtain.c-night::before { background: radial-gradient(circle, rgba(18, 26, 70, .92), #02030a); }
#curtain.c-day::before { background: radial-gradient(circle, rgba(250, 190, 110, .94), rgba(120, 50, 30, .98)); }
#curtain.c-vote::before { background: radial-gradient(circle, rgba(120, 10, 25, .94), #140004); }
#curtain.c-over::before { background: radial-gradient(circle, rgba(90, 60, 15, .94), #0a0602); }
.c-band { position: relative; text-align: center; }
#curtain.on .c-ic { animation: cic 2s var(--spring) both; }
#curtain.on .c-t, #curtain.on .c-s { animation: ct 2s var(--ease) both; }
.c-ic { font-size: 5rem; }
.c-t { font-family: Georgia, serif; font-size: 2.3rem; font-weight: 700; letter-spacing: 6px; color: #fff; }
#curtain.c-day .c-t { color: #3a1606; }
#curtain.c-day .c-s { color: #5a2a10; }
.c-s { color: rgba(255, 255, 255, .78); margin-top: 4px; }
@keyframes curtain { 0% { opacity: 0; } 18% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cic { 0% { transform: scale(.3) translateY(40px); opacity: 0; } 25% { transform: none; opacity: 1; } 85% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes ct { 0% { opacity: 0; letter-spacing: 20px; } 30% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- bildirim ---------- */
#toast { position: fixed; left: 50%; top: calc(70px + var(--st)); z-index: 40; transform: translate(-50%, -30px); opacity: 0; pointer-events: none; background: #f3e9e4; color: #1a0d12; font-weight: 700; padding: 10px 16px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: calc(100% - 32px); text-align: center; font-size: .9rem; transition: transform .35s var(--spring), opacity .25s; }
#toast.on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- kişisel efektler (fx.js) ---------- */
.fx { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; overflow: hidden; cursor: pointer; animation: fxin .35s ease both; }
.fx.out { animation: fxout .26s ease both; }
@keyframes fxin { from { opacity: 0; } }
@keyframes fxout { to { opacity: 0; transform: scale(1.05); } }
.fx-k-death { background: radial-gradient(circle, rgba(90, 0, 12, .88), rgba(10, 0, 2, .96)); }
.fx-k-save { background: radial-gradient(circle, rgba(10, 70, 45, .88), rgba(2, 14, 8, .96)); }
.fx-k-info { background: radial-gradient(circle, rgba(45, 30, 95, .88), rgba(6, 4, 16, .96)); }
.fx-k-dark { background: radial-gradient(circle, rgba(40, 40, 50, .9), rgba(4, 4, 6, .96)); }
.fx-k-win { background: radial-gradient(circle, rgba(110, 75, 10, .88), rgba(14, 8, 2, .96)); }
.fx-art { position: relative; width: 100%; height: 42vh; display: grid; place-items: center; }
.fx-icon { position: relative; z-index: 2; font-size: clamp(5rem, 28vw, 8rem); filter: drop-shadow(0 0 30px rgba(255, 255, 255, .25)); }
.fx-text { position: relative; z-index: 2; text-align: center; padding: 0 22px; animation: up .6s .3s var(--ease) both; }
.fx-text b { display: block; font-family: Georgia, serif; font-size: clamp(1.8rem, 9vw, 2.6rem); letter-spacing: 2px; }
.fx-k-death .fx-text b { color: #ff4a5e; } .fx-k-save .fx-text b { color: #6ff0a8; } .fx-k-info .fx-text b { color: #c9b8ff; } .fx-k-win .fx-text b { color: var(--gold); }
.fx-text span { display: block; margin-top: 6px; font-size: 1.05rem; color: #eee; }
.fx-text small { display: block; margin-top: 14px; font-size: .72rem; color: rgba(255, 255, 255, .4); }
.fx-bar { position: absolute; left: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .5); animation: fxbar var(--dur) linear both; }
@keyframes fxbar { from { width: 100%; } to { width: 0; } }
.fx-a-slam { animation: slam .6s var(--spring) both; }
.fx-a-stab { animation: stab .5s cubic-bezier(.6, 0, .4, 1) both; }
.fx-a-wobble { animation: pop .5s var(--spring) both, wobble 1.2s .5s ease-in-out infinite; }
.fx-a-gutter { animation: pop .6s both, gutter 2s .6s ease-in-out infinite; }
.fx-a-swing { transform-origin: 50% -40%; animation: pop .5s both, swing 1.8s .5s ease-in-out infinite; }
.fx-a-spin { animation: spinin 1s var(--ease) both; }
.fx-a-beat { animation: pop .5s var(--spring) both, beat2 .9s .5s ease-in-out infinite; }
.fx-a-chop { transform-origin: 80% 80%; animation: chop .7s cubic-bezier(.7, 0, .3, 1) both; }
.fx-a-rise { animation: risebig 1s var(--ease) both; }
.fx-a-float { animation: pop .6s both, float 2.4s .6s ease-in-out infinite; }
.fx-a-tilt { animation: pop .5s both, tilt 1.6s .5s ease-in-out infinite; }
.fx-a-jig { animation: pop .5s both, jig .6s .5s ease-in-out infinite; }
@keyframes slam { 0% { transform: scale(3); opacity: 0; } 60% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1); } }
@keyframes stab { 0% { transform: translate(60vw, -40vh) rotate(-45deg); } 100% { transform: none; } }
@keyframes wobble { 50% { transform: rotate(8deg) scale(1.05); } }
@keyframes gutter { 50% { opacity: .5; transform: scale(.96); } }
@keyframes swing { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
@keyframes spinin { from { transform: rotate(-540deg) scale(0); opacity: 0; } }
@keyframes beat2 { 15% { transform: scale(1.15); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }
@keyframes chop { 0% { transform: rotate(-80deg) translateY(-20px); opacity: 0; } 50% { opacity: 1; } 75% { transform: rotate(12deg); } 100% { transform: none; } }
@keyframes risebig { from { transform: translateY(30vh) scale(.6); opacity: 0; } }
@keyframes tilt { 50% { transform: rotate(-10deg); } }
@keyframes jig { 25% { transform: rotate(-10deg) translateY(-6px); } 75% { transform: rotate(10deg) translateY(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flicker { 0%, 100% { opacity: 1; } 45% { opacity: .75; } 52% { opacity: .6; } }
@keyframes flame { 0% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08, .94) rotate(3deg); } 100% { transform: scale(.95, 1.08) rotate(-1deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.fx-p { position: absolute; font-style: normal; font-size: calc(1.4rem * var(--s)); z-index: 1; pointer-events: none; }
.fx-rise { bottom: -10%; animation: prise 3.2s ease-out both; }
.fx-fall { top: -10%; animation: pfall 3.6s linear both; }
.fx-burst { left: 50% !important; top: 50%; animation: pburst 1.4s var(--ease) both; }
@keyframes prise { from { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } to { transform: translateY(-110vh) rotate(var(--r)); opacity: 0; } }
@keyframes pfall { from { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } to { transform: translateY(115vh) rotate(var(--r)); opacity: .2; } }
@keyframes pburst { from { transform: translate(-50%, -50%) scale(.2); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(var(--s)) rotate(var(--r)); opacity: 0; } }
.fx-rings { position: absolute; inset: 0; display: grid; place-items: center; }
.fx-rings b { position: absolute; width: 140px; height: 140px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .5); animation: ring 2s ease-out infinite; }
.fx-rings b:nth-child(2) { animation-delay: .6s; } .fx-rings b:nth-child(3) { animation-delay: 1.2s; }
@keyframes ring { from { transform: scale(.4); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
.fx-bars { position: absolute; inset: -10vh 0; display: flex; justify-content: space-around; z-index: 3; animation: bars .5s .1s cubic-bezier(.7, 0, .3, 1) both; }
.fx-bars b { width: 12px; background: linear-gradient(90deg, #555, #ccc, #555); border-radius: 6px; }
.fx-bars.faint { opacity: .35; }
@keyframes bars { from { transform: translateY(-110%); } }
.fx-claw { position: absolute; width: 80%; max-width: 340px; height: 100%; z-index: 3; }
.fx-claw path { fill: #d01430; filter: drop-shadow(0 0 8px rgba(255, 0, 30, .7)); clip-path: inset(0 0 100% 0); animation: scratch .25s ease-out both; }
@keyframes scratch { to { clip-path: inset(0 0 0 0); } }
.fx-drip { position: absolute; top: 0; width: 10px; height: var(--h); background: linear-gradient(#8a0012, #d01430); border-radius: 0 0 8px 8px; transform-origin: top; animation: fxdrip 1.4s ease-in both; z-index: 1; }
@keyframes fxdrip { from { transform: scaleY(0); } }
.fx-slash { position: absolute; width: 140%; height: 6px; background: linear-gradient(90deg, transparent, #fff, #ff3048, transparent); transform: rotate(-30deg) scaleX(0); animation: slash .35s .35s ease-out both; }
@keyframes slash { to { transform: rotate(-30deg) scaleX(1); } }
.fx-beams { position: absolute; width: 520px; height: 520px; background: repeating-conic-gradient(rgba(255, 240, 190, .22) 0 8deg, transparent 8deg 18deg); border-radius: 50%; animation: spin 14s linear infinite; -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%); }
.fx-noose { position: absolute; top: -42vh; width: 4px; height: 50vh; background: #b08a5a; transform-origin: top; animation: noose 1.2s var(--spring) both, swing 2.2s 1.2s ease-in-out infinite; }
.fx-noose::after { content: ""; position: absolute; bottom: -40px; left: -18px; width: 32px; height: 44px; border: 5px solid #b08a5a; border-radius: 50%; }
@keyframes noose { from { transform: translateY(-50vh); } }
.fx-vortex { position: absolute; width: 380px; height: 380px; border-radius: 50%; background: repeating-conic-gradient(rgba(150, 60, 200, .35) 0 15deg, transparent 15deg 30deg); animation: spin 3s linear infinite; }
.fx-chain { position: absolute; width: 150%; height: 18px; background: repeating-linear-gradient(90deg, #888 0 22px, #444 22px 26px); border-radius: 9px; transform: rotate(28deg); z-index: 3; }
.fx-chain.c2 { transform: rotate(-28deg); }
.fx-orb { position: absolute; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, .6), rgba(150, 120, 255, .4) 40%, rgba(60, 30, 140, .2) 70%); box-shadow: 0 0 80px 20px rgba(150, 120, 255, .4); }
.fx-lamp { position: absolute; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 200, 100, .55), transparent 65%); animation: flicker 2s infinite; }
.fx-cross { position: absolute; width: 220px; height: 220px; border-radius: 50%; border: 3px solid #ff4a5e; animation: slam .6s both; }
.fx-cross::before, .fx-cross::after { content: ""; position: absolute; left: 50%; top: -20px; bottom: -20px; width: 3px; margin-left: -1.5px; background: #ff4a5e; }
.fx-cross::after { transform: rotate(90deg); }
.fx-moon { position: absolute; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffb4a0, #d9363e 55%, #7a0f1a); box-shadow: 0 0 90px 30px rgba(220, 40, 60, .45); animation: risebig 1.2s var(--ease) both; }
body.shake #app, body.shake #stage { animation: shake .5s ease both; }
@keyframes shake { 15%, 55% { transform: translate(-8px, 4px); } 35%, 75% { transform: translate(8px, -4px); } }
body.sick #stage { animation: sick 3.5s ease-in-out both; }
@keyframes sick { 20% { transform: rotate(1.2deg) translateX(4px); filter: blur(1px) hue-rotate(40deg); } 50% { transform: rotate(-1deg) translateX(-4px); filter: blur(1.5px) hue-rotate(80deg); } 80% { transform: rotate(.6deg); filter: blur(.5px); } }
.priest-scene { position: fixed; inset: 0; z-index: 45; background: radial-gradient(circle at 50% 30%, #2a1a10, #050302 75%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; overflow: hidden; animation: fxin 1s both; cursor: pointer; }
.ps-glow { position: absolute; width: 400px; height: 400px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 190, 90, .3), transparent 70%); }
.ps-candles { position: relative; display: flex; align-items: flex-end; gap: 16px; }
.ps-candle { position: relative; width: 14px; background: linear-gradient(#f3e6c8, #b8a07a); border-radius: 3px; }
.ps-candle b { position: absolute; left: 50%; bottom: 100%; width: 12px; height: 20px; margin-left: -6px; border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%; background: radial-gradient(circle at 50% 70%, #fff7c2, #ffb23c 60%, transparent); box-shadow: 0 0 22px 8px rgba(255, 170, 60, .4); transform-origin: 50% 100%; animation: flame 1.4s ease-in-out infinite alternate, out .6s var(--d) ease forwards; }
@keyframes out { to { opacity: 0; transform: scale(.2); } }
.ps-text { position: relative; text-align: center; font-family: Georgia, serif; font-size: 1.6rem; color: #f1e2c4; }
.ps-text span { display: block; animation: rise 1.2s .6s both; }
.ps-text span + span { animation-delay: 3.2s; color: #c9a77a; }
body.lite .btn.glow::after { animation: none; }

/* ---------- tuval efektleri (fx.js) ---------- */
.fxs { position: fixed; inset: 0; z-index: 50; cursor: pointer; animation: fxin .3s ease both; will-change: transform; }
.fxs.out { animation: fxout .28s ease both; }
.fxs.priest-scene { z-index: 45; }
.fxs canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fxs-text { position: absolute; left: 0; right: 0; bottom: 18%; text-align: center; padding: 0 22px; animation: up .7s .6s var(--ease) both; pointer-events: none; }
.fxs-text b { display: block; font-family: Georgia, serif; font-size: clamp(1.9rem, 9.5vw, 2.8rem); letter-spacing: 3px; text-shadow: 0 4px 20px #000, 0 0 30px currentColor; }
.fxs-k-death .fxs-text b { color: #ff4a5e; } .fxs-k-save .fxs-text b { color: #7dffb0; } .fxs-k-info .fxs-text b { color: #cdbcff; } .fxs-k-win .fxs-text b { color: var(--gold); } .fxs-k-dark .fxs-text b { color: #e8dcc8; }
.fxs-text span { display: block; margin-top: 8px; font-size: 1.08rem; color: #f2eee8; text-shadow: 0 2px 8px #000; }
.fxs-text small { display: block; margin-top: 16px; font-size: .72rem; color: rgba(255, 255, 255, .4); }
.priest-scene .fxs-text { bottom: auto; top: 14%; animation-delay: 1s; }
.priest-scene .fxs-text span { font-family: Georgia, serif; font-size: 1.4rem; color: #c9a77a; animation: up 1s 3.4s var(--ease) both; }
.fxs-bar { position: absolute; left: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .45); animation: fxbar var(--dur) linear both; }
body.q-low .bottom, body.q-low .plate, body.q-low .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(14, 9, 12, .92); }
body.q-low .btn.glow::after, body.q-low .tm.low span { animation: none; }

/* ---------- sinematik alt yazısı ---------- */
.cine-cap { margin-top: auto; margin-bottom: calc(18px + var(--sb)); max-width: 520px; text-align: center; padding: 12px 18px; border-radius: 16px; background: rgba(8, 4, 6, .7); border: 1px solid rgba(255, 59, 82, .35); animation: up .8s 2s var(--ease) both; }
.cine-cap b { display: block; font-family: Georgia, serif; font-size: 1.3rem; color: #ff6a7a; letter-spacing: 1px; }
.cine-cap span { display: block; margin-top: 4px; color: #eadfd8; }
.cine-cap i { font-style: normal; color: var(--gold); font-weight: 700; }
.cine-cap.priest { border-color: rgba(242, 184, 75, .4); }
.cine-cap.priest b { color: #f2d39a; }

/* ---------- sol altta kalıcı defter (gece sonuçları) ---------- */
.notes { position: fixed; left: 10px; bottom: calc(200px + var(--sb)); z-index: 3; max-width: min(78vw, 340px); background: rgba(30, 22, 12, .86); border: 1px solid rgba(242, 184, 75, .45); border-radius: 14px; box-shadow: 0 8px 22px rgba(0, 0, 0, .5); pointer-events: auto; overflow: hidden; }
.notes.fresh { animation: notesGlow 1.4s ease-in-out 3; }
@keyframes notesGlow { 50% { box-shadow: 0 0 0 3px rgba(242, 184, 75, .7), 0 0 26px rgba(242, 184, 75, .6); } }
.notes-h { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; padding: 8px 10px; font-weight: 800; font-size: .85rem; color: var(--gold); cursor: pointer; }
.notes-h i { font-style: normal; background: var(--gold); color: #1a0d05; border-radius: 99px; padding: 0 6px; font-size: .7rem; }
.notes-h span { margin-left: auto; color: var(--mute); }
.notes-last { padding: 0 10px 9px; font-size: .78rem; color: #f2e6d0; line-height: 1.3; }
.notes-b { max-height: 38vh; overflow-y: auto; padding: 0 10px 10px; }
.notes-n { border-left: 3px solid var(--gold); padding: 4px 8px; margin-top: 6px; background: rgba(0, 0, 0, .25); border-radius: 0 8px 8px 0; }
.notes-n b { display: block; font-size: .68rem; color: var(--gold); text-transform: uppercase; }
.notes-n p { margin: 2px 0 0; font-size: .82rem; color: #f2e6d0; }

/* oy dağılımı */
.votes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.vt { font-size: .78rem; background: rgba(0, 0, 0, .08); border-radius: 99px; padding: 2px 8px; }
.vt i { font-style: normal; color: #8a1a22; }
.vbars { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.vb { display: flex; align-items: center; gap: 6px; font-size: .8rem; }
.vb span { min-width: 64px; }
.vb b { display: inline-block; height: 14px; width: calc(var(--w) * 22px); background: #8a1a22; color: #fff; font-size: .7rem; text-align: right; padding-right: 4px; border-radius: 4px; animation: vgrow .8s var(--ease) both; }
@keyframes vgrow { from { width: 0; } }
/* oyun sonu tekrarı */
.replay { display: flex; flex-direction: column; gap: 6px; }
.rp { padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); border-left: 3px solid var(--gold); font-size: .88rem; animation: up .5s var(--ease) both; animation-delay: calc(var(--i) * .25s); }
.rp.n { border-color: #9fb0ff; } .rp.v { border-color: var(--blood2); }

/* hayalet sohbeti (sağ alt) */
.ghostc { position: fixed; right: 10px; bottom: calc(200px + var(--sb)); z-index: 3; width: min(78vw, 320px); background: rgba(20, 26, 40, .88); border: 1px solid rgba(160, 190, 255, .45); border-radius: 14px; overflow: hidden; pointer-events: auto; }
.ghostc:not(.open) { width: auto; }
.ghostc .notes-h { color: #bcd0ff; } .ghostc .notes-h i { background: #bcd0ff; }
.ghostc.fresh { animation: notesGlow 1.4s ease-in-out 3; }
.ghostc p { margin: 3px 0; font-size: .82rem; color: #e6ecff; } .ghostc p b { color: #bcd0ff; }
.ghostc form { display: flex; gap: 6px; padding: 0 8px 8px; }
.ghostc input { flex: 1; min-width: 0; border-radius: 10px; border: 1px solid rgba(160, 190, 255, .4); background: rgba(0, 0, 0, .35); color: #fff; padding: 8px; font-size: 16px; }
.ghostc .btn { padding: 6px 12px; }
