* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================ */
/* HAPTIC SYSTEM STYLES (из haptic-king.html) */
/* ============================================================ */

#__hapticSwitch {
    position: fixed;
    top: 0;
    left: 0;
    width: 54px;
    height: 32px;
    opacity: 0.01;
    z-index: 0;
    -webkit-appearance: switch;
    appearance: auto;
    background: transparent;
    border: none;
    pointer-events: none;
}

.overlay-switch {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0.01;
    z-index: 2;
    -webkit-appearance: switch;
    appearance: auto;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer;
    touch-action: manipulation;
    color-scheme: light;
}

button,
.direction-btn,
.compass-center {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Специальное скрытие overlay для компаса чтобы не было видно */
.compass-center .overlay-switch {
    opacity: 0 !important;
    transform: scale(0.01) !important;
    width: 1px !important;
    height: 1px !important;
}

/* ============================================================ */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e8ba3 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Анимация волн на фоне */
body::before {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(transparent, rgba(30, 60, 114, 0.5));
    pointer-events: none;
    z-index: 1;
}

/* Экраны */
.screen {
    display: none;
    min-height: 100vh;
    padding: 0 20px; /* Убираем отступ сверху/снизу полностью */
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Прижимаем к верху, не центрируем */
    align-items: center;
}

/* Главное меню по центру */
#mainMenu.screen.active {
    justify-content: center; /* Меню остается по центру */
}

/* Экран окончания игры по центру */
#gameOverScreen.screen.active,
#achievementsScreen.screen.active,
#infoScreen.screen.active {
    justify-content: center; /* Центрируем окна сообщений */
}

/* Игровой экран без отступов сверху */
#gameScreen.screen {
    padding: 2px 10px; /* Минимальный отступ 2px сверху */
}

#gameScreen .game-header {
    margin-top: 0; /* Убираем любой margin сверху */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Главное меню */
.title-container {
    text-align: center;
    margin-bottom: 50px;
    animation: floatTitle 3s ease-in-out infinite;
}

@keyframes floatTitle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.game-title {
    font-size: 3em;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8),
                 0 0 40px rgba(255, 215, 0, 0.6),
                 3px 3px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.subtitle {
    font-size: 1.2em;
    color: #ffd700;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    font-style: italic;
    white-space: nowrap;
}

/* Контейнер для ввода имени игрока */
.player-name-container {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 30px;
    justify-content: center;
    width: 200px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.player-name-input {
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    border: 2px solid #fff;
    border-radius: 8px;
    padding: 9px 2px;
    font-size: 0.95em;
    font-weight: 500;
    flex: 1;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    outline: none;
}

.player-name-input:focus {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 3px 15px rgba(74, 144, 226, 0.4);
    border-color: #4a90e2;
}

.player-name-input.inactive {
    background: rgba(200, 200, 200, 0.7);
    color: #666;
    cursor: pointer;
}

/* Полоса прогресса при проверке логин-ключа */
.login-progress-bar {
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        #7ba3d0 0%, 
        #9bbde0 25%, 
        #a8c8e6 50%, 
        #9bbde0 75%, 
        #7ba3d0 100%);
    background-size: 200% 100%;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

.login-progress-fill {
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        #5a8bc0 0px,
        #5a8bc0 10px,
        #7ba3d0 10px,
        #7ba3d0 20px,
        #9bbde0 20px,
        #9bbde0 30px
    );
    background-size: 30px 100%;
    animation: loginProgressSlide 1s linear infinite;
    width: 100%;
}

@keyframes loginProgressSlide {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 30px 0;
    }
}


.player-name-input::placeholder {
    color: rgba(44, 62, 80, 0.5);
}

.confirm-name-btn {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: 2px solid #fff;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.confirm-name-btn:hover {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
    transform: translateY(-2px);
}

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

/* Информация о последнем победителе */
.last-winner-container {
    width: 100%;
    max-width: 500px;
    margin-bottom: 30px;
    display: none;
}

.winner-info {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.15) 100%);
    border: 3px solid rgba(255, 215, 0, 0.5);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3), 
                inset 0 2px 10px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: winnerGlow 2s ease-in-out infinite;
}

@keyframes winnerGlow {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3), 
                    inset 0 2px 10px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 0 8px 35px rgba(255, 215, 0, 0.5), 
                    inset 0 2px 10px rgba(255, 255, 255, 0.2);
    }
}

.winner-icon {
    font-size: 3em;
    margin-bottom: 10px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.winner-text {
    font-size: 0.80em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8),
                 0 0 10px rgba(255, 215, 0, 0.5);
    margin-bottom: 8px;
    line-height: 1.3;
}

.winner-time {
    font-size: 1em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    margin-bottom: 10px;
}

.winner-score {
    font-size: 1.2em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    margin-top: 10px;
}

/* Модальное окно победителя */
.winner-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

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

