* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Запрещаем выделение текста и вызов контекстного меню */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    /* Запрещаем двойной тап для зума, но разрешаем обычные клики */
    touch-action: manipulation;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #111;
    /* Жестко закручиваем запрет на любые браузерные жесты */
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

canvas {
    display: block;
}
/* Контейнеры кнопок */
.touch-controls {
    position: absolute;
    bottom: 35px;
    display: flex;
    gap: 15px; /* Чуть уменьшили зазор между овалами */
    z-index: 10;
}

.left-controls {
    left: 35px;
}

.right-controls {
    right: 35px;
}

/* Базовый стиль для всех кнопок */
.touch-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    outline: none;
    touch-action: manipulation;
    cursor: pointer;
    position: relative;
}

/* 1. Делаем стрелки «Влево/Вправо» ОВАЛЬНЫМИ */
.left-controls .touch-btn {
    width: 95px;          /* Делаем заметно шире */
    height: 65px;         /* Оставляем комфортную высоту */
    border-radius: 35px;  /* Закругление дает форму овального пиллюльного блока */
}

/* 2. Кнопка «Прыжок» остается КРУГЛОЙ */
.jump-btn {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background: rgba(0, 255, 102, 0.25);
    border-color: rgba(0, 255, 102, 0.6);
}

/* Расширенная невидимая область нажатия (псевдоэлемент) */
.touch-btn::before {
    content: '';
    position: absolute;
    top: -12px;
    bottom: -12px;
    left: -12px;
    right: -12px;
    background: transparent;
}

/* Эффект нажатия */
.touch-btn:active {
    background: rgba(255, 255, 255, 0.5);
}

.jump-btn:active {
    background: rgba(0, 255, 102, 0.6);
}


/* Экран предупреждения */
#rotate-warning {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: white;
    z-index: 9999; /* Поверх всего */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: sans-serif;
    padding: 20px;
}

.phone-icon {
    font-size: 40px;
    margin-bottom: 15px;
    animation: rotateAnim 2s infinite ease-in-out;
}

@keyframes rotateAnim {
    0%,
    10% {
        transform: rotate(0deg);
    }
    50%,
    60% {
        transform: rotate(-90deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Автоматически показываем предупреждение, если высота экрана больше ширины */
@media screen and (orientation: portrait) {
    #rotate-warning {
        display: flex;
    }
}
