/* Version: 20241224190323 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f2f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    text-align: center;
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    transition: background-image 0.5s ease-in-out;
}

h1 {
    color: #2c3e50;
    margin-bottom: 2rem;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #34495e;
}

.game-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 20px auto;
    max-width: 500px;
}

.card {
    width: 120px;
    height: 160px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transform: scale(1);
    transition: transform 0.5s;
    margin: auto;
}

.front,
.back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.front {
    background-color: #3498db;
}

.back {
    background-color: white;
    transform: rotateY(180deg);
    background-size: cover;
    background-position: center;
    border: 3px solid #3498db;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card.matched {
    transform: rotateY(180deg);
}

.card.matched .back {
    border-color: #2ecc71;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.5);
}

.card:not(.matched):hover {
    transform: scale(1.05);
}

.card.flipped:not(.matched):hover {
    transform: scale(1.05) rotateY(180deg);
}

.restart-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.restart-btn:hover {
    background-color: #2980b9;
}

/* زر التحكم في الموسيقى */
.music-btn {
    display: block;
    margin: 5px auto;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.music-btn:hover {
    background-color: #45a049;
}

.music-btn.muted {
    background-color: #f44336;
}

.contact-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4a90e2;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-right: 10px;
    transition: background-color 0.3s;
}

.contact-link:hover {
    background-color: #357abd;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-info, .game-controls, .memory-game {
    transition: opacity 0.5s ease-in-out;
}

.game-info {
    margin: 15px 0;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.character-selection {
    text-align: center;
    margin-bottom: 2rem;
}

.character-selection h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.character-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 150px 5px 150px 5px!important;
}

.character-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.character-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.character-btn.active {
    background-color: #2ecc71;
}

.change-character-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.change-character-btn:hover {
    background-color: #c0392b;
}

@keyframes celebrate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.celebration-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #3498db;
    animation: confetti 1s ease-out forwards;
}

.win-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    text-align: center;
    display: none;
    z-index: 1001;
}

.win-message.show {
    display: block;
    animation: celebrate 0.5s ease-out;
}
