/* ==========================================================
   Yäne Productions – Dark Mode (Standard) + Hellmodus
   ========================================================== */

:root {
    color-scheme: dark;

    --purple: #5a0f8e;
    --purple-bright: #9d3cff;
    --purple-soft: #cba6ff;
    --red: #ff2e45;
    --red-deep: #d81126;

    --bg: #0d0814;
    --bg-elevated: #160e22;
    --surface: #1c1229;
    --surface-hover: #251836;
    --border: #2f2042;
    --text: #efe7f8;
    --muted: #9a89ad;
    --text-strong: #ffffff;

    --header-bg: rgba(13, 8, 20, .75);
    --field-bg: rgba(28, 18, 41, .7);
    --row-hover: rgba(28, 18, 41, .6);
    --overlay: rgba(13, 8, 20, .85);
    --auth-bg: rgba(22, 14, 34, .85);
    --desc-text: #d8cbe6;
    --bg-glow-1: rgba(90, 15, 142, .35);
    --bg-glow-2: rgba(216, 17, 38, .12);
    --shadow-strong: rgba(90, 15, 142, .8);

    --ok-bg: rgba(34, 160, 80, .12);
    --ok-text: #7ee2a0;
    --ok-border: rgba(126, 226, 160, .3);
    --err-text: #ff8b98;

    --radius: 12px;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
    --glow: 0 0 0 1px rgba(155, 77, 222, .35), 0 10px 40px -10px rgba(155, 77, 222, .55);
}

:root[data-theme="light"] {
    color-scheme: light;

    --purple: #5a0f8e;
    --purple-bright: #7a22e0;
    --purple-soft: #5a0f8e;
    --red: #d81126;
    --red-deep: #b00d1f;

    --bg: #f8f4fd;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-hover: #f1e8fb;
    --border: #e4d5f2;
    --text: #2a0a45;
    --muted: #76618c;
    --text-strong: #3d0866;

    --header-bg: rgba(255, 255, 255, .8);
    --field-bg: #ffffff;
    --row-hover: rgba(122, 34, 224, .06);
    --overlay: rgba(255, 255, 255, .92);
    --auth-bg: rgba(255, 255, 255, .92);
    --desc-text: #4a3560;
    --bg-glow-1: rgba(122, 34, 224, .12);
    --bg-glow-2: rgba(216, 17, 38, .06);
    --shadow-strong: rgba(90, 15, 142, .35);

    --ok-bg: #e6f6ea;
    --ok-text: #1c6b31;
    --ok-border: #b9e4c4;
    --err-text: #b00d1f;

    --glow: 0 0 0 1px rgba(122, 34, 224, .3), 0 10px 30px -10px rgba(122, 34, 224, .45);
}

/* Weicher Farbwechsel beim Umschalten */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
    transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease), fill .45s var(--ease) !important;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    min-height: 100%;
    overflow-x: clip;
    /* Platz für die Scrollleiste immer reservieren, sonst springt das Layout seitlich */
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 10% -10%, var(--bg-glow-1), transparent 60%),
        radial-gradient(900px 500px at 110% 10%, var(--bg-glow-2), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    line-height: 1.55;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: clip;
    display: flex;
    flex-direction: column;
    animation: fade-in .45s var(--ease) both;
}

body.page-leave {
    animation: page-out .22s ease-in forwards;
}

::selection { background: var(--purple-bright); color: #fff; }

a {
    color: var(--purple-soft);
    transition: color .2s var(--ease);
}
a:hover { color: var(--text-strong); }

svg { width: 1em; height: 1em; fill: currentColor; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }

:focus-visible {
    outline: 2px solid var(--purple-bright);
    outline-offset: 3px;
    border-radius: 6px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

/* ---------- Seitenübergänge (Chrome/Edge: View Transitions) ---------- */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: page-out .2s ease-in both; }
::view-transition-new(root) { animation: page-in .45s var(--ease) both; }

html.theme-vt::view-transition-old(root),
html.theme-vt::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

@supports (view-transition-name: none) {
    body { animation: none; }
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--header-bg);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    animation: slide-down .6s var(--ease) both;
}
.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--purple-bright), var(--purple), var(--purple-bright), transparent);
    background-size: 200% 100%;
    animation: line-flow 6s linear infinite;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 12px;
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    font-size: 1.25rem;
    white-space: nowrap;
}
.brand:hover { color: var(--text-strong); }
.brand-logo {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--purple-bright);
    background: var(--purple);
    box-shadow: inset 0 0 0 3px var(--bg), 0 0 18px rgba(155, 77, 222, .5);
    color: #fff;
    transition: transform .5s var(--ease-bounce), box-shadow .3s;
}
.brand-logo svg { width: 16px; height: 16px; margin-left: 2px; }
.brand-logo-img {
    height: 44px;
    width: 44px;
    display: block;
    transition: transform .6s var(--ease-bounce), filter .3s;
    animation: logo-in .9s var(--ease-bounce) .15s backwards, logo-glow 3.5s ease-in-out 1s infinite;
}
.brand:hover .brand-logo { transform: rotate(360deg) scale(1.08); box-shadow: inset 0 0 0 3px var(--bg), 0 0 28px rgba(155, 77, 222, .9); }
.brand:hover .brand-logo-img { transform: scale(1.12) rotate(360deg); }
.brand-name { font-weight: 500; letter-spacing: .5px; }

.search-form {
    flex: 1;
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 280px;
}
.search-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid var(--purple);
    border-radius: 999px;
    padding: 7px 16px;
    color: var(--purple-soft);
    background: var(--field-bg);
    transition: border-color .25s, box-shadow .35s var(--ease), background .25s;
}
.search-field:hover { border-color: var(--purple-bright); }
.search-field:focus-within {
    border-color: var(--purple-bright);
    background: var(--surface);
    box-shadow: var(--glow);
}
.search-field svg { transition: transform .4s var(--ease-bounce); }
.search-field:focus-within svg { transform: scale(1.2) rotate(-10deg); color: var(--text-strong); }
.search-field input {
    flex: 1;
    border: 0;
    outline: 0;
    font: inherit;
    color: var(--text);
    background: transparent;
    min-width: 0;
}
.search-field input::placeholder { color: var(--muted); }

