.wwai-video-slot {
  aspect-ratio: 16 / 9;
  background: #000 center / contain no-repeat;
}

.wwai-video-stage {
  position: relative;
  container-type: inline-size;
  isolation: isolate;
  background: #000;
}

.wwai-video-glass {
  color: #fff;
  background: linear-gradient(165deg, #ffffff30, #ffffff04 60%), #071329c2;
  border: 1px solid #ffffff65;
  border-radius: 999px;
  box-shadow: inset 0 1px 1px #ffffff42, 0 8px 28px #01051066;
  -webkit-backdrop-filter: blur(18px) saturate(155%);
  backdrop-filter: blur(18px) saturate(155%);
}

.wwai-video-start {
  position: absolute;
  top: 68%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 22px 7px 8px;
  overflow: hidden;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  font: 800 clamp(15px, 2.3cqw, 21px) / 1.2 Urbanist, sans-serif;
  cursor: pointer;
  transition: transform .28s cubic-bezier(.2, .8, .35, 1), box-shadow .25s, border-color .25s;
}

.wwai-video-start::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, #fff4 49%, transparent 68%);
  transform: translateX(-110%);
  transition: transform .65s ease;
  pointer-events: none;
}

.wwai-video-start-icon {
  display: grid;
  place-items: center;
  width: clamp(36px, 6cqw, 54px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(150deg, #fff5ad, #ffd900 62%, #edb900);
  box-shadow: inset 0 1px 2px #fff9, 0 2px 12px #ffdc004d;
  color: #10172b;
}

.wwai-video-start-icon::after,
.wwai-video-toggle::before {
  content: '';
  width: 14px;
  aspect-ratio: 1;
  margin-left: 2px;
  background: currentColor;
  clip-path: polygon(16% 0, 100% 50%, 16% 100%);
}

@media (hover: hover) {
  .wwai-video-start:hover {
    transform: translate(-50%, -54%) scale(1.05);
    border-color: #fff5bd;
    box-shadow: inset 0 1px 2px #fff9, 0 12px 36px #0008, 0 0 24px #ffd90055;
  }

  .wwai-video-start:hover::before {
    transform: translateX(110%);
  }

  .wwai-video-stage[data-playing]:not(:hover):not(:has(:focus-visible)) .wwai-video-controls {
    opacity: 0;
    pointer-events: none;
  }
}

.wwai-video-controls {
  position: absolute;
  inset: auto clamp(6px, 2cqw, 18px) clamp(6px, 2cqw, 18px);
  display: flex;
  align-items: center;
  gap: clamp(3px, 1cqw, 10px);
  padding: 3px 6px;
  transition: opacity .2s ease;
}

.wwai-video-stage [hidden] {
  display: none;
}

.wwai-video-controls button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(34px, 8cqw, 44px);
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: #fff1;
}

.wwai-video-controls button:hover {
  background-color: #ffffff42;
}

.wwai-video-stage :focus-visible {
  outline: 2px solid #ffea70;
  outline-offset: 2px;
}

.wwai-video-stage[data-playing] .wwai-video-toggle::before {
  margin-left: 0;
  background: linear-gradient(90deg, currentColor 35%, transparent 35% 65%, currentColor 65%);
  clip-path: none;
}

.wwai-video-progress {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
  min-width: 0;
}

.wwai-video-time {
  flex: none;
  white-space: nowrap;
  font: 700 12px / 1 Urbanist, sans-serif;
  font-variant-numeric: tabular-nums;
}

.wwai-video-range {
  --range-fill: 0%;
  --range-track: linear-gradient(90deg, #ffe15b var(--range-fill), #ffffff54 var(--range-fill));
  appearance: none;
  min-width: 0;
  height: 32px;
  margin: 0;
  background: var(--range-track) center / 100% 4px no-repeat;
  cursor: pointer;
}

.wwai-video-range::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px #0008;
}

.wwai-video-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px #0008;
}

.wwai-video-seek { flex: 1; }
.wwai-video-volume { width: clamp(38px, 10cqw, 74px); }

.wwai-video-mute::before {
  content: '';
  width: 18px;
  height: 16px;
  background: currentColor;
  clip-path: polygon(0 31%, 26% 31%, 57% 0, 57% 100%, 26% 69%, 0 69%, 0 31%, 71% 34%, 100% 16%, 100% 30%, 71% 49%, 71% 34%, 71% 57%, 100% 74%, 100% 88%, 71% 71%, 71% 57%);
}

.wwai-video-mute[aria-label="Unmute"]::before {
  clip-path: polygon(0 31%, 26% 31%, 57% 0, 57% 100%, 26% 69%, 0 69%, 0 31%, 65% 26%, 73% 18%, 82% 38%, 92% 18%, 100% 26%, 90% 50%, 100% 74%, 92% 82%, 82% 62%, 73% 82%, 65% 74%, 74% 50%, 65% 26%);
}

.wwai-video-fullscreen::before {
  content: '';
  width: 16px;
  aspect-ratio: 1;
  background:
    linear-gradient(currentColor 2px, transparent 0 14px, currentColor 0) center / 100% 100%,
    linear-gradient(90deg, currentColor 2px, transparent 0 14px, currentColor 0);
  clip-path: polygon(0 0, 38% 0, 38% 38%, 62% 38%, 62% 0, 100% 0, 100% 38%, 62% 38%, 62% 62%, 100% 62%, 100% 100%, 62% 100%, 62% 62%, 38% 62%, 38% 100%, 0 100%, 0 62%, 38% 62%, 38% 38%, 0 38%);
}

.wwai-video-fullscreen[aria-label="Exit full screen"]::before { transform: rotate(180deg) scale(.75); }

.wwai-video-stage[data-floating] {
  position: fixed;
  z-index: 110;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: clamp(220px, 30vw, 360px);
  max-width: calc(100vw - 32px);
  overflow: hidden;
  border: 1px solid #d2e8ff94;
  border-radius: 16px;
  color: #fff;
  box-shadow: 0 12px 40px #0009, 0 0 0 1px #010b2a80;
  animation: wwai-video-dock .22s ease-out;
}

.wwai-video-stage[data-floating] .wwai-video-volume { display: none; }

@keyframes wwai-video-dock {
  from { opacity: .4; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.wwai-video-stage:fullscreen { width: 100%; height: 100%; }
.wwai-video-stage[data-expanded] {
  position: fixed;
  z-index: 10000;
  inset: 0;
}

.wwai-video-stage:fullscreen #workshop-video,
.wwai-video-stage[data-expanded] #workshop-video { height: 100%; }

html:has(.wwai-video-stage[data-expanded]) { overflow: hidden; }

@container (max-width: 310px) {
  .wwai-video-time { display: none; }
}

@media (max-width: 767px) {
  .wwai-video-stage[data-floating] {
    left: max(10px, env(safe-area-inset-left));
    bottom: calc(64px + env(safe-area-inset-bottom));
    width: clamp(204px, 58vw, 280px);
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wwai-video-start:hover { transform: translate(-50%, -50%); }
  .wwai-video-start::before,
  .wwai-video-stage[data-floating] { animation: none; transition: none; }
}
