/* Story Display Styles */

#story-container {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 30;
}

.story-video.hidden {
    display: none !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.story-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 20;
    animation: fadeInPage 3s ease-in forwards;
}

.story-content.hidden {
    display: none !important;
}

@keyframes fadeInPage {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.story-page {
    width: 90%;
    max-width: 800px;
    height: 90%;
    max-height: 600px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    box-shadow: 0 0 50px rgba(139, 0, 0, 0.8);
    position: relative;
}

.story-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    filter: blur(2px) brightness(1.1);
    z-index: -1;
}

.story-text {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    font-family: 'Creepster', 'Courier New', cursive;
    font-size: 1.5rem;
    line-height: 2;
    color: #8B0000;
    text-align: left;
    padding: 2.5rem;
    background: rgba(255, 248, 240, 0.98);
    border-radius: 10px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: fadeInText 2s ease-in 3s forwards;
    position: relative;
    z-index: 10;
    filter: none;
    backdrop-filter: none;
}

@keyframes fadeInText {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.story-text p {
    margin-bottom: 2rem;
    text-indent: 2rem;
    opacity: 0;
    animation: handwriting 4s ease-in forwards;
    animation-delay: calc(var(--paragraph-index, 0) * 2s + 5s);
    font-weight: 500;
    letter-spacing: 1px;
    font-size: 1.5rem;
    line-height: 2.2;
    color: #8B0000;
    filter: none;
}

@keyframes handwriting {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.story-text::-webkit-scrollbar {
    width: 8px;
}

.story-text::-webkit-scrollbar-track {
    background: rgba(139, 0, 0, 0.2);
}

.story-text::-webkit-scrollbar-thumb {
    background: rgba(139, 0, 0, 0.6);
    border-radius: 4px;
}

#close-story-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 30;
}

/* Responsive */
@media (max-width: 768px) {
    .story-page {
        width: 95%;
        height: 95%;
        padding: 1.5rem;
    }
    
    .story-text {
        font-size: 1.2rem;
        line-height: 1.9;
        padding: 1.5rem;
    }
    
    .story-text p {
        font-size: 1.2rem;
        line-height: 1.9;
        color: #8B0000;
    }
}

@media (max-width: 480px) {
    .story-page {
        padding: 1rem;
    }
    
    .story-text {
        font-size: 1.1rem;
        line-height: 1.8;
        padding: 1rem;
    }
    
    .story-text p {
        text-indent: 1rem;
        margin-bottom: 1.5rem;
        font-size: 1.1rem;
        line-height: 1.8;
        color: #8B0000;
    }
}
