/* ========================================================
   DISCX CALL EXPERIENCE
   ======================================================== */
.voice-arena-container {
  --call-panel-width: 294px;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 55% -20%, rgba(87, 70, 255, 0.16), transparent 38%),
    linear-gradient(145deg, #070b14 0%, #090f1d 54%, #070b14 100%);
}

.voice-arena-header {
  flex: 0 0 70px;
  min-width: 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(7, 11, 20, 0.72);
  backdrop-filter: blur(18px);
  z-index: 10;
}

.voice-call-identity,
.voice-title-line,
.voice-call-meta,
.voice-header-actions,
.voice-panel-tabs,
.call-participant-actions,
.dock-group,
.dock-primary-controls,
.call-security-status {
  display: flex;
  align-items: center;
}

.voice-call-identity { gap: 12px; min-width: 0; }
.voice-brand-mark { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; color: #b7b1ff; background: linear-gradient(145deg, rgba(76, 111, 255, .22), rgba(155, 92, 255, .12)); border: 1px solid rgba(131, 119, 255, .28); box-shadow: 0 0 24px rgba(108, 99, 255, .14); }
.voice-brand-mark svg { width: 20px; height: 20px; }
.voice-title-line { gap: 8px; min-width: 0; }
.voice-title-line h1 { font: 700 16px/1.25 var(--font-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-title-line > svg { width: 15px; height: 15px; color: var(--text-muted); }
.voice-call-meta { gap: 8px; margin-top: 4px; color: var(--text-muted); font-size: 11px; }
.meta-separator { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }
.connection-quality { display: inline-flex; align-items: center; gap: 5px; color: #78d9b0; }
.connection-quality > span { width: 6px; height: 6px; border-radius: 50%; background: var(--status-online); box-shadow: 0 0 8px var(--status-online); }
.call-latency-badge { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); }
.call-latency-badge svg { width: 12px; height: 12px; }
.voice-header-actions { gap: 8px; }

.call-icon-button { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border-subtle); background: rgba(18, 26, 45, .72); color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer; transition: .18s ease; }
.call-icon-button:hover,
.call-icon-button.active { color: #fff; border-color: rgba(124, 100, 255, .45); background: rgba(108, 99, 255, .16); }
.call-icon-button svg { width: 18px; height: 18px; }
.call-icon-button.compact { width: 28px; height: 28px; border-radius: 8px; }
.call-icon-button.compact svg { width: 14px; height: 14px; }
.button-count { font-size: 10px; font-weight: 800; }

.voice-workspace { flex: 1 1 auto; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--call-panel-width); overflow: hidden; }
.voice-arena-container.panel-closed .voice-workspace { grid-template-columns: minmax(0, 1fr); }
.voice-stage-area { min-width: 0; min-height: 0; padding: 18px; overflow: hidden; }
.voice-stage-area.is-sharing { display: flex; flex-direction: column; gap: 12px; }
.voice-gallery-shell { height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.voice-gallery-heading { flex: 0 0 auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 2px 4px; }
.voice-gallery-heading .eyebrow { display: block; margin-bottom: 4px; color: #7771e9; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.voice-gallery-heading h2 { font: 700 17px/1.2 var(--font-heading); }
.encrypted-call { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 10px; }
.encrypted-call svg { width: 13px; height: 13px; color: var(--status-online); }

.voice-participants-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); grid-auto-rows: minmax(180px, 1fr); gap: 12px; overflow: auto; align-content: center; }
.voice-participants-grid[data-count="1"] { grid-template-columns: minmax(280px, 720px); justify-content: center; }
.voice-participants-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(240px, 560px)); justify-content: center; }
.voice-participants-grid.is-compact { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); grid-auto-rows: minmax(140px, 1fr); }

