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

.container {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    gap: 10px; 
    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;
}
.container-items {
    display: flex;
    flex-wrap: wrap;
    padding: 10px;
    margin-bottom: 20px;
    min-height: 120px;
}

.grid {
    display: grid;
    margin: 0 auto;
    z-index: 900;
}

.cell {
    width: 60px;
    height: 60px;
    border: 1px solid #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cell.hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.cell.empty {
    background-color: transparent;
}

.cell.occupied {
    background-color: rgba(0, 0, 0, 0.2);
}

.placed-element {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.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);
}

.container_score {

    color: #fff;
    font-family: 'Arial', sans-serif;
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.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;
}

#btnReplay {
    background: #45a049;
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#btnReplay:hover {
    background: #4fce56;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

@media screen and (max-width: 768px) {

    .cell {
        width: 45px;
        height: 45px;
    }

    .placed-element {
        width: 35px;
        height: 35px;
    }

    .grid {
        transform: scale(0.75);
        transform-origin: center top;
    }
    .back-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        top: 10px;
        left: 10px;
    }
    .container-items {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: 10px;
    }
}
