/* Lern-Player. Farben über --l-* anpassbar, Standard: COOKIE-Petrol. */
.lp {
  --l-accent: var(--petrol, #00738b);
  --l-ink: var(--ink, #0b2a31);
  --l-chrome: #0f2f36;
  --l-chrome-line: rgba(255, 255, 255, .18);
  position: relative;
  /* Die Steuerleiste richtet sich nach der Breite des Players, nicht des Fensters */
  container-type: inline-size;
  background: var(--l-chrome);
  border-radius: 14px;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 1px 2px rgba(11, 42, 49, .08), 0 18px 40px rgba(11, 42, 49, .16);
}
.lp:fullscreen { border-radius: 0; display: flex; flex-direction: column; background: #000; }
.lp:fullscreen .lp-stage { flex: 1; }
.lp:fullscreen .lp-video { height: 100%; max-height: none; }

.lp-stage { position: relative; background: #000; }
.lp-video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 78vh; background: #000; }
.lp.is-enhanced .lp-video { cursor: pointer; }
.lp-video::cue { font-family: var(--font, sans-serif); font-size: 1.125rem; background: rgba(11, 42, 49, .82); }

.lp-missing {
  position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px;
  text-align: center; color: rgba(255, 255, 255, .8);
}

.lp-bigplay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--l-accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.lp-bigplay svg { width: 40px; height: 40px; margin-left: 4px; }
.lp-bigplay:hover { transform: translate(-50%, -50%) scale(1.05); }
.lp-bigplay[hidden], .lp-bar[hidden], .lp-next[hidden], .lp-tip[hidden] { display: none; }

.lp-next {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; text-align: center;
  background: rgba(11, 42, 49, .88); padding: 20px;
}
.lp-next p { margin: 0; font-size: 1.125rem; font-weight: 600; }
/* Beide Buttons gleich breit und gleich hoch */
.lp-next-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; justify-content: center; }
.lp-next-actions .btn { width: 100%; }

.lp-bar { padding: 10px 14px 8px; background: var(--l-chrome); }

/* Zeitleiste: ein Segment pro Kapitel */
.lp-timeline { position: relative; padding: 9px 0; cursor: pointer; touch-action: none; }
.lp-timeline:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lp-segments { display: flex; gap: 3px; height: 6px; }
.lp-timeline:hover .lp-segments, .lp-timeline:focus-visible .lp-segments { height: 8px; margin-top: -1px; }
.lp-seg { position: relative; flex: 1 1 0; min-width: 3px; background: rgba(255, 255, 255, .26); border-radius: 2px; overflow: hidden; }
.lp-seg-fill { position: absolute; inset: 0; background: #7fd3e3; transform: scaleX(0); transform-origin: left; }
.lp-thumb {
  position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; left: 0;
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(127, 211, 227, .45); pointer-events: none;
}
.lp-tip {
  position: absolute; bottom: 26px; transform: translateX(-50%); white-space: nowrap;
  max-width: 80vw; overflow: hidden; text-overflow: ellipsis;
  background: #fff; color: var(--l-ink); font-size: .8125rem; font-weight: 600;
  padding: 5px 9px; border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); pointer-events: none;
}

.lp-controls { display: flex; align-items: center; gap: 2px; min-height: 44px; }
.lp-btn {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px;
  background: transparent; color: #fff; border: 0; border-radius: 8px; cursor: pointer;
  font: inherit; font-weight: 650; font-size: .875rem;
}
.lp-btn:hover { background: rgba(255, 255, 255, .1); }
.lp-btn svg { width: 22px; height: 22px; }
.lp-btn[aria-pressed="true"] { color: #7fd3e3; }
.lp-i-pause { display: none; }
.lp.is-playing .lp-i-play { display: none; }
.lp.is-playing .lp-i-pause { display: block; }
.lp.is-muted .lp-i-wave { display: none; }
.lp-time { font-variant-numeric: tabular-nums; font-size: .875rem; padding: 0 8px; white-space: nowrap; color: rgba(255, 255, 255, .85); }
.lp-chapter {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .875rem; font-weight: 600; padding-left: 10px; border-left: 1px solid var(--l-chrome-line);
}
.lp-spacer { flex: 1; }

/* Fokus nach Klick aufs Video, damit Pfeiltasten die Lautstärke regeln; nicht per Tab erreichbar */
.lp:focus { outline: none; }

/* Lautstärke: Spur und Füllung wie die Zeitleiste, Griff wie der Zeitleisten-Punkt */
.lp-volume { display: inline-flex; flex: none; align-items: center; padding: 0 6px 0 2px; }
.lp-volume[hidden] { display: none; }
.lp-volume-range {
  --lp-level: 100%;
  -webkit-appearance: none; appearance: none;
  width: 72px; height: 40px; margin: 0; padding: 0 4px; background: transparent; cursor: pointer; border-radius: 8px;
}
/* Allgemeine Formularfelder bekommen beim Fokus eine weiße Fläche; der Regler nur den Fokusrahmen */
.lp-volume-range:focus { outline: none; background: transparent; box-shadow: none; }
.lp-volume-range:focus-visible { outline: 2px solid #fff; outline-offset: 0; }
.lp-volume-range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, #7fd3e3 var(--lp-level), rgba(255, 255, 255, .26) var(--lp-level));
}
.lp-volume-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0;
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(127, 211, 227, .45);
}
.lp-volume-range::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .26); }
.lp-volume-range::-moz-range-progress { height: 4px; border-radius: 2px; background: #7fd3e3; }
.lp-volume-range::-moz-range-thumb {
  width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(127, 211, 227, .45);
}

@media (max-width: 640px) {
  .lp { border-radius: 10px; }
  .lp-bar { padding: 6px 6px 4px; }
  .lp-chapter { display: none; }
  .lp-time { padding: 0 4px; font-size: .8125rem; }
  .lp-btn { min-width: 36px; padding: 0 4px; }
  .lp-volume { padding: 0 2px 0 0; }
  .lp-bigplay { width: 64px; height: 64px; }
  .lp-bigplay svg { width: 30px; height: 30px; }
}
@media (max-width: 380px) {
  .lp-controls [data-lp="back"], .lp-controls [data-lp="forward"] { display: none; }
}
/* Touch-Geräte regeln die Lautstärke über die Gerätetasten, der Ton-Button bleibt */
@media (pointer: coarse) {
  .lp-volume { display: none; }
}
/* Schmale Player mit Maus (z. B. Gratis-Vorschau): Platz für den Regler, ±10 s über J/L und Pfeiltasten */
@media (pointer: fine) {
  @container (max-width: 520px) {
    .lp-chapter, .lp-controls [data-lp="back"], .lp-controls [data-lp="forward"] { display: none; }
    .lp-volume-range { width: 56px; }
  }
}
@container (max-width: 400px) {
  .lp-volume { display: none; }
}
/* Sehr schmale Player (Gratis-Vorschau bei 320 px): Buttons und Zeit etwas enger, damit nichts abgeschnitten wird */
@container (max-width: 300px) {
  .lp-btn { min-width: 32px; padding: 0 2px; }
  .lp-time { padding: 0 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-bigplay:hover { transform: translate(-50%, -50%); }
}
