/* Fusion Chamber Styles */
.fusion-chamber-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
    justify-content: center;
}

.fusion-explanation {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.fusion-interface {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.fusion-slots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.fusion-slot-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.fusion-slot {
    width: 220px;
    height: 300px;
    border: 3px solid rgba(106, 76, 147, 0.6);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(106, 76, 147, 0.08), rgba(106, 76, 147, 0.15));
    box-shadow: 0 0 20px rgba(106, 76, 147, 0.2), inset 0 1px 3px rgba(106, 76, 147, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(2px);
}

.fusion-slot.empty {
    cursor: pointer;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(106, 76, 147, 0.3);
        border-color: #6a4c93;
    }
    50% {
        box-shadow: 0 0 30px rgba(106, 76, 147, 0.6);
        border-color: #8b6bb1;
    }
}

.fusion-slot.empty:hover {
    border-color: #8b6bb1;
    background-color: rgba(106, 76, 147, 0.2);
    box-shadow: 0 0 25px rgba(106, 76, 147, 0.5);
    transform: scale(1.02);
}

.fusion-slot:not(.empty) {
    border-style: solid;
    background-color: rgba(106, 76, 147, 0.2);
}

.fusion-slot-placeholder {
    color: #6a4c93;
    font-weight: bold;
    text-align: center;
    padding: 10px;
}

.fusion-plus,
.fusion-arrow {
    font-size: 48px;
    font-weight: bold;
    color: #6a4c93;
    text-shadow: 0 0 10px rgba(106, 76, 147, 0.6);
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.fusion-slot.result {
    border-color: #ff9e00;
    background-color: rgba(255, 158, 0, 0.1);
}

.fusion-slot.result:not(.empty) {
    border-style: solid;
    background-color: rgba(255, 158, 0, 0.2);
    box-shadow: 0 0 15px rgba(255, 158, 0, 0.5);
}

.fusion-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.fusion-btn,
.fusion-reset-btn,
.fusion-select-btn {
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fusion-btn {
    background-color: #6a4c93;
    color: white;
    border: none;
}


.fusion-reset-btn {
    background: linear-gradient(45deg, #dc3545, #e74c3c);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.fusion-reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
}

.fusion-select-btn {
    background: linear-gradient(45deg, #28a745, #34ce57);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.fusion-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

.fusion-message {
    min-height: 24px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.fusion-message.success {
    background-color: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
}

.fusion-message.error {
    background-color: rgba(244, 67, 54, 0.2);
    color: #c62828;
}

/* Card Selection Modal */
.fusion-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 15px;
}

.fusion-card-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.fusion-card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.fusion-card-image {
    width: 100%;
    height: auto;
    display: block;
}

.fusion-card-count {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.fusion-card-search {
    margin-bottom: 15px;
    width: 100%;
}

.fusion-card-search input {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 16px;
}

/* New Header Styles */
.fusion-header {
    text-align: center;
    margin-bottom: 30px;
}

.fusion-header h1 {
    color: #6a4c93;
    font-size: 2.5em;
    margin: 0;
    text-shadow: 0 0 20px rgba(106, 76, 147, 0.5);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(106, 76, 147, 0.5); }
    50% { text-shadow: 0 0 30px rgba(106, 76, 147, 0.8); }
}

.fusion-subtitle {
    color: #8b6bb1;
    font-size: 1.2em;
    margin: 10px 0 0 0;
}

/* Stats Bar */
.fusion-stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.fusion-stat {
    text-align: center;
    padding: 15px 20px;
    background: rgba(106, 76, 147, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(106, 76, 147, 0.3);
}

.fusion-stat-label {
    display: block;
    color: #6a4c93;
    font-weight: bold;
    margin-bottom: 5px;
}

.fusion-stat-value {
    display: block;
    color: #ff9e00;
    font-size: 1.5em;
    font-weight: bold;
}

/* Recipe Book */
.fusion-recipe-book {
    margin-top: 20px;
    text-align: center;
}

.recipe-book-btn {
    background: linear-gradient(45deg, #ff6b35, #ff9e00);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.recipe-book-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

/* Recipe Book Modal */
.recipe-book-modal {
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
}

.recipe-book-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #6a4c93;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: #6a4c93;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #6a4c93;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.recipes-grid, .achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.recipe-item, .achievement-item {
    background: rgba(106, 76, 147, 0.1);
    border: 2px solid rgba(106, 76, 147, 0.3);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.achievement-item.unlocked {
    background: rgba(255, 158, 0, 0.1);
    border-color: rgba(255, 158, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 158, 0, 0.3);
}

/* Card Filters */
.fusion-card-filters {
    margin-bottom: 15px;
}

.fusion-filter-select {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 2px solid #6a4c93;
    background: white;
    font-size: 16px;
    color: #6a4c93;
}

/* Particle Effects */
.fusion-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #6a4c93;
    border-radius: 50%;
    animation: particleFloat 3s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    50% {
        transform: translateY(-50px) scale(1.5);
        opacity: 1;
    }
}

/* Achievement Notification */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(45deg, #ff6b35, #ff9e00);
    color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.5);
    z-index: 1000;
    animation: achievementSlideIn 0.5s ease-out;
}

@keyframes achievementSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.achievement-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

.achievement-content h4 {
    margin: 0 0 5px 0;
    color: #ffe135;
}

.achievement-content p {
    margin: 5px 0;
}

.achievement-reward {
    font-weight: bold;
    color: #ffe135 !important;
}

/* Coin Reward Animation */
.coin-reward-animation {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: #ff9e00;
    font-weight: bold;
    font-size: 1.2em;
    animation: coinFloat 2s ease-out;
    pointer-events: none;
}

@keyframes coinFloat {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(-20px);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px);
    }
}

/* Responsive Design Improvements */
@media (max-width: 768px) {
    .fusion-chamber-layout {
        padding: 10px;
        gap: 15px;
    }
    
    .fusion-slot {
        width: 180px;
        height: 240px;
    }
    
    .fusion-stats-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .fusion-slots {
        flex-direction: column;
        gap: 20px;
    }
    
    .fusion-plus, .fusion-arrow {
        transform: rotate(90deg);
    }
    
    .recipe-book-modal {
        max-width: 95vw;
        max-height: 90vh;
    }
}

/* Animation for successful fusion */
@keyframes fusion-success-glow {
    0% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }

    100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
}

.fusion-success {
    animation: fusion-success-glow 1.5s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fusion-slots {
        flex-direction: column;
    }

    .fusion-plus,
    .fusion-arrow {
        transform: rotate(90deg);
    }

    .fusion-slot {
        width: 140px;
        height: 200px;
    }
}