.search-form select {
    font: inherit;
    border: 0;
    padding: 7px 6px;
    background: transparent;
    color: var(--purple-soft);
    cursor: pointer;
    border-radius: 8px;
    transition: color .2s, background .2s;
}
.search-form select:hover, .search-form select:focus { color: var(--text-strong); background: var(--surface); outline: 0; }
.search-form select option { background: var(--bg-elevated); color: var(--text); }

.user-nav { display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 600; color: var(--purple-soft); }

/* ---------- Buttons ---------- */
.btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px;
    border: 2px solid var(--purple-bright);
    background: linear-gradient(135deg, var(--purple-bright), var(--purple));
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform .25s var(--ease-bounce), box-shadow .3s var(--ease), background .3s, color .2s;
}
.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .35), transparent 70%);
    transform: translateX(-120%);
    transition: transform .6s var(--ease);
}
.btn:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--glow); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(.96); }
.btn-ghost { background: transparent; color: var(--purple-soft); border-color: var(--purple); }
.btn-ghost:hover { background: rgba(122, 34, 224, .25); }

/* Theme-Umschalter */
.theme-toggle {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid var(--purple);
    background: var(--field-bg);
    color: var(--purple-soft);
    cursor: pointer;
    overflow: hidden;
    transition: transform .3s var(--ease-bounce), border-color .25s, box-shadow .3s var(--ease);
}
.theme-toggle:hover { transform: rotate(-15deg) scale(1.08); border-color: var(--purple-bright); box-shadow: var(--glow); }
.theme-toggle:active { transform: scale(.9); }
.theme-toggle svg {
    position: absolute;
    width: 20px;
    height: 20px;
    transition: transform .6s var(--ease-bounce), opacity .35s var(--ease);
}
.theme-toggle .icon-sun  { opacity: 0; transform: rotate(-90deg) scale(.3); }
.theme-toggle .icon-moon { opacity: 1; transform: none; }
:root[data-theme="light"] .theme-toggle .icon-sun  { opacity: 1; transform: none; color: #e08a00; }
:root[data-theme="light"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(.3); }
.btn-block { width: 100%; }

/* ---------- Meldungen ---------- */
.flash {
    margin: 20px 0 0;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid;
    animation: flash-in .6s var(--ease-bounce) both, flash-out .5s ease-in 6s forwards;
}
.flash-success { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }
.flash-error   { background: rgba(255, 46, 69, .12); color: var(--err-text); border-color: rgba(255, 46, 69, .35); }
.flash-info    { background: rgba(155, 77, 222, .14); color: var(--purple-soft); border-color: rgba(155, 77, 222, .35); }

main.container { flex: 1; padding-top: 10px; padding-bottom: 50px; }

.result-info { color: var(--muted); margin: 24px 0 0; animation: fade-up .5s var(--ease) both; }
.empty, .notice-box {
    text-align: center;
    padding: 70px 20px;
    color: var(--muted);
    animation: fade-up .6s var(--ease) both;
}
.notice-box h1 { color: var(--text); }

/* ---------- Videoliste ---------- */
.video-list { list-style: none; margin: 0; padding: 0; }
.video-row {
    display: grid;
    grid-template-columns: minmax(220px, 380px) 1fr;
    gap: 28px;
    padding: 24px 16px;
    margin: 0 -16px;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background .35s var(--ease);
    animation: fade-up .7s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 70ms + 150ms);
}
.video-row:hover { background: var(--row-hover); }

.thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border: 2px solid var(--purple);
    border-radius: var(--radius);
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(155, 77, 222, .18), transparent 70%),
        var(--surface);
    color: var(--purple-soft);
    transition: transform .45s var(--ease), border-color .3s, box-shadow .45s var(--ease);
}
.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .8s var(--ease), filter .5s;
}
.video-row:hover .thumb, .side-item:hover .thumb {
    transform: translateY(-4px);
    border-color: var(--purple-bright);
    box-shadow: var(--glow);
}
.video-row:hover .thumb img, .side-item:hover .thumb img { transform: scale(1.06); filter: brightness(.8); }

.thumb-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}
.thumb-play svg {
    width: 56px;
    height: 56px;
    padding: 12px 10px 12px 14px;
    border-radius: 50%;
    color: #fff;
    background: rgba(90, 15, 142, .75);
    border: 2px solid var(--purple-bright);
    backdrop-filter: blur(4px);
    transition: transform .45s var(--ease-bounce), background .3s, box-shadow .3s;
}
.video-row:hover .thumb-play svg, .side-item:hover .thumb-play svg {
    transform: scale(1.18);
    background: var(--purple-bright);
    box-shadow: 0 0 0 8px rgba(155, 77, 222, .25), 0 0 30px rgba(155, 77, 222, .8);
}

.thumb-lock {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--overlay);
    color: var(--red);
    animation: lock-pulse 2.4s ease-in-out infinite;
}
.thumb-lock svg { width: 18px; height: 18px; }
.video-row:hover .thumb-lock { animation: lock-wiggle .5s ease-in-out; }

.thumb-views {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 2px 9px;
    border-radius: 8px;
    background: var(--overlay);
    color: var(--purple-soft);
    font-size: .85rem;
    font-weight: 600;
}

