/* ===== ОСНОВНЫЕ ПЕРЕМЕННЫЕ ===== */
:root {
    --sunset-orange: #ff6b35;
    --sunset-pink: #f7931e;
    --sunset-purple: #9b59b6;
    --sunset-dark: #2c1654;
    --sunset-night: #1a0a2e;

    --gold: #ffd700;
    --gold-light: #ffed4a;
    --gold-dark: #b8860b;

    --road-gray: #3d3d3d;
    --road-light: #5a5a5a;
    --road-line: #ffffff;

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);

    --ui-gradient: linear-gradient(135deg, var(--sunset-orange), var(--sunset-pink));
    --btn-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

/* ===== СБРОС И БАЗОВЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3a 30%, #0d1b2a 60%, #1b263b 100%);
}

/* ===== ЭКРАНЫ ===== */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* ===== ГЛАВНЫЙ ЭКРАН (МЕНЮ) ===== */
#menu-screen {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.menu-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    padding-top: 30px;
}

/* Логотип */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
    animation: logoAppear 1s ease-out;
}

/* Логотип изображение */
.menu-logo {
    width: 80px;
    height: auto;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
    animation: logoFloat 3s ease-in-out infinite;
}

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

/* Персонаж справа на меню */
.menu-character-right {
    position: absolute;
    right: 15px;
    bottom: 5%;
    pointer-events: none;
    z-index: 5;
    animation: characterAppear 1.2s ease-out;
}

.character-image-right {
    width: 160px;
    height: auto;
    filter: drop-shadow(0 8px 25px rgba(0, 0, 0, 0.5));
    animation: characterBob 2s ease-in-out infinite;
}

@keyframes characterAppear {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.game-title {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-primary);
    text-shadow:
        0 0 10px var(--sunset-orange),
        0 0 20px var(--sunset-orange),
        0 0 40px var(--sunset-pink),
        3px 3px 0 var(--sunset-dark);
    letter-spacing: 4px;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

.title-underline {
    width: 150px;
    height: 4px;
    background: var(--ui-gradient);
    margin: 10px auto;
    border-radius: 2px;
    animation: underlineExpand 1s ease-out 0.5s both;
}

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

@keyframes titleGlow {
    from {
        text-shadow:
            0 0 10px var(--sunset-orange),
            0 0 20px var(--sunset-orange),
            0 0 40px var(--sunset-pink),
            3px 3px 0 var(--sunset-dark);
    }
    to {
        text-shadow:
            0 0 20px var(--sunset-orange),
            0 0 40px var(--sunset-orange),
            0 0 60px var(--sunset-pink),
            3px 3px 0 var(--sunset-dark);
    }
}

@keyframes underlineExpand {
    from {
        width: 0;
    }
    to {
        width: 150px;
    }
}

/* Профиль игрока */
.player-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 25px;
    border-radius: 50px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideInLeft 0.8s ease-out 0.3s both;
}

.avatar-container {
    position: relative;
    width: 60px;
    height: 60px;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gold);
}

.avatar-glow {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
    opacity: 0.5;
    animation: avatarPulse 2s ease-in-out infinite;
}

@keyframes avatarPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.player-info {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.player-record {
    font-size: 0.9rem;
    color: var(--gold);
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Кнопка СТАРТ */
.start-button {
    position: relative;
    width: 200px;
    height: 60px;
    background: var(--ui-gradient);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: var(--btn-shadow);
    animation: slideInUp 0.8s ease-out 0.5s both;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.start-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6);
}

.start-button:active {
    transform: scale(0.98);
}

.btn-text {
    position: relative;
    z-index: 2;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: btnShine 3s infinite;
}

@keyframes btnShine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

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

/* Лидерборд */
.leaderboard {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideInUp 0.8s ease-out 0.7s both;
}

.leaderboard-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: background 0.3s ease, transform 0.2s ease;
}

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

.leaderboard-item.gold {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), transparent);
    border-left: 3px solid var(--gold);
}