.participant-card { min-width: 0; min-height: 0; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.075); border-radius: 18px; background: radial-gradient(circle at 50% 22%, rgba(99, 90, 170, .16), transparent 42%), linear-gradient(145deg, rgba(19, 28, 48, .96), rgba(11, 17, 30, .98)); box-shadow: inset 0 1px rgba(255,255,255,.025), 0 15px 36px rgba(0,0,0,.2); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.participant-card:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.14); }
.participant-card.speaking { border-color: #3ee0a2; box-shadow: 0 0 0 1px rgba(62,224,162,.36), 0 0 28px rgba(16,185,129,.16); }
.participant-media { position: absolute; inset: 0; display: grid; place-items: center; }
.participant-avatar-wrap { position: relative; width: clamp(68px, 18%, 112px); aspect-ratio: 1; }
.participant-avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 3px solid rgba(255,255,255,.08); box-shadow: 0 12px 36px rgba(0,0,0,.42); }
.generated-avatar { display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, hsl(var(--avatar-hue) 70% 55%), hsl(calc(var(--avatar-hue) + 42) 72% 35%)); font-weight: 800; letter-spacing: -.03em; user-select: none; }
.participant-audio-ring { position: absolute; inset: -8px; border: 2px solid rgba(62,224,162,.48); border-radius: 50%; animation: speaking-ring 1.8s ease-out infinite; }
@keyframes speaking-ring { 0% { transform: scale(.94); opacity: .9; } 75%,100% { transform: scale(1.14); opacity: 0; } }
.participant-camera { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s ease; }
.participant-camera.is-visible { opacity: 1; }
.participant-media.has-video .participant-avatar-wrap { opacity: 0; }
.participant-card-overlay { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; z-index: 2; }
.participant-name-row { min-width: 0; display: flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 9px; background: rgba(5,9,17,.72); backdrop-filter: blur(10px); }
.participant-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 650; }
.participant-live-tag { flex: 0 0 auto; padding: 2px 5px; border-radius: 5px; color: #ff8e8e; background: rgba(239,68,68,.16); font-size: 8px; font-weight: 800; }
.participant-state-icons { display: flex; align-items: center; gap: 4px; }
.participant-state-icons > svg,
.participant-state { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: rgba(5,9,17,.72); }
.participant-state-icons svg { width: 13px; height: 13px; }
.participant-state.is-online { color: #51dda9; }
.participant-state.is-danger,
.is-danger { color: #ff6565 !important; }

.screenshare-display-box { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.08); border-radius: 18px; background: #020306; box-shadow: 0 18px 48px rgba(0,0,0,.36); }
.screenshare-video-el { width: 100%; height: 100%; object-fit: contain; background: #020306; }
.screenshare-connecting { position:absolute; inset:0; z-index:1; display:grid; place-content:center; justify-items:center; gap:8px; pointer-events:none; background:radial-gradient(circle,rgba(26,31,55,.82),rgba(2,3,6,.96) 62%); color:#fff; }
.screenshare-connecting>span { width:30px; height:30px; border:3px solid rgba(255,255,255,.12); border-top-color:#7668ff; border-radius:50%; animation:screenStreamSpin .85s linear infinite; }
.screenshare-connecting strong { margin-top:4px; font-size:12px; }
.screenshare-connecting small { color:var(--text-muted); font-size:9px; }
.screenshare-display-box.stream-ready .screenshare-connecting { opacity:0; visibility:hidden; transition:opacity .25s ease,visibility .25s; }
@keyframes screenStreamSpin { to { transform:rotate(360deg); } }
.screenshare-top-overlay { position: absolute; inset: 14px 14px auto; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; }
.presenter-tag,
.stream-quality-tag { pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; background: rgba(7,11,20,.78); backdrop-filter: blur(14px); color: var(--text-secondary); font-size: 11px; }
.presenter-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; font-size: 8px; }
.badge-stream-hd { display: inline-flex; align-items: center; gap: 5px; color: #aaa4ff; font-weight: 700; }
.badge-stream-hd svg { width: 14px; height: 14px; }
.participants-filmstrip { flex: 0 0 116px; min-width: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: 10px; overflow-x: auto; }
.participants-filmstrip.is-compact { flex-basis: 92px; grid-auto-columns: 145px; }
.participants-filmstrip .participant-card { border-radius: 13px; }
.participants-filmstrip .participant-avatar-wrap { width: 52px; }

.voice-side-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--border-subtle); background: rgba(10, 16, 29, .86); backdrop-filter: blur(18px); overflow: hidden; }
.voice-side-panel.is-hidden { display: none; }
.voice-panel-tabs { flex: 0 0 54px; padding: 9px; gap: 6px; border-bottom: 1px solid var(--border-subtle); }
.voice-panel-tab { flex: 1; height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text-muted); font: 650 11px var(--font-sans); cursor: pointer; }
.voice-panel-tab svg { width: 14px; height: 14px; }
.voice-panel-tab span { min-width: 17px; padding: 1px 5px; border-radius: 999px; background: rgba(255,255,255,.07); font-size: 9px; }
.voice-panel-tab.active { color: #fff; background: rgba(108,99,255,.14); border-color: rgba(108,99,255,.24); }
.voice-panel-view { display: none; flex: 1; min-height: 0; }
.voice-panel-view.active { display: flex; flex-direction: column; }
.voice-panel-section-header { flex: 0 0 45px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.text-action { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: #8e88ff; font: 650 10px var(--font-sans); cursor: pointer; letter-spacing: 0; }
.text-action svg { width: 13px; height: 13px; }
.call-participants-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; }
.call-participant-row { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px; border-radius: 11px; transition: background .15s ease; }
.call-participant-row:hover { background: rgba(255,255,255,.035); }
.call-participant-avatar-wrap { flex: 0 0 34px; height: 34px; position: relative; }
.call-participant-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; font-size: 10px; }
.call-presence-dot { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border: 2px solid #0a101d; border-radius: 50%; background: var(--status-online); }
.call-participant-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.call-participant-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); font-size: 12px; font-weight: 650; }
.call-participant-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 9px; }
.call-participant-actions { gap: 6px; color: var(--text-muted); }
.call-participant-actions svg { width: 13px; height: 13px; }

.call-chat-view { min-height: 0; }
.call-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px; }
.empty-call-chat { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 24px; text-align: center; color: var(--text-muted); }
.empty-call-chat svg { width: 34px; height: 34px; margin-bottom: 4px; color: #716af1; }
.empty-call-chat strong { color: var(--text-secondary); font-size: 12px; }
.empty-call-chat span { max-width: 210px; font-size: 10px; line-height: 1.5; }
.call-message { display: flex; align-items: flex-start; gap: 8px; padding: 7px 3px; }
.call-message-avatar { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; font-size: 9px; }
.call-message-body { min-width: 0; flex: 1; }
.call-message-meta { display: flex; align-items: baseline; gap: 6px; }
.call-message-meta strong { color: #fff; font-size: 11px; }
.call-message-meta time { color: var(--text-muted); font-size: 8px; }
.call-message-body p { margin-top: 2px; color: var(--text-secondary); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.call-chat-form { flex: 0 0 auto; margin: 10px; padding: 5px 5px 5px 11px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--border-subtle); border-radius: 11px; background: rgba(20,29,50,.82); }
.call-chat-form:focus-within { border-color: rgba(108,99,255,.48); box-shadow: 0 0 0 3px rgba(108,99,255,.08); }
.call-chat-form input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #fff; font: 11px var(--font-sans); }
.call-chat-form input::placeholder { color: var(--text-muted); }
.call-chat-form button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #fff; background: var(--accent-gradient); cursor: pointer; }
.call-chat-form button svg { width: 14px; height: 14px; }

.voice-controls-dock { flex: 0 0 82px; min-width: 0; display: grid; grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr); align-items: center; gap: 14px; padding: 0 22px; border-top: 1px solid var(--border-subtle); background: rgba(7,11,20,.9); backdrop-filter: blur(18px); z-index: 12; }
.dock-group { gap: 8px; }
.dock-right { justify-content: flex-end; }
.dock-primary-controls { justify-content: center; gap: 7px; }
.dock-secondary-action { height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--border-subtle); border-radius: 10px; background: rgba(18,26,45,.76); color: var(--text-secondary); font: 600 10px var(--font-sans); cursor: pointer; }
.dock-secondary-action:hover { color: #fff; border-color: var(--border-light); }
.dock-secondary-action svg { width: 15px; height: 15px; }
.dock-control-btn { width: 54px; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--border-subtle); border-radius: 14px; background: rgba(18,26,45,.9); color: var(--text-secondary); font: 600 8px var(--font-sans); cursor: pointer; transition: .18s ease; }
.dock-control-btn:hover { transform: translateY(-2px); color: #fff; border-color: var(--border-light); background: #172238; }
.dock-control-btn svg { width: 18px; height: 18px; }
.dock-control-btn.active { color: #fff; border-color: rgba(108,99,255,.55); background: linear-gradient(145deg, rgba(76,111,255,.36), rgba(124,77,255,.27)); box-shadow: 0 0 18px rgba(108,99,255,.18); }
.dock-control-btn.is-off { color: #ff8b8b; }
.dock-control-btn.danger-leave { width: 62px; color: #fff; border-color: transparent; border-radius: 18px; background: linear-gradient(145deg, #ef4545, #d52f38); box-shadow: 0 8px 22px rgba(239,68,68,.22); }
.dock-control-btn.danger-leave:hover { background: #f14b4b; box-shadow: 0 10px 28px rgba(239,68,68,.34); }
.call-security-status { gap: 8px; color: #67d8aa; font-size: 9px; line-height: 1.2; }
.call-security-status > svg { width: 16px; height: 16px; }
.call-security-status small { color: var(--text-muted); font-size: 8px; }

@media (max-width: 1180px) {
  .voice-arena-container { --call-panel-width: 260px; }
  .dock-left .dock-secondary-action span,
  .call-security-status span { display: none; }
  .voice-controls-dock { grid-template-columns: 80px auto 30px; padding-inline: 14px; }
  .dock-secondary-action { width: 36px; padding: 0; justify-content: center; }
}

@media (max-width: 900px) {
  .voice-workspace { position: relative; display: block; }
  .voice-stage-area { height: 100%; padding: 12px; }
  .voice-side-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(310px, 88%); z-index: 15; box-shadow: -18px 0 50px rgba(0,0,0,.42); }
  .voice-gallery-heading { display: none; }
  .voice-participants-grid { grid-auto-rows: minmax(150px, 1fr); }
  .voice-controls-dock { grid-template-columns: 1fr; height: 76px; padding: 0 8px; }
  .dock-left,
  .dock-right { display: none; }
  .dock-control-btn { width: 48px; height: 50px; }
}

@media (max-width: 620px) {
  .voice-arena-header { flex-basis: 62px; padding: 0 12px; }
  .voice-brand-mark { display: none; }
  .connection-quality,
  .call-latency-badge,
  .voice-header-actions #btn-call-settings-top { display: none; }
  .voice-title-line h1 { font-size: 14px; }
  .voice-participants-grid,
  .voice-participants-grid[data-count="2"] { grid-template-columns: 1fr; grid-auto-rows: minmax(160px, 1fr); }
  .dock-primary-controls { gap: 4px; overflow-x: auto; justify-content: flex-start; }
  .dock-control-btn { flex: 0 0 45px; }
  .dock-control-btn.danger-leave { flex-basis: 54px; }
  .dock-control-btn span { font-size: 7px; }
}