.video-info { min-width: 0; padding-top: 4px; }
.video-title { margin: 0 0 8px; font-size: 1.35rem; font-weight: 600; }
.video-title a {
    color: var(--text);
    text-decoration: none;
    background: linear-gradient(var(--purple-bright), var(--purple-bright)) left bottom / 0 2px no-repeat;
    transition: background-size .45s var(--ease), color .2s;
}
.video-row:hover .video-title a, .video-title a:hover { color: var(--text-strong); background-size: 100% 2px; }
.video-desc {
    margin: 0 0 12px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-meta { margin: 0; display: flex; gap: 16px; align-items: center; color: var(--purple-soft); font-weight: 600; }
.badge-protected {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--red);
    font-size: .85rem;
    font-weight: 600;
}
.badge-protected::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 8px var(--red);
    animation: blink 1.8s ease-in-out infinite;
}

.badge-public { color: #3fbf7f; }
.badge-public::before { background: #3fbf7f; box-shadow: 0 0 8px #3fbf7f; animation: none; }
.badge-account, .badge-users { color: var(--purple-soft); }
.badge-account::before, .badge-users::before { background: var(--purple-bright); box-shadow: 0 0 8px var(--purple-bright); }
.badge-access {
    padding: 2px 9px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    color: #3fbf7f;
    background: rgba(63, 191, 127, .14);
    animation: fade-up .5s var(--ease) both;
}

.thumb-lock-account, .thumb-lock-users { color: var(--purple-bright); animation-name: lock-pulse-purple; }
.thumb-lock.has-access { color: #3fbf7f; animation: none; }

.unlock-icon-user { color: var(--purple-soft) !important; background: rgba(157, 60, 255, .15) !important; border-color: rgba(157, 60, 255, .5) !important; }
.unlock-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.player-locked .unlock-form p.muted { max-width: 420px; margin: 0; }

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 34px;
    animation: fade-up .6s var(--ease) .3s both;
}
.pagination a {
    min-width: 40px;
    text-align: center;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    text-decoration: none;
    background: var(--surface);
    color: var(--purple-soft);
    transition: transform .25s var(--ease-bounce), background .25s, border-color .25s;
}
.pagination a:hover { transform: translateY(-3px); border-color: var(--purple-bright); color: var(--text-strong); }
.pagination a.active { background: var(--purple); color: #fff; border-color: var(--purple-bright); box-shadow: var(--glow); }

/* ---------- Videoseite ---------- */
.watch-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    margin-top: 24px;
}
.watch-main { animation: fade-up .6s var(--ease) .1s both; min-width: 0; }

.player {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--purple);
    box-shadow: 0 20px 60px -20px var(--shadow-strong);
    animation: zoom-in .7s var(--ease) both;
}
.player video { width: 100%; height: 100%; display: block; }

.player-locked {
    background:
        radial-gradient(circle at 30% 20%, rgba(155, 77, 222, .45), transparent 55%),
        radial-gradient(circle at 80% 90%, rgba(216, 17, 38, .25), transparent 50%),
        var(--bg-elevated);
    background-size: 160% 160%;
    animation: zoom-in .7s var(--ease) both, bg-drift 12s ease-in-out infinite alternate;
}
.player-locked img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(16px) brightness(.4);
    transform: scale(1.1);
}
.unlock-form {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: #fff;
    text-align: center;
}
.unlock-form > * { animation: fade-up .6s var(--ease) both; }
.unlock-form > :nth-child(2) { animation-delay: .1s; }
.unlock-form > :nth-child(3) { animation-delay: .15s; }
.unlock-form > :nth-child(n+4) { animation-delay: .2s; }
.unlock-form:has(.form-error) input[type="password"] { animation: shake .5s ease-in-out; border-color: var(--red); }
.unlock-form h2 { margin: 0; font-size: 1.2rem; font-weight: 600; }
.unlock-form a { color: var(--purple-soft); }
.unlock-form input[type="password"] {
    width: min(320px, 100%);
    padding: 11px 18px;
    border-radius: 999px;
    border: 2px solid var(--purple);
    background: rgba(13, 8, 20, .7);
    color: #fff;
    font: inherit;
    text-align: center;
    transition: border-color .25s, box-shadow .35s var(--ease);
}
.unlock-form input[type="password"]:focus { outline: 0; border-color: var(--purple-bright); box-shadow: var(--glow); }
.unlock-form .muted { color: rgba(255, 255, 255, .7); }
.unlock-icon {
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255, 46, 69, .12);
    border: 2px solid rgba(255, 46, 69, .5);
    color: var(--red);
    animation: lock-pulse 2.4s ease-in-out infinite !important;
}
.unlock-icon svg { width: 32px; height: 32px; }

.watch-title { margin: 20px 0 6px; font-size: 1.6rem; font-weight: 600; }
.watch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; color: var(--muted); }
.like-form { margin-left: auto; }
.btn-like { background: var(--surface); color: var(--purple-soft); border-color: var(--purple); }
.btn-like svg { transition: transform .4s var(--ease-bounce); }
.btn-like:hover svg { transform: scale(1.3); }
.btn-like.liked { background: linear-gradient(135deg, var(--red), var(--red-deep)); border-color: var(--red); color: #fff; }
.btn-like.liked svg { animation: heart-pop .6s var(--ease-bounce); }

.watch-desc {
    margin-top: 16px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--desc-text);
}

.comments { margin-top: 34px; }
.comments h2 { font-size: 1.15rem; font-weight: 600; }
.comment-form { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.comment-form textarea, .auth-box input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    color: var(--text);
    background: var(--bg-elevated);
    transition: border-color .25s, box-shadow .35s var(--ease), background .25s;
}
.comment-form textarea { resize: vertical; min-height: 90px; }
.comment-form textarea:focus, .auth-box input:focus {
    outline: 0;
    border-color: var(--purple-bright);
    background: var(--surface);
    box-shadow: var(--glow);
}
.comment-list { list-style: none; padding: 0; margin: 20px 0 0; }
.comment-list li {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    animation: fade-up .5s var(--ease) both;
}
.comment-list li:nth-child(1) { animation-delay: .05s; }
.comment-list li:nth-child(2) { animation-delay: .1s; }
.comment-list li:nth-child(3) { animation-delay: .15s; }
.comment-list li:nth-child(n+4) { animation-delay: .2s; }
.comment-list strong { color: var(--purple-soft); margin-right: 6px; }
.comment-list p { margin: 4px 0 0; }

