/* --- СТИЛИ СПЕЦИАЛЬНО ДЛЯ ИГРЫ "ЗМЕЙКА" --- */

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 500px;
    padding: 1rem;
    animation: fadeInScale 0.8s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.game-header {
    width: 100%;
    max-width: 400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.score-display {
    font-size: 1.5rem;
    font-weight: 700;
}

.back-button {
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent-color-1);
    padding: 0.5rem;
    transition: color 0.2s;
}
.back-button:hover {
    color: var(--text-color);
}

#gameCanvas {
    background-color: #000;
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 1 / 1;
}

/* --- НОВЫЕ СТИЛИ ДЛЯ КРЕСТОВИНЫ --- */
.touch-controls {
    display: grid;
    grid-template-columns: repeat(3, 60px); /* 3 колонки по 60px */
    grid-template-rows: repeat(3, 60px); /* 3 ряда по 60px */
    gap: 4px; /* Отступ между кнопками */
    margin-top: 1.5rem;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.control-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    font-size: 1.5rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.control-btn:active {
    background: rgba(147, 51, 234, 0.2);
    transform: scale(0.95);
}

/* Расставляем кнопки по сетке 3x3 */
#btnUp { grid-column: 2; grid-row: 1; }
#btnLeft { grid-column: 1; grid-row: 2; }
#btnRight { grid-column: 3; grid-row: 2; }
#btnDown { grid-column: 2; grid-row: 3; }

/* На десктопе сенсорное управление не нужно */
@media (min-width: 1024px) {
    .touch-controls {
        display: none;
    }
}