body {
    margin: 0;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #faf8ef;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overscroll-behavior: none;
}

.container {
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 435px;
    touch-action: none;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    background: #bbada0;
    padding: 10px;
    border-radius: 5px;
    margin: 0 auto;
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    touch-action: none;
}

.cell {
    background: rgba(238, 228, 218, 0.35);
    border-radius: 3px;
    width: 100%;
    aspect-ratio: 1;
    touch-action: none;
}

.tile {
    position: absolute;
    width: calc((100% - 50px) / 4);  
    aspect-ratio: 1;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.15s ease-in-out;
    z-index: 1;
    touch-action: none;
    font-size: 24px;
    font-weight: bold;
    color: #776e65;
}

.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(238, 228, 218, 0.9);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.8s ease;
    touch-action: none;
}

.game-over-content {
    text-align: center;
    color: #776e65;
    touch-action: none;
}

.game-over-content h2 {
    font-size: 40px;
    margin-bottom: 20px;
}

.restart-button {
    padding: 10px 20px;
    font-size: 18px;
    background: #8f7a66;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s ease;
    touch-action: none;
}

.restart-button:hover {
    background: #7f6a56;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

h1 {
    font-size: 40px;
    margin-bottom: 20px;
    color: #776e65;
    touch-action: none;
}

.score {
    font-size: 24px;
    margin: 20px 0;
    color: #776e65;
    touch-action: none;
}