.watch-side { animation: fade-left .7s var(--ease) .25s both; }
.watch-side h2 { font-size: 1.05rem; margin-top: 0; font-weight: 600; }
.side-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    padding: 8px;
    margin: 0 -8px 8px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: background .3s var(--ease), transform .3s var(--ease);
}
.side-item:hover { background: var(--surface); color: var(--text-strong); transform: translateX(4px); }
.thumb-small { border-width: 1px; }
.thumb-small .thumb-play svg { width: 34px; height: 34px; padding: 7px 6px 7px 9px; }
.thumb-small .thumb-lock { width: 22px; height: 22px; left: 6px; bottom: 6px; border-radius: 6px; }
.thumb-small .thumb-lock svg { width: 14px; height: 14px; }
.side-info { display: flex; flex-direction: column; min-width: 0; }
.side-title {
    font-weight: 600;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ---------- Login / Registrieren ---------- */
.auth-box {
    position: relative;
    max-width: 430px;
    margin: 60px auto;
    padding: 34px;
    background: var(--auth-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 30px 80px -30px var(--shadow-strong);
    animation: zoom-in .6s var(--ease) both;
}
.auth-box::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--purple-bright), transparent 40%, transparent 60%, var(--purple));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.auth-box h1 { margin-top: 0; font-weight: 600; }
.auth-box form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.auth-box label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: .9rem;
    color: var(--purple-soft);
    animation: fade-up .5s var(--ease) both;
}
.auth-box label:nth-of-type(1) { animation-delay: .1s; }
.auth-box label:nth-of-type(2) { animation-delay: .16s; }
.auth-box label:nth-of-type(3) { animation-delay: .22s; }
.auth-box label:nth-of-type(4) { animation-delay: .28s; }
.auth-box .btn { margin-top: 6px; animation: fade-up .5s var(--ease) .32s both; }

.form-error {
    color: var(--err-text);
    background: rgba(255, 46, 69, .12);
    border: 1px solid rgba(255, 46, 69, .35);
    padding: 8px 12px;
    border-radius: 10px;
    margin: 0 0 10px;
    animation: shake .5s ease-in-out;
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: auto;
    width: 100%;
    border-top: 1px solid var(--border);
    padding: 22px 0;
    color: var(--muted);
    font-size: .85rem;
    /* Nur einblenden, nicht verschieben: sonst ragt der Footer kurz unten raus und erzeugt eine Scrollleiste */
    animation: fade-in .6s var(--ease) .4s both;
}
.site-footer .container {
    display: flex;
    justify-content: center;
    text-align: center;
}

/* ==========================================================
   Admin-Bereich
   ========================================================== */
.btn-admin {
    background: linear-gradient(135deg, var(--red), var(--purple-bright));
    border-color: transparent;
}
.btn-admin svg { width: 16px; height: 16px; }

.admin { margin-top: 24px; }

.admin-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--field-bg);
    width: fit-content;
    max-width: 100%;
    animation: fade-up .5s var(--ease) both;
}
.admin-nav a {
    padding: 7px 16px;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: .92rem;
    transition: background .3s var(--ease), color .2s, transform .25s var(--ease-bounce);
}
.admin-nav a:hover { color: var(--text-strong); background: var(--surface); transform: translateY(-1px); }
.admin-nav a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--purple-bright), var(--purple));
    box-shadow: var(--glow);
}

.admin-head {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 26px 0 20px;
    animation: fade-up .5s var(--ease) .05s both;
}
.admin-head h1 { margin: 0; font-size: 1.7rem; font-weight: 600; margin-right: auto; }
.admin-head h1 .muted { font-weight: 400; font-size: 1.1rem; }

