/* Kolory tła startowo = krawędzie ostatniej klatki filmu.
   Podczas odtwarzania app.js dopasowuje je na żywo do krawędzi aktualnej klatki. */
@property --bg-top    { syntax: '<color>'; inherits: true; initial-value: #010513; }
@property --bg-bottom { syntax: '<color>'; inherits: true; initial-value: #020817; }

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

html, body { height: 100%; }

body {
  --bg-top: #010513;
  --bg-bottom: #020817;
  --ar: 1.7778; /* proporcje filmu, nadpisywane przez app.js */
  background-color: var(--bg-top);
  background-image:
    radial-gradient(ellipse 75% 85% at 50% 50%, transparent 55%, rgba(0, 0, 0, .45) 100%),
    linear-gradient(to bottom, var(--bg-top), var(--bg-bottom));
  transition: --bg-top .7s ease, --bg-bottom .7s ease;
  overflow: hidden;
  color: #e8f4ff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

#film {
  display: block;
  width: min(100vw, calc(100vh * var(--ar)));
  width: min(100vw, calc(100dvh * var(--ar)));
  height: auto;
  aspect-ratio: var(--ar);
  object-fit: contain;
  background: transparent;
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
  /* miękkie wtopienie krawędzi filmu w tło */
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}
#film.ready { opacity: 1; }

.btn {
  position: fixed;
  display: grid;
  place-items: center;
  border: 1px solid rgba(120, 200, 255, .35);
  background: rgba(10, 30, 50, .45);
  color: #bfe6ff;
  border-radius: 50%;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: transform .2s ease, background .2s ease, opacity .4s ease;
}
.btn:hover { background: rgba(20, 60, 95, .6); transform: scale(1.06); }
.btn:focus-visible { outline: 2px solid #5cc8ff; outline-offset: 3px; }
.btn[hidden] { display: none; }
.btn svg { fill: currentColor; }

.btn-play {
  width: 84px; height: 84px;
  left: 50%; top: 50%;
  translate: -50% -50%;
}
.btn-play svg { width: 38px; height: 38px; margin-left: 4px; }

.btn-sound {
  width: 44px; height: 44px;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  opacity: .75;
}
.btn-sound:hover { opacity: 1; }
.btn-sound svg { width: 22px; height: 22px; }
.btn-sound.on .x { display: none; }
.btn-sound.fade { opacity: 0; pointer-events: none; }