.winner-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.winner-modal-content {
    position: relative;
    z-index: 10001;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.winner-modal-content .winner-info {
    position: relative;
    min-width: 350px;
    max-width: 500px;
}

/* Модальное окно повышения уровня */
.levelup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
    --levelup-accent1: #4facfe;
    --levelup-accent2: #00f2fe;
}

.levelup-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(10px);
}

.levelup-fireworks {
    position: absolute;
    inset: 0;
    z-index: 10001;
    pointer-events: none;
}

.levelup-modal-content {
    position: relative;
    z-index: 10002;
    animation: slideIn 0.4s ease-out;
}

.levelup-card {
    position: relative;
    min-width: 320px;
    max-width: 520px;
    padding: 22px 18px 20px;
    border-radius: 18px;
    border: 2px solid transparent;
    background:
        linear-gradient(135deg, rgba(0, 0, 0, 0.80), rgba(0, 0, 0, 0.55)) padding-box,
        linear-gradient(135deg, var(--levelup-accent1), var(--levelup-accent2)) border-box;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    text-align: center;
    color: #fff;
}

.levelup-icon {
    font-size: 3.1em;
    margin-bottom: 6px;
}

.levelup-title {
    font-size: 1.25em;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.levelup-level {
    font-size: 1.6em;
    font-weight: 900;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.levelup-close-btn {
    background: linear-gradient(135deg, var(--levelup-accent1) 0%, var(--levelup-accent2) 100%);
}

.levelup-close-btn:hover {
    background: linear-gradient(135deg, var(--levelup-accent2) 0%, var(--levelup-accent1) 100%);
}

.winner-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.winner-close-btn:hover {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.6);
}

.winner-close-btn:active {
    transform: scale(0.95);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.menu-btn {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border: 3px solid #fff;
    border-radius: 15px;
    padding: 18px 40px;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Play button loading overlay */
#playBtn {
    position: relative;
}

.play-loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px; /* увеличено на ~15% */
    height: 32px; /* увеличено на ~15% */
    border-radius: 50%;
    background: rgba(200,200,200,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.play-loading-overlay .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(120,130,140,0.9);
    box-shadow: -12px 0 0 rgba(150,160,170,0.7), 12px 0 0 rgba(150,160,170,0.7);
    animation: playSpinner 0.9s linear infinite;
}

@keyframes playSpinner {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.7); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

/* Скрывать текст кнопки при состоянии загрузки */
.menu-btn.loading {
    color: transparent !important;
    text-shadow: none !important;
}

.menu-btn:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #5ba3ff 0%, #4a90e2 100%);
}

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

.menu-btn.danger-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-color: #fff;
    font-size: 1em;
    min-width: auto;
}

.menu-btn.danger-btn:hover {
    background: linear-gradient(135deg, #ff6b5a 0%, #e74c3c 100%);
    box-shadow: 0 10px 25px rgba(231, 76, 60, 0.4);
}

.credits {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    text-align: center;
    margin-top: 30px;
}

/* Экран игры */
#gameScreen {
    justify-content: flex-start;
    padding: 15px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px;
    background: transparent; /* Полностью прозрачный фон */
    padding: 5px 8px;
    border-radius: 10px;
    margin-bottom: 8px;
    width: 100%;
    max-width: 800px;
    box-shadow: none; /* Убрали тень */
    position: relative;
    z-index: 10;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
}

.stat-label {
    color: #ffd700;
    font-weight: bold;
    font-size: 1em;
}

.stat-value {
    color: #fff;
    font-size: 1.2em;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.game-area {
    flex: 1;
    width: 100%;
    max-width: 800px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px; /* Увеличено на 15%: было 5px */
}

/* Параллакс-фон (новый игровой слой) */
.parallax-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.parallax-view {
    width: 100%;
    height: 100%;
    /* background-image устанавливается через JavaScript */
    background-size: 600% auto; /* 6x масштаб - каждая четверть (25% изображения) = 150% экрана */
    background-position: 0% center;
    background-repeat: no-repeat;
    transition: background-position 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    opacity: 0;
    /* filter: blur(1px); Легкий blur эффект */
    animation: breathingZoom 10s ease-in-out infinite;
}

/* Увеличенная пульсация для uw1.jpg */
.parallax-view.uw1-zoom {
    animation: breathingZoomUw1 10s ease-in-out infinite;
}

@keyframes breathingZoom {
    0%, 100% {
        transform: scale(1.0);
    }
    50% {
        transform: scale(1.08);
    }
}

@keyframes breathingZoomUw1 {
    0%, 100% {
        transform: scale(1.04);
    }
    50% {
        transform: scale(1.12);
    }
}

#gameScreen.active .parallax-view {
    opacity: 1;
    transition: opacity 0.5s ease, background-position 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.castle-icon {
    position: absolute;
    font-size: 8em;
    right: 5%;
    top: 50%;
    transform: translate(0, -50%) scale(0);
    transition: all 0.5s ease-out;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
}

#gameScreen.active .castle-icon {
    opacity: 0;
    transform: translate(0, -50%) scale(0);
    transition: all 0.5s ease-out;
}

