/* ===== CALLS ===== */
.call-root {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  background: linear-gradient(160deg, oklch(0.30 0.05 220), oklch(0.20 0.04 235) 60%, oklch(0.16 0.03 245));
  color: #fff; overflow: hidden;
}
.call-bg-blur { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; filter: blur(90px) saturate(1.3); opacity: .5; transform: scale(1.4); }
.call-bg-blur > div { border-radius: 50%; }

.call-top { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; }
.call-top.floating { position: absolute; top: 0; left: 0; right: 0; background: linear-gradient(oklch(0 0 0 /.5), transparent); }
.call-top-name { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.call-top-sub { font-size: 13px; opacity: .8; }
.call-enc { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; background: oklch(1 0 0 /.12); padding: 6px 12px; border-radius: 99px; backdrop-filter: blur(8px); }
.call-enc.dark { background: oklch(0 0 0 /.35); }

.call-center { position: relative; z-index: 3; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.call-name { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 16px 0 0; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; }
.call-status { font-size: 15px; opacity: .85; }
.call-status.faint { opacity: .55; font-size: 13.5px; }

.ring-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.ring { position: absolute; width: 132px; height: 132px; border-radius: 50%; border: 2px solid oklch(1 0 0 /.5); animation: ringPulse 2s infinite; }
.ring.r2 { animation-delay: 1s; }

.call-incoming-actions { position: relative; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 28px; padding: 0 26px 56px; }
.call-round { width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: var(--shadow-lg); transition: transform .12s; }
.call-round:active { transform: scale(.92); }
.call-round.decline { background: var(--danger); }
.call-round.accept { background: var(--success); animation: acceptPulse 1.6s infinite; }
@keyframes acceptPulse { 0%,100% { box-shadow: 0 0 0 0 oklch(0.62 0.12 155 / .5); } 50% { box-shadow: 0 0 0 16px oklch(0.62 0.12 155 / 0); } }
.call-round-lbl { font-size: 12.5px; opacity: .8; }
.call-quick { width: 48px; height: 48px; border-radius: 50%; background: oklch(1 0 0 /.14); display: flex; align-items: center; justify-content: center; color: #fff; }

/* controls bar */
.call-controls { position: relative; z-index: 3; margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 22px 26px 40px; flex-wrap: wrap; }
.call-ctrl { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 70px; font-size: 11.5px; color: #fff; opacity: .95; }
.call-ctrl > svg { width: 56px; height: 56px; padding: 16px; border-radius: 50%; background: oklch(1 0 0 /.14); transition: background .14s, transform .1s; box-sizing: border-box; }
.call-ctrl:hover > svg { background: oklch(1 0 0 /.22); }
.call-ctrl:active > svg { transform: scale(.92); }
.call-ctrl.off > svg { background: #fff; color: oklch(0.25 0.02 240); }
.call-ctrl.end > svg { background: var(--danger); }
.call-ctrl span { opacity: .85; }

/* video */
.vid-main { position: absolute; inset: 0; }
.vid-feed { position: relative; width: 100%; height: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: oklch(0.28 0.02 235); }
.vid-avatar { position: relative; z-index: 1; opacity: .9; }
.vid-name { position: absolute; left: 12px; bottom: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; background: oklch(0 0 0 /.4); padding: 4px 10px; border-radius: 8px; backdrop-filter: blur(6px); }
.vid-feed-lbl { position: absolute; right: 12px; top: 12px; z-index: 2; font-size: 10px; opacity: .5; }
.vid-self { position: absolute; right: 20px; bottom: 130px; z-index: 4; width: 130px; height: 184px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); border: 2px solid oklch(1 0 0 /.2); }

/* group grid */
.group-grid { position: relative; z-index: 2; flex: 1; display: grid; gap: 8px; padding: 8px 16px; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; align-content: stretch; }
.group-grid .vid-feed { border-radius: 16px; }
@media (min-width: 900px) { .group-grid { grid-template-columns: repeat(3, 1fr); } }

/* voice equalizer */
.voice-eq { display: flex; align-items: center; gap: 4px; height: 50px; margin-top: 24px; }
.voice-eq span { width: 5px; border-radius: 4px; background: oklch(1 0 0 /.85); animation: eq 0.9s ease-in-out infinite alternate; }
@keyframes eq { from { transform: scaleY(0.4); } to { transform: scaleY(1); } }

@media (max-width: 560px) {
  .call-ctrl { width: 60px; }
  .call-ctrl > svg { width: 50px; height: 50px; padding: 13px; }
  .vid-self { width: 96px; height: 138px; bottom: 120px; right: 14px; }
}

/* ---- Group calls (LiveKit) ---- */
.group-grid {
  position: absolute; inset: 0; padding: 10px 10px 120px;
  display: grid; gap: 6px; align-content: center;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  background: oklch(0.16 0.02 250);
}
.group-tile {
  position: relative; min-height: 150px; border-radius: 14px; overflow: hidden;
  background: oklch(0.22 0.02 250); display: flex; align-items: center; justify-content: center;
}
.group-tile-av { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.group-tile .vid-name {
  position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 4px;
  background: oklch(0.12 0.02 250 / .62); color: #fff; padding: 3px 9px; border-radius: 8px;
  font-size: 12.5px; max-width: calc(100% - 16px);
}
.group-tile .vid-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