.leaderboard-item.silver {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.2), transparent);
    border-left: 3px solid #c0c0c0;
}

.leaderboard-item.bronze {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.2), transparent);
    border-left: 3px solid #cd7f32;
}

.leader-rank {
    font-size: 1.2rem;
    width: 30px;
    text-align: center;
}

.leader-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.leader-name {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.leader-score {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
}

/* Грозовой фон */
.storm-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Грозовые облака */
.storm-clouds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(30, 40, 70, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 70% 15%, rgba(40, 50, 80, 0.7) 0%, transparent 50%),
        radial-gradient(ellipse 90% 60% at 50% 10%, rgba(25, 35, 60, 0.9) 0%, transparent 60%),
        radial-gradient(ellipse 70% 45% at 85% 25%, rgba(35, 45, 75, 0.6) 0%, transparent 50%);
    animation: cloudsMove 20s ease-in-out infinite;
}

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

/* Вспышка молнии на весь экран */
.storm-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(200, 220, 255, 0);
    animation: stormFlash 8s ease-in-out infinite;
}

@keyframes stormFlash {
    0%, 100% { background: rgba(200, 220, 255, 0); }
    45% { background: rgba(200, 220, 255, 0); }
    46% { background: rgba(200, 220, 255, 0.15); }
    47% { background: rgba(200, 220, 255, 0); }
    48% { background: rgba(200, 220, 255, 0.1); }
    49% { background: rgba(200, 220, 255, 0); }
    75% { background: rgba(200, 220, 255, 0); }
    76% { background: rgba(200, 220, 255, 0.2); }
    77% { background: rgba(200, 220, 255, 0.05); }
    78% { background: rgba(200, 220, 255, 0.15); }
    79% { background: rgba(200, 220, 255, 0); }
}

/* Молнии */
.lightning {
    position: absolute;
    width: 3px;
    height: 0;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(180, 200, 255, 0.8) 20%,
        rgba(255, 255, 255, 1) 50%,
        rgba(180, 200, 255, 0.8) 80%,
        rgba(255, 255, 255, 0) 100%
    );
    filter: blur(1px);
    opacity: 0;
    box-shadow:
        0 0 10px 2px rgba(180, 200, 255, 0.8),
        0 0 20px 4px rgba(100, 150, 255, 0.5),
        0 0 40px 8px rgba(80, 120, 255, 0.3);
}

.lightning::before,
.lightning::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 60%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(180, 200, 255, 0.6) 100%
    );
    filter: blur(1px);
    box-shadow:
        0 0 8px 2px rgba(180, 200, 255, 0.6),
        0 0 15px 3px rgba(100, 150, 255, 0.4);
}

.lightning::before {
    top: 30%;
    left: -15px;
    transform: rotate(-25deg);
}

.lightning::after {
    top: 50%;
    right: -12px;
    transform: rotate(20deg);
}

.lightning-1 {
    left: 15%;
    top: 0;
    animation: lightningStrike1 7s ease-in-out infinite;
}

.lightning-2 {
    left: 60%;
    top: 0;
    animation: lightningStrike2 9s ease-in-out infinite;
    animation-delay: 3s;
}

.lightning-3 {
    left: 85%;
    top: 0;
    animation: lightningStrike3 11s ease-in-out infinite;
    animation-delay: 5s;
}

@keyframes lightningStrike1 {
    0%, 100% { height: 0; opacity: 0; }
    44% { height: 0; opacity: 0; }
    45% { height: 45%; opacity: 1; }
    46% { height: 45%; opacity: 0.3; }
    47% { height: 45%; opacity: 1; }
    48% { height: 45%; opacity: 0; }
    49% { height: 0; opacity: 0; }
}

@keyframes lightningStrike2 {
    0%, 100% { height: 0; opacity: 0; }
    54% { height: 0; opacity: 0; }
    55% { height: 50%; opacity: 1; }
    56% { height: 50%; opacity: 0.5; }
    57% { height: 50%; opacity: 0.8; }
    58% { height: 50%; opacity: 0; }
    59% { height: 0; opacity: 0; }
}

