/*
 * ActiMals – Skin "Halloween" 🎃
 * Aktiv, wenn <html data-skin="halloween"> (Auswahl im Benutzermenü → Design).
 * Nachthimmel mit Mond, Fledermäusen und Spinnennetz; Kürbis-Orange als Hauptfarbe, Hexen-Lila für Flächen.
 * Neue Skins: eigene Datei skin-<name>.css nach diesem Muster + Eintrag in js/skins.js und AuthController::SKINS.
 */

:root[data-skin="halloween"] {
    /* Grundpalette: dunkle Flächen, helle Schrift */
    --night: #140c1f;
    --night-2: #1e1230;
    --plum: #2a1a40;
    --plum-2: #34224f;
    --plum-line: #4a3470;
    --pumpkin: #ff8a1f;
    --pumpkin-dark: #c25500;
    --pumpkin-light: #ffb460;
    --witch: #9b5cf0;
    --witch-light: #cfa8ff;
    --slime: #8fe05a;
    --candy: #ffd23f;
    --ink: #f4ecff;

    /* bestehende Variablen auf die Halloween-Welt abbilden */
    --blue-900: var(--ink);          /* Text */
    --blue-700: var(--pumpkin-dark); /* Schatten der Hauptknöpfe */
    --blue-500: var(--pumpkin);      /* Hauptfarbe */
    --blue-300: var(--witch);
    --blue-100: #4b2f72;
    --blue-50:  #33204d;

    --yellow-600: #d99a00;
    --yellow-500: var(--candy);
    --yellow-300: var(--pumpkin-light);
    --yellow-100: #3d2a12;

    --brown-800: var(--ink);
    --brown-600: var(--pumpkin-light); /* Überschriften, Beschriftungen */
    --brown-400: var(--witch);
    --brown-200: var(--plum-line);     /* Rahmen */
    --brown-100: var(--plum-2);        /* Chips, Hintergründe von Zählern */

    --green-600: var(--slime);
    --green-500: #4caf3a;
    --green-100: #1d3a1c;
    --red-600: #ff6b6b;
    --red-100: #4a1724;

    --bg: var(--night);
    --surface: var(--plum);
    --text: var(--ink);
    --text-muted: #b9a7d6;
    --border: var(--plum-line);
    --primary: var(--pumpkin);
    --primary-dark: var(--pumpkin-light);

    --shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.35);
    --shadow-strong: 0 3px 0 rgba(0, 0, 0, 0.45), 0 10px 30px rgba(0, 0, 0, 0.5);

    color-scheme: only dark; /* nicht vom Browser umfärben lassen (siehe app.css) */
}

/* ---------- Nachthimmel: Mond, Fledermäuse, Spinnennetz (fest im Hintergrund) ---------- */

:root[data-skin="halloween"] body {
    background:
        radial-gradient(circle at 88% 6%, rgba(255, 236, 170, 0.95) 0 34px, rgba(255, 220, 140, 0.25) 35px 60px, transparent 61px),
        radial-gradient(ellipse at 50% 120%, rgba(255, 138, 31, 0.18), transparent 60%),
        linear-gradient(180deg, var(--night) 0%, var(--night-2) 55%, #2a1238 100%);
    background-attachment: fixed;
}
:root[data-skin="halloween"] body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 32'%3E%3Cpath fill='%23100616' fill-opacity='.92' d='M32 10c2-4 4-5 4-5s0 3-1 5c4-1 8-5 10-9 1 5 7 6 12 4-2 5-7 7-11 7 3 2 4 6 4 9-4-3-9-4-13-2-2 1-3 4-5 6-2-2-3-5-5-6-4-2-9-1-13 2 0-3 1-7 4-9-4 0-9-2-11-7 5 2 11 1 12-4 2 4 6 8 10 9-1-2-1-5-1-5s2 1 4 5z'/%3E%3C/svg%3E") no-repeat calc(88% - 6px) 52px / 50px 25px,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 32'%3E%3Cpath fill='%23a07cd6' fill-opacity='.38' d='M32 10c2-4 4-5 4-5s0 3-1 5c4-1 8-5 10-9 1 5 7 6 12 4-2 5-7 7-11 7 3 2 4 6 4 9-4-3-9-4-13-2-2 1-3 4-5 6-2-2-3-5-5-6-4-2-9-1-13 2 0-3 1-7 4-9-4 0-9-2-11-7 5 2 11 1 12-4 2 4 6 8 10 9-1-2-1-5-1-5s2 1 4 5z'/%3E%3C/svg%3E") no-repeat 14% 26% / 38px 19px,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 32'%3E%3Cpath fill='%23a07cd6' fill-opacity='.3' d='M32 10c2-4 4-5 4-5s0 3-1 5c4-1 8-5 10-9 1 5 7 6 12 4-2 5-7 7-11 7 3 2 4 6 4 9-4-3-9-4-13-2-2 1-3 4-5 6-2-2-3-5-5-6-4-2-9-1-13 2 0-3 1-7 4-9-4 0-9-2-11-7 5 2 11 1 12-4 2 4 6 8 10 9-1-2-1-5-1-5s2 1 4 5z'/%3E%3C/svg%3E") no-repeat 70% 58% / 28px 14px,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120' fill='none' stroke='%23ffffff' stroke-opacity='.13' stroke-width='1.4'%3E%3Cpath d='M0 0L120 120M0 0L120 60M0 0L60 120M0 0L120 0M0 0L0 120'/%3E%3Cpath d='M28 0Q24 14 0 28M56 0Q48 30 0 56M84 0Q72 44 0 84M112 0Q96 58 0 112'/%3E%3C/svg%3E") no-repeat 0 100% / 150px 150px;
}
:root[data-skin="halloween"] #app { position: relative; z-index: 1; }