.castle-icon.visible {
    opacity: 1 !important;
    transform: translate(0, -50%) scale(1) !important;
}

/* Сцена с персонажем */
.scene-container {
    position: relative;
    width: 100%;
    height: 225px; /* Уменьшено на 10% (было 250px) */
    background: linear-gradient(to bottom, #87ceeb 0%, #4a90e2 50%, #2a5298 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: none; /* Скрыли старую сцену, используем параллакс */
    z-index: 5;
}

.ocean-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 80px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.2));
    animation: wave 4s linear infinite;
}

@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Прогресс-путь */
.progress-path-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 140px;
    background: transparent; /* Убрали фон для лучшего обзора */
    border-radius: 15px;
    padding: 10px;
    box-shadow: none; /* Убрали тень */
    margin-bottom: 15px;
    overflow: visible;
    z-index: 10;
}

.progress-path {
    width: 100%;
    height: 100%;
}

#pathProgress {
    transition: stroke-dashoffset 0.8s ease-out;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
}

.path-character {
    position: absolute;
    font-size: 2.5em;
    transition: all 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5));
    z-index: 1; /* Проходит за кнопками компаса */
    pointer-events: none;
    animation: characterFloat 2s ease-in-out infinite;
}

@keyframes characterFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}


.character {
    position: absolute;
    font-size: 3.5em;
    left: 20%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: bob 2s ease-in-out infinite;
    transition: all 0.5s ease;
    z-index: 10;
}

@keyframes bob {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50% { transform: translate(-50%, -50%) translateY(-10px); }
}

.character.horse {
    font-size: 2.8em;
}

.destination {
    position: absolute;
    right: 10%;
    top: 30%;
    font-size: 3.5em;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Информация о последнем победителе */
.last-winner-info {
    position: absolute;
    top: 135px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 500px;
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    text-align: center;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    z-index: 8;
    pointer-events: none;
    white-space: normal;
    word-wrap: break-word;
    transition: opacity 0.5s ease-in-out, width 0.5s ease-in-out, padding 0.5s ease-in-out;
}

.last-winner-info:empty {
    display: none;
}

/* Погодные эффекты */
.weather-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.weather-effect.storm::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    animation: lightning 3s infinite;
}

@keyframes lightning {
    0%, 90%, 100% { opacity: 0; }
    91%, 93%, 95% { opacity: 1; }
}

.weather-effect.fog::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(200, 200, 200, 0.6);
    animation: fogMove 5s ease-in-out infinite;
}

@keyframes fogMove {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* Компас */
.compass-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.compass {
    position: relative;
    width: 200px; /* Уменьшили с 280px для лучшего обзора */
    height: 200px;
    background: radial-gradient(circle, rgba(42, 42, 42, 0.4) 0%, rgba(26, 26, 26, 0.3) 100%); /* Полупрозрачный */
    border-radius: 50%;
    border: 6px solid rgba(255, 215, 0, 0.5); /* Полупрозрачная рамка */
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3),
                inset 0 0 20px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.35s ease, width 0.35s ease, height 0.35s ease;
    z-index: 15;
    pointer-events: none; /* Клики проходят сквозь круг компаса к кнопкам */
    margin-top: 227px; /* Сдвиг вниз */
}

.compass.locked {
    width: 240px; /* 200px * 1.2 */
    height: 240px;
    pointer-events: none;
    max-width: 85vw;
    max-height: 85vw;
}

.compass.locked-correct {
    width: 240px; /* 200px * 1.2 */
    height: 240px;
    pointer-events: none;
    max-width: 85vw;
    max-height: 85vw;
}

.compass.locked-wrong {
    width: 240px; /* 200px * 1.2 */
    height: 240px;
    animation: steeringWheel 0.525s ease;
    pointer-events: none;
    max-width: 85vw;
    max-height: 85vw;
}

@keyframes steeringWheel {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
    75% { transform: rotate(-10deg); }
    100% { transform: rotate(0deg); }
}

.compass.locked .direction-btn,
.compass.locked-correct .direction-btn,
.compass.locked-wrong .direction-btn {
    pointer-events: none;
    opacity: 0.6;
}

.compass-rose {
    position: absolute;
    width: 60%;
    height: 60%;
    background: 
        linear-gradient(45deg, transparent 40%, #ffd700 40%, #ffd700 60%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, #ffd700 40%, #ffd700 60%, transparent 60%);
    opacity: 0.3;
    pointer-events: none;
}

/* Центральная кнопка компаса */
.compass-center {
    position: absolute;
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.5) 0%, rgba(255, 165, 0, 0.4) 100%);
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 15px rgba(255, 215, 0, 0.3),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    z-index: 20;
    user-select: none;
    pointer-events: auto; /* Восстанавливаем события для центральной кнопки */
}

.compass-center:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.5),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
}

.compass-center:active {
    transform: scale(0.95);
}

.compass-center-content {
    font-size: 2.5em;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.compass-arrow {
    position: absolute;
    width: 50px;
    height: 50px;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.1s ease;
    pointer-events: none;
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.5));
}

