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

html {
  min-height: 100%;
  background: linear-gradient(to bottom, #22354b, #b6b6bd) no-repeat fixed;
  background-size: 100% 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: none;
  font-family: sans-serif;
}

/* Landing overlay */
#landing-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.6s ease;
}

#landing-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#landing-img {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
}

#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Face field - coordinate space for absolute face positioning */
#face-field {
  position: relative;
  width: 100%;
}

/* Face buttons */
.face {
  position: absolute;
  width: 120px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  transform: rotate(var(--rotation));
  animation: float 3s ease-in-out infinite;
  animation-delay: var(--float-delay);
  transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              top 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
  z-index: 1;
  outline: none;
}

.face img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  border-radius: 50%;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6)) drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

/* Floating animation - preserves per-face rotation */
@keyframes float {
  0%, 100% {
    transform: rotate(var(--rotation)) translateY(0);
  }
  50% {
    transform: rotate(var(--rotation)) translateY(-12px);
  }
}

/* Face flying to centre */
.face--flying {
  position: fixed !important;
  animation: none;
  z-index: 100;
  transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              top 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
}

.face--hidden {
  opacity: 0;
  pointer-events: none;
}

/* Video overlay */
#video-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

#video-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

#player {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

#close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 210;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

#close-btn:hover,
#close-btn:focus {
  opacity: 1;
}