@keyframes lightningStrike3 {
    0%, 100% { height: 0; opacity: 0; }
    64% { height: 0; opacity: 0; }
    65% { height: 40%; opacity: 1; }
    66% { height: 40%; opacity: 0.4; }
    67% { height: 40%; opacity: 0.9; }
    68% { height: 40%; opacity: 0; }
    69% { height: 0; opacity: 0; }
}

/* Падающие монетки */
.falling-coins {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

.coin {
    position: absolute;
    top: -50px;
    left: var(--x, 50%);
    width: 25px;
    height: 25px;
    background: radial-gradient(circle at 30% 30%, #ffed4a, #ffd700 40%, #b8860b 100%);
    border-radius: 50%;
    box-shadow:
        inset -3px -3px 6px rgba(0, 0, 0, 0.3),
        inset 3px 3px 6px rgba(255, 255, 255, 0.4),
        0 0 10px rgba(255, 215, 0, 0.5);
    animation: coinFall 8s linear infinite;
    animation-delay: var(--delay, 0s);
    opacity: 0.7;
}

.coin::before {
    content: '₽';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    color: #b8860b;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

@keyframes coinFall {
    0% {
        transform: translateY(0) rotateY(0deg) rotateX(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(110vh) rotateY(720deg) rotateX(360deg);
        opacity: 0;
    }
}

/* Разные размеры монеток */
.coin:nth-child(odd) {
    width: 20px;
    height: 20px;
    animation-duration: 10s;
}

.coin:nth-child(3n) {
    width: 30px;
    height: 30px;
    animation-duration: 7s;
}

.coin:nth-child(3n)::before {
    font-size: 14px;
}

.coin:nth-child(odd)::before {
    font-size: 10px;
}

/* Декоративный фон меню */
.menu-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    pointer-events: none;
    z-index: 1;
}

.bg-road {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, #1a1a2e 40%, #0f0f1a 100%);
    clip-path: polygon(40% 0%, 60% 0%, 100% 100%, 0% 100%);
}

.bg-mountains {
    position: absolute;
    bottom: 30%;
    left: 0;
    right: 0;
    height: 100px;
    background:
        linear-gradient(135deg, var(--sunset-dark) 25%, transparent 25%),
        linear-gradient(-135deg, var(--sunset-dark) 25%, transparent 25%);
    background-size: 80px 100px;
    opacity: 0.5;
}

.bg-sun {
    display: none;
}

.bg-mountains {
    display: none;
}

/* ===== ИГРОВОЙ ЭКРАН ===== */
#game-screen {
    background: #000;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#game-screen.active {
    display: block;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Game HUD */
.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    pointer-events: none;
    z-index: 100;
}

.hud-left, .hud-right {
    display: flex;
    align-items: center;
}

.coin-counter, .speed-multiplier {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.coin-icon {
    font-size: 1.5rem;
    animation: coinSpin 1s linear infinite;
}

@keyframes coinSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

#coin-count {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
    min-width: 50px;
}

.speed-icon {
    font-size: 1.3rem;
    color: #00d4ff;
}

#speed-mult {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00d4ff;
}

/* Подсказка управления */
.control-hint {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 30px;
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    animation: hintPulse 1.5s ease-in-out infinite;
    backdrop-filter: blur(5px);
    z-index: 100;
    white-space: nowrap;
}

.control-hint.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

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

/* ===== ЭКРАН КОНЦА ИГРЫ ===== */
#gameover-screen {
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(44, 22, 84, 0.9) 100%);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.gameover-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    max-width: 350px;
    width: 90%;
}

