/* ---------- watch-party room */
.room { display: grid; grid-template-columns: 1fr 380px; gap: 18px; padding: calc(var(--header-h) + 14px) var(--gutter) 20px; height: 100svh; }
.room-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.room-main .player-wrap { aspect-ratio: auto; flex: 1; min-height: 0; border-radius: 16px; }
.room-main .player-wrap video { object-fit: contain; }
.room-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.room-bar h1 { font: 400 clamp(18px, 2vw, 28px)/1.1 var(--f-display); text-transform: uppercase; margin: 0; flex: 1 1 260px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live { display: inline-flex; align-items: center; gap: 6px; font: 700 11px var(--f-mono); letter-spacing: .12em; color: var(--red-2); }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--red-2); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3 } }

.panel { --c: 18px; display: flex; flex-direction: column; min-height: 0; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); clip-path: var(--cut); overflow: hidden; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); flex: none; }
.tabs button { height: 48px; border: 0; background: none; color: var(--muted); font: 400 12px var(--f-display); position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tabs button.on { color: var(--cream); }
.tabs button.on::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; background: var(--red); }
.tabs .cnt { font: 600 11px var(--f-mono); background: var(--bg-3); border-radius: 6px; padding: 2px 6px; }
.tab { display: none; flex: 1; min-height: 0; flex-direction: column; }
.tab.on { display: flex; }

.chat-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg { max-width: 92%; }
.msg .who { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 2px; display: flex; gap: 6px; align-items: center; }
.msg .who .host { font: 700 9px var(--f-mono); background: var(--red); color: #fff; padding: 2px 5px; border-radius: 4px; letter-spacing: .08em; }
.msg .txt { background: var(--bg-3); border-radius: 4px 14px 14px 14px; padding: 8px 12px; font-size: 14.5px; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; }
.msg.mine .who { justify-content: flex-end; }
.msg.mine .txt { background: var(--red); color: #fff; border-radius: 14px 4px 14px 14px; }
.msg.sys { align-self: center; font: 600 11px var(--f-mono); letter-spacing: .04em; color: var(--dim); text-align: center; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); flex: none; }
.chat-form input { flex: 1; height: 44px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg); padding: 0 16px; outline: none; min-width: 0; font-size: 16px; }
.chat-form input:focus { border-color: var(--red); }
.chat-form button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--red); color: #fff; display: grid; place-items: center; flex: none; }
.chat-form button svg { width: 18px; height: 18px; }
.chat-locked { padding: 12px; text-align: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

.people-list { flex: 1; overflow-y: auto; padding: 8px; }
.pp { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; }
.pp:hover { background: var(--bg-3); }
.av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 700 15px var(--f-display); background: var(--bg-3); border: 2px solid transparent; flex: none; position: relative; }
.av.speaking { border-color: var(--green); box-shadow: 0 0 0 4px rgba(155,215,124,.2); }
.av.off::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #555; border: 2px solid var(--bg-2); }
.pp .nm { flex: 1; min-width: 0; }
.pp .nm b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp .nm span { font-size: 12px; color: var(--muted); }
.pp .icons { display: flex; gap: 4px; color: var(--muted); }
.pp .icons svg { width: 16px; height: 16px; }
.pp .icons .x { color: var(--red-2); }
.pp-menu { position: relative; }
.pp-menu .dd { position: absolute; right: 0; top: 40px; z-index: 20; background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; min-width: 220px; display: none; box-shadow: 0 20px 50px -10px #000; }
.pp-menu.open .dd { display: block; }
.pp-menu .dd button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 8px; font-size: 14px; }
.pp-menu .dd button:hover { background: var(--bg-3); }
.pp-menu .dd button.danger { color: var(--red-2); }
.dots-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: none; display: grid; place-items: center; }

.host-box { padding: 14px; border-top: 1px solid var(--line); display: grid; gap: 4px; flex: none; }
.host-box h4 { margin: 0 0 6px; font: 700 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--red-2); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line-2); position: relative; transition: .2s; flex: none; cursor: pointer; margin: 0; }
.toggle input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--cream); transition: .2s; }
.toggle input:checked { background: var(--red); border-color: var(--red); }
.toggle input:checked::after { left: 20px; }

.voice { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.voice-hero { text-align: center; padding: 18px; border-radius: 16px; background: var(--bg-3); }
.voice-hero h3 { font: 700 26px/1 var(--f-display); text-transform: uppercase; margin: 0 0 6px; }
.voice-hero p { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.voice-ctrls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; }
.voice-grid .v { text-align: center; font-size: 12px; color: var(--muted); }
.voice-grid .v .av { width: 60px; height: 60px; margin: 0 auto 6px; font-size: 22px; }

@media (max-width: 960px) {
  .room { grid-template-columns: 1fr; height: auto; min-height: 100svh; padding-left: 0; padding-right: 0; padding-top: var(--header-h); gap: 0; }
  .room-main { gap: 0; }
  .room-main .player-wrap { aspect-ratio: 16/9; flex: none; border-radius: 0; position: sticky; top: var(--header-h); z-index: 5; }
  .room-bar { padding: 12px var(--gutter); }
  .panel { border-radius: 0; border-inline: 0; height: calc(100svh - var(--header-h) - 56.25vw - 64px); min-height: 360px; }
}
