/* Room layout: status bar, "+" and "⋯" sheets, messenger-style chat. Loaded after styles.css and watch.css. */
.room-bar{display:flex;align-items:center;gap:10px;margin-bottom:18px}
.room-peers{display:flex;align-items:center;padding-left:6px}
.room-avatar{width:30px;height:30px;margin-left:-6px;border-radius:50%;display:grid;place-items:center;font-size:13px;font-weight:600;color:#baf2d8;background:#1a402e;border:2px solid var(--bg);transition:opacity .2s}
.room-avatar:nth-child(2){color:#d4c8b0;background:#2b271f}
.room-avatar.loading{opacity:.55}
.room-avatar.missing{color:#698a7b;background:transparent;border:1px dashed #465f53;font-weight:400}
.room-bar .connection-badge{margin-right:auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
.room-action{width:40px;height:40px;min-width:40px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--text)}
.room-action .ui-icon{width:20px;height:20px}
#addVideoButton{background:var(--accent);border-color:var(--accent);color:var(--dark)}
#addVideoButton:hover{background:#b6f1d5}
.now-playing-text{min-width:0}
.empty-video .button{margin-top:18px}

/* Chat */
.day-divider{align-self:center;font-size:11px;color:#98b0a5;background:#ffffff08;border:1px solid #ffffff0a;border-radius:20px;padding:4px 11px;margin:4px 0;flex-shrink:0}
.message.grouped{margin-top:-11px}
.message-bubble{position:relative;cursor:pointer;-webkit-user-select:text;user-select:text;outline:none}
.message-bubble:focus-visible{box-shadow:0 0 0 2px var(--accent)}
.message.selected .message-bubble{border-color:#9cecc780;box-shadow:0 0 0 1px #9cecc755}
.bubble-time{position:absolute;right:10px;bottom:5px;font-size:10px;line-height:1;color:#90ad9f;white-space:nowrap;pointer-events:none}.bubble-text::after{content:"";display:inline-block;width:40px;height:1px}
.message.own .bubble-time{color:#a7d7c1}
.message-actions{display:none}
.message.selected .message-actions{display:flex}
.message.own .message-actions,.message.own .message-reactions{justify-content:flex-end}
.message-meta{font-size:10px;color:#96b4a6}

/* Sheets */
dialog.sheet-dialog{max-width:460px}
dialog.sheet-dialog h2{margin:0 0 6px}
dialog.sheet-dialog .video-form{margin-top:16px}
#videoDialog .error{margin:12px 0 0}
.menu-list{display:flex;flex-direction:column;gap:4px}
.menu-item{width:100%;min-height:50px;text-align:left;border:0;border-radius:12px;background:transparent;color:var(--text);font-size:15px;padding:12px 14px}
.menu-item:hover,.menu-item:focus-visible{background:#ffffff0d}
.menu-item.danger{color:var(--error)}
.menu-sheet .dialog-actions{margin-top:14px}

/* Phones (portrait, and landscape where the height is small): the room fills the visible screen like a messenger. */
@media (max-width:850px),(orientation:landscape) and (max-height:520px){
  body.in-room{overflow:hidden;overscroll-behavior:none}
  body.in-room .page{padding:0;max-width:none}
  body.in-room .topbar,body.in-room footer{display:none}
  body.in-room .watch-room:not([hidden]){position:fixed;left:0;right:0;top:var(--vv-top,0px);height:var(--vv-height,100dvh);display:flex;flex-direction:column;padding:env(safe-area-inset-top) 0 0;background:var(--bg)}
  .room-bar{flex:none;margin:0;gap:8px;padding:8px max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left))}
  .room-bar .connection-badge{padding:7px 10px}
  .room-grid{flex:1;min-height:0;display:flex;flex-direction:column;gap:0}
  .watch-column{display:block;flex:none;min-width:0}
  .video-shell{position:relative;top:auto;z-index:auto;border-radius:0;border-left:0;border-right:0}
  .pip-placeholder{border-radius:0;border-left:0;border-right:0}
  .now-playing{padding:7px 14px 8px;gap:8px}
  .now-playing h2{font-size:13px;margin:2px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:none}
  .provider-badge{font-size:9px}
  .participants-card{display:none}
  .chat-home{display:flex;flex:1;min-height:0}
  .chat-card{flex:1;height:auto;min-height:0;max-height:none;border-radius:0;border-width:1px 0 0;background:var(--bg)}
  .chat-header,.chat-hint{display:none}
  .messages{min-height:0;padding:10px 12px;gap:11px}
  .message.grouped{margin-top:-8px}
  .message{max-width:84%}
  .message-bubble{font-size:15px;line-height:1.45;padding:7px 11px}
  .chat-bottom{border-top:1px solid #ffffff0a;padding:7px max(10px,env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
  .chat-form{border-radius:22px;padding:3px 4px 3px 6px}
  .send-button{border-radius:50%;width:38px;height:38px}
  .fullscreen-chat .chat-card{border-radius:14px;border-width:1px;background:#0f2219ea}
  .empty-video{padding:12px}
  .empty-video .orbit,.empty-video p,.empty-providers{display:none}
  .empty-video h2{font-size:18px;margin:0}
  .empty-video .button{margin-top:12px}
  body.in-room .toast{bottom:calc(76px + env(safe-area-inset-bottom))}
  dialog.sheet-dialog{margin:auto 0 0;width:100%;max-width:none;max-height:85dvh;border-radius:20px 20px 0 0;border-width:1px 0 0;padding:22px max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))}
  dialog.sheet-dialog .video-form{flex-wrap:wrap;padding:8px 8px 8px 14px}
  dialog.sheet-dialog .video-form input{flex:1 1 180px;min-width:0}
  dialog.sheet-dialog .video-form .button{flex:1 0 100%;padding:13px}
}
/* Phone on its side: video on the left, chat on the right. */
@media (orientation:landscape) and (max-height:520px){
  .room-bar{padding-top:5px;padding-bottom:5px}
  .room-grid{flex-direction:row}
  .watch-column{flex:1;display:flex;flex-direction:column;overflow:hidden}
  .video-shell,.pip-placeholder{flex:1;min-height:0;aspect-ratio:auto;border:0}
  .now-playing{display:none}
  .chat-home{flex:none;width:min(360px,40vw)}
  .chat-card{border-width:0 0 0 1px}
}
dialog.sheet-dialog .video-form .button{font-size:15px}dialog.sheet-dialog .video-form input{font-size:16px!important}
@media (max-width:850px),(orientation:landscape) and (max-height:520px){body.keyboard-open .now-playing{display:none}body.keyboard-open .room-bar{padding-top:4px;padding-bottom:4px}}
/* Seats: two real avatars overlap slightly; the free seat sits apart with the same outer size. */
.room-avatar{flex:none;box-sizing:border-box}
.room-avatar.missing{margin-left:6px;border:1.5px dashed #5a7d6d;font-size:15px;line-height:1}
/* Message field: no inner focus frame, the whole pill lights up instead; buttons and field share one height. */
.chat-form{align-items:flex-end;transition:border-color .15s}
.chat-form:focus-within{border-color:#9cecc780}
.chat-form textarea:focus,.chat-form textarea:focus-visible{outline:none;box-shadow:none}
.chat-form #emojiButton{width:40px;height:40px;min-width:40px;min-height:40px;padding:0;flex:none;display:grid;place-items:center}
.chat-form .send-button{width:40px;height:40px;margin:0;flex:none}
.chat-form textarea{min-height:40px;padding:9px 2px!important;line-height:22px}
#videoInput:focus-visible{outline:none}
.video-form:focus-within{border-color:#9cecc780}
/* Messenger chat v2: avatars, reactions on the bubble, Telegram-style reaction bar. */
.message{display:flex;align-items:flex-end;gap:8px;max-width:88%}
.message.own{max-width:80%}
.message-body{position:relative;min-width:0;display:flex;flex-direction:column;align-items:flex-start}
.message.own .message-body{align-items:flex-end}
.message-avatar{width:30px;height:30px;flex:none;border-radius:50%;display:grid;place-items:center;font-size:13px;font-weight:600;color:#ecd6a4;background:#3b3220;border:1px solid #57492c;margin-bottom:1px}
.message-avatar.spacer{visibility:hidden}
.message-bubble{background:#1a2d24;border:1px solid #ffffff08;border-radius:16px 16px 16px 6px;color:var(--text)}
.message.grouped .message-bubble{border-top-left-radius:6px}
.message.own .message-bubble{background:#1e5a3f;border-color:#2b7353;color:#ecfaf2;border-radius:16px 16px 6px 16px}
.message.own.grouped .message-bubble{border-top-right-radius:6px}
.message.own .bubble-time{color:#a9d9bf}
.bubble-reactions{display:flex;flex-wrap:wrap;gap:4px;margin:6px 40px 0 0}
.bubble-reaction{border:0;border-radius:12px;min-height:26px;padding:2px 8px;font-size:14px;line-height:1.3;color:inherit;background:#ffffff14;cursor:pointer}
.bubble-reaction.mine{background:#9cecc733;box-shadow:inset 0 0 0 1px #9cecc770}
.message.own .bubble-reaction{background:#00000029}
.message.own .bubble-reaction.mine{background:#ffffff2b;box-shadow:inset 0 0 0 1px #ffffff55}
.messages.has-selection .message:not(.selected),.messages.has-selection .day-divider{opacity:.35;transition:opacity .15s}
.message.selected{z-index:3}
.message.selected .message-bubble{box-shadow:0 6px 24px #0007}
.reaction-bar{position:absolute;left:-4px;bottom:calc(100% + 8px);display:flex;gap:2px;padding:5px 6px;border-radius:26px;background:#1c3a2c;border:1px solid #2f5a45;box-shadow:0 10px 30px #000a;z-index:6;animation:bar-pop .16s ease-out;white-space:nowrap}
.message.own .reaction-bar{left:auto;right:-4px}
.reaction-choice{width:42px;height:42px;border:0;border-radius:50%;background:transparent;font-size:25px;line-height:1;display:grid;place-items:center;cursor:pointer;transition:transform .12s}
.reaction-choice:hover,.reaction-choice:focus-visible{transform:scale(1.18);background:#ffffff10}
.reaction-choice.mine{background:#9cecc72e}
.bar-below .reaction-bar{position:static;margin-top:8px;animation:none}
.message-menu{margin-top:8px;min-width:190px;display:flex;flex-direction:column;background:#1c3a2c;border:1px solid #2f5a45;border-radius:14px;overflow:hidden;box-shadow:0 10px 30px #000a;z-index:5;animation:bar-pop .16s ease-out}
.message-menu .message-action{min-height:44px;padding:10px 16px;text-align:left;font-size:15px;color:var(--text);border-radius:0}
.message-menu .message-action+.message-action{border-top:1px solid #ffffff0d}
@keyframes bar-pop{from{opacity:0;transform:translateY(6px) scale(.96)}to{opacity:1;transform:none}}
@media (max-width:850px),(orientation:landscape) and (max-height:520px){
  .message{max-width:90%}
  .message.own{max-width:82%}
  .reaction-choice{width:40px;height:40px;font-size:24px}
}
.in-pip .fullscreen-chat .message-avatar{width:24px;height:24px;font-size:11px}
.message-menu{position:absolute;top:calc(100% + 8px);left:0}
.message.own .message-menu{left:auto;right:0}
.messages.has-selection{padding-bottom:130px}
@media (display-mode:standalone){.topbar{padding-top:env(safe-area-inset-top);height:auto;min-height:80px}}
.message.pending .message-bubble{opacity:.72}.message.pending .bubble-time{font-size:11px}
