* {
    -webkit-tap-highlight-color: transparent;
  }

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #2e2e2e;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 100%;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: #fff;
    font-family: 'Arial', sans-serif;
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    text-align: center;
}

.game-board {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.cell {
    width: 90px;
    height: 90px;
    background-color: white;
    margin: 14px;
    border-radius: 4px;
    text-align: center;
}



/*fleches*/
.arrow-container {
    display: grid;
    grid-template-columns: 40px 40px 40px;
    grid-template-rows: 40px 40px 40px;
    align-items: center;
    justify-items: center;
    margin-top: 10px;
}

.arrow {
    width: 40px;
    height: 40px;
    background-color: #444;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 10px;
    transition: 0.3s;
}

.arrow:hover {
    background-color: #666;
}

.arrow::before {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    border: solid white;
    border-width: 5px 5px 0 0;
}

.upA { transform: rotate(-45deg); }
.downA { transform: rotate(135deg); }
.leftA { transform: rotate(-135deg); }
.rightA { transform: rotate(45deg); }

@media screen and (max-width: 450px) {
    .arrow:hover {
        background-color: #444;
    }
    
}
/*fin fleches*/

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.popup-content {
    background: #1a1a1aea;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    margin: 20px;
    transform: translateY(0);
    animation: slideUp 0.4s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color:white;
}

.container-btn-flex {
    display: flex;
}

#restart-btn {
    display: block;
    margin: 20px auto;
    background: #4CAF50;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#restart-btn:hover {
    background: #4CAF50;
    transform: scale(1.05);
}

.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}
.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@media screen and (max-width: 450px) {
    .container{
        margin-top: 20px;
    }
    h1 {
        font-size: 2.5rem;
        margin-bottom: 0rem;
    }
    .cell {
        width: 50px;
        height: 50px;
        margin: 9px;
    }
    #restart-btn {
        font-size: 0.8rem;
    }
    .back-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        top: 10px;
        left: 10px;
    }
}