/* Состояния компаса */
.compass-center.ready .compass-center-content {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

.compass-center.ready .compass-arrow {
    opacity: 1;
    animation: arrowShimmer 2s ease-in-out infinite;
}

.compass-center.ready {
    animation: readyPulse 2s ease-in-out infinite;
}

@keyframes readyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes arrowShimmer {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5)); }
    50% { filter: drop-shadow(0 0 15px rgba(255, 215, 0, 1)); }
}

.compass-center.spinning {
    pointer-events: none;
    animation: compassSpinGrow 0.85s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.compass-center.spinning .compass-center-content {
    opacity: 0;
}

.compass-center.spinning .compass-arrow {
    opacity: 1;
    /* Вращение теперь управляется через JavaScript */
}

@keyframes compassSpinGrow {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.3);
    }
    50% { 
        transform: scale(1.15);
        box-shadow: 0 0 40px rgba(255, 100, 0, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.5);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.3);
    }
}

.compass-center.result-correct {
    background: radial-gradient(circle, rgba(76, 175, 80, 0.9) 0%, rgba(46, 125, 50, 0.7) 100%);
    animation: compassPulse 0.5s ease;
}

.compass-center.result-wrong {
    background: radial-gradient(circle, rgba(244, 67, 54, 0.9) 0%, rgba(198, 40, 40, 0.7) 100%);
    animation: compassShake 0.5s ease;
}

@keyframes compassPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes compassShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.direction-btn {
    position: absolute;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.5) 0%, rgba(21, 101, 192, 0.5) 100%); /* Полупрозрачный фон */
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.6); /* Полупрозрачная рамка */
    border-radius: 50%;
    padding: 18px;
    font-size: 1.8em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 2px 5px rgba(255, 255, 255, 0.2),
        inset 0 -2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px; /* Размер кнопок остается большим */
    height: 80px;
    backdrop-filter: blur(3px);
    z-index: 25; /* Выше центральной кнопки компаса */
    pointer-events: auto; /* Восстанавливаем события для кнопок направления */
    /* Явно сбрасываем transform-подобные свойства */
    transform: none;
    scale: 1;
    rotate: 0deg;
    translate: 0 0;
}

/* Морская тема (по умолчанию) */
.compass:not(.horse-mode) .direction-btn {
    background: linear-gradient(135deg, rgba(2, 136, 209, 0.5) 0%, rgba(1, 87, 155, 0.5) 100%); /* Полупрозрачный */
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 
        0 4px 15px rgba(1, 87, 155, 0.3),
        inset 0 2px 5px rgba(135, 206, 250, 0.3),
        inset 0 -2px 5px rgba(0, 0, 0, 0.2);
}

/* Сухопутная тема (на коне) */
.compass.horse-mode .direction-btn {
    background: linear-gradient(135deg, #795548 0%, #4E342E 100%);
    border-color: rgba(255, 235, 205, 0.9);
    box-shadow: 
        0 4px 15px rgba(78, 52, 46, 0.5),
        inset 0 2px 5px rgba(205, 164, 133, 0.4),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3);
}

.direction-btn:hover {
    scale: 1.1;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.4);
}

.compass:not(.horse-mode) .direction-btn:hover {
    background: linear-gradient(135deg, #03A9F4 0%, #0288D1 100%);
    box-shadow: 
        0 6px 20px rgba(3, 169, 244, 0.6),
        inset 0 2px 5px rgba(135, 206, 250, 0.5);
}

.compass.horse-mode .direction-btn:hover {
    background: linear-gradient(135deg, #8D6E63 0%, #5D4037 100%);
    box-shadow: 
        0 6px 20px rgba(141, 110, 99, 0.6),
        inset 0 2px 5px rgba(215, 184, 153, 0.5);
}

.direction-btn:active {
    scale: 0.95;
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.direction-btn.correct {
    background: linear-gradient(135deg, #66BB6A 0%, #2E7D32 100%) !important;
    border-color: rgba(255, 255, 255, 1) !important;
    box-shadow: 
        0 0 20px rgba(76, 175, 80, 0.8),
        0 4px 15px rgba(46, 125, 50, 0.5),
        inset 0 2px 5px rgba(200, 230, 201, 0.5) !important;
    animation: correctPulse 0.3s ease forwards;
}

.direction-btn.wrong {
    background: linear-gradient(135deg, #EF5350 0%, #C62828 100%) !important;
    border-color: rgba(255, 255, 255, 1) !important;
    box-shadow: 
        0 0 20px rgba(244, 67, 54, 0.8),
        0 4px 15px rgba(198, 40, 40, 0.5),
        inset 0 2px 5px rgba(255, 205, 210, 0.3) !important;
    animation: shake 0.16s ease forwards;
}

@keyframes correctPulse {
    0%, 100% { scale: 1; }
    50% { scale: 1.35; }
}

@keyframes shake {
    0%, 100% { 
        scale: 1;
    }
    50% { 
        scale: 1.05;
    }
}

.direction-icon {
    width: 40px;
    height: 40px;
    position: relative;
    display: block;
}

/* Серебряные треугольные стрелки */
.north .direction-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 24px solid #c0c0c0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.south .direction-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 24px solid #c0c0c0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.east .direction-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-left: 24px solid #c0c0c0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.west .direction-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-right: 24px solid #c0c0c0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.direction-label {
    font-size: 0.9em;
}

/* Надпись о шторме */
.storm-warning {
    position: absolute;
    top: -85px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8),
                 0 0 40px rgba(255, 0, 0, 0.6),
                 3px 3px 10px rgba(0, 0, 0, 0.8);
    z-index: 19;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    animation: stormPulse 1s ease-in-out infinite;
}

/* Надпись о тумане */
.fog-warning {
    position: absolute;
    top: -85px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 20px rgba(200, 200, 200, 0.8),
                 0 0 40px rgba(200, 200, 200, 0.6),
                 3px 3px 10px rgba(0, 0, 0, 0.8);
    z-index: 19;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.compass.fog-mode .fog-warning {
    opacity: 1;
    animation: fogPulse 2s ease-in-out infinite;
}

@keyframes fogPulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.7; }
    50% { transform: translateX(-50%) scale(1.05); opacity: 1; }
}

@keyframes stormPulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.1); }
}

