/* Story Mode Modal */
.story-mode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.story-mode-overlay:not(.hidden) {
    opacity: 1;
}

.story-mode-overlay.hidden {
    display: none;
}

/* Main Modal Container */
.story-mode-modal {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    max-height: 800px;
    background: linear-gradient(135deg, rgba(20, 15, 30, 0.98), rgba(35, 25, 45, 0.98));
    border: 3px solid rgba(255, 215, 0, 0.6);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 60px rgba(255, 215, 0, 0.4),
        0 0 100px rgba(255, 215, 0, 0.2),
        inset 0 0 50px rgba(255, 215, 0, 0.05);
    animation: storyModalIn 0.5s ease-out;
}

@keyframes storyModalIn {
    from {
        transform: scale(0.9) translateY(-30px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.story-modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 50%;
    color: #ffd700;
    font-size: 24px;
    cursor: url('../images/cursor.png') 16 16, pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.story-modal-close-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    transform: rotate(90deg);
}

/* Story Header */
.story-modal-header {
    padding: 30px 30px 20px 30px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 20px;
}

.story-element-icon-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 215, 0, 0.4);
}

.story-element-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
}

.story-header-text {
    flex: 1;
}

.story-chapter-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8em;
    color: #ffd700;
    margin: 0 0 5px 0;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.story-tier-badge {
    display: inline-block;
    padding: 5px 15px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 20px;
    font-family: 'Cinzel', serif;
    font-size: 0.9em;
    color: rgba(255, 215, 0, 0.9);
}

/* Story Tabs */
.story-tabs-container {
    padding: 20px 30px;
    background: linear-gradient(180deg, rgba(30, 20, 40, 0.6), transparent);
}

.story-tabs {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.story-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: rgba(40, 30, 50, 0.6);
    border: 2px solid rgba(100, 100, 120, 0.4);
    border-radius: 12px;
    cursor: url('../images/cursor.png') 16 16, pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.story-tab.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.story-tab.locked:hover {
    transform: none;
    border-color: rgba(100, 100, 120, 0.4);
}

.story-tab.unlocked:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 215, 0, 0.6);
    background: rgba(50, 40, 60, 0.8);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.story-tab.active {
    border-color: rgba(255, 215, 0, 0.8);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
}

.tier-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.1));
    border: 2px solid rgba(255, 215, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.tier-icon.locked-icon {
    background: rgba(100, 100, 120, 0.2);
    border-color: rgba(100, 100, 120, 0.4);
}

.tier-label {
    font-family: 'Cinzel', serif;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Story Content */
.story-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.story-content-title {
    font-family: 'Cinzel', serif;
    font-size: 2em;
    color: #ffd700;
    text-align: center;
    margin: 0 0 30px 0;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.story-content-text {
    font-family: Georgia, serif;
    font-size: 1.15em;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    text-align: justify;
    max-width: 900px;
    margin: 0 auto;
    text-indent: 2em;
}

/* Scrollbar */
.story-content::-webkit-scrollbar {
    width: 10px;
}

.story-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.story-content::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 5px;
}

.story-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.7);
}

/* Story Scroll Icons on Cards */
.story-scroll-icon {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    font-size: 20px;
    cursor: url('../images/cursor.png') 16 16, pointer;
    transition: all 0.3s ease;
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    z-index: 20;
    animation: scrollPulse 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 10, 30, 0.8);
    border-radius: 50%;
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.story-scroll-icon:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 1));
    border-color: rgba(255, 215, 0, 0.9);
}

@keyframes scrollPulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.9));
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .story-mode-modal {
        width: 95%;
        height: 90vh;
    }

    .story-modal-header {
        padding: 20px;
    }

    .story-element-icon-container {
        width: 60px;
        height: 60px;
    }

    .story-element-icon {
        width: 45px;
        height: 45px;
    }

    .story-chapter-title {
        font-size: 1.3em;
    }

    .story-tabs {
        gap: 8px;
        flex-wrap: wrap;
    }

    .story-tab {
        min-width: 80px;
        padding: 12px 15px;
    }

    .tier-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .tier-label {
        font-size: 0.75em;
    }

    .story-content {
        padding: 20px;
    }

    .story-content-title {
        font-size: 1.5em;
    }

    .story-content-text {
        font-size: 1em;
    }
}
