:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101418;
  color: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.call {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: #101418;
}

.participant {
  position: absolute;
  background: #121b22;
}

.participant.is-main {
  inset: 0;
}

.participant.is-pip {
  right: 18px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 3;
  width: min(28vw, 280px);
  min-width: 150px;
  height: min(24vh, 210px);
  min-height: 112px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgb(0 0 0 / 0.4);
}

.label {
  position: absolute;
  z-index: 2;
  left: 16px;
  top: 14px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgb(0 0 0 / 0.62);
  font-size: 13px;
  font-weight: 700;
}

.video-slot,
.video-slot video {
  width: 100%;
  height: 100%;
}

.video-slot {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.video-slot video {
  display: block;
  object-fit: cover;
}

.loading {
  color: #dbe5ec;
  text-align: center;
  padding: 16px;
}

.media-retry {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 16px;
  color: #dbe5ec;
  text-align: center;
}

.retry-media-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #f4f7f8;
  color: #102027;
  font-weight: 800;
  cursor: pointer;
}

.retry-media-button i {
  font-size: 18px;
}

.call-controls {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 999px;
  background: rgb(7 12 16 / 0.72);
  transform: translateX(-50%);
}

.call-controls.is-hidden {
  display: none;
}

[hidden] {
  display: none !important;
}

.control-button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #f4f7f8;
  color: #102027;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.control-button i {
  font-size: 24px;
  line-height: 1;
}

.control-button.danger {
  background: #d83b3b;
  color: #fff;
}

.control-button.is-active {
  background: #16a085;
  color: #fff;
}

.end-screen {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  background: rgb(16 20 24 / 0.92);
  text-align: center;
}

.end-screen.is-hidden {
  display: none;
}

.end-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f4f7f8;
  color: #16a085;
}

.end-icon i {
  font-size: 42px;
}

.end-screen h1 {
  margin: 0;
  font-size: 28px;
}

.end-screen p {
  margin: 0;
  color: #dbe5ec;
}

.toast-region {
  position: fixed;
  z-index: 12;
  left: 50%;
  top: max(18px, env(safe-area-inset-top));
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 8px;
  background: rgb(15 23 30 / 0.94);
  box-shadow: 0 16px 36px rgb(0 0 0 / 0.34);
  color: #f4f7f8;
  font-size: 14px;
  font-weight: 700;
}

.toast i {
  flex: 0 0 auto;
  color: #ffcf5c;
  font-size: 20px;
}

@media (max-width: 640px) {
  .participant.is-pip {
    right: 12px;
    width: min(38vw, 180px);
    min-width: 118px;
    height: min(23vh, 160px);
  }

  .control-button {
    width: 44px;
    height: 44px;
  }
}
