html, body {
    margin: 0; padding: 0; width: 100%; height: 100%;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
    /* Базовые стили для тач-устройств */
    -webkit-tap-highlight-color: transparent;
}

/* Исключения для страниц где нужен скролл - welcome и guest страницы */
html.welcome-page,
body.welcome-page,
html.guest-page,
body.guest-page {
    overflow: auto !important;
    touch-action: pan-y !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -webkit-overflow-scrolling: touch !important;
    position: static !important;
    overscroll-behavior: auto !important;
}

/* Для game-page оставляем фиксированный layout без скролла */
html.game-page,
body.game-page {
    overflow: hidden;
    background-color: #000;
    color: white;
    touch-action: none;
    position: fixed;
    user-select: none;
    -webkit-user-select: none;
    -webkit-overflow-scrolling: auto;
}

/* Навигация на странице welcome должна работать корректно */
html.welcome-page .game-navbar,
body.welcome-page .game-navbar {
    touch-action: manipulation !important;
    pointer-events: auto !important;
}

html.welcome-page .navbar-burger,
body.welcome-page .navbar-burger {
    touch-action: manipulation !important;
    pointer-events: auto !important;
    cursor: pointer;
}

html.welcome-page .navbar-menu,
body.welcome-page .navbar-menu {
    touch-action: pan-y !important;
    pointer-events: auto !important;
}

/* Разрешаем скролл и тач для navbar на всех страницах */
.game-navbar,
.navbar-burger {
    touch-action: manipulation !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Для мобильного меню navbar - отключаем overflow-y auto чтобы меню было видно полностью */
@media (max-width: 768px) {
    .navbar-menu {
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        /* Отключаем скролл внутри меню - меню должно быть видно полностью */
        overflow-y: visible !important;
    }
}

/* Кастомизация скроллбара */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.6);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.8);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Для Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.6) rgba(30, 41, 59, 0.5);
}

/* Разрешаем скролл на стартовом экране */
html.start-screen-active,
body.start-screen-active {
    position: static;
    overflow: visible;
}

/* Стили для страницы welcome - удалено дублирование, теперь в начале файла */

html:not(.game-page) .game-wrapper,
body:not(.game-page) .game-wrapper {
    display: none;
}

html.start-screen-active .start-screen,
body.start-screen-active .start-screen {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

html.start-screen-active .game-wrapper,
body.start-screen-active .game-wrapper {
    display: none;
}

*, *::before, *::after {
    box-sizing: inherit;
}

.game-wrapper {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; z-index: 1;
}

.map-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center; justify-content: center;
    background-color: #000;
    box-shadow: 0 0 50px rgba(0,0,0,0.7);
}

/* Подсветка спрайта при наведении - без затемнения фона */
@media (hover: hover) and (pointer: fine) {
    .sprite:hover .sprite-img {
        filter: brightness(1.3) drop-shadow(0 0 20px rgba(255, 255, 255, 0.8));
    }
    
    .sprite:hover {
        z-index: 15;
    }
}

.map-content {
    position: relative;
    background-color: #1e293b;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    overflow: hidden;
    z-index: 1;
    transform-origin: center center;
    will-change: transform;
    transition: transform 0.1s linear;
}

.map-container:fullscreen, .map-container:-webkit-full-screen {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background-color: #000; border-radius: 0; overflow: hidden; box-shadow: none;
}

.map-container:fullscreen .map-content,
.map-container:-webkit-full-screen .map-content {
    background-size: contain; background-repeat: no-repeat; background-position: center;
}

.sprite {
    position: absolute; top: 0; left: 0; transform: translate(-50%, -50%);
    z-index: 10; cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: top 0.4s cubic-bezier(0.25, 1, 0.5, 1), left 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    /* Убедимся, что контейнер не ловит клики в пустых местах, если есть clip-path */
    pointer-events: auto; 
    /* Улучшаем поведение touch на iOS - отключаем задержку 300мс */
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

/* Дублирующее правило удалено - теперь только в блоке выше */

/* Класс для визуальной обратной связи при касании на iOS */
.sprite:active .sprite-img {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

/* Принудительно отключаем :hover на тач-устройствах чтобы избежать залипаний */
@media (hover: none) and (pointer: coarse) {
    .sprite:hover .sprite-img {
        transform: none;
        filter: none;
    }
}

.sprite-img {
    width: 100%; height: auto; display: block; pointer-events: none;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.3));
    transition: transform 0.2s, filter 0.2s;
}

