* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f0;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    overflow: hidden;
}

.container {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 10px;
    width: 95%;
    height: 95vh;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 5px;
    padding-bottom: 5px;
    border-bottom: 2px solid rgba(21, 45, 64, 0.2);
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #D8521D;
}

h1 {
    color: #152D40;
    font-size: 1.5rem;
    font-weight: bold;
}

.info-container {
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
    color: #152D40;
    background-color: #f5f5f0;
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: bold;
    margin-top:25px;
}

.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    flex-shrink: 0;
}

.difficulty-btn {
    background-color: #152D40;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.0rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    margin-top:25px;
}

.difficulty-btn:hover {
    background-color: #D8521D;
}

.difficulty-btn.active {
    background-color: #D8521D;
}

.game-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

#game-board {
    display: grid;
    gap: 5px;
    width: 100%;
    height: 100%;
    align-content: center;
    justify-content: center;
}

/* Grid layouts for different difficulties */
.easy-grid {
    grid-template-columns: repeat(4, minmax(10px, 1fr));
    grid-template-rows: repeat(4, minmax(10px, 1fr));
    max-width: min(90vw, 90vh);
    max-height: min(90vw, 90vh);
}

.medium-grid {
    grid-template-columns: repeat(5, minmax(10px, 1fr));
    grid-template-rows: repeat(5, minmax(10px, 1fr));
    max-width: min(90vw, 90vh);
    max-height: min(90vw, 90vh);
}

.hard-grid {
    grid-template-columns: repeat(6, minmax(10px, 1fr));
    grid-template-rows: repeat(6, minmax(10px, 1fr));
    max-width: min(90vw, 90vh);
    max-height: min(90vw, 90vh);
}

.card {
    aspect-ratio: 1 / 1;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    height: 100%;
}

.card-front, .card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    transition: transform 0.6s;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card-front {
    background-color: #dbcab0;
    color: #3333333;
    transform: rotateY(0deg);
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-front::after {
    content: "?";
    font-weight: bold;
}

.card-back {
    background-color: white;
    transform: rotateY(180deg);
    border: 2px solid #D8521D;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
}

.card.flipped .card-front {
    transform: rotateY(180deg);
}

.card.flipped .card-back {
    transform: rotateY(0deg);
}

.card.matched {
    box-shadow: 0 0 10px #D8521D;
}

.card.matched .card-back {
    background-color: rgba(216, 82, 29, 0.1);
    border: 2px solid #D8521D;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    max-width: 90%;
    width: 320px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border: 2px solid #152D40;
}

.modal h2 {
    margin-bottom: 15px;
    color: #D8521D;
    font-size: 1.5rem;
}

.modal p {
    margin-bottom: 15px;
    font-size: 1rem;
    color: #152D40;
    line-height: 1.5;
}

.modal span {
    font-weight: bold;
    color: #152D40;
}

#play-again {
    background-color: #D8521D;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

#play-again:hover {
    background-color: #152D40;
}

/* Styles pour le footer de services */
.services-footer {

    margin-top: 25px;
    padding-top: 5px;
    border-top: 2px solid rgba(21, 45, 64, 0.2);
    text-align: center;
    flex-shrink: 0;
}

.services h3 {
    color: #152D40;
    margin-bottom: 5px;
    font-size: 1rem;
}

.services ul {
    list-style: none;
    padding: 0;
    margin-bottom: 5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.services li {
    background-color: #f5f5f0;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.7rem;
    color: #152D40;
    font-weight: bold;
}

.site-link {
    display: inline-block;
    background-color: #D8521D;
    color: white;
    text-decoration: none;
    padding: 5px 15px;
    border-radius: 30px;
    font-weight: bold;
    margin-bottom: 5px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    font-size: 0.8rem;
}

.site-link:hover {
    background-color: #152D40;
}

/* Responsive design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center;
        gap: 5px;
        margin-bottom: 5px;
    }
    
    .info-container {
        width: 100%;
        justify-content: space-around;
        padding: 5px;
        font-size: 0.8rem;
    }
    
    .easy-grid {
        grid-template-columns: repeat(4, minmax(10px, 1fr));
        grid-template-rows: repeat(4, minmax(10px, 1fr));
    }
    
    .medium-grid {
        grid-template-columns: repeat(4, minmax(10px, 1fr));
        grid-template-rows: repeat(6, minmax(10px, 1fr));
    }
    
    .hard-grid {
        grid-template-columns: repeat(5, minmax(10px, 1fr));
        grid-template-rows: repeat(8, minmax(10px, 1fr));
    }
    
    .card-front::after {
        font-size: 0.9rem;
    }
    
    .services h3 {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .services ul {
        gap: 3px;
        margin-bottom: 5px;
    }
    
    .services li {
        padding: 3px 8px;
        font-size: 0.5rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .container {
        padding: 8px;
        width: 98%;
        height: 98vh;
    }
    
    .logo {
        width: 30px;
        height: 30px;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    .info-container {
        font-size: 0.7rem;
        gap: 5px;
    }
    
    .difficulty-btn {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    
    .easy-grid {
        grid-template-columns: repeat(4, minmax(10px, 1fr));
        grid-template-rows: repeat(4, minmax(10px, 1fr));
    }
    
    .medium-grid {
        grid-template-columns: repeat(4, minmax(10px, 1fr));
        grid-template-rows: repeat(6, minmax(10px, 1fr));
    }
    
    .hard-grid {
        grid-template-columns: repeat(4, minmax(10px, 1fr));
        grid-template-rows: repeat(9, minmax(10px, 1fr));
    }
    
    .services ul {
        flex-direction: column;
        gap: 3px;
        align-items: center;
    }
    
    .services li {
        width: 90%;
        font-size: 0.3rem;
    }
    
    .site-link {
        padding: 4px 12px;
        font-size: 0.7rem;
    }
    
    .modal-content {
        padding: 15px;
        width: 280px;
    }
    
    .modal h2 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .modal p {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    #play-again {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}