/* Tier Upgrade Modal Overlay */
.tier-upgrade-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: 10000;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.tier-upgrade-overlay:not(.hidden) {
    opacity: 1;
}

/* Main Modal Container */
.tier-upgrade-modal {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(20, 15, 35, 0.98), rgba(40, 25, 50, 0.98));
    border: 3px solid rgba(255, 215, 0, 0.7);
    border-radius: 20px;
    padding: 40px;
    box-shadow:
        0 0 50px rgba(255, 215, 0, 0.5),
        0 0 100px rgba(255, 215, 0, 0.3),
        inset 0 0 50px rgba(255, 215, 0, 0.1);
    animation: tierModalSlideIn 0.6s ease-out;
}

@keyframes tierModalSlideIn {
    from {
        transform: scale(0.8) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Background Story Image */
.tier-upgrade-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    pointer-events: none;
}

/* Particles Animation */
.tier-upgrade-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    border-radius: 20px;
}

.tier-upgrade-particles::before,
.tier-upgrade-particles::after {
    content: '';
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 215, 0, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    animation: particleFloat 4s ease-in-out infinite;
}

.tier-upgrade-particles::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.tier-upgrade-particles::after {
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.3;
    }
    50% {
        transform: translate(20px, -30px);
        opacity: 1;
    }
}

/* Header Section */
.tier-upgrade-header {
    position: relative;
    text-align: center;
    margin-bottom: 30px;
    z-index: 1;
}

.tier-upgrade-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 40px rgba(255, 215, 0, 1));
    }
}

.tier-upgrade-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5em;
    font-weight: bold;
    color: #ffd700;
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.4);
    margin: 0 0 10px 0;
    letter-spacing: 2px;
}

.tier-upgrade-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 1.3em;
    color: rgba(255, 215, 0, 0.9);
    margin-bottom: 10px;
}

.tier-upgrade-element-name {
    font-family: 'Cinzel', serif;
    font-size: 1.5em;
    color: #fff;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Tier Display */
.tier-upgrade-display {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    z-index: 1;
}

.tier-number-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tier-number-large {
    font-family: 'Cinzel', serif;
    font-size: 4em;
    font-weight: bold;
    color: #ffd700;
    text-shadow:
        0 0 30px rgba(255, 215, 0, 1),
        0 0 60px rgba(255, 215, 0, 0.5);
    line-height: 1;
}

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

.tier-arrow {
    font-size: 3em;
    color: #ffd700;
    animation: arrowPulse 1.5s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% {
        transform: translateX(0);
        opacity: 0.6;
    }
    50% {
        transform: translateX(10px);
        opacity: 1;
    }
}

.new-tier {
    animation: newTierGlow 2s ease-in-out infinite;
}

@keyframes newTierGlow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

/* Story Section */
.tier-upgrade-story {
    position: relative;
    background: linear-gradient(135deg, rgba(40, 30, 60, 0.6), rgba(30, 20, 50, 0.6));
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 25px;
    margin: 25px 0;
    z-index: 1;
}

.story-chapter {
    font-family: 'Cinzel', serif;
    font-size: 0.9em;
    color: rgba(255, 215, 0, 0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.story-text {
    font-family: Georgia, serif;
    font-size: 1.1em;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    text-align: justify;
    font-style: italic;
}

/* Stats Section */
.tier-upgrade-stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin: 25px 0;
    position: relative;
    z-index: 1;
}

.tier-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 12px;
    flex: 1;
}

.tier-stat-number {
    font-family: 'Cinzel', serif;
    font-size: 2.5em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    line-height: 1;
}

.tier-stat-label {
    font-family: 'Cinzel', serif;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

/* Continue Button */
.tier-upgrade-continue-btn {
    width: 100%;
    padding: 18px 40px;
    font-family: 'Cinzel', serif;
    font-size: 1.3em;
    font-weight: bold;
    color: #000;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border: 3px solid #ffed4e;
    border-radius: 12px;
    cursor: url('../images/cursor.png') 16 16, pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.5);
    position: relative;
    z-index: 1;
    margin-top: 20px;
}

.tier-upgrade-continue-btn:hover {
    background: linear-gradient(135deg, #ffed4e, #ffd700);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.7);
}

.tier-upgrade-continue-btn:active {
    transform: translateY(0);
}

/* Close Button */
.tier-upgrade-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: 1.8em;
    cursor: url('../images/cursor.png') 16 16, pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 2;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .tier-upgrade-modal {
        padding: 25px;
    }

    .tier-upgrade-title {
        font-size: 1.8em;
    }

    .tier-upgrade-subtitle {
        font-size: 1.1em;
    }

    .tier-number-large {
        font-size: 3em;
    }

    .tier-upgrade-stats {
        flex-direction: column;
    }

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