.sprite.clicked .sprite-img {
    transform: scale(1.15); filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8)) brightness(1.3);
}
.sprite.completed .sprite-img {
    /* Убраны стили - теперь яркость и галочка управляются через JS */
}
.sprite.completed::after {
    /* Убрано - галочка теперь добавляется через JS как отдельный элемент */
}

.zone-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #22c55e;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    pointer-events: none;
    z-index: 20;
}

.ui-layer {
    position: absolute; inset: 0; pointer-events: none; z-index: 50;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    display: flex; flex-direction: column; justify-content: flex-start;
    opacity: 1; transition: opacity 0.3s ease;
    box-sizing: border-box;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* В fullscreen режиме увеличиваем z-index для ui-layer */
:fullscreen .ui-layer,
:-webkit-full-screen .ui-layer,
:-moz-full-screen .ui-layer,
:-ms-fullscreen .ui-layer {
    z-index: 100015 !important;
}

.ui-element { pointer-events: auto; }
.settings-btn, .close-btn, .action-btn, .quiz-close-btn, .quiz-skip-btn, .quiz-replay-btn, .quiz-answer-btn, .back-btn, .toggle-switch {
    /* Улучшаем поведение touch на iOS для всех интерактивных элементов - отключаем задержку 300мс */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    /* Отключаем стандартное выделение и зум по двойному тапу */
    user-select: none;
    -webkit-user-select: none;
}

/* Принудительно отключаем :hover эффекты на тач-устройствах чтобы избежать залипаний */
@media (hover: none) and (pointer: coarse) {
    .settings-btn:hover, .close-btn:hover, .action-btn:hover, .quiz-close-btn:hover, 
    .quiz-skip-btn:hover, .quiz-replay-btn:hover, .quiz-answer-btn:hover:not(:disabled), 
    .back-btn:hover {
        transform: none;
        background: inherit;
    }
}

/* Визуальная обратная связь при касании для кнопок */
.settings-btn:active, .close-btn:active, .action-btn:active, .quiz-close-btn:active, 
.quiz-skip-btn:active, .quiz-replay-btn:active, .quiz-answer-btn:active:not(:disabled), 
.back-btn:active {
    transform: scale(0.95);
}

.settings-btn {
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2); color: white;
    padding: 10px; border-radius: 50%; cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.settings-btn:hover { background: rgba(0, 0, 0, 0.8); transform: rotate(90deg); }

.side-menu-overlay {
    position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5);
    z-index: 1001; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.side-menu-overlay.open { opacity: 1; pointer-events: auto; }

.side-menu {
    position: absolute; top: 0; right: 0; bottom: 0; width: 33%;
    min-width: 280px; max-width: 400px; background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(15px); z-index: 1002; transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid rgba(255, 255, 255, 0.1); padding: 2rem;
    display: flex; flex-direction: column; gap: 1.5rem;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5); overflow-y: auto;
}
.side-menu.open { transform: translateX(0); }