.admin-search input, .field input, .field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    color: var(--text);
    background: var(--bg-elevated);
    transition: border-color .25s, box-shadow .35s var(--ease), background .25s;
}
.admin-search input { width: 260px; border-radius: 999px; }
.admin-search input:focus, .field input:focus, .field textarea:focus {
    outline: 0;
    border-color: var(--purple-bright);
    box-shadow: var(--glow);
}
.field textarea { resize: vertical; }
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: .9rem;
    color: var(--purple-soft);
}
.field input[type="file"] { padding: 8px; cursor: pointer; }
.field input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 6px 12px;
    border: 0;
    border-radius: 999px;
    background: var(--purple);
    color: #fff;
    font: inherit;
    cursor: pointer;
}
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.check input { accent-color: var(--red); width: 16px; height: 16px; }

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}
.admin-card {
    padding: 22px;
    background: var(--auth-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    min-width: 0;
    animation: fade-up .6s var(--ease) both;
    transition: border-color .3s, box-shadow .4s var(--ease);
}
.admin-grid > .admin-card:nth-child(2) { animation-delay: .06s; }
.admin-grid > .admin-card:nth-child(3) { animation-delay: .12s; }
.admin-grid > .admin-card:nth-child(4) { animation-delay: .18s; }
.admin-grid > .admin-card:nth-child(5) { animation-delay: .24s; }
.admin-card:hover { border-color: rgba(157, 60, 255, .45); }
.admin-card h2 { margin: 0 0 16px; font-size: 1.05rem; font-weight: 600; }
.admin-card-wide { grid-column: 1 / -1; }

/* Upload-Feld */
.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 34px 20px;
    border: 2px dashed var(--purple);
    border-radius: 14px;
    text-align: center;
    cursor: pointer;
    background: radial-gradient(circle at 50% 0%, rgba(157, 60, 255, .12), transparent 70%);
    transition: border-color .3s, background .3s, transform .35s var(--ease-bounce);
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--purple-bright); transform: scale(1.01); }
.dropzone.drag { background: rgba(157, 60, 255, .15); }
.dropzone.has-file { border-style: solid; border-color: #3fbf7f; }
.dropzone-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--purple-bright), var(--purple));
    box-shadow: var(--glow);
    transition: transform .4s var(--ease-bounce);
}
.dropzone-icon svg { width: 28px; height: 28px; }
.dropzone:hover .dropzone-icon, .dropzone.drag .dropzone-icon { transform: translateY(-5px); animation: bob 1.2s ease-in-out infinite; }
.dropzone.has-file .dropzone-icon { background: linear-gradient(135deg, #4be08a, #1f9d5a); }
.dropzone-text { font-weight: 600; word-break: break-word; }

.upload-progress { margin-top: 16px; animation: fade-up .4s var(--ease) both; }
.upload-bar {
    height: 10px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    overflow: hidden;
}
.upload-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--purple), var(--purple-bright), var(--red), var(--purple-bright));
    background-size: 300% 100%;
    animation: line-flow 2s linear infinite;
    transition: width .3s var(--ease);
}
.upload-progress.done .upload-bar span { background: linear-gradient(90deg, #1f9d5a, #4be08a); }
.upload-progress.error .upload-bar span { background: var(--red); }
.upload-progress.error .js-upload-status { color: var(--red); }
.upload-info { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: .85rem; color: var(--muted); }

.thumb-picker { margin-top: 18px; animation: zoom-in .5s var(--ease) both; }
.thumb-picker video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    border: 2px solid var(--purple);
}
.thumb-picker-controls { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.thumb-picker input[type="range"] { width: 100%; accent-color: var(--purple-bright); }

.thumb-current {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    margin-bottom: 14px;
    border: 2px solid var(--purple);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
}
.thumb-current img { width: 100%; height: 100%; object-fit: cover; }
.thumb-current.pop { animation: thumb-pop .6s var(--ease-bounce); }

/* Segment-Auswahl */
.segmented {
    display: inline-flex;
    padding: 4px;
    margin-bottom: 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    color: var(--muted);
    transition: background .35s var(--ease), color .25s, box-shadow .35s;
}
.segmented input:checked + span { color: #fff; background: var(--purple); box-shadow: var(--glow); }
.segmented input[value="protected"]:checked + span { background: linear-gradient(135deg, var(--red), var(--red-deep)); }
.segmented input:focus-visible + span { outline: 2px solid var(--purple-bright); outline-offset: 2px; }

.password-field { position: relative; display: block; }
.password-field input { padding-right: 46px; }
.password-field button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color .2s, background .2s;
}
.password-field button:hover, .password-field button.active { color: var(--purple-bright); background: var(--surface); }
.password-field button svg { width: 18px; height: 18px; }

/* Schalter */
.switch { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
    position: relative;
    width: 50px;
    height: 28px;
    border-radius: 999px;
    background: var(--border);
    transition: background .35s var(--ease), box-shadow .35s;
    flex-shrink: 0;
}
.switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
    transition: transform .45s var(--ease-bounce);
}
.switch input:checked + .switch-track { background: linear-gradient(135deg, var(--purple-bright), var(--purple)); box-shadow: var(--glow); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(22px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--purple-bright); outline-offset: 2px; }

.admin-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin: 24px 0 8px;
    animation: fade-up .5s var(--ease) .3s both;
}

/* Tabellen */
.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--auth-bg);
    animation: fade-up .6s var(--ease) .1s both;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.admin-table th {
    text-align: left;
    padding: 14px 16px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr {
    transition: background .25s var(--ease);
    animation: fade-up .5s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 40ms + 150ms);
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: var(--row-hover); }

.admin-video-cell { display: flex; align-items: center; gap: 14px; min-width: 260px; }
.thumb-mini { width: 110px; flex-shrink: 0; border-width: 1px; border-radius: 8px; }
.thumb-mini .thumb-play svg { width: 26px; height: 26px; padding: 5px 4px 5px 7px; }
.admin-video-title { display: block; font-weight: 600; color: var(--text); text-decoration: none; }
.admin-video-title:hover { color: var(--purple-bright); }

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-live      { color: #3fbf7f; background: rgba(63, 191, 127, .14); }
.status-live::before { animation: blink 1.8s ease-in-out infinite; }
.status-draft     { color: var(--muted); background: rgba(154, 137, 173, .15); }
.status-scheduled { color: #e0a030; background: rgba(224, 160, 48, .15); }

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.row-actions form { display: flex; align-items: center; gap: 6px; }
.icon-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--purple-soft);
    cursor: pointer;
    transition: transform .25s var(--ease-bounce), border-color .2s, color .2s, background .2s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { transform: translateY(-2px); border-color: var(--purple-bright); color: var(--text-strong); }
.icon-btn-danger:hover { border-color: var(--red); color: #fff; background: var(--red); }

.btn-mini {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--purple-soft);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .25s var(--ease-bounce), border-color .2s, color .2s;
}
.btn-mini svg { width: 14px; height: 14px; }
.btn-mini:hover { transform: translateY(-2px); border-color: var(--purple-bright); color: var(--text-strong); }

.inline-password input {
    width: 150px;
    padding: 6px 12px;
    border: 1px solid var(--purple-bright);
    border-radius: 999px;
    font: inherit;
    font-size: .85rem;
    color: var(--text);
    background: var(--bg-elevated);
    animation: grow-in .35s var(--ease) both;
}

/* Statistik */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--auth-bg);
    overflow: hidden;
    animation: fade-up .6s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 70ms + 100ms);
    transition: transform .35s var(--ease-bounce), border-color .3s, box-shadow .4s var(--ease);
}
.stat-card::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(157, 60, 255, .35), transparent 70%);
    transition: transform .5s var(--ease);
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--purple-bright); box-shadow: var(--glow); }
.stat-card:hover::after { transform: scale(1.6); }
.stat-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--text-strong); line-height: 1.2; }

