/**
 * Talking Heads OBS Overlay Styles
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: transparent;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

#avatarContainer {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 400px;
  height: 400px;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

.avatar.active {
  opacity: 1;
}

.avatar.fading-out {
  opacity: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Multiple avatar support - stack them */
.avatar:nth-child(2) {
  bottom: 20px;
  left: 20px;
  right: auto;
}

.avatar:nth-child(3) {
  top: 20px;
  right: 20px;
  bottom: auto;
}

.avatar:nth-child(4) {
  top: 20px;
  left: 20px;
  bottom: auto;
  right: auto;
}

/* Animation effects */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
}

.avatar.animating-in {
  animation: fadeIn 0.3s ease-out forwards;
}

.avatar.animating-out {
  animation: fadeOut 0.3s ease-out forwards;
}

#spawnCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 5;
}

#spawnCanvas.active {
  opacity: 1;
}

#spawnMediaLayer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 6;
}

.spawn-media {
  max-width: 50vw;
  max-height: 50vh;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}
