/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Loading Overlay ───────────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  transition: opacity 0.5s ease;
}

.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 16px;
}

.loading-text {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  letter-spacing: 0.05em;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Error Overlay ─────────────────────────────────────────────────────────── */
.error-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9500;
}

.error-content {
  text-align: center;
  color: #fff;
}

.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: #f59e0b;
}

.error-message {
  font-size: 18px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.error-retry {
  font-size: 13px;
  opacity: 0.5;
}

/* ── Slideshow ─────────────────────────────────────────────────────────────── */
.slideshow {
  position: fixed;
  inset: 0;
  background: #000;
}

/* Individual slide */
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-ms, 1500ms) ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.slide.leaving {
  opacity: 0;
  z-index: 0;
}

/* Image slide */
.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.slide img.cover {
  object-fit: cover;
}

/* SVG slide — same as image */
.slide.svg-slide img {
  object-fit: contain;
}

/* Video slide */
.slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.slide video.cover {
  object-fit: cover;
}

.fallback-slide {
  background: radial-gradient(circle at 30% 30%, #1e293b, #020617 70%);
}

.fallback-inner {
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  padding: 2rem;
}

.fallback-inner p {
  font-size: 1.25rem;
  font-weight: 600;
}

.fallback-sub {
  margin-top: 0.5rem;
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  opacity: 0.65;
}

/* ── Volume OSD ────────────────────────────────────────────────────────────── */
.volume-osd {
  position: fixed;
  bottom: 40px;
  right: 40px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 8000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

.volume-osd.hidden {
  display: none;
}

.volume-osd.fade-out {
  opacity: 0;
}

.volume-bar-track {
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.volume-bar-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  transition: width 0.15s ease;
}

.volume-label {
  color: #fff;
  font-size: 13px;
  min-width: 36px;
  text-align: right;
}

/* ── Debug Overlay ─────────────────────────────────────────────────────────── */
.debug-overlay {
  position: fixed;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.8);
  color: #0f0;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 10px 14px;
  border-radius: 6px;
  z-index: 9999;
  max-width: 400px;
  line-height: 1.6;
  border: 1px solid rgba(0, 255, 0, 0.2);
}

.debug-overlay.hidden {
  display: none;
}

/* ── Utility ────────────────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}
