/* Odtwarzacz filmów lekcji (od 7.11.2026): film na dole sekcji, w stylu kursu (brąz, złoto). includes/lesson_videos.php, assets/js/lesson-video.js */
.hbv-wrap { padding: 0 1rem 1rem; margin-top: -0.5rem; }
@media (min-width: 640px) { .hbv-wrap { padding: 0 1.5rem 1.5rem; } }
@media (min-width: 768px) { .hbv-wrap { padding: 0 3.5rem 3.5rem; margin-top: -1.5rem; } }
.hbv { --hbv-zl: #E5A820; --hbv-zl2: #F8C555; position: relative; max-width: 56rem; margin: 0 auto; aspect-ratio: 16 / 9; border-radius: 18px;
  overflow: hidden; background: #0F0B07; outline: none; box-shadow: 0 0 0 1px rgba(229, 168, 32, .35), 0 18px 44px rgba(0, 0, 0, .35);
  font-family: inherit; color: #F5EFE3; -webkit-tap-highlight-color: transparent; }
.hbv:focus-visible { box-shadow: 0 0 0 3px var(--hbv-zl2), 0 18px 44px rgba(0, 0, 0, .35); }
.hbv-video { position: absolute; inset: 0; width: 100%; height: 100%; background: #0F0B07; display: block; cursor: pointer; }
.hbv::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42%; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: linear-gradient(180deg, rgba(15, 11, 7, 0) 0%, rgba(15, 11, 7, .55) 55%, rgba(15, 11, 7, .88) 100%); }
.hbv.hbv--pokaz::after, .hbv.hbv--pauza::after { opacity: 1; }

/* przycisk na okładce (lewy dolny róg, żeby nie zasłaniał tytułu w kadrze) i po pauzie przed startem */
.hbv-duzy { position: absolute; left: clamp(12px, 2.6%, 26px); bottom: clamp(12px, 3.2%, 26px); z-index: 3; margin: 0;
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px 12px 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--hbv-zl), var(--hbv-zl2)); color: #1C1610; font-family: inherit; font-weight: 700; font-size: 17px; line-height: 1;
  box-shadow: 0 0 0 6px rgba(229, 168, 32, .2), 0 14px 34px rgba(0, 0, 0, .5); transition: transform .2s, opacity .2s, box-shadow .2s; }
.hbv-duzy svg { width: 22px; height: 22px; fill: currentColor; }
.hbv-duzy-czas { font-weight: 600; font-variant-numeric: tabular-nums; opacity: .75; }
.hbv-duzy-czas:not(:empty)::before { content: "· "; }
.hbv-duzy:hover, .hbv-duzy:focus-visible { transform: scale(1.04); box-shadow: 0 0 0 9px rgba(229, 168, 32, .26), 0 14px 34px rgba(0, 0, 0, .5); outline: none; }
.hbv.hbv--zaczety .hbv-duzy, .hbv.hbv--gra .hbv-duzy { opacity: 0; pointer-events: none; transform: scale(.9); }

/* wczytywanie (7.11.2026): po przeskoku w miejsce, którego przeglądarka jeszcze nie pobrała, i gdy brakuje danych w trakcie oglądania */
.hbv-laduje { position: absolute; left: 50%; top: 50%; z-index: 2; width: 78px; height: 78px; margin: -39px 0 0 -39px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(15, 11, 7, .78); box-shadow: 0 0 0 1px rgba(229, 168, 32, .35), 0 12px 32px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transform: scale(.82); transition: opacity .2s, transform .25s; pointer-events: none; }
.hbv.hbv--laduje .hbv-laduje { opacity: 1; transform: none; }
.hbv-video { transition: filter .3s; }
.hbv.hbv--laduje .hbv-video { filter: brightness(.6); }
.hbv-laduje svg { width: 54px; height: 54px; animation: hbv-obrot 1.5s linear infinite; }
.hbv-laduje circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.hbv-laduje-tlo { stroke: rgba(245, 239, 227, .16); }
.hbv-laduje-luk { stroke: var(--hbv-zl2); stroke-dasharray: 1 200; stroke-dashoffset: 0; animation: hbv-luk 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(229, 168, 32, .55)); }
@keyframes hbv-obrot { to { transform: rotate(360deg); } }
@keyframes hbv-luk {
  0% { stroke-dasharray: 1 200; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 90 200; stroke-dashoffset: -35; }
  100% { stroke-dasharray: 90 200; stroke-dashoffset: -124; }
}

/* pasek sterowania */
.hbv-pasek { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 0 14px 10px; opacity: 0; transform: translateY(6px);
  transition: opacity .25s, transform .25s; }