/* Левое меню (для выбора уровней) */
.side-menu-left {
    left: 0; right: auto;
    border-left: none; border-right: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
}
.side-menu-left.open { transform: translateX(0); }
.menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-shrink: 0; }
.close-btn { background: transparent; border: none; color: #94a3b8; cursor: pointer; padding: 5px; }
.close-btn:hover { color: white; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; background: rgba(255, 255, 255, 0.05); padding: 1rem; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.05); }
.toggle-switch { position: relative; width: 48px; height: 26px; background-color: #334155; border-radius: 26px; cursor: pointer; transition: background-color 0.3s; }
.toggle-switch.active { background-color: #3b82f6; }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background-color: white; border-radius: 50%; transition: transform 0.3s; }
.toggle-switch.active .toggle-knob { transform: translateX(22px); }
.action-btn { width: 100%; padding: 1rem; border-radius: 12px; border: none; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; background: #3b82f6; color: white; }

/* Кнопка сброса прогресса */
.reset-btn { background: #ef4444; }
.reset-btn:hover { background: #dc2626; }

/* Стили для списка уровней */
.levels-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.level-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.level-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateX(5px);
}

.level-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 10px;
}

.level-info {
    flex: 1;
}

.level-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.level-status {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Убран :active чтобы не конфликтовал с общим правилом выше */

.rotate-message { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #0f172a; z-index: 99999; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
@media screen and (orientation: portrait) { body.game-page .rotate-message { display: flex; } }
.no-transition { transition: none !important; }

.quiz-overlay {
    position: fixed; inset: 0; z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}
.quiz-overlay.active { display: flex; opacity: 1; }

.quiz-bg-image {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.quiz-controls {
    position: absolute; top: 16px; left: 16px; right: 16px;
    z-index: 100010;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.quiz-close-btn {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    width: 48px; height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
    pointer-events: auto;
    flex-shrink: 0;
}
.quiz-close-btn:hover { background: rgba(0, 0, 0, 0.8); transform: scale(1.1); }
.quiz-close-btn.disabled { opacity: 0.4; pointer-events: none; cursor: not-allowed; }

.quiz-skip-btn {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0 18px; height: 48px;
    border-radius: 24px;
    cursor: pointer;
    display: none;
    align-items: center; justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 6px;
    transition: background 0.2s, transform 0.2s;
    pointer-events: auto;
    flex-shrink: 0;
    white-space: nowrap;
}
.quiz-skip-btn.visible { display: flex; }
.quiz-skip-btn:hover { background: rgba(0, 0, 0, 0.8); transform: scale(1.05); }
/* Убран :active чтобы не конфликтовал с общим правилом выше */

.quiz-replay-btn {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0 18px; height: 48px;
    border-radius: 24px;
    cursor: pointer;
    display: none;
    align-items: center; justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 6px;
    transition: background 0.2s, transform 0.2s;
    pointer-events: auto;
    flex-shrink: 0;
    white-space: nowrap;
}
.quiz-replay-btn.visible { display: flex; }
.quiz-replay-btn:hover { background: rgba(0, 0, 0, 0.8); transform: scale(1.05); }
/* Убран :active чтобы не конфликтовал с общим правилом выше */

.quiz-question-bar {
    position: absolute; bottom: 0; left: 0; right: 0;
    z-index: 100005;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    padding: 20px 20px 28px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}
.quiz-question-bar.visible { display: flex; }

.quiz-question-bar-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: white;
    max-width: 700px;
    line-height: 1.4;
}
@media (max-width: 768px) {
    .quiz-question-bar-text {
        font-size: 0.95rem;
    }
}

.quiz-audio-indicator {
    display: none;
    align-items: center; justify-content: center;
    gap: 8px; padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}
@media screen and (orientation: landscape) {
    .quiz-audio-indicator {
        display: flex;
    }
    .quiz-question-bar-text {
        display: none;
    }
    .quiz-question-bar.show-text-mobile .quiz-question-bar-text {
        display: block;
    }
}
@media screen and (orientation: portrait) {
    body.game-page .game-wrapper,
    body.game-page .map-container,
    body.game-page .ui-layer,
    body.game-page .quiz-overlay {
        display: none !important;
    }
}
.quiz-audio-indicator.playing {
    background: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    animation: pulse-audio 1.2s infinite;
}
.quiz-audio-indicator.ready {
    background: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

@keyframes pulse-audio {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.quiz-answers-overlay {
    position: absolute; inset: 0;
    z-index: 100006;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.quiz-answers-overlay.visible { display: flex; opacity: 1; }

.quiz-answers-question {
    font-size: 1.35rem;
    font-weight: 700;
    color: white;
    text-align: center;
    margin-bottom: 24px;
    max-width: 800px;
    line-height: 1.4;
}
@media (max-width: 768px) {
    .quiz-answers-question {
        font-size: 1.1rem;
    }
}

.quiz-answers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    max-width: 700px;
}
@media(min-width: 600px) {
    .quiz-answers-grid { grid-template-columns: 1fr 1fr; }
}

.quiz-answer-btn {
    padding: 1rem 1.2rem;
    border-radius: 14px;
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    transition: all 0.2s;
    pointer-events: auto;
}
.quiz-answer-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.35);
    transform: translateY(-2px);
}
.quiz-answer-btn:disabled { cursor: not-allowed; opacity: 0.55; }
.quiz-answer-btn.correct {
    background: rgba(34, 197, 94, 0.35) !important;
    border-color: #22c55e !important;
    animation: pulse-green 0.5s;
}
.quiz-answer-btn.wrong {
    background: rgba(239, 68, 68, 0.35) !important;
    border-color: #ef4444 !important;
    animation: shake 0.5s;
}

.quiz-feedback-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 100008;
    padding: 16px 20px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    display: none;
    backdrop-filter: blur(6px);
}
.quiz-feedback-bar.success {
    display: block;
    background: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}
.quiz-feedback-bar.error {
    display: block;
    background: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.back-btn {
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2); color: white;
    padding: 10px 20px; border-radius: 50px; cursor: pointer;
    font-weight: bold; display: flex; align-items: center; gap: 8px;
    transition: background 0.2s;
}
.back-btn:hover { background: rgba(0, 0, 0, 0.8); }

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
    position: relative;
    z-index: 100020;
}
.top-bar-left { 
    display: flex;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 100020;
}
#zoneTitle {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 100020;
}
.top-bar-right { 
    display: flex;
    align-items: center;
    position: relative;
    z-index: 100020;
}

@keyframes pulse-green { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* Стили для личного кабинета */
.profile-item {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}

.profile-item:hover {
    background: rgba(59, 130, 246, 0.25) !important;
    border-color: rgba(59, 130, 246, 0.6) !important;
}

/* Стили для общей статистики */
.game-stats {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.stats-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 0.75rem;
    text-align: center;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-label {
    font-size: 0.9rem;
    color: #cbd5e1;
}

.stats-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4ade80;
}

/* Стили для экрана загрузки */
.loading-screen {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    text-align: center;
}

.loading-progress {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Стили для стартового экрана */
.start-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    z-index: 999998;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.start-screen-active .start-screen {
    position: fixed;
    inset: 0;
    height: 100%;
    min-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.start-screen-content {
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 40px 20px 60px;
    margin: 0 auto;
    flex-shrink: 0;
}

.start-header {
    text-align: center;
}

.start-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    text-shadow: 0 0 30px rgba(251, 191, 36, 0.3);
}

.start-subtitle {
    font-size: 1.2rem;
    color: #94a3b8;
    max-width: 600px;
    line-height: 1.5;
}

.start-description {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
}

.start-description p {
    font-size: 1.1rem;
    color: #e2e8f0;
    margin-bottom: 16px;
    text-align: center;
}

.start-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.start-features li {
    font-size: 1rem;
    color: #cbd5e1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
}

.start-features li i {
    margin-right: 10px;
    color: #fbbf24;
    width: 20px;
    text-align: center;
}

/* Инструкция по управлению интерфейсом */
.start-controls-info {
    width: 100%;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    padding: 24px;
}

.start-controls-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fbbf24;
    text-align: center;
    margin-bottom: 20px;
}

.start-controls-title i {
    margin-right: 10px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.control-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    flex-shrink: 0;
}

.control-icon i {
    font-size: 1.5rem;
    color: #60a5fa;
}

.control-desc {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-desc strong {
    color: white;
    font-size: 1rem;
}

.control-desc span {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.4;
}

.start-levels {
    width: 100%;
}

.start-levels-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fbbf24;
    text-align: center;
    margin-bottom: 16px;
}

.start-levels-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.start-level-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-level-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.start-level-icon {
    font-size: 3rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 14px;
    flex-shrink: 0;
}

.start-level-info {
    flex: 1;
}

.start-level-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.start-level-status {
    font-size: 0.9rem;
    color: #94a3b8;
}

.continue-btn {
    width: 100%;
    max-width: 400px;
    padding: 18px 32px;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.5);
}

.continue-btn:active {
    transform: translateY(0);
}

/* Кнопка повтора аудио */
.replay-audio-btn {
    background: rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #60a5fa;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.replay-audio-btn:hover {
    background: rgba(59, 130, 246, 0.5);
    transform: scale(1.1);
}

.replay-audio-btn:active {
    transform: scale(0.95);
}

/* Принудительное отображение кнопок в fullscreen режиме */
:fullscreen .replay-audio-btn,
:-webkit-full-screen .replay-audio-btn,
:-moz-full-screen .replay-audio-btn,
:-ms-fullscreen .replay-audio-btn {
    display: flex !important;
    pointer-events: auto !important;
    z-index: 100020 !important;
    position: relative !important;
}

/* Особые стили для Android в fullscreen режиме */
:fullscreen #zoneTitle,
:-webkit-full-screen #zoneTitle,
:-moz-full-screen #zoneTitle,
:-ms-fullscreen #zoneTitle {
    z-index: 100020 !important;
    position: relative !important;
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px) !important;
}

@media (max-width: 768px) {
    .start-screen {
        align-items: flex-start;
        padding: 10px;
    }
    
    .start-screen-content {
        padding: 20px 10px 40px;
    }
    
    .start-title {
        font-size: 2rem;
    }
    
    .start-subtitle {
        font-size: 1rem;
    }
    
    .start-levels-list {
        grid-template-columns: 1fr;
    }
    
    .start-level-item {
        padding: 16px;
    }
    
    .start-level-icon {
        font-size: 2.5rem;
        width: 60px;
        height: 60px;
    }
}

@media screen and (orientation: portrait) {
    body.game-page .game-wrapper,
    body.game-page .map-container,
    body.game-page .ui-layer,
    body.game-page .quiz-overlay {
        display: none !important;
    }
    body.game-page .start-screen {
        display: flex !important;
    }
}

/* Стили для оверлея вступительного аудио */
.intro-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.05);
    z-index: 2147483647;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Принудительное отображение в fullscreen режиме */
