/* The call screen, with Telegram's proportions and colours. */

.call-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
}

.call-screen[hidden],
.call-bar[hidden],
.call-action[hidden],
.call-screen video[hidden] {
  display: none;
}

.call-dialog {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(420px, 100%);
  height: min(80vh, 640px);
  overflow: hidden;
  border-radius: 12px;
  background: #17212b;
  color: #fff;
}

.call-dialog:fullscreen {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.call-avatar.avatar {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  border-radius: 0;
  font-size: 96px;
  transform: scale(1.1);
}

.call-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.call-avatar.blurred {
  filter: blur(10px);
}

.call-main-video {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.call-own-video {
  position: absolute;
  right: 16px;
  bottom: 112px;
  width: 144px;
  max-height: 40%;
  border-radius: 8px;
  object-fit: cover;
  background: #000;
  transform: rotateY(180deg);
}

.call-header {
  position: absolute;
  top: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  padding: 8px;
}

.call-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: auto;
  padding: 64px 16px 32px;
  background: linear-gradient(rgba(0, 0, 0, 0.3), transparent);
  text-align: center;
  user-select: none;
}

.call-info h1 {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  font-size: 28px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-peer-muted {
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 13px;
}

.call-buttons {
  position: absolute;
  bottom: 16px;
  display: flex;
  justify-content: center;
  gap: 16px;
  user-select: none;
}

.call-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.call-action span {
  margin-top: 4px;
}

.call-round {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.call-round.small {
  width: 40px;
  height: 40px;
  font-size: 22px;
}

.call-round:hover {
  background: rgba(0, 0, 0, 0.4);
}

.call-round.active {
  background: #fff;
  color: #707579;
}

.call-round.active:hover {
  background: #ddd;
}

.call-round.leave {
  background: #ff595a;
}

.call-round.leave:hover {
  background: #d24646;
}

.call-round.accept {
  background: #5cc85e;
}

.call-round.accept:hover {
  background: #4eab50;
}

.call-round.accept .icon {
  transform: rotate(-135deg);
}

.call-round:disabled {
  opacity: 0.5;
  cursor: default;
}

.call-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 79;
  width: 100%;
  height: 32px;
  border: 0;
  background: linear-gradient(135deg, #3152e8, #8f4aac);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

@media (max-width: 600px) {
  .call-screen {
    padding: 0;
  }

  .call-dialog {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .call-buttons {
    gap: 4px;
  }
}

/* Encryption key emoji (tap for what they mean) and the rating after a call, as in Telegram. */
.call-emoji {
  margin-top: 8px;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 20px;
  letter-spacing: 4px;
}

.call-rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 14px;
}

.call-stars {
  display: flex;
  gap: 6px;
}

.call-stars button {
  color: rgba(255, 255, 255, 0.55);
  font-size: 30px;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
}

.call-stars:hover button,
.call-stars button:focus-visible {
  color: #ffd257;
}

.call-stars button:hover ~ button {
  color: rgba(255, 255, 255, 0.55);
}

.call-stars button:hover {
  transform: scale(1.15);
}