/* Режим шторма */
.compass.storm-mode .storm-warning {
    opacity: 1;
}

.compass.storm-mode .direction-label {
    opacity: 0;
}

.compass.storm-mode .direction-btn {
    animation: stormShake 0.3s ease-in-out infinite;
}

.compass.storm-mode .direction-btn.north {
    rotate: -15deg;
}

.compass.storm-mode .direction-btn.east {
    rotate: 15deg;
}

.compass.storm-mode .direction-btn.south {
    rotate: 15deg;
}

.compass.storm-mode .direction-btn.west {
    rotate: -15deg;
}

@keyframes stormShake {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(0.8); }
}

/* Режим тумана */
.compass.fog-mode .direction-btn {
    border: 2px dashed rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(5px);
}

.compass.fog-mode .direction-icon,
.compass.fog-mode .direction-label {
    opacity: 0;
}

.compass.fog-mode .ghost-btn {
    display: flex !important;
}

/* Призрачные кнопки (скрыты по умолчанию) */
.ghost-btn {
    display: none;
    border: 2px dashed rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(5px);
}

/* Анимация появления призрачных кнопок */
@keyframes ghostAppear {
    from {
        opacity: 0;
        scale: 0.5;
    }
    to {
        opacity: 1;
        scale: 1;
    }
}

.compass.fog-mode .ghost-btn {
    animation: ghostAppear 0.5s ease-out;
}

/* Позиционирование основных 4 кнопок */
.north { 
    top: -60px; 
    left: 50%; 
    translate: -50% 0;
}
.east { 
    right: -60px; 
    top: 50%; 
    translate: 0 -50%;
}
.south { 
    bottom: -60px; 
    left: 50%; 
    translate: -50% 0;
}
.west { 
    left: -60px; 
    top: 50%; 
    translate: 0 -50%;
}

/* Позиционирование дополнительных 4 призрачных кнопок */
.northeast { 
    top: -45px; 
    right: -55px; 
    rotate: -45deg;
}

.southeast { 
    bottom: -45px; 
    right: -55px; 
    rotate: 45deg;
}

.southwest { 
    bottom: -45px; 
    left: -55px; 
    rotate: -45deg;
}

.northwest { 
    top: -45px; 
    left: -55px; 
    rotate: 45deg;
}

/* Сообщение обратной связи */
.feedback-message {
    text-align: center;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.3em;
    font-weight: bold;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    z-index: 1000;
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: calc(100% - 40px);
    max-width: 600px;
    backdrop-filter: blur(5px);
    white-space: pre-line; /* сохранять переводы строк, если используются */
}

.feedback-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    animation: slideUp 0.3s ease forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.feedback-message.correct {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.6) 0%, rgba(46, 125, 50, 0.6) 100%);
    color: white;
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.feedback-message.wrong {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.6) 0%, rgba(198, 40, 40, 0.6) 100%);
    color: white;
    box-shadow: 0 5px 20px rgba(244, 67, 54, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.feedback-message.artifact-message {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.6) 0%, rgba(255, 237, 78, 0.6) 100%);
    color: #2a5298;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.5);
    font-weight: bold;
    padding: 20px;
    z-index: 2147483647; /* Очень высокий z-index, чтобы точно быть поверх всего */
    /* Позиционирование в центре между прогрессом и компасом */
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) scale(0.5) !important;
    opacity: 0;
    transition: none !important;
    flex-direction: column; /* заголовок над текстом */
    gap: 8px;
}

.feedback-message.artifact-message.show {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1) !important;
    animation: artifactAppear 0.5s ease-out forwards !important;
}

