/* Szenen: Foto mit Fernseher, auf dem Folien laufen. Für Landing Page, Anmeldung und Registrierung. */
.tv {
    padding: 0.5%;
    border-radius: 4px;
    background: #0c0e11;
}

.tv-screen {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: 2px;
    background: #16191d;
}

.tv-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Liegt genau auf dem Gerät im Foto, der schwarze Rahmen deckt dessen Rand ab. */
.scene-tv {
    position: absolute;
    top: var(--y);
    left: var(--x);
    width: var(--w);
    height: var(--h);
}

.scene-tv .tv-screen > img {
    position: absolute;
    inset: 0;
}

/* Ohne Bewegung liegt die erste Folie oben. */
.scene-tv .tv-screen > img:not(:first-child) {
    visibility: hidden;
}

.pause,
.scenes-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    min-height: 44px;
    border: 0;
    border-radius: var(--radius);
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    color: var(--ink);
    font-size: var(--text-s);
    font-weight: 600;
    cursor: pointer;
}

.pause {
    padding: 0 16px 0 12px;
}

.pause svg,
.scenes-button svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pause .play-icon,
.pause[aria-pressed="true"] .pause-icon {
    display: none;
}

.pause[aria-pressed="true"] .play-icon {
    display: inline;
}

/* Karussell. Die Nachbarn schauen links und rechts halb durchsichtig herein. */
.scenes {
    --scene: min(1120px, 78vw);
    --grow-from: 0.84;
    position: relative;
    margin-top: clamp(36px, 3.6vw, 48px);
    overflow-x: clip;
}

.scenes-track {
    position: relative;
    width: var(--scene);
    margin-inline: auto;
    aspect-ratio: 2000 / 1131;
    transform-origin: top;
}

.scene {
    position: absolute;
    inset: 0;
    border-radius: var(--card-radius);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateX(calc(200% + 48px));
}

.scene picture,
.auth-scene picture {
    display: block;
    height: 100%;
}

.scene img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scene.is-active {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    transform: none;
}

.scene.is-prev,
.scene.is-next {
    opacity: 0.4;
    visibility: visible;
    cursor: pointer;
}

.scene.is-prev {
    transform: translateX(calc(-100% - 24px));
}

.scene.is-next {
    transform: translateX(calc(100% + 24px));
}

.scene.is-prev:hover,
.scene.is-next:hover {
    opacity: 0.6;
}

.scenes-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.scenes-controls button {
    background: #ffffff;
}

/* Anmeldung und Registrierung */
.auth {
    display: grid;
    grid-template-columns: minmax(0, 480px) minmax(0, 560px);
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 5vw, 72px);
    padding-block: clamp(24px, 4vw, 56px);
}

.auth-scene {
    position: relative;
    aspect-ratio: 1400 / 1520;
    border-radius: var(--card-radius);
    overflow: hidden;
    background: #e7eaee;
}

.auth-scene picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-scene .pause {
    position: absolute;
    right: 16px;
    bottom: 16px;
}

@media (prefers-reduced-motion: no-preference) {
    .scenes,
    .auth-scene {
        animation: rise 0.9s 0.24s var(--ease) backwards;
    }

    .scene {
        transition: transform 1.6s cubic-bezier(0.65, 0, 0.15, 1), opacity 1.6s ease, visibility 0s 1.6s;
    }

    .scene.is-active,
    .scene.is-prev,
    .scene.is-next {
        transition: transform 1.6s cubic-bezier(0.65, 0, 0.15, 1), opacity 1.6s ease;
    }

    /* Wächst beim Herunterscrollen langsam auf volle Größe. */
    @supports (animation-timeline: scroll()) {
        .scenes-track {
            animation: scenes-grow linear both;
            animation-timeline: scroll(root);
            animation-range: 0 560px;
        }
    }

    /* Drei Folien je 4 Sekunden. Die erste ist beim Start schon da (-0,8 s). Nur die Szene in der Mitte läuft weiter. */
    .scene-tv .tv-screen > img {
        visibility: visible !important;
        animation: 12s calc(var(--i) * 4s - 0.8s) var(--ease) infinite backwards paused;
    }

    .scene.is-active .tv-screen > img,
    .auth-scene .tv-screen > img {
        animation-play-state: running;
    }

    .deck-up > img { animation-name: deck-up !important; }
    .deck-left > img { animation-name: deck-left !important; }
    .deck-fade > img { animation-name: deck-fade !important; }
    .deck-zoom > img { animation-name: deck-zoom !important; }
    .deck-wipe > img { animation-name: deck-wipe !important; }
}

.is-paused :is(.tv-loop, .tv-screen > img, .feed, .swap-price b, .ticker span, .signal, .clockHand) {
    animation-play-state: paused !important;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(28px); }
}

@keyframes scenes-grow {
    from { transform: scale(var(--grow-from)); }
}

@keyframes deck-up {
    0% { transform: translateY(100%); }
    6.6%, 33.3% { transform: none; }
    40% { transform: translateY(-100%); }
    40.01%, 100% { transform: translateY(100%); }
}

@keyframes deck-left {
    0% { transform: translateX(100%); }
    6.6%, 33.3% { transform: none; }
    40% { transform: translateX(-100%); }
    40.01%, 100% { transform: translateX(100%); }
}

@keyframes deck-fade {
    0% { opacity: 0; z-index: 1; }
    8%, 33.3% { opacity: 1; z-index: 1; }
    33.4%, 42% { opacity: 1; z-index: 0; }
    42.1%, 100% { opacity: 0; z-index: 0; }
}

@keyframes deck-zoom {
    0% { opacity: 0; transform: scale(1.18); z-index: 1; }
    8%, 33.3% { opacity: 1; transform: none; z-index: 1; }
    33.4%, 42% { opacity: 1; transform: none; z-index: 0; }
    42.1%, 100% { opacity: 0; transform: none; z-index: 0; }
}

@keyframes deck-wipe {
    0% { clip-path: inset(0 100% 0 0); z-index: 1; }
    8%, 33.3% { clip-path: inset(0); z-index: 1; }
    33.4%, 42% { clip-path: inset(0); z-index: 0; }
    42.1%, 100% { clip-path: inset(0 100% 0 0); z-index: 0; }
}

@media (max-width: 63.9375em) {
    .auth {
        grid-template-columns: minmax(0, 480px);
    }
}

@media (max-width: 47.9375em) {
    .scenes {
        --scene: 80vw;
        --grow-from: 0.93;
    }

    .scenes-track,
    .auth-scene {
        aspect-ratio: 4 / 3;
    }

    .scene-tv {
        top: var(--my);
        left: var(--mx);
        width: var(--mw);
        height: var(--mh);
    }

    .scene.is-prev {
        transform: translateX(calc(-100% - 12px));
    }

    .scene.is-next {
        transform: translateX(calc(100% + 12px));
    }

    .auth-scene .pause span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .auth-scene .pause {
        right: 12px;
        bottom: 12px;
        padding-inline: 13px;
    }
}