:fullscreen .intro-overlay,
:-webkit-full-screen .intro-overlay,
:-moz-full-screen .intro-overlay,
:-ms-fullscreen .intro-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147483647 !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
}

:fullscreen .intro-content,
:-webkit-full-screen .intro-content,
:-moz-full-screen .intro-content,
:-ms-fullscreen .intro-content {
    pointer-events: auto !important;
    z-index: 2147483648 !important;
    position: relative !important;
}

/* Блокируем клики по всем элементам игры когда оверлей активен */
body.intro-audio-playing .game-wrapper,
body.intro-audio-playing .ui-layer,
body.intro-audio-playing .map-container {
    pointer-events: none !important;
}

/* Разрешаем клики по кнопкам повтора аудио и зоне заголовка даже во время intro-audio-playing */
body.intro-audio-playing .replay-audio-btn,
body.intro-audio-playing #zoneTitle,
body.intro-audio-playing .top-bar {
    pointer-events: auto !important;
}

.intro-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 20px 28px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    max-width: 90%;
    width: auto;
    pointer-events: auto;
}

.intro-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

.intro-text {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    text-align: left;
    margin: 0;
}

.skip-intro-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: rgba(59, 130, 246, 0.8);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

.skip-intro-btn:hover {
    background: rgba(59, 130, 246, 1);
    transform: scale(1.05);
}

