/* Schrift selbst gehostet (nur lateinischer Zeichensatz, reicht für Deutsch) */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/cormorant-garamond-300.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/cormorant-garamond-300-italic.woff2") format("woff2");
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --fg: #fff;
  --fg-dim: rgba(255, 255, 255, 0.35);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  background: #000;
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { fill: currentColor; display: block; }

/* ── Bühne: immer exakt der sichtbare Bildschirm ── */
.player {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.backdrop {
  position: absolute;
  inset: -10%;
  background: #000 url("video/poster.jpg") center / cover no-repeat;
  filter: blur(40px) brightness(0.45);
  transform: scale(1.1);
}

video {
  /* absolut an die Bühne geheftet: sonst bemisst das Grid die Höhe nach dem Seitenverhältnis
     des Videos, und im Querformat (Desktop-Vollbild) wird es oben und unten abgeschnitten */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* nichts abschneiden; per Doppeltipp auf "cover" umschaltbar */
  background: transparent;
}
.player.fill video { object-fit: cover; }

/* ── Startbildschirm ── */
.start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  background: rgba(0, 0, 0, 0.35);
  transition: opacity 0.4s ease;
}
.start__title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 300;
  font-size: clamp(2.6rem, 13vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}
.start__date {
  margin: -0.5rem 0 1.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  opacity: 0.85;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}
.start__title i { font-style: italic; }
.start__icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  animation: pulse 2.4s ease-in-out infinite;
}
.start__icon svg { width: 36px; height: 36px; margin-left: 4px; }
.start__hint {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.8;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* ── Pause-Symbol ── */
.paused {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.paused svg { width: 32px; height: 32px; margin-left: 3px; }

/* ── Bedienleiste ── */
.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 2.5rem 16px calc(14px + var(--safe-b));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  transition: opacity 0.3s ease;
}
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn .i-muted { display: none; }
.icon-btn.is-muted .i-sound { display: none; }
.icon-btn.is-muted .i-muted { display: block; }

.progress {
  flex: 1;
  height: 28px; /* große Touch-Fläche */
  display: flex;
  align-items: center;
  position: relative;
  touch-action: none;
}
.progress::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--fg-dim);
}
.progress__bar {
  position: relative;
  height: 3px;
  width: 0;
  border-radius: 2px;
  background: var(--fg);
}
.progress__bar::after {
  content: "";
  position: absolute;
  right: -6px;
  top: -4.5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fg);
}
.time { font-size: 0.75rem; font-variant-numeric: tabular-nums; opacity: 0.85; min-width: 2.6em; text-align: right; }

/* ── Teilen & Herunterladen ── */
.actions {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(84px + var(--safe-b));
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  transition: opacity 0.3s ease;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 1.1rem;
  border-radius: 22px;
  font-size: 0.9rem;
  color: var(--fg);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.pill:active { background: rgba(255, 255, 255, 0.3); }
.pill svg { width: 18px; height: 18px; }

.toast {
  position: absolute;
  left: 50%;
  top: calc(24px + env(safe-area-inset-top, 0px));
  transform: translate(-50%, -10px);
  padding: 0.6rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Zustände ── */
.player.started:not(.is-paused) .actions { opacity: 0; pointer-events: none; }
.player:not(.started) .controls,
.player:not(.started) .paused { opacity: 0; pointer-events: none; }
.player.started .start { opacity: 0; pointer-events: none; }
.player.started.is-paused .paused { opacity: 1; transform: scale(1); }
.player.started.idle:not(.is-paused) .controls { opacity: 0; }

.error {
  position: absolute;
  bottom: calc(40px + var(--safe-b));
  left: 16px; right: 16px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  .start__icon { animation: none; }
}