.crash-title {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 2rem;
    font-weight: 900;
    color: #ff4444;
    margin-bottom: 40px;
    animation: crashShake 0.5s ease-out;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.crash-emoji {
    font-size: 2.5rem;
    animation: explosionPulse 0.8s ease-out infinite;
}

@keyframes crashShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

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

.results {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    animation: resultSlide 0.5s ease-out both;
}

.result-item:nth-child(1) { animation-delay: 0.2s; }
.result-item:nth-child(2) { animation-delay: 0.4s; }
.result-item:nth-child(3) { animation-delay: 0.6s; }

.result-item.rank {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), rgba(255, 107, 53, 0.2));
    border: 1px solid rgba(255, 215, 0, 0.3);
}

@keyframes resultSlide {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.result-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.gameover-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.gameover-btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: btnAppear 0.5s ease-out 0.8s both;
}

.gameover-btn.primary {
    background: var(--ui-gradient);
    color: var(--text-primary);
    box-shadow: var(--btn-shadow);
}

.gameover-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gameover-btn:hover {
    transform: scale(1.02);
}

.gameover-btn:active {
    transform: scale(0.98);
}

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

/* ===== АНИМАЦИЯ СБОРА МОНЕТЫ ===== */
.coin-collect-effect {
    position: fixed;
    font-size: 1.5rem;
    color: var(--gold);
    font-weight: bold;
    pointer-events: none;
    animation: coinCollect 0.8s ease-out forwards;
    z-index: 1000;
    text-shadow: 0 0 10px var(--gold);
}

@keyframes coinCollect {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) scale(1.5);
        opacity: 0;
    }
}

/* ===== ПЕРЕХОД МЕЖДУ ЭКРАНАМИ ===== */
.screen-transition {
    animation: screenFade 0.5s ease;
}

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

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-height: 700px) {
    .game-title {
        font-size: 2.5rem;
    }

    .player-profile {
        padding: 10px 20px;
        margin-bottom: 20px;
    }

    .avatar, .avatar-container {
        width: 50px;
        height: 50px;
    }

    .start-button {
        width: 180px;
        height: 50px;
        margin-bottom: 25px;
    }

    .leaderboard {
        padding: 15px;
    }

    .leaderboard-item {
        padding: 8px 12px;
    }
}

@media (max-width: 360px) {
    .game-title {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .player-name {
        font-size: 1rem;
    }

    .btn-text {
        font-size: 1.2rem;
    }

    .character-image-right {
        width: 120px;
    }

    .menu-character-right {
        right: 5px;
        bottom: 10%;
    }
}

@media (max-width: 450px) {
    .character-image-right {
        width: 150px;
    }

    .menu-character-right {
        right: 5px;
    }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ ЭФФЕКТЫ ===== */

/* Пульсация счётчика при сборе монет */
#coin-count {
    transition: transform 0.1s ease;
}

/* Новый рекорд */
.new-record {
    animation: newRecord 0.5s ease-out;
}

@keyframes newRecord {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); color: #00ff00; }
}

/* Предупреждение о препятствии */
.warning-flash {
    animation: warningPulse 0.3s ease-in-out;
}

@keyframes warningPulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: inset 0 0 50px rgba(255, 0, 0, 0.3); }
}

/* Плавное появление game screen - стили определены выше */

/* Анимация кнопки старт при наведении */
.start-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 30px;
    padding: 2px;
    background: linear-gradient(45deg, #ff6b35, #ffd700, #ff6b35);
    background-size: 200% 200%;
    animation: borderGlow 2s linear infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.start-button:hover::before {
    opacity: 1;
}

@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Стиль для топ-1 игрока */
.leaderboard-item.gold .leader-score {
    animation: goldShine 2s ease-in-out infinite;
}

@keyframes goldShine {
    0%, 100% {
        color: #ffd700;
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
    50% {
        color: #ffed4a;
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    }
}

/* Touch highlight отключение */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Cursor для desktop */
.start-button, .gameover-btn, .leaderboard-item {
    cursor: pointer;
}

/* Scrollbar скрыть */
::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Safe area для iPhone X+ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .menu-container {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .game-hud {
        padding-top: calc(15px + env(safe-area-inset-top));
    }

    .gameover-container {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