@keyframes artifactAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes artifactAppear {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-180deg);
    }
    50% {
        transform: scale(1.2) rotate(0deg);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Эффект частиц при правильном ответе */
@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

.particle {
    position: absolute;
    pointer-events: none;
    font-size: 1.5em;
    animation: particleBurst 0.8s ease-out forwards;
    z-index: 999;
}

/* Эффект тряски при ошибке в шторме */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Пульсация компаса */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px 10px rgba(255, 215, 0, 0);
    }
}

/* Эффект вспышки при получении артефакта */
@keyframes flashEffect {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes wolfAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes wolfDisappear {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

.exit-btn {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 2px solid #fff;
    border-radius: 10px;
    padding: 12px 25px;
    font-size: 1.1em;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.exit-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

/* Панель для экранов достижений и информации */
.panel {
    background: linear-gradient(135deg, 
        rgba(200, 210, 220, 0.95) 0%, 
        rgba(230, 235, 240, 0.95) 50%, 
        rgba(200, 210, 220, 0.95) 100%);
    padding: 30px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%; /* Ширина 90% от экрана */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.panel h2 {
    color: #2a5298;
    margin-bottom: 20px;
    text-align: center;
    font-size: 2em;
}

/* Уменьшаем размер заголовка на экране результатов (GameOver) на 20% */
#gameOverScreen .panel h2,
#gameOverTitle {
    font-size: 1.5em;
}

/* Уменьшаем шрифт всех всплывающих подсказок и модалей на 38% (оставляем 62% от базового)
   Включает игровые уведомления, артефакты, модалки уровня, окно логин-ключа и настройки. */
#feedbackMessage,
.feedback-message,
.artifact-message,
.levelup-modal .levelup-modal-content,
.login-key-modal .login-key-content,
.game-limit-modal .game-limit-modal-content,
.login-progress-bar,
.settings-panel,
.settings-toggle-btn,
.showArtifactMessage {
    font-size: 70%;
}

.panel h3 {
    color: #357abd;
    margin: 20px 0 10px 0;
    font-size: 1.3em;
}

.info-content {
    color: #333;
    line-height: 1.8;
}

.info-content p {
    margin-bottom: 15px;
}

.info-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.info-content li {
    margin-bottom: 8px;
}

.license {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #ddd;
}

/* Достижения */
.achievements-list {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.achievement {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.achievement.unlocked {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.5);
}

.achievement:hover {
    transform: translateY(-3px);
}

.achievement-icon {
    font-size: 2.5em;
    filter: grayscale(100%);
    opacity: 0.5;
}

.achievement.unlocked .achievement-icon {
    filter: grayscale(0%);
    opacity: 1;
    animation: unlock 0.5s ease;
}

@keyframes unlock {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.achievement-info {
    flex: 1;
}

.achievement-title {
    font-weight: bold;
    color: #2a5298;
    margin-bottom: 5px;
}

.achievement-desc {
    font-size: 0.9em;
    color: #666;
}

/* Статистика */
.stats-container {
    background: #f0f0f0;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

#statsDisplay {
    display: grid;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-label-text {
    font-weight: bold;
    color: #357abd;
}

.stat-value-text {
    color: #2a5298;
    font-weight: bold;
}

/* Экран результатов */
.game-over-stats {
    text-align: center;
    margin: 30px 0;
}

.game-over-stats p {
    font-size: 1.3em;
    color: #333;
    margin: 15px 0;
}

.highlight {
    color: #ffd700;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

#newAchievements {
    margin-top: 20px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 10px;
}

/* Победная ачивка */
.victory-badge {
    display: none;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    border: 5px solid #fff;
    border-radius: 20px;
    padding: 30px;
    margin: 20px auto;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.6),
                inset 0 0 50px rgba(255, 255, 255, 0.3);
    animation: victoryPulse 2s ease-in-out infinite;
    text-align: center;
    max-width: 90%;
}

.victory-badge.show {
    display: block;
}

@keyframes victoryPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 40px rgba(255, 215, 0, 0.6), inset 0 0 50px rgba(255, 255, 255, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 15px 50px rgba(255, 215, 0, 0.8), inset 0 0 60px rgba(255, 255, 255, 0.5); }
}

.victory-badge-icon {
    font-size: 5em;
    margin-bottom: 15px;
    animation: victoryBounce 1s ease-in-out infinite;
}

@keyframes victoryBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.victory-badge-title {
    font-size: 2.5em;
    color: #2a5298;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}

.victory-badge-subtitle {
    font-size: 1.5em;
    color: #357abd;
    margin-bottom: 15px;
    font-weight: bold;
}

.victory-badge-desc {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
}

.victory-badge-difficulty {
    display: inline-block;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

.victory-badge-difficulty.hard {
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .game-title {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 0.95em;
    }
    
    .menu-btn {
        font-size: 1.1em;
        padding: 15px 30px;
        min-width: 250px;
    }
    
    .screen {
        padding: 5px 15px; /* Минимальный отступ сверху/снизу */
    }
    
    .game-header {
        flex-wrap: nowrap;
        gap: 8px;
        margin-bottom: 15px; /* Уменьшенный отступ */
    }
    
    .stat {
        flex: 1;
        min-width: fit-content;
    }
    
    .game-area {
        gap: 15px; /* Уменьшенный отступ между блоками */
    }
    
    .progress-path-container {
        height: 100px;
        margin-bottom: 10px;
    }
    
    .path-character {
        font-size: 1.5em;
    }
    
    .compass {
        width: 180px; /* Меньше для планшетов */
        height: 180px;
    }
    
    .compass.locked,
    .compass.locked-correct,
    .compass.locked-wrong {
        width: 216px; /* 180px * 1.2 */
        height: 216px;
    }
    
    .storm-warning {
        font-size: 1.5em;
    }
    
    .fog-warning {
        font-size: 1.5em;
    }
    
    .direction-btn {
        padding: 10px 15px;
        min-width: 75px;
        font-size: 0.9em;
        width: 75px;
        height: 75px;
    }
    
    .north { top: -55px; }
    .east { right: -60px; }
    .south { bottom: -55px; }
    .west { left: -60px; }
    
    .character, .destination {
        font-size: 2em;
    }
    
    .destination {
        font-size: 2.5em;
    }
    
    .character.horse {
        font-size: 1.8em;
    }
    
    .scene-container {
        height: 180px; /* Уменьшено на 10% (было 200px) */
    }
    
    .victory-badge-icon {
        font-size: 3.5em;
    }
    
    .victory-badge-title {
        font-size: 2em;
    }
    
    .victory-badge-subtitle {
        font-size: 1.2em;
    }
    
    .victory-badge-desc {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 0 10px; /* Полностью убираем отступ сверху */
        justify-content: flex-start; /* Прижимаем контент к верху */
    }
    
    .game-title {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 0.85em;
    }
    
    .game-header {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 5px;
        padding: 3px 8px; /* Уменьшаем высоту вдвое: было 6.5px -> 3px */
        overflow-x: auto;
        margin-bottom: 8px; /* Уменьшаем еще на 25% от 11px -> 8px */
    }
    
    .stat {
        flex: 1;
        min-width: fit-content;
        padding: 3px 6px; /* Уменьшаем высоту вдвое: было 6px 8px -> 3px 6px */
        justify-content: center;
    }
    
    .stat-label {
        font-size: 0.85em;
    }
    
    .stat-value {
        font-size: 0.95em;
    }
    
    .game-area {
        gap: 3px; /* Увеличено на 15%: было 2px */
    }
    
    .progress-path-container {
        height: 55px;
    }
    
    .path-character {
        font-size: 1.2em;
        bottom: auto; /* Убираем отрицательный отступ */
        top: 50%; /* Центрируем по вертикали относительно траектории */
        transform: translate(-50%, -50%); /* Центрирование */
    }
    
    .compass {
        width: 200px;
        height: 200px;
    }
    
    .compass.locked,
    .compass.locked-correct,
    .compass.locked-wrong {
        width: 240px; /* 200px * 1.2 */
        height: 240px;
    }
    
    .storm-warning {
        font-size: 1.2em;
    }
    
    .fog-warning {
        font-size: 1.2em;
    }
    
    .direction-btn {
        padding: 8px 12px;
        min-width: 65px;
        font-size: 0.8em;
        width: 65px;
        height: 65px;
    }
    
    .direction-icon {
        font-size: 1.2em;
    }
    
    .north { top: -50px; }
    .east { right: -50px; }
    .south { bottom: -50px; }
    .west { left: -50px; }
    
    .victory-badge-icon {
        font-size: 3em;
    }
    
    .victory-badge-title {
        font-size: 1.5em;
    }
    
    .victory-badge-subtitle {
        font-size: 1em;
    }
    
    .victory-badge-desc {
        font-size: 0.9em;
    }
    
    .victory-badge-difficulty {
        font-size: 0.9em;
        padding: 8px 20px;
    }
    
    /* Модальное окно бонусов на мобильных */
    .bonus-modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .bonus-modal-content h2 {
        font-size: 1.5em;
    }
    
    .bonus-description {
        font-size: 1em;
        margin-bottom: 20px;
    }
    
    .bonus-options {
        gap: 10px;
    }
    
    .bonus-btn {
        min-width: 90px;
        padding: 15px;
    }
    
    .bonus-icon {
        font-size: 2.5em;
    }
    
    .bonus-text {
        font-size: 0.9em;
    }
    
    .bonus-result-icon {
        font-size: 2.5em;
    }
    
    .bonus-result-title {
        font-size: 1.3em;
    }
    
    .bonus-result-desc {
        font-size: 1em;
    }
}

/* Скролл для панелей */
.panel::-webkit-scrollbar {
    width: 8px;
}

.panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.panel::-webkit-scrollbar-thumb {
    background: #4a90e2;
    border-radius: 10px;
}

.panel::-webkit-scrollbar-thumb:hover {
    background: #357abd;
}

/* Модальное окно бонусов */
.bonus-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.bonus-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bonus-modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 215, 0, 0.6);
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.4s ease;
}

/* Модальное окно лимита игр */
.game-limit-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.game-limit-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-limit-modal-content {
    background: linear-gradient(135deg, #2d5f3f 0%, #4a9d65 50%, #5cb877 100%);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(100, 200, 100, 0.6);
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.4s ease;
    position: relative;
}

.game-limit-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.game-limit-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.game-limit-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.game-limit-modal-content h2 {
    color: #fff;
    font-size: 2.2em;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.game-limit-description {
    color: #fff;
    font-size: 1.3em;
    margin-bottom: 20px;
    opacity: 0.95;
    line-height: 1.5;
}

.game-limit-description .highlight {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.2em;
}

.game-limit-advice {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    margin-top: 15px;
    font-style: italic;
}

@keyframes scaleIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.bonus-modal-content h2 {
    color: #ffd700;
    font-size: 2em;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.bonus-description {
    color: #fff;
    font-size: 1.2em;
    margin-bottom: 30px;
    opacity: 0.9;
}

.bonus-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.bonus-btn {
    background: linear-gradient(135deg, #795548 0%, #4E342E 100%);
    border: 3px solid rgba(255, 215, 0, 0.5);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.bonus-btn:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: rgba(255, 215, 0, 0.9);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.bonus-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.bonus-icon {
    font-size: 3em;
    animation: float 2s ease-in-out infinite;
}

.bonus-btn:nth-child(1) .bonus-icon {
    animation-delay: 0s;
}

.bonus-btn:nth-child(2) .bonus-icon {
    animation-delay: 0.3s;
}

.bonus-btn:nth-child(3) .bonus-icon {
    animation-delay: 0.6s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bonus-text {
    color: #fff;
    font-size: 1em;
    font-weight: bold;
}

.bonus-result {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    animation: fadeIn 0.5s ease;
}

.bonus-result-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.bonus-result-title {
    font-size: 1.5em;
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 10px;
}

.bonus-result-desc {
    font-size: 1.1em;
    color: #fff;
    opacity: 0.9;
}

/* Режим тестировщика */
.test-mode-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    gap: 20px;
    align-items: center;
}

.test-mode-controls.active {
    display: flex;
}

.test-nav-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
    border: 3px solid #fff;
    font-size: 2em;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.test-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 7px 20px rgba(255, 215, 0, 0.6);
}

.test-nav-btn:active {
    transform: scale(0.95);
}

.test-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#anchorStat {
    cursor: pointer;
    transition: all 0.3s ease;
}

#anchorStat:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: scale(1.05);
}

body.test-mode .compass-container {
    display: none;
}

/* ============================================
   РЕЖИМ ЭНЕРГОСБЕРЕЖЕНИЯ
   ============================================ */

/* Отключение анимации фона в режиме энергосбережения */
#gameScreen.power-saving-mode .parallax-view {
    animation: none !important;
}

/* Отключение пульсации компаса в режиме энергосбережения */
#gameScreen.power-saving-mode .compass {
    animation: none !important;
}

/* Отключение анимации иконок персонажа в режиме энергосбережения */
#gameScreen.power-saving-mode .character,
#gameScreen.power-saving-mode .path-character,
#gameScreen.power-saving-mode .destination {
    animation: none !important;
}

/* Скрытие подсказок результата в режиме энергосбережения */
#gameScreen.power-saving-mode .result-message,
#gameScreen.power-saving-mode .feedback-message {
    display: none !important;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО ЛОГИН-КЛЮЧА
   ============================================ */

.login-key-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-key-modal.show {
    opacity: 1;
}

.login-key-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #ffd700;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.login-key-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 1.5em;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-key-close:hover {
    background: rgba(255, 0, 0, 0.6);
    transform: rotate(90deg);
}

.login-key-content h2 {
    color: #ffd700;
    font-size: 2em;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.login-key-content p {
    color: white;
    font-size: 1.1em;
    margin-bottom: 15px;
    text-align: center;
}

.login-key-display {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.login-key-display input {
    flex: 1;
    padding: 15px;
    font-size: 1.3em;
    font-weight: bold;
    text-align: center;
    border: 3px solid #ffd700;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    letter-spacing: 2px;
}

.copy-btn {
    padding: 15px 20px;
    background: #4caf50;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.login-key-hint {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    font-size: 1em !important;
    margin: 15px 0 !important;
}

.login-key-save-btn {
    width: 100%;
    padding: 15px;
    background: #ffd700;
    border: 3px solid rgba(255, 255, 255, 0.5);
    color: #333;
    font-size: 1.3em;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-key-save-btn:hover {
    background: #ffed4e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
}

@media (max-width: 600px) {
    .login-key-content {
        padding: 20px;
    }
    
    .login-key-display {
        flex-direction: column;
    }
    
    .login-key-display input {
        font-size: 1.1em;
    }
}