.skip-intro-btn:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .intro-overlay {
        align-items: flex-end;
    }
    
    .intro-content {
        flex-direction: column;
        gap: 16px;
        padding: 16px 20px;
        margin-bottom: 16px;
        width: 90%;
    }
    
    .intro-spinner {
        width: 32px;
        height: 32px;
    }
    
    .intro-text {
        font-size: 0.9rem;
        text-align: center;
    }
    
    .skip-intro-btn {
        padding: 8px 18px;
        font-size: 0.9rem;
    }
}

/* Стили для меню уровней с навигацией */
.level-menu-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
}

.level-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.level-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.level-menu-item-logout {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.level-menu-item-logout:hover {
    background: rgba(239, 68, 68, 0.3);
}

.level-menu-form {
    margin: 0;
    padding: 0;
}

.level-menu-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

/* Кастомизация скроллбаров в тему сайта */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 5px;
    border: 2px solid rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

/* Скроллбар для меню и списков */
.side-menu::-webkit-scrollbar,
.levels-list::-webkit-scrollbar,
.start-levels-list::-webkit-scrollbar,
.start-screen::-webkit-scrollbar {
    width: 8px;
}

.side-menu::-webkit-scrollbar-track,
.levels-list::-webkit-scrollbar-track,
.start-levels-list::-webkit-scrollbar-track,
.start-screen::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.side-menu::-webkit-scrollbar-thumb,
.levels-list::-webkit-scrollbar-thumb,
.start-levels-list::-webkit-scrollbar-thumb,
.start-screen::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.6);
    border-radius: 4px;
}