/* ---------- Kopfzeile & Navigation ---------- */

:root[data-skin="halloween"] .app-header {
    /* Vollmond mit Fledermaus zwischen Schriftzug und Namen */
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 32'%3E%3Cpath fill='%23100616' d='M32 10c2-4 4-5 4-5s0 3-1 5c4-1 8-5 10-9 1 5 7 6 12 4-2 5-7 7-11 7 3 2 4 6 4 9-4-3-9-4-13-2-2 1-3 4-5 6-2-2-3-5-5-6-4-2-9-1-13 2 0-3 1-7 4-9-4 0-9-2-11-7 5 2 11 1 12-4 2 4 6 8 10 9-1-2-1-5-1-5s2 1 4 5z'/%3E%3C/svg%3E") no-repeat calc(56% + 4px) calc(50% + 4px) / 30px 15px,
        radial-gradient(circle at 57% 50%, rgba(255, 238, 180, 0.95) 0 15px, rgba(255, 220, 140, 0.22) 16px 26px, transparent 27px),
        linear-gradient(90deg, #2b1247, #3d1a5c 60%, #4a1f63);
    box-shadow: 0 3px 0 var(--pumpkin-dark), 0 6px 18px rgba(0, 0, 0, 0.45);
}
:root[data-skin="halloween"] .app-header .title { color: var(--ink); }
:root[data-skin="halloween"] .app-header .title span { color: var(--pumpkin); }
:root[data-skin="halloween"] .app-header img { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
:root[data-skin="halloween"] .bottom-nav { background: #1b1029; border-top-color: var(--pumpkin-dark); }
:root[data-skin="halloween"] .bottom-nav a.active { color: var(--pumpkin); }

/* ---------- Karten, Knöpfe, Badges ---------- */

:root[data-skin="halloween"] .card,
:root[data-skin="halloween"] .list-item { background: linear-gradient(180deg, var(--plum-2), var(--plum)); }
:root[data-skin="halloween"] .btn { color: #2a1440; box-shadow: 0 3px 0 var(--pumpkin-dark); }
:root[data-skin="halloween"] .btn:active { box-shadow: 0 1px 0 var(--pumpkin-dark); }
:root[data-skin="halloween"] .btn.secondary { background: var(--plum-2); color: var(--pumpkin-light); box-shadow: 0 3px 0 #120a1c; }
:root[data-skin="halloween"] .btn.success { background: var(--slime); color: #12240d; box-shadow: 0 3px 0 #3f7a26; }
:root[data-skin="halloween"] .btn.warning,
:root[data-skin="halloween"] .fab-done { background: var(--candy); color: #2a1440; }
:root[data-skin="halloween"] .btn.danger { background: #c9384a; color: #fff; box-shadow: 0 3px 0 #7a1f2c; }
:root[data-skin="halloween"] .btn.ghost { background: transparent; color: var(--pumpkin-light); box-shadow: none; }
:root[data-skin="halloween"] .fab-done { box-shadow: 0 3px 0 #b88a00, var(--shadow-strong); }

:root[data-skin="halloween"] .badge.points { background: var(--candy); color: #2a1440; }
:root[data-skin="halloween"] .badge.mandatory { background: var(--witch); color: #fff; }
:root[data-skin="halloween"] .badge.due { background: #4a3210; color: var(--candy); }
:root[data-skin="halloween"] .badge.due_soon,
:root[data-skin="halloween"] .badge.none { background: #33204d; color: var(--witch-light); }
:root[data-skin="halloween"] .avatar.new-person { color: #2a1440; }

:root[data-skin="halloween"] .task.overdue { border-color: #8a2a3a; box-shadow: 0 0 0 1px #8a2a3a, 0 0 18px rgba(255, 70, 90, 0.18); }
:root[data-skin="halloween"] .task::before { background: var(--cat-color, var(--pumpkin)); }

/* Wochenkarte: Kürbis-Glühen */
:root[data-skin="halloween"] .week-card {
    background: linear-gradient(135deg, #5b2a86, #2a1145);
    box-shadow: 0 4px 0 #120a1c, 0 0 24px rgba(255, 138, 31, 0.18);
}
:root[data-skin="halloween"] .week-card .score .big { color: var(--pumpkin); }
:root[data-skin="halloween"] .week-card .muted { color: #d9c6f5; }
:root[data-skin="halloween"] .progress > div { background: linear-gradient(90deg, var(--pumpkin), var(--candy)); }

/* Reiter, Umschalter, Eingaben */
:root[data-skin="halloween"] .tabs button.active { color: #2a1440; box-shadow: 0 3px 0 var(--pumpkin-dark); }
:root[data-skin="halloween"] .segmented { background: #1b1029; }
:root[data-skin="halloween"] .segmented button.active { background: var(--plum-2); color: var(--pumpkin); }
:root[data-skin="halloween"] .input,
:root[data-skin="halloween"] select.input,
:root[data-skin="halloween"] textarea.input { background: #1b1029; color: var(--ink); }
:root[data-skin="halloween"] .input::placeholder { color: #8f7bb0; }

/* ---------- Anmeldung ---------- */

:root[data-skin="halloween"] .login {
    background:
        radial-gradient(circle at 82% 8%, rgba(255, 236, 170, 0.9) 0 30px, rgba(255, 220, 140, 0.2) 31px 56px, transparent 57px),
        radial-gradient(circle at 20% 30%, rgba(155, 92, 240, 0.25), transparent 45%),
        radial-gradient(ellipse at 50% 110%, rgba(255, 138, 31, 0.25), transparent 60%),
        var(--night);
}
:root[data-skin="halloween"] .pin-pad button { background: var(--plum-2); color: var(--ink); box-shadow: 0 3px 0 #120a1c; }
:root[data-skin="halloween"] .pin-dots span { border-color: var(--pumpkin); }
:root[data-skin="halloween"] .pin-dots span.filled { background: var(--pumpkin); box-shadow: 0 0 10px rgba(255, 138, 31, 0.6); }

/* ---------- Sheets, Toasts, Sonstiges ---------- */

:root[data-skin="halloween"] .backdrop { background: rgba(8, 3, 14, 0.7); }
:root[data-skin="halloween"] .sheet { background: linear-gradient(180deg, #24163a, var(--night)); border-top: 2px solid var(--pumpkin-dark); }
:root[data-skin="halloween"] .toast { background: #2b1247; border: 1px solid var(--plum-line); }
:root[data-skin="halloween"] .toast.success { background: #2e5a22; }
:root[data-skin="halloween"] .toast.error { background: #8a2a3a; }
:root[data-skin="halloween"] .toast button { color: var(--pumpkin); }
:root[data-skin="halloween"] .acting-banner { background: var(--witch); }
:root[data-skin="halloween"] .maintenance-banner { color: #2a1440; }
:root[data-skin="halloween"] .intro-extra { background: #1b1029; }
:root[data-skin="halloween"] .switch::after { background: var(--ink); }
:root[data-skin="halloween"] .code-big { background: #3d2a12; color: var(--candy); }
:root[data-skin="halloween"] .empty .emoji { filter: drop-shadow(0 0 8px rgba(255, 138, 31, 0.5)); }
:root[data-skin="halloween"] .loading { color: var(--pumpkin-light); }
:root[data-skin="halloween"] .nav-badge { background: #c9384a; } /* helles Rot wäre mit weißer Zahl kaum lesbar */
