html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: fixed;
    font-family: Arial, sans-serif;
    background: url('/static/background.png') no-repeat center center fixed;
    background-size: cover;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.5); /* Полупрозрачный темный фон */
}

.header {
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.logo {
    font-size: 40px;
    font-weight: bold;
    color: #ffffff; /* Изменили цвет на белый для лучшей видимости */
}

.scoreBar {
    background: rgba(185, 185, 185, 0.376);
    padding: 10px 20px;
    border-radius: 3px;
    color: white;
}

#stage {
    background: rgba(185, 185, 185, 0.376); /* Увеличили прозрачность */
    border-radius: 6px;
    width: 100vmin;
    height: 100vmin;
    max-width: 500px;
    max-height: 500px;
    position: relative;
    touch-action: none;
    backdrop-filter: blur(5px);
}

/* Плитки */
span {
    display: flex;
    width: 23%;  /* Немного увеличили ширину */
    height: 23%; /* Немного увеличили высоту */
    position: absolute;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background-color: rgba(204, 192, 179, 0.9);
    border-radius: 3px;
    font-size: 35px;
    transition: all 0.15s ease;
}

/* Обновляем отступы для точного позиционирования */
.row0 { top: 1%; }
.row1 { top: 25.5%; }
.row2 { top: 50%; }
.row3 { top: 74.5%; }

.cell0 { left: 1%; }
.cell1 { left: 25.5%; }
.cell2 { left: 50%; }
.cell3 { left: 74.5%; }

/* Цвета плиток */
.num2 { background: #eee4da; color: #776e65; }
.num4 { background: #ede0c8; color: #776e65; }
.num8 { background: #f2b179; color: #f9f6f2; }
.num16 { background: #f59563; color: #f9f6f2; }
.num32 { background: #f67c5f; color: #f9f6f2; }
.num64 { background: #f65e3b; color: #f9f6f2; }
.num128 { background: #edcf72; color: #f9f6f2; font-size: 30px; }
.num256 { background: #edcc61; color: #f9f6f2; font-size: 30px; }
.num512 { background: #edc850; color: #f9f6f2; font-size: 30px; }
.num1024 { background: #edc53f; color: #f9f6f2; font-size: 25px; }
.num2048 { background: #edc22e; color: #f9f6f2; font-size: 25px; }

/* Анимация появления */
@keyframes appear {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 1; transform: scale(1); }
}

span.new {
    animation: appear 200ms ease;
}

/* Стили для кнопки выхода */
.exit-button {
    margin-top: 20px;
    padding: 10px 30px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    text-align: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.exit-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.exit-button:active {
    transform: scale(0.98);
    background-color: rgba(255, 255, 255, 0.25);
}

/* Добавим стили для мобильных устройств */
@media screen and (max-width: 520px) {
    .container {
        padding: 10px;
    }
    
    .logo {
        font-size: 30px;
    }
    
    span {
        font-size: 25px;
    }
    
    .num128, .num256, .num512 {
        font-size: 20px;
    }
    
    .num1024, .num2048 {
        font-size: 18px;
    }
    
    .exit-button {
        padding: 8px 20px;
        font-size: 16px;
    }
}