/* Full-height mobile conversation. Only the message history scrolls. */
body.room-open{overflow:hidden;overscroll-behavior:none}
.app.in-room{position:fixed;inset:auto;top:var(--visual-top,0px);left:50%;transform:translateX(-50%);width:100%;max-width:480px;height:var(--visual-height,100dvh);min-height:0;margin:0;padding:0;overflow:hidden;background:#0b0e13}
.app.in-room>header,.app.in-room>.demo,.app.in-room>nav{display:none!important}
.in-room #room.active{display:flex;flex-direction:column;width:100%;height:100%;min-height:0;padding:0;overflow:hidden;animation:none}
.room-topbar{flex:none;display:flex;align-items:center;gap:9px;min-height:62px;padding:9px 12px;border-bottom:1px solid #27303b;background:#12181f}
.room-topbar button{flex-shrink:0;border:0;cursor:pointer;background:none}
.room-back{width:32px;min-height:40px;color:#e7eef6;font-size:33px;line-height:1;padding:0}
.room-heading{flex:1;min-width:0}
.in-room #room .room-heading h2{font-size:17px;line-height:1.25;font-weight:750;margin:0 0 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:-.2px}
.room-online{display:flex;align-items:center;gap:5px;color:#20e89b;font-size:11px;line-height:1}
.room-online .dot{height:6px;width:6px;margin:0 2px 0 0;animation:none;box-shadow:0 0 7px #20e89b66}
.room-sample{font-size:10px;color:#9aa8b9}
.room-topbar .room-invite{border:1px solid #355246;border-radius:18px;padding:8px 10px;color:#65efb9;font-weight:650;font-size:11px}
.room-menu{width:25px;height:38px;font-size:23px;color:#adbac9;padding:0}
.room-scoreboard{flex:none;margin:9px 12px 0;padding:9px 12px 5px;border:1px solid #33404e;border-radius:14px;background:linear-gradient(120deg,#1a232d,#121820);box-shadow:0 5px 18px #0002}
.room-score-head{display:flex;align-items:center;justify-content:space-between;color:#a4b2c3;font-size:10px;letter-spacing:.15px;line-height:1.3;margin-bottom:8px}
.room-score-candidates{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
.room-candidate{display:flex;align-items:center;gap:8px;min-width:0}
.room-candidate-right{flex-direction:row-reverse;text-align:right}
.room-portrait{--portrait-color:#fff34b;display:block;position:relative;flex:0 0 40px;width:40px;height:40px;border:1.5px solid var(--portrait-color);border-radius:50%;background:#151a22;overflow:hidden}
.room-portrait-lula{--portrait-color:#ff304b}
.room-portrait img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:50% 14%;transform:none;border:0}
.room-candidate-data{min-width:0}
.room-candidate-name{font-size:11px;line-height:1.2;color:#f1f4f8;white-space:nowrap;display:block}
.room-candidate strong{display:block;font-size:24px;line-height:1.18;letter-spacing:-.7px;margin-top:2px;font-variant-numeric:tabular-nums}
.room-candidate strong b{font-size:inherit;font-weight:800}
.room-candidate small{font-size:13px;letter-spacing:0;margin-left:1px}
.room-vote-bar{display:flex;gap:4px;height:4px;border-radius:10px;overflow:hidden;margin:9px 0 8px}
.room-vote-bar i{width:50%;background:#fff34b}.room-vote-bar i+i{background:#ff304b}
.room-score-metrics{display:flex;justify-content:space-between;align-items:center;gap:6px;font-size:10px;color:#9eafc1;line-height:1.3}
.room-score-metrics b{font-weight:700;color:#f0f4fa;margin-left:3px}
.room-score-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px;min-height:24px}
.room-chart-button{display:flex;align-items:center;gap:6px;background:none;border:0;color:#74eac1;padding:0;min-height:26px;font-size:10px;cursor:pointer}
.room-chart-button svg{display:block;width:60px;height:18px}
#roomUpdated{font-size:9px;color:#8e9eaf;white-space:nowrap}
.in-room #room .room-messages{position:relative;flex:1 1 0;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:0 14px 14px;scrollbar-width:thin;scrollbar-color:#3a4a58 transparent;isolation:isolate}
.room-chat-date{font-size:10px;text-align:center;color:#8294a8;padding:14px 0 5px;line-height:1.4}
.room-messages .message{margin:13px 0;gap:8px}
.room-messages .bubble{max-width:86%;padding:10px 12px;font-size:14px;line-height:1.45;overflow-wrap:anywhere}
.room-messages .bubble b{font-size:11px;margin-bottom:4px;color:#20e89b;line-height:1.3}
.room-messages .bubble time{font-size:9px;margin-top:4px}
.room-messages .msg-avatar{width:26px;height:26px;font-size:9px;background:#214b3c}
.room-composer{position:relative;z-index:6;flex:none;width:100%;padding:9px 10px max(7px,env(safe-area-inset-bottom));background:#121820;border-top:1px solid #2c3845}
.room-compose-form{display:flex;align-items:flex-end;gap:7px;width:100%;margin:0}
.room-compose-form button{display:grid;place-items:center;flex:0 0 42px;width:42px;height:42px;padding:0;border-radius:50%;border:0;cursor:pointer}
.room-compose-form button svg{display:block;width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8}
.room-compose-form #message{display:block;flex:1 1 0;min-width:0;width:0;min-height:42px;max-height:90px;resize:none;overflow-y:auto;box-sizing:border-box;margin:0;border:1px solid #3c4b5a;border-radius:20px;background:#1a2430;color:#fff;padding:10px 13px;font:16px/20px Arial,Helvetica,sans-serif;outline:none}
.room-compose-form #message::placeholder{color:#a1b0c0;font-size:14px}
.room-compose-form #message:focus{border-color:#38cf96;box-shadow:0 0 0 1px #20e89b22}
.room-send{background:#20e89b;color:#072b1c}
.room-local-note{text-align:center;margin-top:6px;font-size:9px;line-height:1.3;color:#8294a8}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.keyboard-open .app.in-room{padding:0}
.keyboard-open .room-local-note,.keyboard-open .room-score-head,.keyboard-open .room-score-bottom{display:none}
.keyboard-open .room-topbar{min-height:49px;padding-top:5px;padding-bottom:5px}
.keyboard-open .room-scoreboard{margin-top:6px;padding-top:7px;padding-bottom:7px}
.keyboard-open .room-portrait{flex-basis:32px;width:32px;height:32px}
.keyboard-open .room-candidate strong{font-size:21px}
.keyboard-open .room-vote-bar{margin-top:7px;margin-bottom:6px}
.keyboard-open .room-composer{padding-bottom:7px}
@media(max-width:350px){.room-topbar{gap:6px;padding-left:8px;padding-right:8px}.room-topbar .room-invite{padding:8px;font-size:10px}.in-room #room .room-heading h2{font-size:16px}.room-scoreboard{margin-left:8px;margin-right:8px;padding-left:10px;padding-right:10px}.room-candidate{gap:6px}.room-candidate-name{font-size:10px}.room-portrait{flex-basis:36px;width:36px;height:36px}.room-candidate strong{font-size:22px}}
@media(max-height:480px){.room-local-note,.room-score-head,.room-score-bottom{display:none}.room-topbar{min-height:45px;padding-top:4px;padding-bottom:4px}.room-scoreboard{margin-top:5px;padding-top:6px;padding-bottom:6px}.room-vote-bar{margin-top:6px;margin-bottom:5px}}

/* Stable compact score: no expanding header when Done closes the keyboard. */
.room-score-head,.room-score-bottom{display:none}
.room-topbar,.keyboard-open .room-topbar{min-height:54px;padding-top:6px;padding-bottom:6px}
.room-scoreboard,.keyboard-open .room-scoreboard{margin-top:6px;padding-top:7px;padding-bottom:7px;align-self:stretch}
.room-portrait,.keyboard-open .room-portrait{flex-basis:32px;width:32px;height:32px}
.room-candidate strong,.keyboard-open .room-candidate strong{font-size:22px}
.room-vote-bar,.keyboard-open .room-vote-bar{margin-top:7px;margin-bottom:6px}
.room-local-note{display:none}
.room-composer{padding:10px 10px max(10px,env(safe-area-inset-bottom))}
.room-compose-form button{touch-action:manipulation}
.room-messages .bubble{font-size:15px;white-space:pre-wrap}
.room-score-bottom,.keyboard-open .room-score-bottom{display:flex}

.room-conversation{position:relative;display:flex;flex:1 1 0;min-height:0;overflow:hidden;isolation:isolate}
.in-room #room .room-conversation .room-messages{width:100%;flex:1 1 0}
#candidateReactions{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:3}
button.room-portrait{padding:0;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button.room-portrait:focus-visible{outline:2px solid white;outline-offset:3px}
button.room-portrait:active{filter:brightness(1.2)}
.candidate-reaction{position:absolute;bottom:10px;width:30px;height:30px;border:2px solid var(--reaction-color);border-radius:50%;overflow:hidden;background:#151a22;box-shadow:0 2px 10px #0006;animation:candidateRise 1.5s ease-out forwards;will-change:transform,opacity}
.candidate-reaction img{width:100%;height:100%;object-fit:cover;object-position:50% 14%;display:block}
@keyframes candidateRise{0%{opacity:0;transform:translateY(0) scale(.7)}12%{opacity:1}75%{opacity:.9}100%{opacity:0;transform:translate(var(--drift),-180px) rotate(var(--tilt)) scale(1)}}
.candidate-reaction.still{animation:candidateFade .8s ease-out forwards}
@keyframes candidateFade{0%,65%{opacity:1}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){.candidate-reaction{animation:candidateFade .8s ease-out forwards}}

.room-cheers{display:flex;align-items:center;justify-content:center;gap:12px;margin:-4px 0 7px;min-height:44px}
.room-cheers>span{color:#b8c8d6;font-size:12px}
.room-cheer-buttons{display:flex;align-items:center;gap:10px}
.room-cheers button.room-portrait{width:40px;height:40px;flex-basis:40px;position:relative;overflow:visible}
.room-cheers button.room-portrait::before{content:'';position:absolute;inset:-3px}
.room-cheers .room-portrait img{border-radius:50%}

#roomUpdated{color:#bfccd8;font-size:10px}.room-vote-bar i{transition:width .6s ease}
