body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to the top */
    padding-top: 50px;
    min-height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
}

.main-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

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

.game-info {
    display: flex;
    justify-content: space-around;
    width: 100%;
    font-size: 1.5em;
    font-weight: bold;
}

#game-board {
    display: grid;
    border: 2px solid #333;
    background-color: #bfbfbf;
}

.game-board.locked {
    pointer-events: none;
    opacity: 0.7;
}

.cell {
    width: 64px;
    height: 64px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    /* Animation properties */
    transition: transform 0.3s ease-in-out;
    will-change: transform;
}

.cell.matched {
    animation: scale-down 0.3s ease-in-out forwards;
}

.cell.swapping {
    z-index: 10;
}

@keyframes scale-down {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
    }
}

#new-game-button {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 1.2em;
    border-radius: 5px;
    border: none;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
}

#new-game-button:hover {
    background-color: #45a049;
}

.ranking-container {
    width: 250px;
    padding: 20px;
    background-color: #e9e9e9;
    border-radius: 8px;
}

.ranking-container h2 {
    text-align: center;
    margin-bottom: 15px;
}

.ranking-container ol {
    padding-left: 20px;
}

.ranking-container li {
    margin-bottom: 5px;
    font-size: 1.1em;
}

.home-button {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.home-button:hover {
    background-color: #5a6268;
}
