* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* Subtitle styles */
h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

/* Paragraph styles */
p {
    width:650px;
    font-size: 1rem;
    text-align: center;
    margin: 10px;
}
a{
    text-decoration: none;
    color: #edc22e;
}
body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f5f5f5; 
}


#grid-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(80px, 1fr)); 
    gap: 10px;
    margin: 20px auto;
    padding: 20px;
    background-color: #faf8ef; 
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.grid-item {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    width: 80px; 
    height: 80px; 
    border-radius: 8px;
    background-color: #cdc1b4; 
    transition: background-color 0.2s, transform 0.2s;
}

.grid-item[data-number="2"] { background-color: #eee4da; }
.grid-item[data-number="4"] { background-color: #ede0c8; }
.grid-item[data-number="8"] { background-color: #f2b179; }
.grid-item[data-number="16"] { background-color: #f59563; }
.grid-item[data-number="32"] { background-color: #f67c5f; }
.grid-item[data-number="64"] { background-color: #f65e3b; }
.grid-item[data-number="128"] { background-color: #edcf72; }
.grid-item[data-number="256"] { background-color: #edcc61; }
.grid-item[data-number="512"] { background-color: #edc850; }
.grid-item[data-number="1024"] { background-color: #edc53f; }
.grid-item[data-number="2048"] { background-color: #edc22e; }

#game-over-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: none;
}


@media (max-width: 768px) {
    .grid-item {
        font-size: 18px;
        width: 60px;
        height: 60px; 
    }
    p{
        width: auto;
    }
}
