:root { --bg: #1a0310; --card: #2b0f1f; --card2: #3a1530; --accent: #B8004A; --gold: #FFC94A; --honest: #2BB673; --chor: #E91E8C; --red: #ff5a6a; --ink: #fdeef4; --muted: #d7a9bd; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at 50% -10%, #4a1030, var(--bg) 62%); color: var(--ink); font-family: 'Noto Sans Devanagari','Noto Sans Telugu','Noto Sans Kannada','Noto Sans Tamil','Noto Sans Malayalam', system-ui, sans-serif; }
[hidden] { display: none !important; }
.screen { min-height: 100dvh; padding: 56px 12px 64px; display: flex; flex-direction: column; align-items: center; }
.screen.center { justify-content: center; text-align: center; gap: 8px; padding-top: 40px; }
.card { width: min(480px, 100%); background: var(--card); border: 1.5px solid rgba(184,0,74,.5); border-radius: 22px; padding: 18px; }
.card.wide { width: min(560px, 100%); }
.logo { font-size: 32px; font-weight: 800; text-align: center; color: var(--gold); }
.sub { text-align: center; color: var(--muted); margin: 4px 0 12px; line-height: 1.45; }
.lbl { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.err { color: #ff8a92; min-height: 18px; font-size: 13px; margin-top: 8px; text-align: center; }
.fine { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.45; }
.fine.c { text-align: center; }
button { font: inherit; color: inherit; }
button.primary { width: 100%; margin-top: 10px; padding: 13px; font-weight: 800; font-size: 17px; color: #fff; background: linear-gradient(180deg, #ff5a9e, var(--accent)); border: 0; border-radius: 14px; cursor: pointer; box-shadow: 0 4px 0 #700030; }
button.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #700030; }
button.primary:disabled { opacity: .5; }
button.ghost { width: 100%; margin-top: 10px; padding: 10px; font-weight: 700; color: var(--gold); background: transparent; border: 1.5px solid rgba(255,201,74,.5); border-radius: 14px; cursor: pointer; }
.kind { font-size: 12px; font-weight: 700; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.07); cursor: pointer; white-space: nowrap; }
.prow { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.prow input { flex: 1; min-width: 0; font: inherit; padding: 9px 11px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.28); color: inherit; }
.code-in { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-weight: 800; }
.room-code { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 40px; font-weight: 900; letter-spacing: 8px; color: var(--gold); }
.room-code .kind { letter-spacing: 0; font-size: 13px; }

/* roster (lobby + results) */
.roster { display: flex; flex-direction: column; gap: 6px; min-height: 30px; margin-top: 6px; }
.roster-row { display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.22); border-radius: 10px; padding: 6px 8px; font-size: 13px; }
.roster-row b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-row .off { opacity: .4; }
.badge { font-size: 9px; font-weight: 800; letter-spacing: .5px; color: #2a0a10; background: var(--gold); border-radius: 7px; padding: 1px 5px; }
.badge.chor { color: #fff; background: var(--chor); }
.seg { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.seg button { padding: 7px 12px; border-radius: 10px; border: 1.5px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); cursor: pointer; font-weight: 700; }
.seg button.on { border-color: var(--gold); background: rgba(255,201,74,.16); color: var(--gold); }

/* private role reveal */
.role-card { width: min(440px, 100%); text-align: center; }
.role-emoji { font-size: 60px; }
.role-card h2 { color: var(--gold); margin: 6px 0; }
.decoy-box { margin-top: 14px; text-align: left; background: rgba(0,0,0,.25); border-radius: 14px; padding: 10px 14px; }
.decoy-box ul { margin: 4px 0 0; padding-left: 18px; }
.decoy-box li { font-size: 13px; margin: 4px 0; color: var(--ink); }

/* round: bar + timer */
.round { padding-top: 46px; gap: 10px; }
.roundbar { display: flex; align-items: center; justify-content: space-between; width: min(520px, 100%); }
.phasechip { font-weight: 800; color: var(--gold); font-size: 15px; }
.roundof { font-size: 12px; color: var(--muted); font-weight: 700; }
.timer { position: relative; width: min(520px, 100%); height: 16px; border-radius: 10px; background: rgba(255,255,255,.12); overflow: hidden; }
#timerBar { height: 100%; width: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--honest), #b6e04a); transform-origin: left; }
#timerBar.warn { background: linear-gradient(90deg, var(--gold), #ff9a3d); } #timerBar.crit { background: linear-gradient(90deg, var(--red), #ff8a6a); }
#timerNum { position: absolute; right: 8px; top: -1px; font-size: 12px; text-shadow: 0 1px 2px #000; }

/* discuss panel */
#discussPanel { width: min(520px, 100%); }
.mytask-card { display: flex; align-items: center; gap: 12px; background: linear-gradient(180deg, var(--card2), var(--card)); border: 1.5px solid rgba(184,0,74,.5); border-radius: 18px; padding: 16px; }
.mt-emoji { font-size: 34px; }
.mt-text { font-weight: 700; font-size: 15px; line-height: 1.4; }

/* vote panel */
#votePanel { width: min(520px, 100%); }
.vote-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.vote-opt { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); cursor: pointer; font-weight: 700; }
.vote-opt.picked { border-color: var(--chor); background: rgba(233,30,140,.2); }
.vote-opt.self { opacity: .45; cursor: default; }
.vote-opt .vo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-opt .vo-mark { font-size: 13px; min-width: 16px; text-align: right; }

/* player strip (alive/eliminated at a glance) */
.player-strip { width: min(520px, 100%); display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.08); }
.chip.out { text-decoration: line-through; opacity: .45; }
.chip.dim { opacity: .55; }
.tools { width: min(520px, 100%); display: flex; justify-content: center; }

/* reveal */
.reveal-emoji { font-size: 54px; }

/* results */
.res-icon { font-size: 60px; text-align: center; } .res-title { text-align: center; margin: 4px 0 6px; color: var(--gold); font-size: 26px; }
.res-body { text-align: center; }

/* toasts, hearts, chat — shared party-game chrome (same pattern as every other room game) */
#toasts { position: fixed; left: 50%; top: 56px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { background: #1c1138; border: 1.5px solid rgba(255,201,74,.6); border-radius: 12px; padding: 8px 14px; font-weight: 700; font-size: 14px; }
.dock { position: fixed; right: 10px; bottom: 64px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.dock-btn { position: relative; width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,201,74,.6); background: #1c1138; font-size: 22px; cursor: pointer; padding: 0; box-shadow: 0 6px 16px rgba(0,0,0,.45); }
.unread { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
#hearts { position: fixed; right: 0; bottom: 0; width: 120px; height: 60vh; pointer-events: none; z-index: 65; overflow: hidden; }
.float-heart { position: absolute; bottom: 60px; font-size: 26px; opacity: 0; animation: heartFloat 2.4s ease-out forwards; }
@keyframes heartFloat { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 0), -55vh) scale(1.1) rotate(var(--rot, 0deg)); } }
.chat-panel { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 80; max-width: 480px; margin: 0 auto; background: var(--card); border: 2px solid rgba(255,201,74,.5); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 60vh; }
.chat-head { display: flex; justify-content: space-between; align-items: center; color: var(--gold); }
.chat-log { overflow-y: auto; min-height: 90px; display: flex; flex-direction: column; gap: 6px; }
.chat-empty { color: var(--muted); text-align: center; padding: 14px 0; font-size: 13px; }
.cmsg { display: flex; gap: 6px; align-items: flex-start; }
.cmsg .bub { background: rgba(255,255,255,.09); border-radius: 12px; padding: 5px 9px; font-size: 14px; overflow-wrap: anywhere; }
.cmsg.mine { flex-direction: row-reverse; } .cmsg.mine .bub { background: rgba(255,201,74,.18); }
.cmsg .bub b { display: block; font-size: 11px; color: var(--gold); }
.quick-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.quick-row button { flex: none; font: inherit; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 14px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.07); color: inherit; cursor: pointer; white-space: nowrap; }
.chat-in { display: flex; gap: 6px; } .chat-in input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.25); color: inherit; }
.ad-slot { width: min(480px, 100%); margin-top: 12px; }
