:root { --bg: #1a0a12; --card: #2b1120; --card2: #3a1730; --accent: #FF3B5C; --gold: #FFC94A; --teamA: #FF9933; --teamB: #22D3EE; --green: #2fbf71; --red: #ff5a6a; --ink: #fdf0f4; --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%, #4a1530, 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(255,59,92,.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); }
.logo.sm { font-size: 22px; margin-bottom: 8px; text-align: center; }
.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: #2a0a10; background: linear-gradient(180deg, #ff8aa0, var(--accent)); border: 0; border-radius: 14px; cursor: pointer; box-shadow: 0 4px 0 #a3122c; }
button.primary.alt { background: linear-gradient(180deg, #4de3f7, #14a9c4); box-shadow: 0 4px 0 #0c6e82; color: #052a33; }
button.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #a3122c; }
button.primary:disabled { opacity: .5; }
button.primary.wide { width: auto; flex: 1; }
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; }
button.ghost.wide { width: auto; flex: 1; margin-top: 0; }
.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; }

/* team rosters (local + online lobby) */
.teams-setup { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.team-col { border-radius: 16px; padding: 10px; border: 1.5px solid rgba(255,255,255,.15); background: rgba(255,255,255,.04); }
.team-col.ta { border-color: rgba(255,153,51,.5); } .team-col.tb { border-color: rgba(34,211,238,.5); }
.team-head { font-weight: 800; text-align: center; margin-bottom: 8px; }
.team-col.ta .team-head { color: var(--teamA); } .team-col.tb .team-head { color: var(--teamB); }
.roster { display: flex; flex-direction: column; gap: 6px; min-height: 30px; }
.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 button { flex: none; font-size: 11px; padding: 3px 7px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); cursor: pointer; color: inherit; }
.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; }

/* lobby / local config: category chips + rounds + seconds */
.cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cats button { padding: 7px 11px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07); font-size: 13px; font-weight: 700; cursor: pointer; }
.cats button.on { border-color: var(--gold); background: rgba(255,201,74,.18); color: var(--gold); }
.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); }

/* pass-the-device privacy screen */
.pass-card { width: min(420px, 100%); text-align: center; }
.pass-emoji { font-size: 60px; }
.pass-card h2 { color: var(--gold); margin: 6px 0; }

/* the acting screen */
.act { padding-top: 46px; gap: 10px; }
.teamsbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; width: min(520px, 100%); }
.tchip { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.15); }
.tchip.ta { border-color: rgba(255,153,51,.55); align-items: flex-start; }
.tchip.tb { border-color: rgba(34,211,238,.55); align-items: flex-end; }
.tchip b { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.tchip.ta b { color: var(--teamA); } .tchip.tb b { color: var(--teamB); }
.tchip span { font-size: 24px; font-weight: 900; color: var(--gold); }
.tchip span.bump { animation: pop .35s ease-out; }
@keyframes pop { 40% { transform: scale(1.25); } }
.turnof { text-align: center; 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(--green), #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; }
#actorView, #watchView { width: min(520px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wordcat { font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); font-weight: 800; }
.wordcard { width: 100%; min-height: 110px; display: grid; place-items: center; text-align: center; padding: 20px 16px; border-radius: 20px; background: linear-gradient(180deg, var(--card2), var(--card)); border: 1.5px solid rgba(255,59,92,.55); font-size: 24px; font-weight: 900; line-height: 1.35; animation: cardIn .35s ease-out; }
@keyframes cardIn { from { transform: translateY(14px) scale(.96); opacity: 0; } }
.tallyRow { color: var(--muted); font-weight: 700; } .tallyRow b { color: var(--gold); font-size: 18px; }
.actbtns { display: flex; gap: 10px; width: 100%; }
.watch-emoji { font-size: 54px; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.watch-msg { font-weight: 800; font-size: 18px; text-align: center; }
.tools { width: min(520px, 100%); display: flex; justify-content: center; }
.reacts { display: flex; gap: 6px; } .reacts button { font-size: 22px; padding: 6px 8px; border-radius: 12px; border: 0; background: rgba(255,255,255,.08); cursor: pointer; }
.reacts button:active { transform: scale(1.3); }

/* turn results */
.turnend-score { font-size: 40px; font-weight: 900; color: var(--gold); text-align: center; margin: 6px 0 10px; }
.wordlist { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-height: 240px; overflow-y: auto; }
.wchip { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.wchip.correct { background: rgba(47,191,113,.22); border: 1px solid rgba(47,191,113,.6); color: #9df0bd; }
.wchip.passed { background: rgba(255,90,106,.15); border: 1px solid rgba(255,90,106,.45); color: #ffb3ba; text-decoration: line-through; }

/* results */
.res-icon { font-size: 60px; text-align: center; } .res-title { text-align: center; margin: 4px 0 10px; color: var(--gold); font-size: 26px; }
.res-scores { display: flex; justify-content: space-around; gap: 10px; margin-bottom: 4px; }
.rs { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; padding: 10px; border-radius: 14px; }
.rs.ta { background: rgba(255,153,51,.12); border: 1.5px solid rgba(255,153,51,.4); } .rs.ta b { color: var(--teamA); }
.rs.tb { background: rgba(34,211,238,.12); border: 1.5px solid rgba(34,211,238,.4); } .rs.tb b { color: var(--teamB); }
.rs.winner { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(255,201,74,.5); }
.rs span { font-size: 30px; font-weight: 900; color: var(--gold); }

/* toasts, hearts, chat — shared party-game chrome */
#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; }
#floaters { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.dock { position: fixed; right: 10px; bottom: 64px; z-index: 60; display: none; flex-direction: column; gap: 8px; }
body.dc-online .dock { display: flex; }   /* hearts/chat are an online-room feature; local pass-the-phone play has no use for them */
.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; }
