/* Felythera Ambient-Player — schlanke Leiste am unteren Rand (seitenweit).
   Extrahiert aus modules/admin/sound-test.php; gilt jetzt global über main.php. */

/* Spotify-artige Player-Leiste am unteren Rand */
#fly-spacer { height: 112px; }
#fly-player {
  --acc1: #8f7bff; --acc2: #c7b6ff; /* Akzentfarbe (per JS pro Felysium gesetzt) */
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
  display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; /* Name hat Vorrang; Transport schrumpft bei Bedarf, bleibt zentriert */
  align-items: center; gap: 1rem; height: 92px; padding: 0 1.3rem;
  background: linear-gradient(180deg, #17171c 0%, #0b0b0e 100%);
  border-top: 1px solid #2b2b33; box-shadow: 0 -6px 26px rgba(0,0,0,.6);
  color: #e8e8ee; font-family: 'Open Sans', sans-serif;
}
#fly-player { transition: transform .3s ease; }
#fly-player.collapsed { transform: translateY(100%); }
.flyp-collapse { position: absolute; top: -22px; right: 18px; width: 42px; height: 22px; background: #17171c; border: 1px solid #2b2b33; border-bottom: none; color: #c9c9d4; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .8rem; }
#stp-reopen { position: fixed; right: 18px; bottom: 0; z-index: 9999; width: 46px; height: 24px; background: #17171c; border: 1px solid #2b2b33; color: #c9c9d4; cursor: pointer; display: none; align-items: center; justify-content: center; font-size: .8rem; box-shadow: 0 -4px 14px rgba(0,0,0,.5); }
#stp-reopen.show { display: flex; }
.flyp-half { display: flex; align-items: center; min-width: 0; }
.flyp-half-r { justify-content: flex-end; }
.flyp-left { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.flyp-art { width: 56px; height: 56px; flex: none;
  background: radial-gradient(circle at 30% 28%, #4a3d7a, #1c1830); background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; font-size: 1.45rem; color: #b9a8ff;
  box-shadow: inset 0 0 12px rgba(0,0,0,.5); }
.flyp-art.has-img i { display: none; }
.flyp-meta { min-width: 0; }
.flyp-title { font-weight: 700; font-size: 1rem; white-space: nowrap; } /* Name immer komplett */
.flyp-user { font-size: .78rem; color: #9a9aa8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .1rem; }
/* Blinken, solange ein Track-Wechsel ansteht (Titel + Play-Button) */
@keyframes flyblink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
.flyp-title.blink, .flyp-play.blink { animation: flyblink .8s ease-in-out infinite; }
/* Eigene Sektion für Tonart / Tempo / Harmonie — gleiche Höhe wie das Albumbild */
.flyp-info { height: 56px; box-sizing: border-box; display: flex; align-items: center; margin: 0 auto; gap: 1.1rem; padding: 0 .9rem; border: 1px solid #2c2c34; background: rgba(255,255,255,.02); flex: none; }
.flyp-info .fi-item { display: flex; flex-direction: column; line-height: 1.2; }
.flyp-info .fi-lab { font-size: .58rem; text-transform: uppercase; letter-spacing: .05em; color: #6d6d78; }
.flyp-info .fi-val { font-size: .85rem; font-weight: 600; color: #d7d7e2; font-family: monospace; }
/* Prozessorlast als Ampel-LED (ganz rechts) + Prozentzahl darunter. Für Laien: nur Farbe + Zahl.
   grün = entspannt, gelb = eng, rot = kritisch/kaputte Effekte. Farbwechsel weich (kein Flackern). */
.flyp-led-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; flex: none; margin-left: .35rem; cursor: help; }
.flyp-led { width: 13px; height: 13px; border-radius: 50%; background: #4a4a52; box-shadow: inset 0 0 2px rgba(0,0,0,.6); transition: background .6s ease, box-shadow .6s ease; }
.flyp-led.ok   { background: #5ddb8c; box-shadow: 0 0 7px rgba(93,219,140,.75); }
.flyp-led.warn { background: #d7b36a; box-shadow: 0 0 7px rgba(215,179,106,.8); }
.flyp-led.crit { background: #db5d5d; box-shadow: 0 0 9px rgba(219,93,93,.95); }
.flyp-led-val { font-size: .62rem; font-weight: 600; font-family: monospace; color: #9a9aa8; line-height: 1; }

.flyp-center { display: flex; flex-direction: column; align-items: stretch; gap: .4rem; width: 100%; max-width: 460px; min-width: 0; }
.flyp-transport { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; column-gap: .9rem; }
.flyp-times { justify-self: end; display: flex; gap: .35rem; font-size: .72rem; color: #9a9aa8; font-family: monospace; white-space: nowrap; }
.flyp-times .sep { opacity: .45; }
.flyp-btn { background: none; border: none; color: #c9c9d4; font-size: 1.05rem; cursor: pointer; padding: .2rem; line-height: 1; transition: transform .1s; }
.flyp-btn:active { transform: scale(.9); }
.flyp-play { width: 40px; height: 40px; border-radius: 50%; background: var(--acc2); color: var(--acc-ink, #1c1830); font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.flyp-play:active { transform: scale(.92); }
.flyp-barlabel { justify-self: start; font-size: .72rem; color: #cfcfe0; font-family: monospace; white-space: nowrap; }
.flyp-bar { position: relative; width: 100%; height: 5px; background: #34343d; overflow: hidden; }
.flyp-bar > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--acc1), var(--acc2)); transition: width .12s linear; }

.flyp-right { display: flex; align-items: center; justify-content: flex-end; gap: .7rem; }
/* Track-Schalter als Icons (an = Akzentfarbe, aus = gedimmt; kein Hover-Farbwechsel) */
.flyp-tracks { display: flex; gap: .1rem; }
.flyp-trk { background: none; border: none; color: #55555f; cursor: pointer; font-size: 1rem; padding: .25rem .3rem; line-height: 1; }
.flyp-trk.on { color: var(--acc2); }
.flyp-trk svg { width: 1.2rem; height: 1.2rem; display: block; }
/* Lautstärke — Akzentfarbe & Höhe wie der Fortschrittsbalken (5px) */
.flyp-vol { display: flex; align-items: center; gap: .4rem; color: #9a9aa8; }
.flyp-vol .flyp-mute { background: none; border: none; color: inherit; cursor: pointer; font-size: 1rem; padding: .1rem .2rem; line-height: 1; }
.flyp-vol input[type=range] { -webkit-appearance: none; appearance: none; width: 100px; height: 5px; background: #34343d; outline: none; cursor: pointer; }
.flyp-vol input[type=range]::-webkit-slider-runnable-track { height: 5px; background: transparent; }
.flyp-vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 11px; height: 11px; margin-top: -3px; background: var(--acc2); border: none; cursor: pointer; }
.flyp-vol input[type=range]::-moz-range-track { height: 5px; background: #34343d; }
.flyp-vol input[type=range]::-moz-range-progress { height: 5px; background: var(--acc1); }
.flyp-vol input[type=range]::-moz-range-thumb { width: 11px; height: 11px; background: var(--acc2); border: none; border-radius: 0; cursor: pointer; }
.flyp-iconbtn { background: none; border: none; color: #c9c9d4; cursor: pointer; font-size: 1rem; padding: .2rem .35rem; line-height: 1; }
/* Felysium-Auswahl-Panel (Suche + Liste) */
.flyp-picker { position: fixed; right: 1.3rem; bottom: 100px; z-index: 10000; width: 320px; max-height: 52vh; display: flex; flex-direction: column;
  background: #141419; border: 1px solid #2b2b33; box-shadow: 0 -6px 26px rgba(0,0,0,.6); }
.flyp-picker[hidden] { display: none; }
/* 64-Takt-Automatik: aktiver Knopf + Mini-Menü (Aus/Alle/Nur verbundene) */
.flyp-iconbtn.on { color: var(--acc2, #c7b6ff); }
.flyp-automenu { position: fixed; right: 1.3rem; bottom: 100px; z-index: 10000; width: 210px; display: flex; flex-direction: column;
  background: #141419; border: 1px solid #2b2b33; box-shadow: 0 -6px 26px rgba(0,0,0,.6); }
.flyp-automenu[hidden] { display: none; }
.flyp-automenu-title { padding: .5rem .7rem; font-size: .75rem; color: #8a8a97; border-bottom: 1px solid #2b2b33; }
.flyp-automenu button { text-align: left; padding: .55rem .7rem; background: none; border: none; color: #d4d4dc; cursor: pointer; font-size: .88rem; }
.flyp-automenu button:hover { background: rgba(255,255,255,.07); }
.flyp-automenu button.active { color: var(--acc2, #c7b6ff); font-weight: 600; }
.flyp-automenu button.active::before { content: '\2713 '; }
/* #-Selektor überschreibt die globale weiße Input-Regel (layout.css) */
#stp-search { padding: .55rem .7rem; background: var(--input-bg-color, #302e39); border: none; border-bottom: 1px solid #2b2b33; color: #fff; font-size: .85rem; outline: none; width: 100%; box-sizing: border-box; }
#stp-search::placeholder { color: #8a8a97; }
.flyp-picklist { overflow: auto; scrollbar-width: thin; scrollbar-color: #3a3a46 #141419; }
.flyp-picklist::-webkit-scrollbar { width: 10px; }
.flyp-picklist::-webkit-scrollbar-track { background: #141419; }
.flyp-picklist::-webkit-scrollbar-thumb { background: #3a3a46; border: 2px solid #141419; }
.flyp-picklist::-webkit-scrollbar-thumb:hover { background: #4a4a58; }
.flyp-pickitem { padding: .42rem .7rem; cursor: pointer; font-size: .82rem; color: #cfcfe0; display: flex; justify-content: space-between; gap: .6rem; }
/* Listen-Eintrag: dezentes Auswahl-Highlight beim Überfahren (kein Icon, daher ok) */
.flyp-pickitem:hover { background: #241f38; }
.flyp-pickitem .u { color: #7a7a88; font-size: .72rem; align-self: center; }

/* Klang-Ebenen-Menü (löst die früheren fünf Einzel-Icons ab) */
.flyp-musicmenu { position: fixed; right: 1.3rem; bottom: 100px; z-index: 10000; width: 236px; display: flex; flex-direction: column;
  background: #141419; border: 1px solid #2b2b33; box-shadow: 0 -6px 26px rgba(0,0,0,.6); }
.flyp-musicmenu[hidden] { display: none; }
.flyp-mrow { text-align: left; padding: .5rem .7rem; background: none; border: none; color: #7d7d8a; cursor: pointer; font-size: .88rem; display: flex; align-items: center; gap: .5rem; }
.flyp-mrow:hover { background: rgba(255,255,255,.07); }
.flyp-mrow .chk { width: 1rem; text-align: center; opacity: 0; }
.flyp-mrow.on { color: var(--acc2, #c7b6ff); }
.flyp-mrow.on .chk { opacity: 1; }
.flyp-mrow small { color: #6a6a77; font-size: .68rem; }

/* Vorlese-Menü (Piper) — nur auf der Activity-Seite eingeblendet */
.flyp-ttsmenu { position: fixed; right: 1.3rem; bottom: 100px; z-index: 10000; width: 252px; display: flex; flex-direction: column;
  background: #141419; border: 1px solid #2b2b33; box-shadow: 0 -6px 26px rgba(0,0,0,.6); padding-bottom: .3rem; }
.flyp-ttsmenu[hidden] { display: none; }
.flyp-ttsrow { display: flex; flex-direction: column; gap: .28rem; padding: .5rem .7rem .2rem; font-size: .8rem; color: #c4c4d0; }
.flyp-ttsrow > span { display: flex; justify-content: space-between; align-items: baseline; }
.flyp-ttsrow > span i { color: #8a8a97; font-style: normal; font-size: .72rem; }
.flyp-ttsrow select { background: #201f28; color: #d8d8e2; border: 1px solid #2b2b33; font-size: .82rem; padding: .28rem .3rem; outline: none; }
.flyp-ttsrow input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; background: #34343d; outline: none; cursor: pointer; }
.flyp-ttsrow input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 11px; height: 11px; margin-top: -3px; background: var(--acc2, #c7b6ff); border: none; }
.flyp-ttsrow input[type=range]::-moz-range-thumb { width: 11px; height: 11px; background: var(--acc2, #c7b6ff); border: none; border-radius: 0; }
.flyp-ttsonoff { flex-direction: row; align-items: center; justify-content: space-between; padding-top: .55rem; }
.flyp-ttstoggle { background: #201f28; color: #9a9aa8; border: 1px solid #2b2b33; padding: .2rem .7rem; cursor: pointer; font-size: .8rem; }
.flyp-ttstoggle[aria-pressed=true] { color: #0d0d12; background: var(--acc2, #c7b6ff); border-color: var(--acc2, #c7b6ff); font-weight: 600; }
.flyp-ttsstatus { padding: .1rem .7rem .3rem; font-size: .72rem; color: var(--acc2, #c7b6ff); }
.flyp-ttsstatus[hidden] { display: none; }

/* Zu alter Browser (kein AudioWorklet): Hinweis statt Player-Bedienung */
#fly-player.flyp-unsupported { display: flex; align-items: center; justify-content: center; }
.flyp-upgrade { color: #d7d7e2; font-size: .9rem; display: flex; align-items: center; gap: .6rem; text-align: center; padding: 0 1rem; }
.flyp-upgrade i { color: #ffcf5a; font-size: 1.1rem; }

/* Blockiert-Hinweis (Brave-Schutzschild o. Ä.) — Streifen direkt über der Player-Leiste */
.flyp-blocked { position: absolute; left: 0; right: 0; bottom: 100%; z-index: 2;
  background: #3a1a1a; color: #ffb3b3; font-size: .8rem; padding: .45rem 1rem;
  text-align: center; display: flex; align-items: center; justify-content: center; gap: .5rem;
  border-top: 1px solid #5a2a2a; }
.flyp-blocked i { color: #ff8080; }

/* Player sichtbar/bedienbar im maximierten Schaubild (body.ft-max: #ftWrapper z-index 9999) … */
body.ft-max #fly-player,
body.ft-max #stp-reopen,
body.ft-max #stp-picker { z-index: 10001; }
/* … UND im echten Vollbild (Fullscreen-Button → documentElement:fullscreen). Dort setzt das
   Schaubild via JS bei allen Geschwistern display:none (hideAllExcept) — daher den Player mit
   !important sichtbar erzwingen (überschreibt inline display:none) + über den Wrapper heben.
   Getrennte Regeln, damit ältere Browser ohne :fullscreen die obige ft-max-Regel nicht verwerfen. */
:fullscreen #fly-player { display: grid !important; z-index: 10001; }
:fullscreen #stp-picker { z-index: 10001; }
/* Zugeklappt: Reopen-Knopf sichtbar erzwingen (überschreibt inline display:none von hideAllExcept),
   sonst lässt sich der Player im Vollbild nach dem Zuklappen nicht wieder öffnen. */
:fullscreen #stp-reopen.show { display: flex !important; z-index: 10001; }
:-webkit-full-screen #fly-player { display: grid !important; z-index: 10001; }
:-webkit-full-screen #stp-picker { z-index: 10001; }
:-webkit-full-screen #stp-reopen.show { display: flex !important; z-index: 10001; }
/* #fly-spacer reserviert im normalen Seitenfluss Platz für die FIXE untere Player-Leiste. Im
   maximierten/Vollbild-Schaubild ist der Player weiterhin fixed → der 112px-Platzhalter wird NICHT
   gebraucht und erschiene (da er in der hideAllExcept-Keep-Liste steht) sonst als leerer,
   transparenter Balken. Deshalb im Vollbild/maximiert ausblenden. */
body.ft-max #fly-spacer,
:fullscreen #fly-spacer,
:-webkit-full-screen #fly-spacer { display: none !important; }

/* ── Persönliches Mixer-Panel (User 17): Channelstrips über der Player-Leiste.
   Aufbau je Strip (oben→unten): Gate (nur Arp) · Effekte · Panorama · HOCHKANTER Vol-Fader. ── */
.flyp-mixer { position: fixed; left: 0; right: 0; bottom: 92px; z-index: 9998;
  background: linear-gradient(180deg, #141419 0%, #0e0e12 100%);
  border-top: 1px solid #2b2b33; box-shadow: 0 -8px 30px rgba(0,0,0,.55);
  color: #e8e8ee; font-family: 'Open Sans', sans-serif; padding: .5rem 1.3rem .8rem; }
.flyp-mixer-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .4rem; }
.flyp-mixer-title { font-weight: 700; font-size: .95rem; color: #c7b6ff; }
.flyp-mix-savebtn { background: #2b2b39; border: 1px solid #4a3d7a; color: #e8e8ee; padding: .3rem .8rem; border-radius: 4px; cursor: pointer; font-size: .82rem; }
.flyp-mix-savebtn:hover { background: #3a3a4d; }
.flyp-mix-msg { font-size: .82rem; color: #7fe0a0; min-width: 8rem; }
.flyp-mix-closebtn { margin-left: auto; background: none; border: none; color: #9a9aa8; font-size: 1rem; cursor: pointer; }
.flyp-strips { display: flex; gap: .35rem; align-items: flex-end; overflow-x: auto; }
.fmx-strip { display: flex; flex-direction: column; align-items: center; flex: 1 1 0; min-width: 96px;
  background: #17171e; border: 1px solid #26262e; border-radius: 6px; padding: .3rem .25rem .5rem; }
.fmx-legend { background: none; border: none; flex: 0 0 56px; min-width: 56px; }
.fmx-legend .fmx-slot { color: #8a8a98; font-size: .68rem; justify-content: flex-end; padding-right: .3rem; }
.fmx-legend .fmx-fader { color: #8a8a98; font-size: .68rem; align-items: flex-end; justify-content: flex-end; padding: 0 .3rem .3rem 0; }
.fmx-slot { height: 24px; display: flex; align-items: center; justify-content: center; width: 100%; }
.fmx-name { font-size: .74rem; font-weight: 700; color: #c9c9d4; }
.fmx-fader { height: 150px; width: 100%; display: flex; align-items: flex-end; justify-content: center; margin-top: .3rem; }
/* Doppel-Regler horizontal (min/max-Bereich, wie im Original-Mixer), kompakt */
.fmx-h { position: relative; width: 100%; max-width: 120px; height: 18px; }
.fmx-h > i { position: absolute; left: 2px; right: 2px; top: 7px; height: 4px; background: #3a3a44; border-radius: 2px; }
.fmx-h input[type=range] { position: absolute; left: 0; top: 0; width: 100%; height: 18px; margin: 0; background: none;
  pointer-events: none; -webkit-appearance: none; appearance: none; }
.fmx-h input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; border-radius: 50%; background: #8cf; border: 1px solid #036; cursor: pointer; }
.fmx-h input[type=range]::-moz-range-thumb { pointer-events: auto; width: 11px; height: 11px; border-radius: 50%;
  background: #8cf; border: 1px solid #036; cursor: pointer; }
.fmx-h input[type=range]::-webkit-slider-runnable-track { background: none; }
.fmx-h input[type=range]::-moz-range-track { background: none; }
/* Doppel-FADER hochkant (Lautstärke): oben = laut. Chromium: writing-mode; Firefox: orient-Attribut. */
.fmx-v { position: relative; width: 34px; height: 148px; }
.fmx-v > i { position: absolute; left: 15px; top: 3px; bottom: 3px; width: 4px; background: #3a3a44; border-radius: 2px; }
.fmx-v input[type=range] { position: absolute; left: 0; top: 0; width: 34px; height: 148px; margin: 0; background: none;
  pointer-events: none; -webkit-appearance: none; appearance: none; writing-mode: vertical-lr; direction: rtl; }
.fmx-v input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; appearance: none;
  width: 26px; height: 12px; border-radius: 3px; background: #8cf; border: 1px solid #036; cursor: pointer; }
.fmx-v input[type=range]::-moz-range-thumb { pointer-events: auto; width: 26px; height: 12px; border-radius: 3px;
  background: #8cf; border: 1px solid #036; cursor: pointer; }
.fmx-v input[type=range]::-webkit-slider-runnable-track { background: none; }
.fmx-v input[type=range]::-moz-range-track { background: none; }
#stp-mixbtn.on { color: #c7b6ff; }
.fmx-led { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2a2a2a; margin-right: 6px; vertical-align: middle; flex: none; }
/* Effekt-Panels (global) unter den Channelstrips */
.flyp-fx { display: flex; gap: .5rem; margin-top: .5rem; }
.fmx-fxstrip { flex: 1 1 0; background: #17171e; border: 1px solid #26262e; border-radius: 6px; padding: .35rem .6rem .55rem; }
.fmx-fxname { font-size: .78rem; font-weight: 700; color: #c7b6ff; margin-bottom: .15rem; }
.fmx-fxlab { font-size: .62rem; color: #8a8a98; margin-top: .3rem; }
.fmx-fxstrip .fmx-h { max-width: none; margin: 0; }
/* Effekt-Popup: schwebt AUF dem Mixerpanel (Z-Achse, überdeckt die Strips teilweise) */
.flyp-fxpop { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 380px;
  background: #1b1b24; border: 1px solid #4a3d7a; border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,.75); padding: .5rem .8rem .7rem; z-index: 10000; }
.flyp-fxpop .fmx-h { max-width: none; }
.fmx-fxclose { float: right; background: none; border: none; color: #9a9aa8; cursor: pointer; font-size: .95rem; }
.fmx-fxclose:hover { color: #e8e8ee; }
.fmx-leglink { cursor: pointer; color: #a99aec; }
.fmx-leglink:hover { color: #d3c7ff; text-decoration: underline; }
/* EIN-Griff-Prozent-Regler (Hall/Delay-Out) + Insert-Hinweis im Effekt-Popup */
.fmx-single input[type=range] { pointer-events: auto; }
.fmx-fxnote { font-size: .66rem; color: #8a8a98; margin-top: .45rem; font-style: italic; }
/* Kompressions-Anzeige im Bus-Glue-Popup (R80): Balken = aktuelle Pegel-Reduktion (bis 12 dB) */
.fmx-cmpmeter { position: relative; height: 15px; background: #17171f; border: 1px solid #3a3a4c; border-radius: 4px; overflow: hidden; margin: .3rem 0 .5rem; }
.fmx-cmpmeter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #4dff88, #ffd24d 55%, #ff6b4d); transition: width .08s linear; }
.fmx-cmpmeter span { position: relative; display: block; text-align: center; font-size: .62rem; line-height: 15px; color: #fff; text-shadow: 0 0 3px #000; }
