* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.game-controls {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.difficulty-selector h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.difficulty-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.difficulty-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.difficulty-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.difficulty-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.new-game-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.new-game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
}

.game-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.puzzle-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-height: 400px;
}

.mosaic-pieces {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-height: 400px;
}

.puzzle {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s ease;
    position: relative;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.puzzle:hover {
    border-color: #007bff;
    background: #e3f2fd;
    transform: scale(1.02);
}

.puzzle.drag-over {
    border-color: #28a745;
    background: #d4edda;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
}

.puzzle.completed {
    border-color: #28a745;
    background: linear-gradient(45deg, #d4edda, #c3e6cb);
    color: #155724;
    transform: scale(1.02);
}

.puzzle .blank {
    display: inline-block;
    width: 60px;
    height: 60px;
    border: 3px solid #007bff;
    border-radius: 10px;
    margin: 0 10px;
    background: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: #007bff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.puzzle .blank.filled {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.puzzle .blank:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.mosaic-piece {
    display: inline-block;
    width: 80px;
    height: 80px;
    margin: 10px;
    border-radius: 15px;
    cursor: grab;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.mosaic-piece:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.mosaic-piece:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.mosaic-piece.used {
    opacity: 0.3;
    cursor: not-allowed;
    transform: scale(0.8);
}

.mosaic-piece.selected {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.6);
    border: 3px solid #007bff;
}

.puzzle.available {
    border-color: #007bff;
    background: #e3f2fd;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.game-info {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.game-info > div {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
}

.game-info span:first-child {
    color: #666;
}

.message {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.message.show {
    opacity: 1;
    transform: translateY(0);
}

.message.success {
    background: linear-gradient(45deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 2px solid #28a745;
}

.message.error {
    background: linear-gradient(45deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 2px solid #dc3545;
}

.message.complete {
    background: linear-gradient(45deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    border: 2px solid #17a2b8;
}

.instructions {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.instructions h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3rem;
}

.instructions ol {
    padding-left: 20px;
    line-height: 1.8;
    color: #666;
}

.instructions li {
    margin-bottom: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-area {
        grid-template-columns: 1fr;
    }
    
    .game-controls {
        flex-direction: column;
        text-align: center;
    }
    
    .difficulty-buttons {
        justify-content: center;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .puzzle {
        font-size: 1.2rem;
    }
    
    .puzzle .blank {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
    
    .mosaic-piece {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
}

/* Animation for mosaic pieces */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.mosaic-piece.bounce {
    animation: bounce 0.6s ease-in-out;
}

/* Success animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.puzzle.completed {
    animation: successPulse 0.5s ease-in-out;
} 