.comment-list.compact { margin-top: 0; }
.comment-list.compact li { padding: 10px 0; }

.admin-comment-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.admin-comment-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    animation-delay: calc(var(--i, 0) * 40ms + 100ms);
}
.admin-comment-list p { margin: 6px 0 0; }
.admin-comment-list strong { color: var(--purple-soft); margin-right: 6px; }

/* Zugriffs-Modi */
.access-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.access-option input { position: absolute; opacity: 0; pointer-events: none; }
.access-option-body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: var(--bg-elevated);
    cursor: pointer;
    transition: border-color .3s, transform .35s var(--ease-bounce), box-shadow .4s var(--ease), background .3s;
}
.access-option-body:hover { transform: translateY(-3px); border-color: var(--purple); }
.access-option-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 6px;
    border-radius: 10px;
    color: var(--purple-soft);
    background: var(--surface);
    transition: transform .45s var(--ease-bounce), background .3s, color .3s;
}
.access-option-icon svg { width: 20px; height: 20px; }
.access-option input:checked + .access-option-body {
    border-color: var(--purple-bright);
    background: radial-gradient(circle at 0 0, rgba(157, 60, 255, .18), transparent 70%), var(--bg-elevated);
    box-shadow: var(--glow);
}
.access-option input:checked + .access-option-body .access-option-icon {
    color: #fff;
    background: linear-gradient(135deg, var(--purple-bright), var(--purple));
    transform: scale(1.1) rotate(-6deg);
}
.access-option-password input:checked + .access-option-body { border-color: var(--red); }
.access-option-password input:checked + .access-option-body .access-option-icon { background: linear-gradient(135deg, var(--red), var(--red-deep)); }
.access-option-public input:checked + .access-option-body { border-color: #3fbf7f; }
.access-option-public input:checked + .access-option-body .access-option-icon { background: linear-gradient(135deg, #4be08a, #1f9d5a); }
.access-option input:checked + .access-option-body::after {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 12px;
    font-weight: 700;
    color: var(--purple-bright);
    animation: heart-pop .4s var(--ease-bounce);
}
.access-option input:focus-visible + .access-option-body { outline: 2px solid var(--purple-bright); outline-offset: 3px; }

.access-settings { display: flex; flex-direction: column; gap: 6px; }
.block-in { animation: fade-up .45s var(--ease) both; }

.user-picker {
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: var(--bg-elevated);
}
.user-picker h3 { margin: 0 0 12px; font-size: .95rem; font-weight: 600; }
.user-picker-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.user-picker-tools input {
    flex: 1;
    min-width: 160px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font: inherit;
    font-size: .9rem;
    color: var(--text);
    background: var(--surface);
}
.user-picker-tools input:focus { outline: 0; border-color: var(--purple-bright); box-shadow: var(--glow); }
.user-picker-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 240px; overflow-y: auto; padding: 2px; }
.user-chip input { position: absolute; opacity: 0; pointer-events: none; }
.user-chip span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: .88rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all .25s var(--ease);
}
.user-chip span svg { width: 14px; height: 14px; }
.user-chip span:hover { border-color: var(--purple); color: var(--text-strong); }
.user-chip input:checked + span {
    color: #fff;
    border-color: var(--purple-bright);
    background: linear-gradient(135deg, var(--purple-bright), var(--purple));
    box-shadow: 0 4px 14px -4px rgba(157, 60, 255, .7);
    transform: scale(1.04);
}
.user-chip input:focus-visible + span { outline: 2px solid var(--purple-bright); outline-offset: 2px; }

.access-summary {
    margin: 10px 0 0;
    padding: 12px 14px;
    border-left: 3px solid var(--purple-bright);
    border-radius: 8px;
    background: rgba(157, 60, 255, .08);
    font-size: .92rem;
}
.access-summary.warn { border-color: var(--red); background: rgba(255, 46, 69, .08); color: var(--err-text); }
.access-summary.pulse { animation: fade-up .35s var(--ease) both; }

@media (max-width: 700px) {
    .admin-search input { width: 100%; }
    .admin-search { flex-basis: 100%; }
    .admin-actions { flex-direction: column-reverse; }
    .admin-actions .btn { width: 100%; }
}

/* ---------- Ladebalken ---------- */
.nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--purple), var(--purple-bright), var(--red));
    box-shadow: 0 0 12px var(--purple-bright);
    opacity: 0;
    pointer-events: none;
}
.nav-progress.active { opacity: 1; animation: progress-run 2.5s cubic-bezier(.1, .7, .2, 1) forwards; }
.nav-progress.done { animation: progress-done .45s ease-out forwards; }

/* ---------- Header beim Scrollen ---------- */
.site-header { transition: box-shadow .4s var(--ease), background .4s var(--ease); }
.header-inner { transition: padding .4s var(--ease); }
.site-header.scrolled { box-shadow: 0 10px 40px -15px rgba(0, 0, 0, .55); }
.site-header.scrolled .header-inner { padding-top: 7px; padding-bottom: 7px; }
.site-header.scrolled .brand-logo-img { height: 36px; width: 36px; }

/* ---------- Nach-oben-Knopf ---------- */
.to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 30;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--purple-bright);
    background: linear-gradient(135deg, var(--purple-bright), var(--purple));
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px) scale(.6);
    pointer-events: none;
    transition: opacity .4s var(--ease), transform .5s var(--ease-bounce), box-shadow .3s;
}
.to-top svg { width: 24px; height: 24px; transition: transform .3s var(--ease-bounce); }
.to-top.visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { box-shadow: var(--glow); }
.to-top:hover svg { transform: translateY(-3px); }

