/* ============================================================
   Yomma Player V2 – Styles
   Dunkle, barrierefreie Player-Oberfläche.
   Signature: das gut lesbare, voll steuerbare Untertitel-Band.
   ============================================================ */

:root {
  --bg:      #0e1116;
  --panel:   #161b22;
  --line:    #2a313c;
  --text:    #e7ecf2;
  --muted:   #9aa6b2;
  --accent:  #4ea1ff;
  --focus:   #ffd34e;
  --radius:  14px;

  /* Untertitel – per JS gesetzt */
  --ut-size:   32px;
  --ut-fg:     #ffffff;
  --ut-bg:     rgba(0,0,0,.86);
  --ut-shadow: 0 2px 6px rgba(0,0,0,.9);
  --ut-lines:  3;
  --ut-line:   45px;   /* Zeilenhöhe in Pixeln – wird per JS gesetzt */
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); }

body {
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.yomma-player {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ---------- Bühne / Video ---------- */
.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0c1118;
  display: grid;
  place-items: center;
}
.stage__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0c1118;
  display: block;
}
.stage__status {
  position: absolute;
  margin: 0;
  color: #6b7785;
  font-size: 14px;
  text-align: center;
  padding: 0 16px;
  pointer-events: none;
}
.live-dot {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  padding: 5px 10px; border-radius: 999px;
}
.live-dot::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: #ff4d4d; animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,77,77,.6); }
  70% { box-shadow: 0 0 0 9px rgba(255,77,77,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,77,77,0); }
}

/* ---------- Untertitel-Ebene ---------- */
.yomma-ut {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px clamp(12px, 4vw, 36px) 18px;
  display: none;
}
.yomma-player[data-ut-visible="true"] .yomma-ut { display: block; }

.yomma-ut__text {
  background: var(--ut-bg);
  color: var(--ut-fg);
  text-shadow: var(--ut-shadow);
  font-size: var(--ut-size);
  line-height: var(--ut-line);
  font-weight: 600;
  border-radius: 10px;
  padding: 0 .6em;
  /* genau --ut-lines volle Zeilen, oben sauber abgeschnitten */
  height: calc(var(--ut-line) * var(--ut-lines));
  overflow: hidden;
  white-space: pre-wrap;
  scroll-behavior: smooth;
}
.yomma-ut__text:empty::before {
  content: "Warte auf Untertitel …";
  opacity: .55;
  font-weight: 500;
}

/* ---------- Steuerleisten ---------- */
.yomma-controls {
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.group__label {
  font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-right: 2px;
}

.btn {
  font: inherit;
  color: var(--text);
  background: #1d2530;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #232c39; }
.btn[aria-pressed="true"],
.btn[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #05121f;
  font-weight: 700;
}
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.marker { font-weight: 800; }

.ut-bar { display: none; }
.yomma-player[data-ut-visible="true"] ~ .ut-bar,
.yomma-player[data-ut-visible="true"] .ut-bar { display: flex; }

.size-readout {
  min-width: 78px; text-align: center;
  font-variant-numeric: tabular-nums;
  background: #11161d; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 6px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.swatch {
  width: 22px; height: 16px; border-radius: 3px;
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 800; line-height: 1;
  border: 1px solid rgba(255,255,255,.25);
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Vollbild ---------- */
/* Gilt für echtes Vollbild UND den CSS-Ersatz (iPhone): per JS-Klasse. */
.yomma-player.is-fs-active {
  position: fixed;
  inset: 0;
  z-index: 99999;
  margin: 0;
  max-width: none;
  width: 100%;
  height: 100%;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
.yomma-player.is-fs-active .stage {
  aspect-ratio: auto;
  flex: 1 1 auto;
  min-height: 0;
}
/* Hintergrund-Scrollen sperren, solange der CSS-Ersatz aktiv ist. */
body.yomma-fs-lock { overflow: hidden; }

/* Vollbild-Knopf: Symbol etwas größer */
.fs-btn .fs-icon { font-size: 1.15em; line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  .yomma-ut__text { scroll-behavior: auto; }
  .live-dot::before { animation: none; }
}
