﻿:root {
    --primary-color: #FFD700;
    --secondary-color: #FF8C00;
    --accent-color: #FFFFFF;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.sp-player {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
}

.sp-content-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.sp-content {
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.sp-center {
    display: flex;
    flex-grow: 1;
    justify-content: center;
    align-items: center;
    min-height: 0;
    padding: 0 1rem;
}

.sp-page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

    .sp-page.slide-in-right {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        z-index: 2;
    }

    .sp-page.hidden-right {
        opacity: 0;
        visibility: hidden;
        transform: translateX(100%);
        z-index: 1;
    }

    .sp-page.offscreen-right {
        display: none;
    }

    .sp-page.slide-out-left {
        transform: translateX(-100%);
        opacity: 0;
        z-index: 1;
    }

    .sp-page.stay-center {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        z-index: 1;
    }

.sp-top {
    padding-top: calc(env(safe-area-inset-top, 0px) + 2rem);
    padding-bottom: 1rem;
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}


.sp-image {
    max-width: 100%;
    max-height: 40vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

    .sp-image.visible {
        opacity: 1;
    }

.sp-text {
    text-align: center;
    display: inline-block;
    line-height: 1.6;
    font-size: 1.2rem;
    color: #222;
}

.sp-text-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    height: 100%;
    max-width: 90%;
    padding: 0 1rem;
    text-align: center;
}

.sp-text.visible {
    opacity: 1;
}

.sp-button-row {
    margin-top: auto;
    margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 2rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}



    .sp-button-row.single-button {
        margin-bottom: 6rem;
    }

.sp-page-control-button,
.sp-button {
    background-color: #48668b;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    max-width: 280px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .sp-page-control-button:hover,
    .sp-page-control-button:focus,
    .sp-button:hover,
    .sp-button:focus {
        background-color: #38536d;
    }

    .sp-page-control-button.next {
        background-color: #b23a48;
        color: #fff;
    }

        .sp-page-control-button.next:hover {
            background-color: #912e3a;
        }

    .sp-page-control-button.replay {
        background-color: #f4be5e;
        color: #333;
    }

        .sp-page-control-button.replay:hover {
            background-color: #e0aa4f;
        }

    .sp-button.read {
        background-color: var(--primary-color);
        color: var(--accent-color);
    }

        .sp-button.read:hover {
            background-color: var(--secondary-color);
        }

.sp-pause-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

    .sp-pause-overlay::before {
        content: "";
        position: absolute;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.4);
        z-index: 1;
        border-radius: inherit;
    }

.sp-pause-card {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    backdrop-filter: blur(6px);
    border-radius: 20px;
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.sp-pause-image {
    max-width: 90%;
    max-height: 50vh;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.6s ease;
}

    .sp-pause-image.visible {
        opacity: 1;
    }

.sp-rotate-overlay {
    display: none;
}

.sp-cover-screen {
    position: fixed;
    inset: 0;
    background-color: black;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;
    z-index: 1000;
}

.sp-cover-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 1rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    margin-top: 2rem;
}

.sp-start-button {
    margin-bottom: 2rem;
    padding: 0.75rem 1.5rem;
    font-size: 1.25rem;
    border: none;
    border-radius: 8px;
    background-color: #ffd700;
    color: black;
    font-weight: bold;
}

@media screen and (orientation: landscape) and (max-width: 768px) {
    .sp-rotate-overlay {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: relative;
        inset: 0;
        background: #f0f0f0;
        z-index: 999;
        gap: 0.75rem;
        padding-top: 2rem;
        min-height: 100dvh;
    }

    .sp-rotate-image {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 85%;
        max-width: 400px;
        aspect-ratio: 2.5 / 1;
        background-image: url('/images/NinjasFalling.png');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        animation: ninja-wobble 2s infinite ease-in-out;
        transform-origin: center;
        z-index: 0;
    }

    .sp-rotate-caption {
        position: relative;
        z-index: 1;
        font-size: 1rem;
        color: var(--primary-color);
        font-weight: 600;
        max-width: 90%;
        margin-top: 10rem;
        animation: caption-fade 0.6s ease-out forwards;
        animation-delay: 0.2s;
    }

    .sp-player > *:not(.sp-rotate-overlay) {
        visibility: hidden;
    }
}

@keyframes ninja-wobble {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(-15deg);
    }

    25% {
        transform: translate(-50%, -50%) rotate(-17deg);
    }

    50% {
        transform: translate(-50%, -50%) rotate(-13deg);
    }

    75% {
        transform: translate(-50%, -50%) rotate(-16deg);
    }
}

@keyframes caption-fade {
    0% {
        opacity: 0;
        transform: translateY(1rem);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