/* ---------- Einblenden beim Scrollen ---------- */
html.anim .reveal { animation: none; opacity: 0; transform: translateY(28px); }
html.anim .reveal.in { animation: reveal-in .75s var(--ease) var(--reveal-delay, 0ms) both; }
html.anim .side-item.reveal { transform: translateX(26px); }

/* ---------- Bilder weich einblenden ---------- */
html.anim .thumb img, html.anim .player-locked img { opacity: 0; transition: opacity .6s var(--ease), transform .8s var(--ease), filter .5s; }
html.anim .thumb img.loaded, html.anim .player-locked img.loaded { opacity: 1; }

/* ---------- Spotlight + 3D-Neigung ---------- */
.video-row:hover {
    background:
        radial-gradient(420px circle at var(--sx, 50%) var(--sy, 50%), rgba(157, 60, 255, .13), transparent 65%),
        var(--row-hover);
}
.video-row .thumb { transform-style: preserve-3d; }
.video-row .thumb.tilting {
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px);
    transition: transform .12s linear, border-color .3s, box-shadow .45s var(--ease);
}
.video-row .thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .22), transparent 55%);
    opacity: 0;
    transition: opacity .35s var(--ease);
    pointer-events: none;
}
.video-row .thumb.tilting::after { opacity: 1; }

/* ---------- Ripple ---------- */
.pagination a, .theme-toggle { position: relative; overflow: hidden; }
.ripple {
    position: absolute;
    border-radius: 50%;
    background: currentColor;
    opacity: .3;
    transform: scale(0);
    pointer-events: none;
    animation: ripple .6s var(--ease) forwards;
}

/* ---------- Lade-Zustand auf Buttons ---------- */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    animation: spin .7s linear infinite;
}
.unlock-form .btn.is-loading::before, .btn-ghost.is-loading::before { border-color: rgba(122, 34, 224, .3); border-top-color: var(--purple-bright); }

/* ---------- Like-Explosion ---------- */
.btn-like.burst { overflow: visible; }
.particle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    border-radius: 50%;
    background: var(--hue);
    pointer-events: none;
    animation: particle .6s var(--ease) forwards;
}
.btn-like.burst svg { animation: heart-pop .5s var(--ease-bounce); color: var(--red); }

