/* Inside each demo window: the title bar with its sync light, the notice, the controls. */
.titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.95rem;
}

.avatar {
  width: 26px;
  height: 26px;
  flex: none;
}

.avatar .eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 5s infinite;
}

.window-b .avatar .eyes {
  animation-delay: -2.2s;
}

.who {
  font-weight: 700;
}

.episode {
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sync {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex: none;
  color: var(--muted);
  font-size: 0.85rem;
}

.sync::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5ee6a8;
}

.window.is-syncing .sync::before {
  background: var(--pink);
  animation: beat 0.4s ease-in-out infinite alternate;
}

.toast {
  position: absolute;
  top: 6%;
  left: 4%;
  max-width: 80%;
  margin: 0;
  padding: 8px 12px;
  border-left: 3px solid var(--pink);
  border-radius: 12px;
  background: rgba(10, 10, 15, 0.86);
  font-size: clamp(0.8rem, 3.6cqw, 1rem);
  font-weight: 600;
  opacity: 0;
  transform: translateY(-10px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.is-shown {
  opacity: 1;
  transform: none;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 12px;
}

.play {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pink);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.play:active,
.play.is-pressed {
  transform: scale(0.86);
}

.play .icon {
  width: 12px;
  height: 14px;
  background: linear-gradient(90deg, #fff 0 34%, transparent 34% 66%, #fff 66%);
}

.window.is-paused .play .icon {
  width: 13px;
  margin-left: 3px;
  background: #fff;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.seek {
  position: relative;
  flex: 1;
  height: 22px;
  cursor: pointer;
}

.seek::before,
.fill {
  position: absolute;
  top: 9px;
  left: 0;
  height: 4px;
  border-radius: 999px;
}

.seek::before {
  content: '';
  right: 0;
  background: var(--line);
}

.fill {
  width: calc(var(--progress, 0.35) * 100%);
  background: var(--pink);
}

.head {
  position: absolute;
  top: 4px;
  left: calc(var(--progress, 0.35) * 100% - 7px);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 59, 92, 0.3);
}

.seek:focus-visible,
.play:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
}

.time {
  flex: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

@keyframes beat {
  to { transform: scale(1.5); }
}

@media (prefers-reduced-motion: reduce) {
  .avatar .eyes,
  .window.is-syncing .sync::before {
    animation: none;
  }

  .toast {
    transition: none;
  }
}