.side-menu::-webkit-scrollbar-thumb:hover,
.levels-list::-webkit-scrollbar-thumb:hover,
.start-levels-list::-webkit-scrollbar-thumb:hover,
.start-screen::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.9);
}

/* Firefox скроллбары */
* {
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 rgba(15, 23, 42, 0.5);
}

.level-menu-subtitle {
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* Стили для иконок FontAwesome в кнопках */
.settings-btn i,
.close-btn i,
.action-btn i,
.quiz-close-btn i,
.quiz-skip-btn i,
.quiz-replay-btn i,
.replay-audio-btn i,
.level-menu-item i,
.start-level-icon i,
.control-icon i {
    font-size: inherit;
}

.settings-btn i {
    font-size: 1.2rem;
}

.close-btn i {
    font-size: 1.2rem;
}

.action-btn i {
    margin-right: 8px;
}

.quiz-close-btn i,
.quiz-skip-btn i,
.quiz-replay-btn i {
    margin-right: 6px;
}

.replay-audio-btn i {
    font-size: 1.1rem;
}

.level-menu-item i {
    width: 20px;
    text-align: center;
    color: #60a5fa;
}

.level-menu-item-logout i {
    color: #ef4444;
}

/* Firefox скроллбары */
.side-menu,
.levels-list,
.start-levels-list,
.start-screen {
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.6) rgba(255, 255, 255, 0.05);
}