/* ---------- Freischalt-Erfolg ---------- */
.player-expired {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
    font-weight: 600;
    color: #fff;
    background: rgba(10, 6, 16, .85);
    backdrop-filter: blur(6px);
    animation: fade-in .4s ease both;
}
.player-expired:hover { color: var(--accent, #c084fc); }

.unlock-success {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    background: radial-gradient(circle, rgba(90, 15, 142, .85), rgba(13, 8, 20, .95));
    pointer-events: none;
    animation: unlock-overlay 1.9s var(--ease) forwards;
}
.unlock-success-icon {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 2px solid #4be08a;
    color: #4be08a;
    box-shadow: 0 0 40px rgba(75, 224, 138, .5);
    animation: unlock-icon .9s var(--ease-bounce) both;
}
.unlock-success-icon svg { width: 38px; height: 38px; animation: lock-open .6s var(--ease) .35s both; }
.unlock-success-text { font-weight: 600; letter-spacing: 1px; animation: fade-up .5s var(--ease) .3s both; }

/* ---------- Player spielt ---------- */
.player.playing { animation: player-glow 3s ease-in-out infinite; }

/* ---------- Meldungen wegklicken ---------- */
.flash { cursor: pointer; }
.flash.dismiss { animation: flash-dismiss .4s var(--ease) forwards; }

/* ---------- Links im Text ---------- */
.muted a, .auth-box p a {
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
    transition: background-size .35s var(--ease), color .2s;
}
.muted a:hover, .auth-box p a:hover { background-size: 100% 1px; }

/* ---------- Keyframes ---------- */
@keyframes bob {
    0%, 100% { transform: translateY(-5px); }
    50%      { transform: translateY(-10px); }
}
@keyframes thumb-pop {
    0%   { transform: scale(.92); opacity: .4; }
    100% { transform: none; opacity: 1; }
}
@keyframes grow-in {
    from { opacity: 0; width: 0; }
    to   { opacity: 1; width: 150px; }
}
@keyframes reveal-in {
    from { opacity: 0; transform: translateY(28px) scale(.98); filter: blur(4px); }
    to   { opacity: 1; transform: none; filter: none; }
}
@keyframes progress-run {
    from { width: 0; }
    to   { width: 85%; }
}
@keyframes progress-done {
    from { width: 85%; opacity: 1; }
    60%  { width: 100%; opacity: 1; }
    to   { width: 100%; opacity: 0; }
}
@keyframes ripple {
    to { transform: scale(1); opacity: 0; }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes particle {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}
@keyframes unlock-overlay {
    0%, 60% { opacity: 1; }
    100%    { opacity: 0; visibility: hidden; }
}
@keyframes unlock-icon {
    from { transform: scale(.2) rotate(-90deg); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
@keyframes lock-open {
    0%   { transform: none; }
    50%  { transform: translateY(-4px) rotate(-12deg); }
    100% { transform: translateY(-2px) rotate(-8deg) scale(1.05); }
}
@keyframes player-glow {
    0%, 100% { box-shadow: 0 20px 60px -20px var(--shadow-strong), 0 0 0 0 rgba(157, 60, 255, 0); }
    50%      { box-shadow: 0 20px 70px -15px var(--shadow-strong), 0 0 30px 2px rgba(157, 60, 255, .35); }
}
@keyframes flash-dismiss {
    to { opacity: 0; transform: translateX(40px); }
}
@keyframes page-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
@keyframes page-out {
    to { opacity: 0; transform: translateY(-8px); }
}
@keyframes slide-down {
    from { opacity: 0; transform: translateY(-100%); }
    to   { opacity: 1; transform: none; }
}
@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes fade-up {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: none; }
}
@keyframes fade-left {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: none; }
}
@keyframes zoom-in {
    from { opacity: 0; transform: scale(.94); }
    to   { opacity: 1; transform: none; }
}
@keyframes logo-in {
    from { opacity: 0; transform: scale(.3) rotate(-180deg); }
    to   { opacity: 1; transform: none; }
}
@keyframes logo-glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(157, 60, 255, .45)); }
    50%      { filter: drop-shadow(0 0 12px rgba(157, 60, 255, .9)); }
}
@keyframes line-flow {
    from { background-position: 0% 0; }
    to   { background-position: 200% 0; }
}
@keyframes bg-drift {
    from { background-position: 0% 0%; }
    to   { background-position: 100% 100%; }
}
@keyframes lock-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 46, 69, .45); }
    50%      { box-shadow: 0 0 0 8px rgba(255, 46, 69, 0); }
}
@keyframes lock-pulse-purple {
    0%, 100% { box-shadow: 0 0 0 0 rgba(157, 60, 255, .45); }
    50%      { box-shadow: 0 0 0 8px rgba(157, 60, 255, 0); }
}
@keyframes lock-wiggle {
    0%, 100% { transform: rotate(0); }
    25%      { transform: rotate(-14deg); }
    75%      { transform: rotate(14deg); }
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: .3; }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}
@keyframes heart-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.5); }
    100% { transform: scale(1); }
}
@keyframes flash-in {
    from { opacity: 0; transform: translateY(-14px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
@keyframes flash-out {
    to { opacity: 0; transform: translateY(-10px); height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; border-width: 0; }
}

/* ---------- Responsive ---------- */
/* ---------- Tablet & Handy ---------- */
.btn, .user-nav a, .search-form select { white-space: nowrap; }

/* Tablet: Suche in eine eigene Zeile unter Logo + Navigation */
@media (max-width: 1180px) {
    .header-inner { row-gap: 10px; }
    .search-form { order: 3; flex-basis: 100%; min-width: 0; }
    .user-nav { margin-left: auto; }
}

@media (max-width: 900px) {
    .watch-layout { grid-template-columns: 1fr; gap: 26px; }
    .watch-side { animation-name: fade-up; }
    .video-row { grid-template-columns: minmax(200px, 300px) 1fr; gap: 20px; }
    .video-title { font-size: 1.2rem; }
}

/* Handy */
@media (max-width: 700px) {
    .container { padding: 0 14px; }
    /* Fixierter Header würde ein Drittel des Bildschirms belegen */
    .site-header { position: relative; }
    .header-inner { gap: 10px; padding-top: 10px; padding-bottom: 12px; }
    .brand { font-size: 1.05rem; gap: 8px; }
    .brand-logo-img { width: 36px; height: 36px; }
    .search-form { flex-wrap: wrap; gap: 8px; }
    .search-field { flex-basis: 100%; }
    .search-form select {
        flex: 1;
        min-width: 0;
        border: 1px solid var(--border);
        background: var(--field-bg);
        border-radius: 999px;
        padding: 8px 12px;
        font-size: .9rem;
    }
    .user-nav { gap: 6px; }
    .user-nav .btn { padding: 7px 13px; font-size: .9rem; }
    .user-name { display: none; }

    .video-row { grid-template-columns: 1fr; gap: 12px; padding: 16px 12px; margin: 0 -12px; }
    .video-title { font-size: 1.15rem; }
    .video-meta { flex-wrap: wrap; gap: 8px 14px; }

    .watch-layout { margin-top: 14px; }
    .player { border-radius: 12px; }
    .watch-title { font-size: 1.3rem; margin-top: 16px; }
    .watch-meta { gap: 10px 14px; }
    .side-item { grid-template-columns: 140px 1fr; }
    .side-item:hover { transform: none; }

    /* Passwort-Box passt nicht ins 16:9-Format: Player darf höher werden */
    .player-locked { aspect-ratio: auto; min-height: 56vw; }
    .player-locked .unlock-form { position: relative; inset: auto; min-height: 56vw; padding: 26px 16px; gap: 10px; }
    .unlock-icon { width: 54px; height: 54px; }
    .unlock-icon svg { width: 26px; height: 26px; }
    .unlock-form h2 { font-size: 1.05rem; }

    .auth-box { margin: 24px auto; padding: 24px 20px; }
    .admin-head h1 { font-size: 1.4rem; }
    .admin-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .admin-nav::-webkit-scrollbar { display: none; }
    .to-top { right: 14px; bottom: 14px; width: 44px; height: 44px; }
}

/* Kleine Handys: Name neben dem Logo hat neben den Buttons keinen Platz */
@media (max-width: 480px) {
    .brand-name { display: none; }
    .side-item { grid-template-columns: 120px 1fr; }
}

/* Touch-Geräte: grössere Tippflächen */
@media (pointer: coarse) {
    .search-field { min-height: 44px; }
    .search-form select { min-height: 44px; }
    .btn { min-height: 42px; }
    .theme-toggle { width: 42px; height: 42px; }
    .pagination a { min-height: 44px; display: inline-grid; place-items: center; }
    .video-title a { display: inline-block; padding: 6px 0; }
    /* Vertikales Padding bei Inline-Links vergrössert nur die Tippfläche, nicht die Zeilenhöhe */
    main p a, .unlock-form p a { padding: 10px 2px; margin: -10px -2px; }
    .admin-nav a { padding: 10px 16px; }
    .unlock-form input[type="password"] { min-height: 46px; font-size: 16px; }
    .comment-form textarea, .auth-box input, .admin-search input, .field input, .field textarea { font-size: 16px; }
}

/* Weniger Bewegung, wenn im System so eingestellt */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
