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

html, body {
  width: 100%;
  height: 100%;
  background: #05070f;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

#slides {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 177.78vh; /* enforce 16:9 by height */
  max-height: 56.25vw; /* enforce 16:9 by width */
  aspect-ratio: 16 / 9;
  background: #000;
  margin: auto;
}

.slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.slide-video {
  position: absolute;
  overflow: hidden;
  background: #000;
}

.slide-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide-link {
  position: absolute;
  cursor: pointer;
  z-index: 5;
}

.slide-link:hover {
  background: rgba(255, 255, 255, 0.15);
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

#play-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  cursor: pointer;
  pointer-events: none;
}

#play-overlay.show {
  pointer-events: auto;
}

#play-overlay.hidden {
  display: none;
}

#play-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#play-btn:hover {
  transform: scale(1.08);
}

#controls {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(5, 7, 15, 0.55);
  backdrop-filter: blur(6px);
  padding: 8px 18px;
  border-radius: 999px;
  z-index: 10;
  user-select: none;
}

#controls button {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

#controls button:hover {
  background: rgba(255, 255, 255, 0.2);
}

#counter {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  min-width: 52px;
  text-align: center;
}

#progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 10;
}

#progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0057ff, #00d8c6);
  width: 0%;
  transition: width 0.4s ease;
}

@media (max-width: 700px) {
  #controls { bottom: 12px; padding: 6px 12px; gap: 12px; }
  #counter { font-size: 11px; }
}
