/* Mola Puzzle Game Styles */
.mola-puzzle-container {
    background: linear-gradient(135deg, #FFF8E1, #FFE0B2);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border: 4px solid #FFD700;
    position: relative;
    overflow: hidden;
}

.mola-puzzle-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="mola-bg" x="0" y="0" width="30" height="30" patternUnits="userSpaceOnUse"><circle cx="15" cy="15" r="10" fill="rgba(196,30,58,0.05)"/><circle cx="15" cy="15" r="5" fill="rgba(255,107,53,0.08)"/></pattern></defs><rect width="100" height="100" fill="url(%23mola-bg)"/></svg>');
    opacity: 0.5;
    z-index: 0;
}

.puzzle-header {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 2rem;
}

.puzzle-title {
    font-size: 2rem;
    font-weight: 700;
    color: #C41E3A;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.puzzle-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.puzzle-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.difficulty-selector {
    display: flex;
    gap: 0.5rem;
}

.difficulty-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #FFD700;
    background: white;
    color: #333;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.difficulty-btn:hover {
    background: linear-gradient(135deg, #FFF8E1, #FFE0B2);
    transform: translateY(-2px);
}

.difficulty-btn.active {
    background: linear-gradient(135deg, #C41E3A, #FF6B35);
    color: white;
    border-color: #FFD700;
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.3);
}

.puzzle-reset-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.puzzle-reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.puzzle-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

/* Soggy Character */
.soggy-character {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.soggy-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #FFD700;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    object-fit: cover;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.soggy-bubble {
    background: white;
    border: 3px solid #FFD700;
    border-radius: 20px;
    padding: 1.5rem;
    max-width: 250px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.soggy-bubble::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: #FFD700;
}

.soggy-bubble p {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
    font-weight: 500;
}

/* Puzzle Area */
.puzzle-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.puzzle-board {
    display: grid;
    gap: 2px;
    background: #8B4513;
    padding: 8px;
    border-radius: 12px;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 4px solid #654321;
    position: relative;
}

/* Wood texture effect */
.puzzle-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="wood" x="0" y="0" width="10" height="10" patternUnits="userSpaceOnUse"><line x1="0" y1="5" x2="10" y2="5" stroke="rgba(0,0,0,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23wood)"/></svg>');
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

.puzzle-slot {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.puzzle-slot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px dashed #ccc;
    border-radius: 4px;
    pointer-events: none;
}

.pieces-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #FFF8E1, #FFE0B2);
    border-radius: 12px;
    border: 3px solid #FFB300;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-height: 100px;
}

.puzzle-piece {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 2px solid #FFD700;
    position: relative;
}

.puzzle-piece:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.puzzle-piece.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.puzzle-piece:active {
    cursor: grabbing;
}

/* Victory Modal */
.victory-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.victory-modal[hidden] {
    display: none !important;
}

.victory-content {
    background: linear-gradient(135deg, #FFF8E1, #FFE0B2);
    border-radius: 24px;
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 4px solid #FFD54F;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.victory-soggy {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #FFD54F;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.victory-title {
    color: #C41E3A;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.victory-message {
    color: #666;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.cultural-explanation {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid #FFD700;
}

.cultural-explanation h3 {
    color: #C41E3A;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.cultural-explanation p {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.victory-reward {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #28A745, #20C997);
    border-radius: 12px;
    color: white;
}

.reward-icon {
    font-size: 2rem;
}

.reward-count {
    font-size: 1.5rem;
    font-weight: 700;
}

.reward-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.victory-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.victory-btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.victory-btn.primary {
    background: linear-gradient(135deg, #28A745, #20C997);
    color: white;
}

.victory-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

.victory-btn.secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.victory-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .puzzle-content {
        grid-template-columns: 1fr;
    }

    .soggy-character {
        flex-direction: row;
        justify-content: center;
    }

    .soggy-img {
        width: 80px;
        height: 80px;
    }

    .soggy-bubble {
        max-width: 200px;
        padding: 1rem;
    }

    .puzzle-piece {
        width: 60px;
        height: 60px;
    }

    .victory-content {
        padding: 2rem;
        max-width: 90%;
    }

    .victory-actions {
        flex-direction: column;
    }

    .victory-btn {
        width: 100%;
    }
}