/* Стили для PWA инструкции на iPhone */
.pwa-instruction {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 9999999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.pwa-instruction.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-instruction-content {
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 16px;
    padding: 24px;
    max-width: 380px;
    width: calc(100vw - 40px);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(59, 130, 246, 0.2);
    position: relative;
}

.pwa-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pwa-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.pwa-instruction h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fbbf24;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-instruction h3 i {
    font-size: 1.4rem;
}

.pwa-instruction > p {
    font-size: 0.95rem;
    color: #cbd5e1;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.pwa-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.pwa-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pwa-steps li:last-child {
    border-bottom: none;
}

.pwa-steps li i {
    color: #60a5fa;
    width: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.pwa-visual {
    text-align: center;
    padding: 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
}

.pwa-step-image {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 2rem;
    color: #fbbf24;
}

.pwa-step-image span {
    color: #60a5fa;
    font-size: 1.5rem;
}

@media (max-width: 480px) {
    .pwa-instruction-content {
        padding: 20px;
    }
    
    .pwa-instruction h3 {
        font-size: 1.1rem;
    }
    
    .pwa-steps li {
        font-size: 0.85rem;
    }
}

/* Navbar burger styles */
.navbar-burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000001;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.navbar-burger span {
    display: block;
    width: 100%;
    height: 3px;
    background: #fbbf24;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.navbar-burger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.navbar-burger.active span:nth-child(2) {
    opacity: 0;
}

.navbar-burger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 768px) {
    .navbar-burger {
        display: flex;
    }
}

@media (max-width: 768px) {
    .game-navbar {
        height: 60px;
    }
}

/* ============================================
   Navbar Styles - Единое верхнее меню
   ============================================ */
.game-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000000;
    display: flex;
    align-items: center;
    /* Важно для touch устройств */
    touch-action: manipulation !important;
    pointer-events: auto !important;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fbbf24;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.navbar-logo:hover {
    color: #f59e0b;
    transform: scale(1.05);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 768px) {
    .navbar-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: auto;
        max-height: calc(100vh - 60px);
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 20px;
        transform: translateX(100%);
        transition: transform 0.3s ease, opacity 0.3s ease;
        /* Отключаем скролл внутри меню - все пункты должны быть видны сразу */
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        z-index: 999999;
        /* Меню должно быть поверх всего контента */
        pointer-events: none;
        opacity: 0;
        /* Важно для touch устройств */
        touch-action: pan-y !important;
    }
    
    .navbar-menu.active {
        transform: translateX(0);
        pointer-events: auto;
        opacity: 1;
    }
}

.navbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.navbar-btn i {
    font-size: 1rem;
}

.navbar-btn-profile {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.navbar-btn-profile:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.navbar-btn-edit {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.navbar-btn-edit:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.navbar-btn-game {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.navbar-btn-game:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.navbar-btn-login {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
}

.navbar-btn-login:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.navbar-btn-register {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.navbar-btn-register:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.navbar-btn-logout {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.navbar-btn-logout:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.navbar-form {
    display: inline;
    margin: 0;
    padding: 0;
}

/* Navbar Burger Button */
.navbar-burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000001;
    /* Важно для touch устройств - бургер работает на тачскринах */
    touch-action: manipulation !important;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent;
}

.navbar-burger span {
    display: block;
    width: 100%;
    height: 3px;
    background: #fbbf24;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.navbar-burger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.navbar-burger.active span:nth-child(2) {
    opacity: 0;
}

.navbar-burger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Responsive Styles for Mobile */
@media (max-width: 768px) {
    .navbar-burger {
        display: flex;
    }

    .navbar-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }

    .navbar-logo {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .navbar-container {
        padding: 0 15px;
    }

    .navbar-logo {
        font-size: 1.2rem;
    }

    .navbar-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .navbar-btn i {
        font-size: 0.9rem;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .game-navbar {
        padding-top: max(0px, env(safe-area-inset-top));
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    .navbar-container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}

/* Исправление скролла для страниц login и register */
html.guest-page,
body.guest-page,
html.login-page,
body.login-page,
html.register-page,
body.register-page {
    position: static !important;
    overflow: auto !important;
    height: 100% !important;
    touch-action: pan-y pinch-zoom !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: auto !important;
}

html.guest-page .game-navbar,
body.guest-page .game-navbar,
html.login-page .game-navbar,
body.login-page .game-navbar,
html.register-page .game-navbar,
body.register-page .game-navbar {
    touch-action: manipulation !important;
    pointer-events: auto !important;
}

html.guest-page .navbar-burger,
body.guest-page .navbar-burger,
html.login-page .navbar-burger,
body.login-page .navbar-burger,
html.register-page .navbar-burger,
body.register-page .navbar-burger {
    touch-action: manipulation !important;
    pointer-events: auto !important;
    cursor: pointer;
    z-index: 1000001 !important;
}

html.guest-page .navbar-menu,
body.guest-page .navbar-menu,
html.login-page .navbar-menu,
body.login-page .navbar-menu,
html.register-page .navbar-menu,
body.register-page .navbar-menu {
    touch-action: pan-y !important;
    pointer-events: auto !important;
    z-index: 1000000 !important;
}