.hbv.hbv--pokaz .hbv-pasek, .hbv.hbv--pauza.hbv--zaczety .hbv-pasek, .hbv:focus-within .hbv-pasek { opacity: 1; transform: none; }
.hbv:not(.hbv--zaczety) .hbv-pasek { opacity: 0; pointer-events: none; }
/* myszka poza filmem od 2 s: sterowanie chowa się zawsze (wygrywa z pauzą i fokusem) */
.hbv.hbv--ukryj .hbv-pasek { opacity: 0 !important; transform: translateY(6px) !important; pointer-events: none !important; }
.hbv.hbv--ukryj.hbv--zaczety::after { opacity: 0 !important; }
.hbv-os { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; outline: none; }
.hbv-tor { position: relative; width: 100%; height: 5px; border-radius: 99px; background: rgba(245, 239, 227, .22); overflow: hidden; transition: height .15s; }
.hbv-os:hover .hbv-tor, .hbv-os:focus-visible .hbv-tor, .hbv--ciagnie .hbv-tor { height: 7px; }
.hbv-bufor { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(245, 239, 227, .28); }
.hbv-postep { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--hbv-zl), var(--hbv-zl2)); }
.hbv-kropka { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--hbv-zl2);
  box-shadow: 0 0 0 4px rgba(229, 168, 32, .3); transform: scale(0); transition: transform .15s; pointer-events: none; }
.hbv-os:hover .hbv-kropka, .hbv-os:focus-visible .hbv-kropka, .hbv--ciagnie .hbv-kropka { transform: scale(1); }
.hbv-przyciski { display: flex; align-items: center; gap: 2px; }
.hbv-btn { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent;
  color: #F5EFE3; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1; letter-spacing: .02em; transition: background .15s, color .15s; }
.hbv-btn svg { width: 22px; height: 22px; fill: currentColor; }
.hbv-btn:hover, .hbv-btn:focus-visible { background: rgba(229, 168, 32, .18); color: var(--hbv-zl2); outline: none; }
.hbv-btn[aria-pressed="true"] { color: var(--hbv-zl2); }
.hbv-wstecz svg { width: 26px; height: 26px; }
.hbv-wstecz text { font-family: inherit; font-size: 6.6px; font-weight: 700; fill: currentColor; }
.hbv-graj svg:last-child { display: none; }
.hbv.hbv--gra .hbv-graj svg:first-child { display: none; }
.hbv.hbv--gra .hbv-graj svg:last-child { display: block; }
.hbv-cisza { display: none; }
.hbv.hbv--cicho .hbv-cisza { display: inline; }
.hbv-czas { margin-left: 6px; font-size: 14px; font-variant-numeric: tabular-nums; color: rgba(245, 239, 227, .9); white-space: nowrap; }
.hbv-sep { opacity: .55; }
.hbv-odstep { flex: 1; }
.hbv-tempo { min-width: 48px; }
.hbv-tempo[aria-expanded="true"] { background: rgba(229, 168, 32, .18); color: var(--hbv-zl2); }
/* wybór prędkości (#313): pasek nad przyciskami, przy prawej krawędzi filmu (na telefonie się nie ucina) */
.hbv-tempo-menu { position: absolute; right: 14px; bottom: calc(100% + 2px); z-index: 5; display: flex; gap: 2px; padding: 5px; border-radius: 12px;
  background: rgba(15, 11, 7, .94); box-shadow: 0 0 0 1px rgba(229, 168, 32, .35), 0 12px 28px rgba(0, 0, 0, .5); white-space: nowrap; }
.hbv-tempo-menu[hidden] { display: none; }
.hbv-tempo-menu button { min-width: 46px; height: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: #F5EFE3;
  font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1; font-variant-numeric: tabular-nums; cursor: pointer; transition: background .15s, color .15s; }
.hbv-tempo-menu button:hover, .hbv-tempo-menu button:focus-visible { background: rgba(229, 168, 32, .18); color: var(--hbv-zl2); outline: none; }
.hbv-tempo-menu button[aria-checked="true"] { background: linear-gradient(135deg, var(--hbv-zl), var(--hbv-zl2)); color: #1C1610; }
.hbv.hbv--menu .hbv-pasek { opacity: 1; transform: none; pointer-events: auto; }
.hbv.hbv--menu::after { opacity: 1; }

/* pełny ekran */
.hbv:fullscreen { max-width: none; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.hbv:fullscreen .hbv-video { object-fit: contain; }

/* napisy */
.hbv-video::cue { background: rgba(15, 11, 7, .82); color: #F5EFE3; font-family: inherit; font-size: 1.05em; line-height: 1.35; }

@media (max-width: 520px) {
  .hbv { border-radius: 12px; }
  .hbv-duzy { padding: 9px 16px 9px 12px; font-size: 15px; gap: 7px; }
  .hbv-duzy svg { width: 18px; height: 18px; }
  .hbv-pasek { padding: 0 6px 4px; }
  .hbv-btn { min-width: 34px; height: 34px; padding: 0 5px; }
  .hbv-btn svg { width: 19px; height: 19px; }
  .hbv-wstecz, .hbv-sep, .hbv-calosc { display: none; }
  .hbv-czas { font-size: 12px; }
  .hbv-tempo-menu { right: 6px; padding: 4px; }
  .hbv-tempo-menu button { min-width: 0; height: 30px; padding: 0 7px; font-size: 13px; }
  .hbv-laduje { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
  .hbv-laduje svg { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .hbv-duzy, .hbv-pasek, .hbv::after, .hbv-tor, .hbv-kropka { transition: none; }
  /* wczytywanie musi być widać, więc tylko wolniejszy obrót bez zmiany długości łuku */
  .hbv-laduje svg { animation-duration: 3s; }
  .hbv-laduje-luk { animation: none; stroke-dasharray: 40 200; }
}
