/* ==========================================================================
   Regler-Modul (aus v2-regler übernommen) · Der Regler arbeitet, fünf Etappen
   Alles hängt an .rgl bzw. an Klassen mit Präfix rgl-, damit nichts mit v1 kollidiert.
   Farben und Schriften aus den :root-Variablen von v1 (schnitt.css), mit Rückfallwerten.
   ========================================================================== */

.rgl {
  --rgl-ink: var(--grund, #060705);
  --rgl-flaeche: var(--flaeche, #0d100a);
  --rgl-flaeche-2: var(--flaeche-2, #141a0f);
  --rgl-chalk: var(--text, #f3f5ee);
  --rgl-text-2: var(--text-2, #c3c9ba);
  --rgl-text-3: var(--text-3, #a9b0a0);
  --rgl-lime: var(--lime, #c8f14b);
  --rgl-grau: var(--grau, #7d8378);
  --rgl-linie-stark: rgba(251, 250, 247, .22);
  --rgl-ease: cubic-bezier(.16, 1, .3, 1);
  position: relative; height: 800vh;
  color: var(--rgl-chalk); background: var(--rgl-ink);
  font-family: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
.rgl *, .rgl *::before, .rgl *::after { box-sizing: border-box; }
.rgl p, .rgl ol { margin: 0; padding: 0; }
.rgl ol { list-style: none; }
.rgl img, .rgl video, .rgl canvas, .rgl svg { display: block; max-width: 100%; }
.rgl button { font: inherit; color: inherit; }
.rgl em { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: 0; color: var(--rgl-lime); font-size: 1em; line-height: inherit; }
.rgl :focus-visible { outline: 2px solid var(--rgl-lime); outline-offset: 3px; border-radius: 4px; }
.rgl .rgl-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------------ Bühne (gepinnt) */
.rgl .rgl-halt { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.rgl .rgl-halt::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: url(assets/korn.png); opacity: .05; mix-blend-mode: screen;
}

/* ------------------------------------------------------------ Regler (Kante, Knauf, Schilder) */
.rgl .rgl-regler {
  --x: .5;
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 16 / 9; border-radius: 14px; background: #050606;
  box-shadow: 0 0 0 1px rgba(251, 250, 247, .14), 0 30px 80px rgba(0, 0, 0, .55);
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.rgl .rgl-ebene { position: absolute; inset: 0; }
.rgl .rgl-fertig { clip-path: inset(0 0 0 calc(var(--x) * 100%)); }
.rgl .rgl-medium, .rgl .rgl-leinwand { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 40%; }
.rgl .rgl-kante {
  position: absolute; top: 0; bottom: 0; left: calc(var(--x) * 100%); width: 2px; margin-left: -1px; z-index: 4;
  background: var(--rgl-lime); box-shadow: 0 0 14px rgba(200, 241, 75, .55); pointer-events: none;
  transition: opacity .3s;
}
.rgl .rgl-knauf {
  position: absolute; z-index: 5; top: 50%; left: calc(var(--x) * 100%); width: 44px; height: 44px; translate: -50% -50%;
  display: grid; place-items: center; cursor: ew-resize; touch-action: none; border-radius: 50%;
  transition: opacity .3s;
}
.rgl .rgl-knauf::before {
  content: ""; position: absolute; inset: 8px; border-radius: 50%;
  background: var(--rgl-ink); border: 2px solid var(--rgl-lime); box-shadow: 0 0 0 4px rgba(200, 241, 75, .18), 0 6px 18px rgba(0, 0, 0, .5);
  transition: transform .2s var(--rgl-ease);
}
.rgl .rgl-knauf:hover::before, .rgl .rgl-regler.zieht .rgl-knauf::before { transform: scale(1.12); }
.rgl .rgl-knauf svg { position: relative; width: 22px; height: 22px; fill: none; stroke: var(--rgl-lime); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rgl .rgl-knauf:focus-visible { outline: none; }
.rgl .rgl-knauf:focus-visible::before { box-shadow: 0 0 0 4px rgba(200, 241, 75, .5); }
.rgl .rgl-schild {
  position: absolute; z-index: 3; top: 14px; padding: 6px 11px; border-radius: 7px;
  font-size: 14px; font-weight: 650; letter-spacing: .01em; line-height: 1.1; pointer-events: none;
  background: rgba(11, 12, 13, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .35s;
}
.rgl .rgl-schild--roh { left: 14px; color: var(--rgl-chalk); box-shadow: inset 0 0 0 1px rgba(125, 131, 120, .7); }
.rgl .rgl-schild--fertig { right: 14px; color: var(--rgl-lime); box-shadow: inset 0 0 0 1px rgba(200, 241, 75, .55); }
.rgl .rgl-regler.roh-verdeckt .rgl-schild--roh, .rgl .rgl-regler.fertig-verdeckt .rgl-schild--fertig { opacity: 0 !important; }

/* ------------------------------------------------------------ Etappen-Reiter */
.rgl .rgl-leiter {
  position: absolute; z-index: 2; left: 50%; translate: -50% 0; top: var(--rgl-leiter-y, 88px);
  display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; transition: opacity .4s;
}
.rgl .rgl-leiter li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--rgl-text-3); white-space: nowrap; transition: color .35s, background-color .35s; }
.rgl .rgl-leiter b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; box-shadow: inset 0 0 0 1px var(--rgl-linie-stark); transition: background-color .35s, color .35s; }
.rgl .rgl-leiter li.ist-an { color: var(--rgl-chalk); background: var(--rgl-flaeche-2); }
.rgl .rgl-leiter li.ist-an b { background: var(--rgl-lime); color: var(--rgl-ink); box-shadow: none; }
.rgl .rgl-leiter li.ist-durch b { color: var(--rgl-lime); box-shadow: inset 0 0 0 1px rgba(200, 241, 75, .5); }

/* ------------------------------------------------------------ große Bühne, Tonband, Texte */
.rgl .rgl-buehne { position: absolute; z-index: 1; left: 50%; top: 0; aspect-ratio: auto; will-change: transform; }
.rgl .rgl-buehne .rgl-video { opacity: 0; transition: opacity .35s; }
.rgl .rgl-buehne.zeigt-video .rgl-video { opacity: 1; }
.rgl .rgl-band { position: absolute; z-index: 1; left: 50%; top: 0; height: 48px; transition: height .5s var(--rgl-ease); }
.rgl .rgl-band__leinwand { width: 100%; height: 100%; }
.rgl .rgl-band__legende { position: absolute; right: 0; top: calc(100% + 6px); display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.3; color: var(--rgl-text-3); white-space: nowrap; }
.rgl .rgl-band__legende i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.rgl .rgl-band__legende .rgl-l-musik { margin-left: 8px; }
.rgl .rgl-l-stimme { background: var(--rgl-lime); }
.rgl .rgl-l-musik { background: var(--rgl-grau); }
.rgl .rgl-fuss { position: absolute; z-index: 1; left: 50%; top: 0; transition: opacity .4s; }
.rgl .rgl-texte { position: relative; }
.rgl .rgl-etext { position: absolute; left: 0; top: 0; right: 0; opacity: 0; translate: 0 10px; transition: opacity .45s var(--rgl-ease), translate .45s var(--rgl-ease); pointer-events: none; max-width: 640px; line-height: 1.55; }
.rgl .rgl-etext.ist-an { opacity: 1; translate: 0 0; }
.rgl .rgl-etext__h { font-size: clamp(19px, 1.6vw, 24px); font-weight: 600; letter-spacing: -.02em; line-height: 1.25; color: var(--rgl-chalk); }
.rgl .rgl-etext__h b { color: var(--rgl-lime); font-weight: 650; }
.rgl .rgl-etext p + p { margin-top: 6px; color: var(--rgl-text-2); font-size: 16px; }

/* ------------------------------------------------------------ Höhepunkt: Text neben (Desktop) oder unter (Handy) dem Video */
.rgl .rgl-gipfel { position: absolute; z-index: 2; left: 0; top: 0; opacity: 0; pointer-events: none; transition: opacity .5s var(--rgl-ease); line-height: 1.55; }
.rgl .rgl-gipfel.ist-an { opacity: 1; pointer-events: auto; }
.rgl .rgl-gipfel__zeile { font-size: clamp(16px, 1.3vw, 20px); font-weight: 600; letter-spacing: -.015em; color: var(--rgl-text-2); }
.rgl .rgl-gipfel__zeile b { color: var(--rgl-lime); }
.rgl .rgl-gipfel__h { margin-top: 14px; font-size: clamp(34px, 3.6vw, 60px); line-height: 1.02; font-weight: 600; letter-spacing: -.04em; text-wrap: balance; color: var(--rgl-chalk); }
.rgl .rgl-gipfel__h em { font-size: 1.12em; }
.rgl .rgl-gipfel__unter { margin-top: 16px; color: var(--rgl-text-2); font-size: clamp(16px, 1.2vw, 18px); }
.rgl .rgl-gipfel__knoepfe { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 0 22px; }
.rgl .rgl-textknopf {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 4px;
  background: none; border: 0; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--rgl-chalk);
  text-decoration: underline; text-decoration-color: rgba(200, 241, 75, .55); text-decoration-thickness: 1.5px; text-underline-offset: 6px;
}
.rgl .rgl-textknopf:hover { color: var(--rgl-lime); }
.rgl .rgl-textknopf[hidden] { display: none; }

/* Ton an: runder Knopf im Bild, nur im Höhepunkt */
.rgl .rgl-tonan {
  position: absolute; z-index: 4; right: 20px; bottom: 20px;
  width: 92px; height: 92px; border-radius: 50%; border: 1.5px solid rgba(251, 250, 247, .85);
  background: rgba(11, 12, 13, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: grid; place-items: center; align-content: center; gap: 2px; cursor: pointer; color: var(--rgl-chalk);
  font-size: 14px; font-weight: 650; line-height: 1.2; opacity: 0; pointer-events: none; scale: .9; transition: opacity .4s, scale .4s var(--rgl-ease), border-color .2s;
}
.rgl .rgl-tonan svg { width: 26px; height: 26px; fill: currentColor; }
.rgl .rgl-tonan .w { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rgl .rgl-tonan::after { content: ""; position: absolute; inset: -1.5px; border-radius: 50%; border: 1.5px solid var(--rgl-lime); animation: rgl-ring 2.4s var(--rgl-ease) infinite; }
@keyframes rgl-ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.45); } }
.rgl .rgl-tonan:hover { border-color: var(--rgl-lime); }
.rgl .rgl-buehne.ist-gipfel .rgl-tonan { opacity: 1; pointer-events: auto; scale: 1; }
.rgl .rgl-buehne.ist-gipfel .rgl-schild--fertig { opacity: 0; }
.rgl .rgl-buehne.mit-ton .rgl-tonan { right: 14px; bottom: auto; top: 14px; width: auto; height: 44px; padding: 0 16px 0 12px; border-radius: 999px; display: flex; align-items: center; gap: 8px; font-size: 14px; border-color: var(--rgl-lime); }
.rgl .rgl-buehne.mit-ton .rgl-tonan svg { width: 20px; height: 20px; }
.rgl .rgl-buehne.mit-ton .rgl-tonan::after { display: none; }
.rgl .rgl-buehne.spielt-roh .rgl-schild--roh { opacity: 1 !important; }
.rgl .rgl-buehne.spielt-roh .rgl-schild--fertig { opacity: 0 !important; }

/* ------------------------------------------------------------ Ruhige Fassung (reduzierte Bewegung) */
.rgl.ist-ruhig { height: auto; }
.rgl.ist-ruhig .rgl-halt { display: none; }
.rgl .rgl-ruhig { padding: 80px max(16px, 4.4vw); display: grid; gap: 64px; max-width: 1100px; margin: 0 auto; line-height: 1.55; }
.rgl .rgl-ruhig[hidden] { display: none; }
.rgl .rgl-ruhig__teil .rgl-regler { margin-bottom: 16px; }
.rgl .rgl-ruhig__teil .rgl-etext__h { margin-bottom: 4px; }
.rgl .rgl-ruhig__teil p + p { color: var(--rgl-text-2); }
.rgl .rgl-ruhig__einleitung { font-size: clamp(22px, 2vw, 30px); font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.rgl .rgl-band--ruhig { position: relative; left: auto; height: 48px; margin: -6px 0 16px; }
.rgl .rgl-clip { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--rgl-flaeche); box-shadow: 0 0 0 1px rgba(251, 250, 247, .12); }
.rgl .rgl-clip video { width: 100%; height: 100%; object-fit: cover; }
.rgl .rgl-tonklein {
  position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 12px;
  border-radius: 999px; border: 1px solid rgba(251, 250, 247, .55); background: rgba(11, 12, 13, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: 14px; font-weight: 650; cursor: pointer;
}
.rgl .rgl-tonklein svg { width: 18px; height: 18px; fill: currentColor; }
.rgl .rgl-tonklein .w { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rgl .rgl-tonklein:hover, .rgl .rgl-tonklein.ist-an { border-color: var(--rgl-lime); color: var(--rgl-lime); }

/* ------------------------------------------------------------ Handy */
@media (max-width: 760px) {
  .rgl .rgl-regler { border-radius: 12px; }
  .rgl .rgl-schild { top: 10px; font-size: 14px; padding: 5px 9px; }
  .rgl .rgl-schild--roh { left: 10px; }
  .rgl .rgl-schild--fertig { right: 10px; }
  .rgl .rgl-leiter li { display: none; }
  .rgl .rgl-leiter li.ist-an { display: flex; }
  .rgl .rgl-band { height: 36px; }
  .rgl .rgl-band__legende { display: none; }
  .rgl .rgl-etext__h { font-size: 18px; }
  .rgl .rgl-etext p + p { font-size: 15px; }
  .rgl .rgl-gipfel__zeile { font-size: 15px; }
  .rgl .rgl-gipfel__h { margin-top: 6px; font-size: clamp(25px, 7.2vw, 32px); }
  .rgl .rgl-gipfel__unter { margin-top: 6px; font-size: 14px; }
  .rgl .rgl-gipfel__knoepfe { margin-top: 2px; gap: 0 16px; }
  .rgl .rgl-tonan { width: 64px; height: 64px; right: 12px; bottom: 12px; }
  .rgl .rgl-tonan svg { width: 20px; height: 20px; }
  .rgl .rgl-buehne.mit-ton .rgl-tonan { right: 10px; bottom: auto; top: 10px; }
  .rgl .rgl-ruhig { padding: 56px 16px; gap: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .rgl *, .rgl *::before, .rgl *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
