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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a0a;
  font-family: Georgia, 'Times New Roman', serif;
  color: #fff;
}

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

/* ── Waiting screen ────────────────────────────────────────────────────────── */
#waiting {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
}

.waiting-inner {
  text-align: center;
  padding: 0 2rem;
  animation: pulse 3s ease-in-out infinite;
}

.waiting-title {
  font-size: clamp(1.4rem, 5vw, 2.4rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #e8d5b0;
  margin-bottom: 1rem;
}

.waiting-subtitle {
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
  letter-spacing: 0.04em;
}

@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1; }
}

/* ── Slideshow ─────────────────────────────────────────────────────────────── */
#slideshow {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
}

#slide-img {
  max-width: 100%;
  max-height: 100dvh;
  max-height: 100vh; /* fallback */
  object-fit: contain;
  display: block;
  transition: opacity 0.6s ease;
  user-select: none;
  -webkit-user-drag: none;
}

#slide-img.fade-out {
  opacity: 0;
}

/* Caption gradient bar */
#caption-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 1.5rem 1.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#caption-text {
  font-size: clamp(0.9rem, 3vw, 1.3rem);
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.03em;
  line-height: 1.5;
  font-style: italic;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

#caption-bar:not(:has(#caption-text:empty)) {
  /* Only show bar when there's a caption — fallback below */
}
#caption-bar.no-caption {
  opacity: 0;
}

/* ── Reconnect badge ───────────────────────────────────────────────────────── */
#reconnect-badge {
  position: fixed;
  top: env(safe-area-inset-top, 12px);
  right: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.6);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 5px 10px 5px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 180, 50, 0.9);
  animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}
