:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --text-color: #2C3E50;
    --bg-overlay: rgba(255, 255, 255, 0.85);
    --modal-bg: #fff;
}

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

body {
    font-family: 'Fredoka', sans-serif; /* Police arrondie pour enfants */
    overflow: hidden; /* Empêche le scroll sur la page principale */
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #e0f7fa;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(3px); /* Léger flou pour faire ressortir le contenu */
}

.main-menu {
    text-align: center;
    background-color: var(--bg-overlay);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    max-width: 90%;
    width: 400px;
    animation: popIn 0.5s ease-out;
}

.title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.menu-btn {
    background: linear-gradient(135deg, var(--secondary-color), #45b7af);
    border: none;
    border-radius: 50px;
    padding: 1.5rem;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 5px 0 #3a968f;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
}

.menu-btn:nth-child(2) {
    background: linear-gradient(135deg, var(--primary-color), #e05555);
    box-shadow: 0 5px 0 #c04040;
}

.menu-btn:nth-child(3) {
    background: linear-gradient(135deg, var(--accent-color), #e6cf50);
    box-shadow: 0 5px 0 #bfa530;
    color: var(--text-color);
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 rgba(0,0,0,0.2);
}

.menu-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

.icon {
    font-size: 2rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--modal-bg);
    padding: 30px;
    border-radius: 20px;
    position: relative;
    width: 90%;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 5px solid var(--secondary-color);
}

.close-btn {
    position: absolute;
    top: -20px;
    right: -20px;
    background-color: #ff4757;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal h2 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 2rem;
}

.media-placeholder {
    background-color: #f1f2f6;
    border: 3px dashed #ccc;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #7f8c8d;
    font-size: 1.2rem;
}

.audio-placeholder {
    height: 150px;
}

/* Memory Game Styles */
.memory-content {
    max-width: 500px;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.card {
    background-color: var(--secondary-color);
    aspect-ratio: 1;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    user-select: none;
}

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

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    font-size: 2rem;
}

.card-front {
    background-color: white;
    transform: rotateY(180deg);
    border: 2px solid var(--secondary-color);
}

.card-back {
    background-color: var(--secondary-color);
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,0.2) 10px,
        rgba(255,255,255,0.2) 20px
    );
}

.hidden {
    display: none;
}

#victory-message {
    margin-top: 20px;
    animation: bounce 1s infinite;
}

#victory-message h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.restart-btn {
    background-color: var(--accent-color);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
    font-family: inherit;
    font-weight: bold;
}

/* Animations */
@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .title {
        font-size: 2rem;
    }
    
    .menu-btn {
        padding: 1.2rem;
        font-size: 1.2rem;
    }

    .memory-grid {
        gap: 5px;
    }
}
