/* ==========================================================
   Farbwelten und Stile (Einstellungen → Darstellung)
   html[data-color]  creme | ozean | wald | mint | lavendel | beere | sonne | grafit
   html[data-style]  classic | glass
   html[data-theme]  light | dark   (wie bisher)
   Jede Farbwelt gibt nur drei Töne vor (--tint, --tint-2, --tint-3);
   alle Flächen, Ränder und Akzente werden daraus gemischt.
   ========================================================== */
:root { --tint: #b8904a; --tint-2: #b07a6e; --tint-3: #6f8f7a; --bar: #f3eee5; --card-solid: var(--card); }
:root[data-theme="dark"] { --bar: #1c1a17; }

:root[data-color="ozean"]    { --tint: #2f6fde; --tint-2: #12a8c9; --tint-3: #7a5af0; }
:root[data-color="wald"]     { --tint: #2e8b57; --tint-2: #88a82d; --tint-3: #0f9aa8; }
:root[data-color="mint"]     { --tint: #0f9aa8; --tint-2: #2fbf8f; --tint-3: #2f6fde; }
:root[data-color="lavendel"] { --tint: #7a5af0; --tint-2: #c05ad6; --tint-3: #2f8fde; }
:root[data-color="beere"]    { --tint: #d1437a; --tint-2: #f0774a; --tint-3: #9a4fd6; }
:root[data-color="sonne"]    { --tint: #e8792b; --tint-2: #e5a81f; --tint-3: #d1437a; }
:root[data-color="grafit"]   { --tint: #5b6472; --tint-2: #7b8794; --tint-3: #4a7fb0; }

/* ---------- Farbwelt, hell ---------- */
:root[data-color]:not([data-color="creme"]) {
  --bg: color-mix(in srgb, var(--tint) 5%, #f7f7f5);
  --bg-raised: color-mix(in srgb, var(--tint) 9%, #f1f1ee);
  --card: color-mix(in srgb, var(--tint) 2%, #ffffff);
  --inset: color-mix(in srgb, var(--tint) 7%, #f4f4f1);
  --surface: color-mix(in srgb, var(--tint) 5%, transparent);
  --surface-2: color-mix(in srgb, var(--tint) 9%, transparent);
  --surface-3: color-mix(in srgb, var(--tint) 15%, transparent);
  --border: color-mix(in srgb, var(--tint) 13%, #e6e5e0);
  --border-strong: color-mix(in srgb, var(--tint) 24%, #d6d4cd);
  --text: color-mix(in srgb, var(--tint) 14%, #1f2023);
  --text-2: color-mix(in srgb, var(--tint) 12%, #5c5e64);
  --text-3: color-mix(in srgb, var(--tint) 10%, #93959b);
  --accent: color-mix(in srgb, var(--tint) 88%, #000);
  --on-accent: #fff;
  --violet: var(--tint);
  --grad-soft: color-mix(in srgb, var(--tint) 10%, transparent);
  --glass: color-mix(in srgb, var(--tint) 3%, rgba(255, 255, 255, .92));
  --glow-a: color-mix(in srgb, var(--tint) 12%, transparent);
  --glow-b: color-mix(in srgb, var(--tint-2) 12%, transparent);
  --focus: 0 0 0 4px color-mix(in srgb, var(--tint) 22%, transparent);
  --shadow: 0 1px 2px color-mix(in srgb, var(--tint) 10%, rgba(30, 30, 40, .05)), 0 12px 28px -18px color-mix(in srgb, var(--tint) 35%, rgba(30, 30, 40, .3));
  --bar: color-mix(in srgb, var(--tint) 5%, #f7f7f5);
}
/* ---------- Farbwelt, dunkel ---------- */
:root[data-theme="dark"][data-color]:not([data-color="creme"]) {
  --bg: color-mix(in srgb, var(--tint) 7%, #121214);
  --bg-raised: color-mix(in srgb, var(--tint) 10%, #17171a);
  --card: color-mix(in srgb, var(--tint) 10%, #1f1f23);
  --inset: color-mix(in srgb, var(--tint) 8%, #19191c);
  --surface: color-mix(in srgb, var(--tint) 8%, transparent);
  --surface-2: color-mix(in srgb, var(--tint) 14%, transparent);
  --surface-3: color-mix(in srgb, var(--tint) 22%, transparent);
  --border: color-mix(in srgb, var(--tint) 16%, #2e2e33);
  --border-strong: color-mix(in srgb, var(--tint) 28%, #3f3f46);
  --text: color-mix(in srgb, var(--tint) 8%, #f1f1f4);
  --text-2: color-mix(in srgb, var(--tint) 14%, #a9abb3);
  --text-3: color-mix(in srgb, var(--tint) 14%, #74767e);
  --accent: color-mix(in srgb, var(--tint) 72%, #fff);
  --on-accent: #101012;
  --violet: color-mix(in srgb, var(--tint) 70%, #fff);
  --grad-soft: color-mix(in srgb, var(--tint) 14%, transparent);
  --glass: color-mix(in srgb, var(--tint) 8%, rgba(26, 26, 30, .92));
  --glow-a: color-mix(in srgb, var(--tint) 16%, transparent);
  --glow-b: color-mix(in srgb, var(--tint-2) 10%, transparent);
  --focus: 0 0 0 4px color-mix(in srgb, var(--tint) 30%, transparent);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -18px rgba(0, 0, 0, .8);
  --bar: color-mix(in srgb, var(--tint) 7%, #121214);
}
:root[data-color]:not([data-color="creme"]) ::selection { background: color-mix(in srgb, var(--tint) 30%, transparent); }
/* Akzentfarbe an ein paar Stellen, die sonst grau bleiben */
:root[data-color]:not([data-color="creme"]) .nav-item.active .i,
:root[data-color]:not([data-color="creme"]) .tab.active,
:root[data-color]:not([data-color="creme"]) .card-label .i { color: var(--accent); }
:root[data-color]:not([data-color="creme"]) .brand-mark { background: linear-gradient(135deg, var(--tint), var(--tint-2)); color: #fff; }
:root[data-color]:not([data-color="creme"]) .grad-text { background: linear-gradient(100deg, var(--tint), var(--tint-2)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .08em; }
:root[data-color]:not([data-color="creme"]) .btn.primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--tint-2) 70%, var(--accent))); border-color: transparent; }

/* ==========================================================
   Glas (wie ein „Glassy Dashboard“): Plyon schwebt als großes
   Milchglas-Fenster vor einem unscharfen Raum. Karten sind helle,
   durchscheinende Scheiben mit Lichtkante, Knöpfe sind Pillen,
   die Seitenleiste ist eine eigene Glas-Kapsel.
   Dunkel = gedämpftes Licht wie im Video, Hell = helles Milchglas.
   Die Farbwelt färbt Raum und Akzente nur leicht ein.
   ========================================================== */
:root[data-style="glass"][data-color] {
  color-scheme: light;
  --font-display: var(--font);
  --bg: #b9b3aa;
  --bg-raised: rgba(255, 255, 255, .18);
  --card: rgba(255, 255, 255, .42);
  --card-solid: rgba(246, 244, 240, .95);
  --inset: rgba(255, 255, 255, .4);
  --surface: rgba(255, 255, 255, .2);
  --surface-2: rgba(255, 255, 255, .34);
  --surface-3: rgba(255, 255, 255, .5);
  --border: rgba(255, 255, 255, .55);
  --border-strong: rgba(255, 255, 255, .78);
  --text: #1d1c1a;
  --text-2: rgba(29, 28, 26, .7);
  --text-3: rgba(29, 28, 26, .5);
  --accent: color-mix(in srgb, var(--tint) 70%, #1d1c1a);
  --on-accent: #fff;
  --glass: rgba(246, 244, 240, .78);
  --pane: rgba(255, 255, 255, .26);
  --pane-edge: rgba(255, 255, 255, .6);
  --sheen: linear-gradient(140deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 55%);
  --pill: #1d1c1a; --on-pill: #fff;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .75), 0 10px 30px -18px rgba(40, 30, 20, .35);
  --shadow-lg: inset 0 1px 0 rgba(255, 255, 255, .75), 0 30px 70px -28px rgba(40, 30, 20, .45);
  --focus: 0 0 0 4px color-mix(in srgb, var(--tint) 28%, rgba(255, 255, 255, .5));
  --blur: blur(40px) saturate(1.25);
  --r-lg: 24px; --r-xl: 30px;
  --bar: #b9b3aa;
}
:root[data-style="glass"][data-theme="dark"][data-color] {
  color-scheme: dark;
  --bg: #4c4843;
  --bg-raised: rgba(255, 255, 255, .05);
  --card: rgba(255, 255, 255, .08);
  --card-solid: rgba(56, 53, 50, .94);
  --inset: rgba(255, 255, 255, .07);
  --surface: rgba(255, 255, 255, .05);
  --surface-2: rgba(255, 255, 255, .09);
  --surface-3: rgba(255, 255, 255, .15);
  --border: rgba(255, 255, 255, .12);
  --border-strong: rgba(255, 255, 255, .22);
  --text: #fff;
  --text-2: rgba(255, 255, 255, .7);
  --text-3: rgba(255, 255, 255, .48);
  --accent: color-mix(in srgb, var(--tint) 45%, #fff);
  --on-accent: #1d1c1a;
  --violet: color-mix(in srgb, var(--tint) 55%, #fff);
  --glass: rgba(52, 49, 46, .8);
  --pane: rgba(120, 114, 106, .22);
  --pane-edge: rgba(255, 255, 255, .16);
  --sheen: linear-gradient(140deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 55%);
  --pill: #fff; --on-pill: #1d1c1a;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 12px 30px -18px rgba(0, 0, 0, .55);
  --shadow-lg: inset 0 1px 0 rgba(255, 255, 255, .14), 0 30px 70px -28px rgba(0, 0, 0, .7);
  --focus: 0 0 0 4px rgba(255, 255, 255, .18);
  --bar: #3d3a36;
}
:root[data-style="glass"] body { background: var(--bg); }
/* Der Raum hinter dem Glas */
:root[data-style="glass"] .bg-glow { background: #8a847c url("../img/glas-raum.jpg") center / cover no-repeat; filter: brightness(1.08) saturate(.95); }
:root[data-style="glass"][data-theme="dark"] .bg-glow { filter: brightness(.6) saturate(.9); }
:root[data-style="glass"] .bg-glow::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 60% at 25% 20%, var(--tint), transparent 70%), radial-gradient(60% 60% at 85% 80%, var(--tint-2), transparent 70%); mix-blend-mode: soft-light; opacity: .55; }
:root[data-style="glass"][data-color="creme"] .bg-glow::after, :root[data-style="glass"][data-color="grafit"] .bg-glow::after { opacity: .2; }

/* Das schwebende Fenster (Glas sitzt auf ::before, damit fixierte Leisten im Inneren normal bleiben) */
:root[data-style="glass"] .app { position: relative; isolation: isolate; }
:root[data-style="glass"] .app::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: var(--sheen), var(--pane); border: 1px solid var(--pane-edge);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 var(--pane-edge), 0 50px 120px -40px rgba(0, 0, 0, .55);
}
@media (min-width: 901px) {
  :root[data-style="glass"] .app { margin: 18px; min-height: calc(100dvh - 36px); border-radius: 36px; }
  :root[data-style="glass"] .sidebar {
    top: 32px; height: calc(100dvh - 64px); margin: 14px 0 14px 14px; padding: 22px 12px 14px;
    border: 1px solid var(--border); border-radius: 28px; background: var(--sheen), var(--bg-raised); box-shadow: var(--shadow);
  }
}
:root[data-style="glass"] .nav-item { border-radius: 16px; }
:root[data-style="glass"] .nav-item:hover { background: var(--surface); }
:root[data-style="glass"] .nav-item.active { background: var(--surface-3); border: 0; box-shadow: inset 0 1px 0 var(--pane-edge); }
:root[data-style="glass"] .brand-mark { border-radius: 50%; background: var(--pill); color: var(--on-pill); }

/* Scheiben: hell, durchscheinend, mit Lichtkante oben links */
:root[data-style="glass"] .card { background: var(--sheen), var(--card); border-color: var(--border); }
:root[data-style="glass"] .game-card { background: var(--sheen), var(--card); }
:root[data-style="glass"] :is(.input, .select, .textarea) { background: var(--inset); border-color: var(--border); border-radius: 16px; }
:root[data-style="glass"] ::placeholder { color: var(--text-3); opacity: 1; }
:root[data-style="glass"] .chip { background: var(--surface-2); border-color: var(--border); }

/* Pillen-Knöpfe; der Hauptknopf ist eine helle (bzw. dunkle) Pille wie „Add product“ */
:root[data-style="glass"] .btn { border-radius: 999px; background: var(--surface-2); border-color: var(--border); box-shadow: inset 0 1px 0 var(--pane-edge); }
:root[data-style="glass"] .btn:hover { background: var(--surface-3); }
:root[data-style="glass"] .btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
:root[data-style="glass"][data-color] .btn.primary { background: var(--pill); color: var(--on-pill); border-color: transparent; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .45); }
:root[data-style="glass"][data-color] .btn.primary:hover { filter: brightness(.94); }
:root[data-style="glass"] .seg { border-radius: 999px; background: var(--surface); border-color: var(--border); }
:root[data-style="glass"] .seg button { border-radius: 999px; }
:root[data-style="glass"] .seg button.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 1px 0 var(--pane-edge); }

/* Was über anderem schwebt, muss lesbar bleiben → dichteres Glas */
:root[data-style="glass"] :is(.modal, .toast, .menu, .pop, .dropdown, .note-pop, .vol-pop, .cmd, .sheet) {
  background: var(--card-solid); border-color: var(--border); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
:root[data-style="glass"] .modal { border-radius: 30px; }
:root[data-style="glass"] .modal-back { background: rgba(20, 18, 16, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
:root[data-style="glass"] .login-card { background: var(--sheen), var(--pane); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-color: var(--pane-edge); }

/* Handy / iPad hochkant: ganzer Bildschirm Glas, Tab-Leiste als schwebende Kapsel */
@media (max-width: 900px) {
  :root[data-style="glass"] .app::before { position: fixed; border: 0; box-shadow: none; border-radius: 0; }
  :root[data-style="glass"] .tabbar {
    border-radius: 28px;
    background: var(--sheen), var(--card-solid); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
    -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root[data-style="glass"][data-color] { --card: var(--card-solid); --pane: var(--card-solid); }
}

/* ---------- Auswahl in den Einstellungen ---------- */
.look-row { flex-wrap: wrap; }
.look-colors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: min(420px, 100%); }
.look-color { display: grid; justify-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--inset); color: var(--text-2); font-size: 12px; font-weight: 600; }
.look-color i { width: 30px; height: 30px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 -6px 10px rgba(0, 0, 0, .18), inset 0 2px 3px rgba(255, 255, 255, .45); }
.look-color.on { border-color: var(--sw); color: var(--text); box-shadow: 0 0 0 2px color-mix(in srgb, var(--sw) 45%, transparent); background: var(--card); }
.look-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: min(420px, 100%); }
.look-style { display: grid; gap: 8px; padding: 10px; border-radius: 16px; border: 1px solid var(--border); background: var(--inset); color: var(--text-2); font-size: 13px; font-weight: 600; }
.look-style.on { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.look-style i { position: relative; display: grid; gap: 6px; align-content: center; padding: 10px; height: 74px; border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--tint) 10%, #f2f1ee); }
.look-style u { display: block; height: 20px; border-radius: 7px; background: #fff; border: 1px solid rgba(0, 0, 0, .08); }
.look-style u + u { width: 62%; }
.look-style.ls-glass i { background: url("../img/glas-raum.jpg") center / cover; }
.look-style.ls-glass i::before { content: ""; position: absolute; inset: 8px; border-radius: 10px; background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.look-style.ls-glass u { position: relative; margin: 0 6px; border-radius: 99px; background: rgba(255, 255, 255, .45); border-color: rgba(255, 255, 255, .7); }
@media (max-width: 560px) { .look-colors, .look-styles { width: 100%; } }
