/* Экран звонка — отдельный слой, спокойные цвета */

.call-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #0c0c0e;
  color: #f5f5f5;
}

.call-top {
  padding: max(12px, env(safe-area-inset-top)) 20px 8px;
  text-align: center;
}

.call-top-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#callTitle {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.call-top-sub {
  font-size: 14px;
  color: #9a9a9a;
}

.call-waiting {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 72px;
  margin: 0;
  text-align: center;
  font-size: 15px;
  color: #9a9a9a;
  pointer-events: none;
  z-index: 2;
}

.call-grid {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 12px 12px 100px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  grid-auto-rows: minmax(140px, 1fr);
  align-content: center;
  justify-items: stretch;
}

.call-screen.call-audio-solo .call-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 120px;
}

.call-screen.call-audio-solo .call-grid .tile {
  width: min(200px, 52vw);
  height: min(200px, 52vw);
  max-height: none;
  border-radius: 50%;
  flex: none;
}

.call-screen.call-audio .call-grid .tile:not(.cam-off) .avatar-fill {
  border-radius: 50%;
}

.call-screen .tile {
  position: relative;
  min-height: 140px;
  border-radius: 16px;
  overflow: hidden;
  background: #1a1a1d;
  border: 1px solid #2c2c30;
}

.call-screen .tile video,
.call-screen #selfVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #1a1a1d;
}

.call-screen .tile.cam-off video,
.call-screen .call-pip.cam-off video {
  opacity: 0;
}

.call-screen #selfVideo {
  transform: scaleX(-1);
}

.call-screen .avatar-fill,
.call-screen .call-avatar-fill {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #252528 !important;
  color: #f0f0f0 !important;
  font-size: clamp(48px, 12vw, 72px);
  font-weight: 600;
  letter-spacing: -0.03em;
  border-radius: inherit;
}

.call-screen .cap {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 12px;
  font-weight: 500;
}

.call-pip {
  position: absolute;
  right: 14px;
  bottom: 108px;
  z-index: 5;
  width: min(120px, 28vw);
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: #1a1a1d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.call-pip .cap {
  font-size: 11px;
}

.call-bar {
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  background: #141416;
  border-top: 1px solid #2a2a2e;
}

.call-bar-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-evenly;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.call-btn {
  border: 0;
  background: transparent;
  color: #e8e8e8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 64px;
  padding: 4px;
}

.call-btn-ico {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2a2a2e;
  display: grid;
  place-items: center;
}

.call-btn-ico svg {
  width: 24px;
  height: 24px;
}

.call-btn .lbl {
  font-size: 11px;
  color: #9a9a9a;
}

.call-btn .when-off {
  display: none;
}

.call-btn.is-off .when-on {
  display: none;
}

.call-btn.is-off .when-off {
  display: block;
}

.call-btn.is-off .call-btn-ico {
  background: #3a3a40;
}

.call-btn--end .call-btn-ico {
  background: #e53935;
  width: 62px;
  height: 62px;
}

.call-btn--end .lbl {
  color: #e8e8e8;
}

.call-screen.call-video-multi .call-grid {
  grid-template-columns: 1fr 1fr;
}

@media (min-width: 500px) {
  .call-screen.call-video-multi .call-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}
