/* Mesh (room) — Rave MeshLayout: [left panel] [video | handle | chat] [right panel] */
.mesh { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mesh-layout {
  flex: 1; min-height: 0; display: grid; padding: 5px; gap: 0;
  grid-template-columns: var(--left-w, 0px) var(--gap-l, 0px) minmax(0, 1fr) var(--gap-r, 0px) var(--right-w, 0px);
  transition: grid-template-columns .6s var(--ease-out);
}
.mesh-layout.has-left { --left-w: clamp(280px, 28vw, 480px); --gap-l: 6px; }
.mesh-layout.has-right { --right-w: clamp(240px, 20vw, 340px); --gap-r: 6px; }
.mesh-layout.has-left.has-right { --left-w: clamp(260px, 24vw, 390px); --right-w: clamp(230px, 18vw, 310px); }
.panel-side {
  min-width: 0; min-height: 0; overflow: hidden; border-radius: 12px; display: flex; flex-direction: column;
  background: var(--acrylic); border: 1px solid var(--border-soft); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: opacity .3s;
}
.mesh-layout:not(.has-left) .panel-left, .mesh-layout:not(.has-right) .panel-right { opacity: 0; pointer-events: none; }
.panel-head { display: flex; align-items: center; gap: .5em; padding: .7em .8em .5em; flex-shrink: 0; }
.panel-head h3 { margin: 0; font-size: 1em; font-weight: 800; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-close { width: 2em; height: 2em; border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: .8; }
.panel-close:hover { background: hsla(0,0%,100%,.1); opacity: 1; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }

.video-chat { min-width: 0; min-height: 0; width: 100%; display: flex; flex-direction: var(--layout-direction, row); gap: 0; }
.panel-video { flex: 1 1 0%; min-width: 280px; min-height: 0; display: flex; }
.video-frame {
  --margin: calc(var(--unit) * .45); --padding: calc(var(--unit) * .3); --mesh-action-width: calc(var(--unit) * 1.4);
  --font-size-1: calc(var(--unit) * .66);
  position: relative; flex: 1; margin: auto; width: 100%; height: 100%; border-radius: 10px; overflow: hidden;
  background: radial-gradient(circle at 50% 42%, rgba(0, 245, 212, .06), rgba(99, 102, 241, .04) 48%, #040508 82%);
  display: flex; align-items: center; justify-content: center;
}
.video-frame.fullscreen,
.video-frame:fullscreen,
.video-frame:-webkit-full-screen {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 9999 !important;
  background: #000 !important;
}
body.vortex-fs .navbar,
body.vortex-fs .panel-chat,
body.vortex-fs .panel-side,
body.vortex-fs .resize-handle {
  display: none !important;
}
body.vortex-fs .mesh,
body.vortex-fs .mesh-layout,
body.vortex-fs .video-chat,
body.vortex-fs .panel-video {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 9998 !important;
}
.player-host { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; z-index: 1; background: transparent; }
.player-host > iframe, .player-host > .yt-mount, .player-host > .yt-mount > iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.player-host > video, .player-host video { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; display: block !important; background: transparent; object-fit: contain; z-index: 1; will-change: transform; transform: translateZ(0); backface-visibility: hidden; }
.player-host > div:not(.yt-mount) { position: absolute; z-index: 4; background: transparent !important; pointer-events: auto; }
.ambilight-canvas { position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; filter: blur(44px) saturate(1.85) brightness(0.85); opacity: 0; display: none; pointer-events: none; z-index: 0; transition: opacity .6s ease; }
.ambilight-canvas.on { display: block; }
.danmaku-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 11; }
.danmaku-item { position: absolute; right: -40%; white-space: nowrap; font-size: clamp(14px, 1.8vmax, 22px); font-weight: 800; text-shadow: 0 2px 6px rgba(0,0,0,.95), 0 0 2px #000; animation: danmakuFly 7.2s linear forwards; pointer-events: none; }
@keyframes danmakuFly { 0% { transform: translateX(0); right: -30%; } 100% { transform: translateX(-160vw); right: 100%; } }
.skip-intro-pill { position: absolute; right: 20px; bottom: 72px; z-index: 16; padding: .52em 1.05em; border-radius: 99px; font-size: .84em; font-weight: 800; box-shadow: 0 8px 24px rgba(0,0,0,.65); pointer-events: auto; cursor: pointer; }
.next-ep-banner { position: absolute; right: 20px; bottom: 72px; z-index: 16; display: flex; align-items: center; gap: .65em; padding: .55em .95em; border-radius: 14px; font-size: .84em; font-weight: 700; border: 1px solid rgba(0,245,212,.35); box-shadow: 0 10px 28px rgba(0,0,0,.75); pointer-events: auto; }
.cam-dock { position: absolute; inset: 0; z-index: 14; display: block; pointer-events: none; overflow: hidden; }
.cam-bubble {
  position: absolute; left: 12px; top: 52px; width: 132px; aspect-ratio: 4/3;
  border-radius: 13px; overflow: hidden; border: 1.5px solid rgba(0,245,212,.6);
  background: #05070c; box-shadow: 0 8px 24px rgba(0,0,0,.68);
  pointer-events: auto; touch-action: none; user-select: none; cursor: grab;
}
.cam-bubble:not(.is-dragging) {
  transition: left .22s cubic-bezier(.16, 1, .3, 1), top .22s cubic-bezier(.16, 1, .3, 1), width .2s ease, height .2s ease, transform .18s ease, box-shadow .18s ease;
}
.cam-bubble.is-dragging { cursor: grabbing; z-index: 26 !important; transform: scale(1.04); box-shadow: 0 14px 34px rgba(0,0,0,.85), 0 0 16px rgba(0,245,212,.45); }
.cam-bubble.swap-target { border-color: #f59e0b !important; box-shadow: 0 0 0 2.5px #f59e0b, 0 0 18px rgba(245,158,11,.8) !important; transform: scale(1.06); }
.cam-bubble video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cam-bubble-tag { position: absolute; left: 5px; bottom: 4px; max-width: calc(100% - 10px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 6px; border-radius: 6px; font-size: .64em; font-weight: 700; background: rgba(0,0,0,.74); color: #fff; pointer-events: none; }
.sfx-pill { font-size: .74em !important; font-weight: 700; padding: .2em .55em !important; border-radius: 99px !important; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: #e2e8f0; }
.sfx-pill:hover { background: rgba(0,245,212,.16) !important; border-color: rgba(0,245,212,.45); color: #fff; }
.resize-handle { flex: 0 0 6px; cursor: ew-resize; border-radius: 3px; background: transparent; transition: background .2s; }
.resize-handle:hover, .resize-handle.dragging { background: rgba(99,130,255,.5); }
.panel-chat { flex: 0 0 var(--chat-w, 340px); min-width: 230px; max-width: 60%; display: flex; flex-direction: column; min-height: 0; }
.video-chat.no-chat .panel-chat, .video-chat.no-chat .resize-handle { display: none; }

/* Pre-message / empty stage (Rave MeshVideoPlayer pre-message) */
.stage-empty { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9em; text-align: center; padding: 1.5em; background: radial-gradient(circle at 50% 40%, var(--bg-nebula-1, rgba(255,255,255,.05)), transparent 65%), #040508; }
.stage-empty h2 { margin: 0; font-size: 1.25em; }
.stage-empty p { margin: 0; opacity: .7; max-width: 30em; line-height: 1.45; }
.stage-overlay-msg { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 6; padding: .4em .9em; border-radius: 99px; font-size: .82em; font-weight: 700; background: rgba(0,0,0,.6); backdrop-filter: var(--blur); }
.stage-error { position: absolute; inset: 0; z-index: 22; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7em; background: rgba(0,0,0,.86); text-align: center; padding: 1.5em; }
.unmute-pill { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20; pointer-events: auto; cursor: pointer; }
.unmute-pill:active { transform: translate(-50%, -50%) scale(.95); }

/* Player controls overlay (Rave VideoPlayerControlsFC) */
.controls { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: space-between; padding: var(--margin); opacity: 0; transition: opacity .2s; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.55) 9%, transparent 20%, transparent 74%, rgba(0,0,0,.6) 88%, rgba(0,0,0,.94) 100%); }
.controls > * { pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .video-frame:not(.fullscreen):not(:fullscreen):not(:-webkit-full-screen):not(.idle-cursor):hover .controls { opacity: 1; }
  .video-frame:not(.fullscreen):not(:fullscreen):not(:-webkit-full-screen):not(.idle-cursor):hover .controls > * { pointer-events: auto; }
}
.controls.show, .controls.ui-active { opacity: 1; }
.controls.show > *, .controls.ui-active > * { pointer-events: auto; }
.video-frame.idle-cursor { cursor: none; }
.controls.passthrough-mid { pointer-events: none; }
.ctl-top { display: flex; align-items: center; gap: var(--padding); padding: 6px 12px; border-radius: 14px; background: rgba(7, 9, 16, .68); border: 1px solid rgba(255, 255, 255, .11); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 8px 24px rgba(0, 0, 0, .42); }
.ctl-thumb { width: calc(var(--unit) * 1.8); height: calc(var(--unit) * 1.8); border-radius: 50%; object-fit: cover; background: #222; }
.ctl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ctl-title { font-size: var(--font-size-1); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl-artist { font-size: calc(var(--font-size-1) * .9); opacity: .6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl-prov { height: calc(var(--unit) * 1.15); padding: 3px 8px; border-radius: 99px; background: rgba(6,7,11,.82); border: 1px solid rgba(255,255,255,.14); object-fit: contain; }
.ctl-mid { flex: 1; }
.ctl-bottom { display: flex; flex-direction: column; gap: 3px; width: 100%; min-width: 0; }
.ctl-bar-row { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--padding); width: 100%; min-width: 0; }
.ctl-spacer { flex: 1 1 auto; min-width: 2px; }
.ctl-action { width: var(--mesh-action-width); height: var(--mesh-action-width); flex: 0 0 var(--mesh-action-width); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; opacity: .88; border-radius: 50%; flex-shrink: 0; transition: opacity .2s, background .2s; }
#ctl-fs { opacity: 1; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24); border-radius: 8px; }
.ctl-action:hover { opacity: 1; background: hsla(0,0%,100%,.12); }
.ctl-action .icon { width: 62%; height: 62%; display: flex; align-items: center; justify-content: center; }
.ctl-action .icon svg { width: 100%; height: 100%; display: block; }
.ctl-time { font-size: calc(var(--font-size-1) * .9); opacity: .75; min-width: max-content; font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }
.timeline { width: 100%; height: 18px; display: flex; align-items: center; cursor: pointer; position: relative; min-width: 100%; flex-shrink: 0; }
.timeline .track { position: relative; width: 100%; height: 3px; background: hsla(0,0%,100%,.3); border-radius: 3px; transition: height .15s; }
.timeline:hover .track { height: 5px; }
.timeline .buf, .timeline .cur { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.timeline .buf { background: hsla(0,0%,100%,.3); }
.timeline .cur { background: #fff; }
.timeline .knob { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%) scale(0); transition: transform .15s; }
.timeline:hover .knob { transform: translate(-50%, -50%) scale(1); }
@media (max-width: 960px), (pointer: coarse) {
  .timeline:not(.locked) .knob { transform: translate(-50%, -50%) scale(.88); }
  .timeline:not(.locked) .track { height: 4px; }
}
.timeline.locked { cursor: default; }
.timeline.locked .track { height: 2px; }
.timeline.locked .knob { display: none; }
.vol-wrap { display: flex; align-items: center; }
.vol-wrap input[type=range] { width: 0; opacity: 0; transition: width .2s, opacity .2s; accent-color: #fff; }
.vol-wrap:hover input[type=range] { width: 80px; opacity: 1; margin: 0 .3em; }
.ctl-action.active-sub { color: #00f0ff; opacity: 1; }
.rave-subtitle-overlay {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 12;
  width: max-content;
  max-width: 92%;
  pointer-events: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: bottom .22s ease;
}
.video-frame.fullscreen .controls,
.video-frame:fullscreen .controls,
.video-frame:-webkit-full-screen .controls {
  padding-top: max(var(--margin), env(safe-area-inset-top, 0px), 10px);
  padding-right: max(var(--margin), env(safe-area-inset-right, 0px), 16px);
  padding-bottom: max(var(--margin), env(safe-area-inset-bottom, 0px), 14px);
  padding-left: max(var(--margin), env(safe-area-inset-left, 0px), 16px);
}
.video-frame.fullscreen .rave-subtitle-overlay,
.video-frame:fullscreen .rave-subtitle-overlay,
.video-frame:-webkit-full-screen .rave-subtitle-overlay {
  bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 24px));
  max-width: 88%;
}
.video-frame:has(.controls.ui-active) .rave-subtitle-overlay,
.video-frame:has(.controls.show) .rave-subtitle-overlay {
  bottom: calc(var(--margin) + var(--mesh-action-width) + 28px);
}
.video-frame.fullscreen:has(.controls.ui-active) .rave-subtitle-overlay,
.video-frame.fullscreen:has(.controls.show) .rave-subtitle-overlay,
.video-frame:fullscreen:has(.controls.ui-active) .rave-subtitle-overlay,
.video-frame:fullscreen:has(.controls.show) .rave-subtitle-overlay,
.video-frame:-webkit-full-screen:has(.controls.ui-active) .rave-subtitle-overlay,
.video-frame:-webkit-full-screen:has(.controls.show) .rave-subtitle-overlay {
  bottom: max(68px, calc(var(--margin) + var(--mesh-action-width) + env(safe-area-inset-bottom, 0px) + 18px));
}
@media (max-width: 960px) and (orientation: portrait) {
  .video-frame.fullscreen:not(:fullscreen):not(:-webkit-full-screen) {
    inset: auto !important;
    top: 50% !important;
    left: 50% !important;
    width: 100vh !important;
    width: 100dvh !important;
    height: 100vw !important;
    max-width: 100vh !important;
    max-width: 100dvh !important;
    max-height: 100vw !important;
    transform: translate(-50%, -50%) rotate(90deg) !important;
    transform-origin: center center !important;
  }
  .video-frame.fullscreen:not(:fullscreen):not(:-webkit-full-screen) .controls {
    padding: 14px 44px 18px !important;
  }
  .video-frame.fullscreen .rave-subtitle-overlay {
    bottom: 24px !important;
    max-width: 84% !important;
  }
  .video-frame.fullscreen:has(.controls.ui-active) .rave-subtitle-overlay,
  .video-frame.fullscreen:has(.controls.show) .rave-subtitle-overlay {
    bottom: 64px !important;
  }
}
@media (hover: hover) and (pointer: fine) {
  .video-frame:not(.fullscreen):not(:fullscreen):not(:-webkit-full-screen):hover .rave-subtitle-overlay {
    bottom: calc(var(--margin) + var(--mesh-action-width) + 12px);
  }
}
.rave-subtitle-cue {
  display: inline-block;
  padding: .24em .68em;
  border-radius: 7px;
  font-weight: 700;
  line-height: 1.35;
  white-space: pre-line;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ctl-menu { position: absolute; right: var(--margin); bottom: calc(var(--margin) + var(--mesh-action-width) + 8px); min-width: 245px; max-width: min(320px, 92vw); max-height: calc(100% - 54px); overflow-y: auto; border-radius: 14px; padding: .5em; z-index: 25; box-shadow: 0 12px 34px rgba(0,0,0,.68); border: 1px solid hsla(0,0%,100%,.14); }
.ctl-menu-head { display: flex; align-items: center; justify-content: space-between; gap: .5em; padding: .35em .5em .5em; border-bottom: 1px solid hsla(0,0%,100%,.1); margin-bottom: .35em; }
.ctl-menu-back { font-size: .86em; font-weight: 800; color: #fff; cursor: pointer; background: none; border: 0; padding: .2em .3em; border-radius: 6px; }
.ctl-menu-back:hover { background: hsla(0,0%,100%,.1); }
.ctl-menu-close { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .8em; font-weight: 800; color: rgba(255,255,255,.85); background: hsla(0,0%,100%,.1); border: 0; cursor: pointer; flex-shrink: 0; }
.ctl-menu-close:hover { background: hsla(0,0%,100%,.22); color: #fff; }
.video-frame.menu-open .rave-subtitle-overlay,
.video-frame.menu-open .stage-overlay-msg,
.video-frame:has(.ctl-menu:not(.hidden)) .rave-subtitle-overlay,
.video-frame:has(.ctl-menu:not(.hidden)) .stage-overlay-msg {
  opacity: 0 !important;
  pointer-events: none !important;
}
.video-frame:not(:has(video:-webkit-full-screen)) video::cue {
  opacity: 0 !important;
  color: transparent !important;
  background: transparent !important;
  text-shadow: none !important;
}
.ctl-menu-subbtn { font-size: .75em; font-weight: 700; padding: .28em .6em; border-radius: 99px; background: hsla(0,0%,100%,.12); color: #fff; border: 0; cursor: pointer; }
.ctl-menu-subbtn:hover { background: hsla(0,0%,100%,.22); }
.ctl-menu-scroll { max-height: 210px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ctl-menu .opt { display: flex; justify-content: space-between; align-items: center; gap: .8em; padding: .52em .7em; border-radius: 8px; cursor: pointer; font-size: .84em; }
.ctl-menu .opt:hover, .ctl-menu .opt.on { background: hsla(0,0%,100%,.14); }
.opt-lbl { display: inline-flex; align-items: center; gap: .55em; font-weight: 600; }
.opt-lbl .icon { width: 1.15em; height: 1.15em; color: var(--accent); opacity: .95; }
.ctl-pill .icon { width: 1.05em; height: 1.05em; }
.ctl-menu-switch-tab { margin-top: .35em; border-top: 1px solid hsla(0,0%,100%,.1); border-radius: 0 0 8px 8px; font-weight: 700; color: #a5b4fc; }
.ctl-pref-group { padding: .35em .5em; }
.ctl-pref-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.ctl-pref-pill { flex: 1; min-width: 54px; padding: .34em .5em; border-radius: 7px; font-size: .76em; font-weight: 700; background: hsla(0,0%,100%,.08); color: rgba(255,255,255,.8); border: 1px solid transparent; cursor: pointer; text-align: center; }
.ctl-pref-pill.on { background: rgba(99,102,241,.35); border-color: #818cf8; color: #fff; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #0fff0c; display: inline-block; }

/* Chat (Rave Chat / Message / ChatBar) */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--transparent-black); border-radius: 10px; overflow: hidden; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: .6em .55em .3em; display: flex; flex-direction: column; gap: 2px; user-select: text; }
.msg { display: flex; gap: .55em; padding: .3em .35em; border-radius: 10px; animation: fade-in .2s ease; }
.msg:hover { background: hsla(0,0%,100%,.04); }
.msg .avatar { width: 30px; height: 30px; font-size: 12px; margin-top: 2px; }
.msg-body { min-width: 0; flex: 1; }
.msg-name { font-size: .78em; font-weight: 800; display: flex; gap: .45em; align-items: baseline; }
.msg-name time { font-weight: 500; opacity: .45; font-size: .9em; }
.msg-text { font-size: .9em; line-height: 1.38; word-wrap: break-word; overflow-wrap: anywhere; }
.msg-text img.gif { max-width: 100%; border-radius: 8px; margin-top: 3px; display: block; }
.msg.cont { padding-top: 0; }
.msg.cont .avatar, .msg.cont .msg-name { visibility: hidden; height: 0; }
.msg.cont .avatar { height: 0; }
.msg.cont .msg-head-row { min-height: 0; height: 0; }
.sysmsg { text-align: center; font-size: .76em; opacity: .65; padding: .35em .5em; }
.sysmsg b { opacity: 1; color: #fff; }
.sys-card { margin: .45em .2em; padding: .75em; border-radius: 12px; background: hsla(0,0%,100%,.06); border: 1px solid var(--border-soft); animation: fade-in .25s ease; }
.sys-card .t { font-size: .85em; font-weight: 700; margin-bottom: .55em; display: flex; align-items: center; gap: .45em; }
.sys-card .row { display: flex; gap: .4em; flex-wrap: wrap; }
.privacy-opt { flex: 1 1 30%; min-width: 88px; display: flex; flex-direction: column; align-items: center; gap: .25em; padding: .6em .4em; border-radius: 10px; background: hsla(0,0%,100%,.06); border: 1px solid transparent; font-size: .78em; font-weight: 700; cursor: pointer; }
.privacy-opt.on { border-color: #fff; background: hsla(0,0%,100%,.16); }
.privacy-opt .icon { width: 1.5em; height: 1.5em; }
.typing { font-size: .74em; opacity: .6; padding: 0 .9em .25em; min-height: 1.3em; }
.chatbar { display: flex; align-items: center; gap: .38em; padding: .45em .5em .55em; flex-shrink: 0; position: relative; }
.mic-btn {
  width: 2.45em; height: 2.45em; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  color: #f8fafc; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 2px 10px rgba(0,0,0,.35);
  transition: background .2s, border-color .2s, box-shadow .2s, color .2s;
}
.mic-btn .icon { width: 1.18em; height: 1.18em; }
.mic-btn:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.28); }
.mic-btn.on { background: linear-gradient(135deg, #ff3b5c, #e11d48); border-color: #ff3b5c; color: #fff; box-shadow: 0 0 14px rgba(255,59,92,.55); }
.mic-btn.off { opacity: .9; }
.chat-input { flex: 1; min-width: 0; display: flex; align-items: center; border-radius: 99px; background: var(--transparent-black-strong); border: 1px solid var(--border-soft); padding: 0 .3em 0 .9em; }
.chat-input input { flex: 1; min-width: 0; background: none; border: none; outline: none; padding: .62em 0; user-select: text; }
.chat-input .ctl-action { --mesh-action-width: 2em; }
.reaction-bar {
  display: flex; align-items: center; gap: .3em; padding: 2px .55em 4px;
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.reaction-bar::-webkit-scrollbar { display: none; }
.reaction-bar button { font-size: 1em; padding: .15em .32em; border-radius: 8px; flex-shrink: 0; white-space: nowrap; }
.reaction-bar button:hover { background: hsla(0,0%,100%,.1); }
.float-emoji { position: absolute; bottom: 12%; font-size: 2em; animation: floatUp 2.4s ease-out forwards; pointer-events: none; z-index: 7; }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: scale(1.1); } 100% { transform: translateY(-260px) scale(1); opacity: 0; } }
.gif-panel { position: absolute; left: .5em; right: .5em; bottom: calc(100% + 4px); height: 300px; border-radius: 14px; display: flex; flex-direction: column; padding: .5em; z-index: 10; }
.gif-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: .5em; }
.gif-grid img { width: 100%; border-radius: 8px; cursor: pointer; display: block; }

/* Participants / Ravers */
.raver { display: flex; align-items: center; gap: .65em; padding: .5em .8em; border-radius: 10px; margin: 0 .3em; }
.raver:hover { background: hsla(0,0%,100%,.06); }
.raver .avatar { width: 36px; height: 36px; font-size: 14px; }
.raver-name { flex: 1; min-width: 0; }
.raver-name b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9em; }
.raver-name span { font-size: .72em; opacity: .55; }
.raver-actions { display: flex; gap: .2em; }
.raver-actions button { width: 2em; height: 2em; border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: .75; }
.raver-actions button:hover { background: hsla(0,0%,100%,.1); opacity: 1; }
.crown { color: #ffd84d; }

/* Vote / Queue (Rave Vote + VoteGrid + Queue) */
.vote-list { display: flex; flex-direction: column; gap: 8px; padding: .3em .6em 1em; }
.vote-card { display: flex; gap: .6em; align-items: center; padding: .4em; border-radius: 14px; background: rgba(0,0,0,.35); border: 1px solid transparent; cursor: pointer; position: relative; }
.vote-card.winning { border-color: gold; }
.vote-card.voted { border-color: hsla(0,0%,100%,.5); }
.vote-card img { width: 110px; aspect-ratio: 16/9; border-radius: 10px; object-fit: cover; background: #111; flex-shrink: 0; }
.vote-card .vi { flex: 1; min-width: 0; }
.vote-card .vt { font-size: .82em; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vote-card .vs { font-size: .72em; opacity: .55; margin-top: 2px; }
.vote-counter { position: absolute; top: 6px; left: 6px; background: rgba(165,0,0,.9); border-radius: 99px; font-size: .72em; font-weight: 800; padding: .1em .5em; }
.vote-card .rm { position: absolute; right: 6px; top: 6px; opacity: .6; }
.pie-timer { width: 2.2em; height: 2.2em; border-radius: 50%; border: 2px solid hsla(0,0%,100%,.5); background: conic-gradient(transparent var(--p, 0%), gray 0); display: flex; align-items: center; justify-content: center; font-size: .7em; font-weight: 800; }

/* Selection panel (Rave Selection / WebSelection) */
.sel-search { display: flex; align-items: center; gap: .4em; margin: 0 .7em .5em; padding: .25em .4em .25em .9em; border-radius: 10px; background: var(--transparent-black-strong); border: 1px solid var(--border-soft); }
.sel-search input { flex: 1; min-width: 0; background: none; border: none; outline: none; padding: .55em 0; user-select: text; }
.sel-note { margin: .3em .9em .7em; font-size: .78em; opacity: .65; line-height: 1.45; }
.sel-desktop { margin: 1em; padding: 1.2em; border-radius: 14px; background: hsla(0,0%,100%,.06); border: 1px solid var(--border-soft); text-align: center; display: flex; flex-direction: column; align-items: center; gap: .7em; }
.sel-desktop img { height: 42px; }
.panel-body .card-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); padding: .3em .7em 1em; gap: 12px; }
.panel-body .provider-grid { padding: .6em .6em 1em; gap: 10px; }
.panel-body .provider-tile { width: 118px; height: 78px; padding: 8px 6px 6px; }
.panel-body .provider-logo-wrap img { height: 26px; }
.panel-body .provider-tile .psub { display: none; }
.settings-group { margin: .2em .7em .85em; padding: .75em .85em; border-radius: 12px; background: var(--card-surface); border: 1px solid var(--border-soft); }
.settings-group h4 { margin: 0 0 .55em; font-size: .84em; opacity: .85; }
.seg { display: flex; gap: .35em; flex-wrap: wrap; }
.seg button { flex: 1 1 auto; padding: .5em .7em; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--border-soft); font-size: .8em; font-weight: 700; text-align: left; }
.seg button.on { border-color: var(--accent); background: var(--card-surface-hover); box-shadow: 0 0 12px -4px var(--accent); }
.seg button small { display: block; font-weight: 500; opacity: .6; font-size: .9em; margin-top: 2px; }
.share-box { display: flex; gap: .4em; margin: 0 .7em .8em; }
.qr { display: block; margin: .3em auto 1em; width: 160px; height: 160px; border-radius: 12px; background: #fff; padding: 8px; }

/* Mobile: stack video over chat (Rave layout-direction column), side panels become sheets */
@media (max-width: 960px) {
  .mesh { width: 100%; height: 100%; }
  .mesh-layout, .mesh-layout.has-left, .mesh-layout.has-right {
    display: flex; flex-direction: column; width: 100%; height: 100%; padding: 6px; gap: 6px;
  }
  .mesh-layout > div:not(.video-chat) { display: none; }
  .video-chat {
    --layout-direction: column; flex: 1 1 0%; width: 100%; min-width: 0; min-height: 0; gap: 8px;
  }
  .panel-video {
    flex: 0 0 auto; width: 100%; min-width: 0; aspect-ratio: 16/9; max-height: 40vh;
  }
  .video-frame {
    --unit: 15px; --margin: 6px; --padding: 4px; --mesh-action-width: 28px; --font-size-1: 11.5px;
    width: 100%; height: 100%; border-radius: 12px;
  }
  .ctl-top { gap: 4px; overflow: hidden; }
  .ctl-thumb { width: 24px; height: 24px; flex-shrink: 0; }
  .ctl-prov, #ctl-orig-btn, #ctl-sub-pill, #ctl-snap, .ctl-top .ctl-time, .vol-wrap input[type=range] { display: none !important; }
  .ctl-bottom { gap: 2px; }
  .ctl-bar-row { gap: 3px; }
  .ctl-speed-btn { width: auto !important; flex: 0 0 auto !important; aspect-ratio: auto !important; min-width: 28px; height: 26px; padding: 0 5px !important; font-size: .68em !important; }
  .video-frame:not(.fullscreen) .rave-subtitle-overlay {
    bottom: 8px;
    max-width: 94%;
  }
  .video-frame:not(.fullscreen):has(.controls.ui-active) .rave-subtitle-overlay,
  .video-frame:not(.fullscreen):has(.controls.show) .rave-subtitle-overlay {
    bottom: 48px;
  }
  .video-frame.menu-open:not(.fullscreen) {
    overflow: visible !important;
    z-index: 60 !important;
  }
  .video-frame:not(.fullscreen) .ctl-menu {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: max(12px, env(safe-area-inset-bottom, 12px)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
    background: rgba(12, 14, 22, .97) !important;
    border: 1px solid rgba(255,255,255,.22) !important;
    box-shadow: 0 -10px 40px rgba(0,0,0,.85) !important;
  }
  .sys-card { margin: .25em .15em; padding: .5em .6em; border-radius: 10px; }
  .sys-card .t { font-size: .78em; margin-bottom: .35em; }
  .privacy-opt { padding: .4em .3em; font-size: .72em; min-width: 72px; }
  .panel-chat {
    flex: 1 1 0%; width: 100%; max-width: none; min-width: 0; min-height: 0;
  }
  .chatbar {
    padding-bottom: max(.55em, env(safe-area-inset-bottom, 0px));
  }
  .resize-handle { display: none; }
  .panel-side {
    position: fixed; left: 0; right: 0; bottom: 0; top: 12%; z-index: 40;
    border-radius: 18px 18px 0 0; transform: translateY(105%);
    transition: transform .35s var(--ease-out); background: var(--acrylic);
    box-shadow: 0 -10px 40px rgba(0,0,0,.7);
  }
  .mesh-layout.has-left .panel-left, .mesh-layout.has-right .panel-right {
    transform: none; opacity: 1; pointer-events: auto;
  }
}

@media (max-width: 960px) and (orientation: landscape) {
  .mesh-layout, .mesh-layout.has-left, .mesh-layout.has-right {
    padding-left: max(6px, env(safe-area-inset-left, 0px));
    padding-right: max(6px, env(safe-area-inset-right, 0px));
    padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
  }
  .video-chat { --layout-direction: row; width: 100%; height: 100%; gap: 8px; }
  .panel-video { flex: 1 1 0%; width: auto; min-width: 0; max-height: none; height: 100%; aspect-ratio: auto; }
  .panel-chat { flex: 0 0 clamp(240px, 34vw, 320px); width: auto; max-width: 38vw; height: 100%; }
}

/* Camera bubble expand & controls, mic live speaking ring, and snapshot flash */
.cam-bubble.expanded {
  width: 240px !important;
  height: 144px !important;
  border-radius: 15px !important;
  border-color: var(--accent, #ff3b5c) !important;
}
.cam-bubble-btn {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: rgba(6, 9, 18, .78);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease, transform .15s ease, background .15s ease;
  z-index: 5;
  cursor: pointer;
}
.cam-bubble:hover .cam-bubble-btn,
.cam-bubble.controls-visible .cam-bubble-btn { opacity: 1; }
@media (pointer: coarse), (max-width: 960px) {
  .cam-bubble .cam-bubble-btn { opacity: .9; }
}
.cam-bubble-btn:hover, .cam-bubble-btn:active { transform: scale(1.12); background: var(--accent, #ff3b5c); }
.mic-btn.on.speaking {
  box-shadow: 0 0 0 calc(2px + var(--mic-lvl, 0.3) * 7px) rgba(16, 185, 129, .42), 0 0 16px rgba(16, 185, 129, .75);
}
.snap-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  z-index: 45;
  pointer-events: none;
  animation: snapFlashAnim .42s ease-out forwards;
}
@keyframes snapFlashAnim {
  0% { opacity: .88; }
  100% { opacity: 0; }
}

/* Dual Subtitles, Quality Badge, Speed Pill & Timeline Seek Preview */
#rave-sub-dual, .rave-sub-dual-cue {
  display: inline-block; max-width: 86%; padding: .16em .6em; margin-bottom: 4px;
  border-radius: 7px; font-size: clamp(12px, 1.65vw, 18px); font-weight: 600;
  color: #a5f3fc; background: rgba(5, 8, 16, .76);
  text-shadow: 0 1px 4px rgba(0,0,0,.95); line-height: 1.3;
}
.ctl-quality-badge {
  display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 6px;
  font-size: .68em; font-weight: 800; color: #00f5d4;
  background: rgba(0, 245, 212, .12); border: 1px solid rgba(0, 245, 212, .38);
  letter-spacing: .02em; flex-shrink: 0;
}
.ctl-speed-btn {
  min-width: 34px; height: 28px; padding: 0 7px !important; border-radius: 8px !important;
  font-size: .74em !important; font-weight: 800 !important; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
}
.ctl-speed-btn:hover { border-color: var(--accent); color: var(--accent); }
.seek-preview-card, #ctl-seek-preview {
  position: absolute; bottom: 26px; transform: translateX(-50%);
  width: 156px; padding: 5px; border-radius: 10px;
  background: rgba(8, 10, 18, .94); border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 10px 28px rgba(0,0,0,.75); pointer-events: none; z-index: 35;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.seek-preview-canvas {
  width: 140px; height: 78px; border-radius: 6px; background: #05060a;
  border: 1px solid rgba(255,255,255,.1); display: block;
}
.seek-preview-chapter { font-size: .68em; font-weight: 800; color: #00f5d4; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.seek-preview-sub { font-size: .63em; color: #cbd5e1; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; max-width: 100%; }
.seek-preview-time { font-size: .72em; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }

/* Inline Subtitle Customization Tools inside CC Menu */
.ctl-pref-group { padding: .45em .65em; display: flex; flex-direction: column; gap: 4px; }
.ctl-pref-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.ctl-pref-pill {
  padding: 3px 8px; border-radius: 7px; font-size: .7em; font-weight: 800;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); color: #e2e8f0;
}
.ctl-pref-pill.on, .ctl-pref-pill:hover { border-color: var(--accent); color: #fff; background: rgba(255,59,92,.24); }
.dual-sub-opt.on { border-left: 3px solid #00f5d4; background: rgba(0,245,212,.1); }

/* Speaking Ring, Voice Ducking Bar, Per-User Volume & Friend Button */
.raver.is-speaking .raver-avatar,
.cam-bubble.is-speaking {
  box-shadow: 0 0 0 2.5px #10b981, 0 0 14px rgba(16, 185, 129, .85) !important;
  border-color: #10b981 !important;
}
.speaking-pill {
  display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 6px;
  border-radius: 99px; font-size: .68em; font-weight: 800;
  background: rgba(16,185,129,.18); color: #10b981; border: 1px solid rgba(16,185,129,.4);
}
.voice-duck-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .5em;
  padding: .5em .65em; margin-bottom: .55em; border-radius: 10px;
  background: rgba(0, 245, 212, .07); border: 1px solid rgba(0, 245, 212, .24);
  font-size: .75em; font-weight: 700; color: #e2e8f0;
}
.peer-vol-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; width: 100%; }
.peer-vol-lbl { font-size: .66em; font-weight: 700; color: #00f5d4; min-width: 42px; }
.peer-vol-slider { flex: 1; height: 4px; accent-color: var(--accent); cursor: pointer; }
.friend-toggle-btn {
  padding: 3px 8px !important; border-radius: 99px !important; font-size: .68em !important; font-weight: 800 !important;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: #fff; flex-shrink: 0;
}
.friend-toggle-btn.on { background: rgba(16,185,129,.18) !important; border-color: #10b981 !important; color: #10b981 !important; }

/* Rich Invite Preview Card (WhatsApp / Telegram / Copy Message) */
.invite-panel-wrap { display: flex; flex-direction: column; gap: .6em; }
.invite-preview-card {
  display: flex; flex-direction: column; gap: .28em; padding: .7em .8em;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,59,92,.14), rgba(0,245,212,.09));
  border: 1px solid rgba(255,255,255,.15);
}
.invite-preview-badge { font-size: .64em; font-weight: 900; color: #00f5d4; letter-spacing: .05em; }
.invite-preview-title { font-size: .9em; font-weight: 800; color: #fff; }
.invite-preview-sub { font-size: .73em; color: var(--text-dim); }
.invite-social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.invite-social-btn { font-size: .73em !important; font-weight: 800 !important; justify-content: center; padding: .48em .6em !important; border-radius: 9px !important; text-decoration: none; }
.invite-social-btn.wa { background: rgba(22,163,74,.25); border-color: rgba(22,163,74,.55); color: #bbf7d0; }
.invite-social-btn.tg { background: rgba(2,132,199,.25); border-color: rgba(2,132,199,.55); color: #bae6fd; }
.invite-social-btn.copy-msg { grid-column: 1 / -1; background: rgba(255,255,255,.08); }

/* Live Interactive Chat Polls */
.sfx-pill.poll-pill {
  background: linear-gradient(135deg, rgba(0,245,212,.18), rgba(139,92,246,.22));
  border-color: rgba(0,245,212,.45); color: #fff; font-weight: 800;
}
.chat-poll-card {
  display: flex; flex-direction: column; gap: 6px; padding: .6em .75em;
  margin: .3em 0; border-radius: 12px;
  background: linear-gradient(145deg, rgba(18,21,34,.94), rgba(10,12,20,.92));
  border: 1px solid rgba(0,245,212,.32);
}
.chat-poll-q { font-size: .8em; font-weight: 800; color: #fff; }
.chat-poll-opts { display: flex; flex-direction: column; gap: 5px; }
.chat-poll-opt {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between;
  padding: .38em .6em; border-radius: 8px; font-size: .74em; font-weight: 700; color: #fff;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); text-align: left;
}
.chat-poll-opt.voted { border-color: #00f5d4; }
.chat-poll-bar {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 0;
  background: linear-gradient(90deg, rgba(255,59,92,.38), rgba(0,245,212,.32));
  transition: width .25s ease;
}
.chat-poll-txt, .chat-poll-cnt { position: relative; z-index: 1; }
.chat-poll-cnt { font-size: .88em; color: #a5f3fc; }
.chat-poll-foot { font-size: .65em; color: var(--text-dim); text-align: right; }

/* Message Reply (Quote) & Per-Message Animated Emoji Reactions */
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes actEmojiSpring {
  0% { opacity: 0; transform: translateY(8px) scale(.4); }
  70% { opacity: 1; transform: translateY(-2px) scale(1.14); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes reactPillPop {
  0% { transform: scale(.55); opacity: 0; }
  60% { transform: scale(1.18); opacity: 1; }
  82% { transform: scale(.94); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes emojiJiggle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  30% { transform: scale(1.32) rotate(-12deg); }
  65% { transform: scale(1.24) rotate(10deg); }
}
@keyframes emojiBurstParticle {
  0% { opacity: 1; transform: translate(0, 0) scale(.6) rotate(0deg); }
  45% { opacity: 1; transform: translate(calc(var(--dx) * .65), calc(var(--dy) * .65)) scale(1.25) rotate(var(--rot)); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.35) rotate(calc(var(--rot) * 1.6)); }
}
.msg {
  position: relative;
  transition: background .22s ease, box-shadow .22s ease;
  animation: msgSlideIn .22s cubic-bezier(.16, 1, .3, 1) both;
}
.msg:hover, .msg.msg-active { z-index: 20; }
.msg.msg-highlight { background: rgba(0, 245, 212, .16) !important; box-shadow: inset 0 0 0 1px rgba(0, 245, 212, .45); }
.msg-head-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 20px; }
.msg-actions {
  position: absolute; right: 0; top: -6px;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 7px; border-radius: 99px;
  background: rgba(12, 15, 26, .96);
  border: 1px solid rgba(0, 245, 212, .32);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .65), 0 0 14px rgba(0, 245, 212, .14);
  backdrop-filter: blur(12px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(6px) scale(.84);
  transform-origin: right center;
  transition: opacity .2s cubic-bezier(.34, 1.56, .64, 1), transform .22s cubic-bezier(.34, 1.56, .64, 1), visibility .2s;
  z-index: 12;
}
@media (hover: hover) and (pointer: fine) {
  .msg:hover:not(.msg-closing) .msg-actions {
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: translateY(0) scale(1);
  }
  .msg:hover:not(.msg-closing) .msg-act-emoji,
  .msg:hover:not(.msg-closing) .msg-act-reply {
    animation: actEmojiSpring .28s cubic-bezier(.34, 1.56, .64, 1) both;
    animation-delay: calc(var(--i, 0) * 32ms);
  }
}
.msg.msg-active:not(.msg-closing) .msg-actions {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(0) scale(1);
}
.msg.msg-active:not(.msg-closing) .msg-act-emoji,
.msg.msg-active:not(.msg-closing) .msg-act-reply {
  animation: actEmojiSpring .28s cubic-bezier(.34, 1.56, .64, 1) both;
  animation-delay: calc(var(--i, 0) * 32ms);
}
.msg-act-emoji {
  font-size: .88em; line-height: 1; padding: 3px 4px; border-radius: 8px;
  transition: transform .16s cubic-bezier(.34, 1.56, .64, 1), background .14s ease;
}
.msg-act-emoji:hover, .msg-act-emoji:active {
  transform: scale(1.32) translateY(-2px);
  background: rgba(255,255,255,.14);
}
.msg-act-reply {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .7em; font-weight: 800; color: #e2e8f0;
  padding: 3px 8px; border-radius: 99px; margin-left: 2px;
  background: rgba(255,255,255,.1);
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.msg-act-reply:hover, .msg-act-reply:active { color: #061018; background: var(--accent); transform: scale(1.06); }
.msg-quote {
  display: flex; flex-direction: column; gap: 1px;
  margin: 4px 0 5px; padding: 4px 9px;
  border-left: 3px solid var(--quote-color, #00f5d4);
  border-radius: 4px 9px 9px 4px;
  background: rgba(255,255,255,.06);
  cursor: pointer; font-size: .78em;
  animation: msgSlideIn .2s ease both;
}
.msg-quote:hover { background: rgba(255,255,255,.1); }
.msg-quote-user { font-weight: 800; font-size: .92em; }
.msg-quote-text { color: rgba(255,255,255,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.msg-reactions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.msg-reactions.empty { display: none; }
.msg-react-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 99px; font-size: .76em; font-weight: 800;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  color: #e2e8f0;
  animation: reactPillPop .34s cubic-bezier(.34, 1.56, .64, 1) both;
  transition: transform .16s cubic-bezier(.34, 1.56, .64, 1), border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.msg-react-pill .em-ico {
  display: inline-block;
  animation: emojiJiggle .45s cubic-bezier(.34, 1.56, .64, 1);
}
.msg-react-pill:hover, .msg-react-pill:active { transform: scale(1.12) translateY(-1px); border-color: rgba(0, 245, 212, .5); }
.msg-react-pill.mine {
  background: linear-gradient(135deg, rgba(0, 245, 212, .22), rgba(99, 102, 241, .22));
  border-color: #00f5d4; color: #fff;
  box-shadow: 0 2px 10px rgba(0, 245, 212, .22);
}
.msg-react-pill .cnt { font-size: .92em; color: #a5f3fc; }
.emoji-burst-p {
  position: fixed; pointer-events: none; z-index: 9999;
  font-size: 1.15rem; line-height: 1; user-select: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.45));
  animation: emojiBurstParticle .68s cubic-bezier(.16, 1, .3, 1) forwards;
}
.sys-card { position: relative; }
.sys-card-close {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .72em; color: rgba(255,255,255,.6); background: rgba(255,255,255,.07);
}
.sys-card-close:hover { color: #fff; background: rgba(255,59,92,.3); }
.reply-draft-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 .55em 3px; padding: 5px 10px;
  border-radius: 10px; background: rgba(14, 18, 28, .96);
  border: 1px solid rgba(255,255,255,.14); border-left: 3px solid var(--quote-color, #00f5d4);
  animation: msgSlideIn .18s cubic-bezier(.34, 1.56, .64, 1) both;
}
.reply-draft-info { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.reply-draft-user { font-size: .72em; font-weight: 800; display: inline-flex; align-items: center; }
.reply-draft-text { font-size: .76em; color: rgba(255,255,255,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-draft-close {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75em; font-weight: 800; color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.08); flex-shrink: 0;
}
.reply-draft-close:hover { background: rgba(255,59,92,.28); color: #fff; }
/* Discord-Style Room Voice / Video / Screen-Share Call Bar & Stage */
.discord-call-bar {
  display: flex; flex-direction: column; gap: 6px;
  margin: .4em .5em .2em; padding: 7px 9px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(16, 20, 34, .95), rgba(10, 13, 22, .92));
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  flex-shrink: 0;
}
.discord-call-bar.in-call {
  border-color: rgba(16, 185, 129, .48);
  box-shadow: 0 6px 22px rgba(16, 185, 129, .15);
}
.discord-call-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap;
}
.discord-call-title {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .76em; font-weight: 800; color: #f8fafc; min-width: 0; white-space: nowrap;
}
.discord-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10b981; box-shadow: 0 0 8px #10b981; flex-shrink: 0;
}
.discord-call-badge {
  padding: 1px 6px; border-radius: 99px; font-size: .82em; font-weight: 800;
  background: rgba(255, 255, 255, .08); color: #94a3b8;
}
.discord-call-badge.live {
  background: rgba(16, 185, 129, .18); color: #10b981; border: 1px solid rgba(16, 185, 129, .38);
}
.discord-call-head-actions { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.discord-stage-btn {
  padding: 3px 8px; border-radius: 8px; font-size: .7em; font-weight: 800;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); color: #e2e8f0;
}
.discord-stage-btn.on, .discord-stage-btn:hover {
  background: rgba(139, 92, 246, .24); border-color: #8b5cf6; color: #fff;
}
.discord-join-btn {
  padding: 4px 10px; border-radius: 8px; font-size: .72em; font-weight: 800;
  background: rgba(16, 185, 129, .22); border: 1px solid rgba(16, 185, 129, .5); color: #34d399;
  transition: transform .15s ease, background .15s ease;
}
.discord-join-btn:hover { background: rgba(16, 185, 129, .34); color: #fff; transform: scale(1.03); }
.discord-join-btn.active {
  background: rgba(239, 68, 68, .24); border-color: rgba(239, 68, 68, .55); color: #fca5a5;
}
.discord-call-peers {
  display: flex; align-items: center; gap: 5px; overflow-x: auto; padding: 2px 0;
  scrollbar-width: none;
}
.discord-call-peers::-webkit-scrollbar { display: none; }
.discord-peer-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 7px 3px 3px; border-radius: 99px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
  font-size: .71em; font-weight: 700; color: #cbd5e1; flex-shrink: 0; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.discord-peer-chip.in-call {
  background: rgba(16, 185, 129, .1); border-color: rgba(16, 185, 129, .35); color: #fff;
}
.discord-peer-chip.is-speaking {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 1.5px #10b981, 0 0 12px rgba(16, 185, 129, .55);
}
.discord-peer-chip.has-screen {
  border-color: #ef4444; background: rgba(239, 68, 68, .12);
}
.d-peer-name { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-peer-badge { font-size: .88em; line-height: 1; }
.d-peer-badge.live-screen {
  padding: 1px 5px; border-radius: 5px; font-size: .76em; font-weight: 900;
  background: #ef4444; color: #fff; letter-spacing: .02em;
}
.discord-call-controls {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px;
}
.discord-call-bar:not(.in-call) .discord-call-controls {
  display: none;
}
.chat-quick-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin: 4px 6px 6px; padding: 6px 8px; border-radius: 11px;
  background: linear-gradient(135deg, rgba(16, 20, 34, .92), rgba(10, 13, 22, .92));
  border: 1px solid rgba(255, 255, 255, .11);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .32);
}
.chat-quick-pills {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; flex: 1;
}
.chat-q-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px; font-size: .68em; font-weight: 800;
  color: #cbd5e1; background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12); text-decoration: none; cursor: pointer;
  white-space: nowrap; transition: all .15s ease;
}
.chat-q-pill:hover { background: rgba(255, 255, 255, .13); color: #fff; border-color: rgba(255, 255, 255, .25); }
.chat-q-pill.primary {
  background: rgba(0, 245, 212, .16); border-color: rgba(0, 245, 212, .45); color: #00f5d4;
}
.chat-q-pill.privacy-opt.on {
  background: rgba(99, 102, 241, .24); border-color: #818cf8; color: #fff;
}
.chat-q-close {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .7em; color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .06);
}
.chat-q-close:hover { background: rgba(255, 59, 92, .28); color: #fff; }
.discord-ctl-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  padding: 5px 4px; border-radius: 8px; font-size: .69em; font-weight: 800;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.discord-ctl-pill:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.discord-ctl-pill.on {
  background: rgba(0, 245, 212, .16); border-color: #00f5d4; color: #00f5d4;
}
#btn-discord-deafen.on {
  background: rgba(239, 68, 68, .18); border-color: #ef4444; color: #fca5a5;
}
#btn-discord-screen.on {
  background: rgba(239, 68, 68, .22); border-color: #ef4444; color: #fff;
}
.discord-ctl-pill.speaking {
  box-shadow: 0 0 0 2px #10b981, 0 0 12px rgba(16, 185, 129, .65);
}
.cam-bubble.is-screen-share {
  width: 210px; height: 120px; border-radius: 12px; border-color: #ef4444;
}
.cam-bubble-btn.spot-btn { right: 29px; }
.cam-bubble-btn.swap-btn { right: 53px; background: rgba(0, 245, 212, .24); border-color: rgba(0, 245, 212, .55); }
.cam-dock.strip-mode {
  position: relative !important; inset: auto !important;
  width: 100% !important; height: auto !important;
  display: flex !important; flex-direction: row !important;
  align-items: center; gap: 8px; overflow-x: auto;
  padding: 4px 2px; pointer-events: auto !important; z-index: 6 !important;
}
.cam-dock.strip-mode .cam-bubble {
  position: relative !important; left: auto !important; top: auto !important;
  width: 112px !important; height: 82px !important; flex-shrink: 0;
}
.cam-dock.grid-mode {
  inset: 44px 10px 58px 10px !important;
  width: auto !important; height: auto !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  gap: 8px !important; align-items: stretch !important;
  background: rgba(6, 9, 16, .86); backdrop-filter: blur(8px);
  padding: 8px; border-radius: 14px; z-index: 28 !important; pointer-events: auto !important;
}
.cam-dock.grid-mode .cam-bubble {
  position: relative !important; left: auto !important; top: auto !important;
  width: 100% !important; height: 100% !important; min-height: 110px; border-radius: 12px !important;
  background: #070a12;
}
.cam-dock.grid-mode .cam-bubble video { object-fit: contain !important; background: #070a12; }
.cam-bubble.spotlight {
  position: absolute !important; inset: 42px 8px 56px 8px !important;
  left: 8px !important; top: 42px !important;
  width: auto !important; height: auto !important; z-index: 30 !important;
  border-radius: 14px !important; border: 2px solid #00f5d4 !important;
  background: #05070e !important; box-shadow: 0 16px 48px rgba(0, 0, 0, .85) !important;
}
.cam-bubble.spotlight video { object-fit: contain !important; transform: none !important; }
@media (max-width: 960px) {
  .cam-bubble { width: 100px; border-radius: 11px; }
  .cam-bubble.is-screen-share { width: 148px; height: 86px; }
  .cam-bubble.expanded { width: 158px !important; height: 104px !important; }
  .cam-bubble-btn { width: 19px; height: 19px; font-size: 9.5px; top: 3px; right: 4px; }
  .cam-bubble-btn.spot-btn { right: 25px; }
  .cam-bubble-btn.swap-btn { right: 46px; }
  .discord-call-bar { margin: 3px 4px 1px; padding: 5px 7px; gap: 4px; }
  .discord-call-head { flex-wrap: wrap; gap: 4px; }
  .discord-stage-btn { padding: 3px 6px; font-size: .66em; }
  .discord-ctl-pill { font-size: .65em; padding: 4px 3px; }
  .chat-input input, .input, input, textarea, select { font-size: 16px !important; }
  html, body, .app, main.mesh { max-width: 100vw !important; overflow-x: hidden !important; left: 0 !important; }
}


/* --- YouTube Music / Spotify / Deezer Room Music & Similar Radio Bar --- */
.music-similar-bar {
  display: flex; flex-direction: column; gap: 5px;
  margin: 2px 6px 4px; padding: 6px 8px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(25, 16, 36, .92), rgba(11, 14, 24, .95));
  border: 1px solid rgba(255, 0, 51, .28);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.music-similar-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap;
}
.music-similar-title {
  font-size: .74em; font-weight: 800; color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.music-similar-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.music-tab-pill {
  padding: 2px 7px; border-radius: 999px; font-size: .66em; font-weight: 800; cursor: pointer;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); color: #cbd5e1;
}
.music-tab-pill.active {
  background: rgba(255, 0, 51, .24); border-color: #ff0033; color: #ffffff;
}
.music-tab-pill.next-sim {
  background: rgba(29, 185, 84, .2); border-color: rgba(29, 185, 84, .55); color: #86efac;
}
.music-similar-strip {
  display: flex; align-items: center; gap: 6px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none;
}
.music-similar-strip::-webkit-scrollbar { display: none; }
.music-sim-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px;
  border-radius: 9px; background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .11); cursor: pointer; flex-shrink: 0;
  max-width: 195px; transition: all .15s ease;
}
.music-sim-chip:hover {
  background: rgba(255, 0, 51, .18); border-color: rgba(255, 0, 51, .5); transform: translateY(-1px);
}
.music-sim-chip img {
  width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
}
.music-sim-meta {
  display: flex; flex-direction: column; min-width: 0; line-height: 1.15;
}
.music-sim-song {
  font-size: .71em; font-weight: 800; color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 112px;
}
.music-sim-artist {
  font-size: .63em; font-weight: 600; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 112px;
}
.music-sim-add {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0, 245, 212, .45);
  background: rgba(0, 245, 212, .14); color: #00f5d4; font-weight: 900; font-size: .75em;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.music-vinyl-stage {
  position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, rgba(22, 12, 36, .92), rgba(5, 7, 13, .98)); overflow: hidden;
}
.music-vinyl-bg {
  position: absolute; inset: -30px; background-size: cover; background-position: center;
  filter: blur(34px) brightness(.32); opacity: .8; pointer-events: none;
}
.music-vinyl-card {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 22px;
  padding: 20px 28px; border-radius: 22px; background: rgba(10, 13, 24, .75);
  border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(14px); max-width: 90%;
}
.music-vinyl-disc {
  width: 132px; height: 132px; border-radius: 50%; position: relative; flex-shrink: 0;
  padding: 18px; background: repeating-radial-gradient(#111 0 3px, #1f2430 4px 6px);
  box-shadow: 0 0 28px rgba(255, 0, 51, .45); animation: kinoxSpin 8s linear infinite;
}
.music-vinyl-disc img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.music-vinyl-hole {
  position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; border-radius: 50%;
  background: #07080d; border: 2px solid rgba(255, 255, 255, .5); transform: translate(-50%, -50%);
}
@keyframes kinoxSpin { to { transform: rotate(360deg); } }
.music-vinyl-badge { font-size: .68em; font-weight: 800; color: #00f5d4; letter-spacing: .08em; }
.music-vinyl-title { margin: 4px 0 2px; font-size: 1.25em; font-weight: 900; color: #fff; }
.music-vinyl-artist { margin: 0 0 10px; font-size: .9em; color: #cbd5e1; font-weight: 700; }
.music-eq-bars { display: flex; align-items: flex-end; gap: 4px; height: 22px; }
.music-eq-bars span {
  width: 4px; border-radius: 2px; background: linear-gradient(to top, #ff0033, #00f5d4);
  animation: kinoxEq .75s ease-in-out infinite alternate;
}
.music-eq-bars span:nth-child(2n) { animation-duration: .52s; }
.music-eq-bars span:nth-child(3n) { animation-duration: .9s; }
@keyframes kinoxEq { from { height: 5px; } to { height: 22px; } }
.music-mode-float-btn {
  position: absolute; top: 52px; right: 14px; z-index: 19; padding: 5px 11px;
  border-radius: 999px; font-size: .74em; font-weight: 800; cursor: pointer;
  background: rgba(11, 14, 24, .82); border: 1px solid rgba(0, 245, 212, .45); color: #e2e8f0;
  backdrop-filter: blur(8px);
}
.music-mode-float-btn.active { background: rgba(255, 0, 51, .28); border-color: #ff0033; color: #fff; }
