* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Предотвращение дерганий при касании */
    -webkit-tap-highlight-color: transparent;
}

/* GPU-ускорение для анимаций */
*::before,
*::after {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

html {
    -webkit-text-size-adjust: 100%;
    /* Плавный скролл */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #2d3436 0%, #1e272e 50%, #2c3e50 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    /* Предотвращение выделения текста при длинном нажатии */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Разрешить выделение текста в полях ввода */
input, textarea, [contenteditable] {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

/* Глобальные стили для всех кнопок - быстрый отклик */
button {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    /* GPU-ускорение */
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Быстрые переходы */
    transition: transform 0.08s ease,
                background 0.1s ease,
                box-shadow 0.1s ease,
                opacity 0.1s ease;
    will-change: transform;
    cursor: pointer;
}

button:active {
    transform: scale(0.92) translateZ(0);
    transition: transform 0.05s ease;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Мобильные тач-оптимизации */
@media (hover: none) and (pointer: coarse) {
    button {
        /* Мгновенный отклик на тач-устройствах */
        transition: transform 0.05s ease,
                    background 0.08s ease;
    }
    
    button:active {
        transform: scale(0.93) translateZ(0);
        transition: transform 0.08s ease;
    }
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    overflow-x: hidden;
}

@media (max-width: 500px) {
    .container {
        padding: 15px;
        border-radius: 16px;
    }
}

h1 {
    text-align: center;
    color: #776e65;
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: bold;
}



/* Цвета стихий */
.element-indicator-normal { background: linear-gradient(135deg, #A8A878 0%, #8a8a5c 100%); }
.element-indicator-fire { background: linear-gradient(135deg, #F08030 0%, #dd6610 100%); }
.element-indicator-water { background: linear-gradient(135deg, #6890F0 0%, #4a70d0 100%); }
.element-indicator-electric { background: linear-gradient(135deg, #F8D030 0%, #e0b010 100%); }
.element-indicator-grass { background: linear-gradient(135deg, #78C850 0%, #5aa030 100%); }
.element-indicator-poison { background: linear-gradient(135deg, #A040A0 0%, #803080 100%); }
.element-indicator-ground { background: linear-gradient(135deg, #E0C068 0%, #c0a048 100%); }
.element-indicator-flying { background: linear-gradient(135deg, #A890F0 0%, #8870d0 100%); }
.element-indicator-bug { background: linear-gradient(135deg, #A8B820 0%, #889810 100%); }
.element-indicator-rock { background: linear-gradient(135deg, #B8A038 0%, #988020 100%); }
.element-indicator-ice { background: linear-gradient(135deg, #98D8D8 0%, #78b8b8 100%); }
.element-indicator-fighting { background: linear-gradient(135deg, #C03028 0%, #a01810 100%); }
.element-indicator-psychic { background: linear-gradient(135deg, #F85888 0%, #d83868 100%); }
.element-indicator-ghost { background: linear-gradient(135deg, #705898 0%, #503878 100%); }
.element-indicator-dark { background: linear-gradient(135deg, #705848 0%, #503828 100%); }
.element-indicator-steel { background: linear-gradient(135deg, #B8B8D0 0%, #9898b0 100%); }
.element-indicator-fairy { background: linear-gradient(135deg, #EE99AC 0%, #ce798c 100%); }
.element-indicator-dragon { background: linear-gradient(135deg, #7038F8 0%, #5018d8 100%); }
.element-indicator-cosmic { background: linear-gradient(135deg, #3D1A78 0%, #1d0a58 100%); }
.element-indicator-shadow { background: linear-gradient(135deg, #1A1A2E 0%, #0a0a1e 100%); }
.element-indicator-legendary { background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%); }

.score-box {
    background: #bbada0;
    border-radius: 6px;
    padding: 10px 20px;
    text-align: center;
    min-width: 120px;
}

.score-label {
    color: #eee4da;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
}

.score-value {
    color: white;
    font-size: 32px;
    font-weight: bold;
}

.new-game-btn {
    background: #8f7a66;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    min-height: 44px;
    min-width: 44px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
}

.new-game-btn:hover {
    background: #9f8a76;
}

.new-game-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.gm-tx-display {
    background: linear-gradient(135deg, #4a5568 0%, #5a6578 100%);
    border-radius: 6px;
    padding: 8px 12px;
    text-align: center;
}

.gm-tx-link {
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.gm-tx-link:hover {
    text-decoration: underline;
}

.transaction-display {
    background: #8f7a66;
    border-radius: 6px;
    padding: 10px 15px;
    text-align: center;
    min-width: 120px;
    flex: 0 0 auto;
    cursor: pointer;
    transition: all 0.3s ease;
}

.transaction-display:hover {
    background: #9f8a76;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.transaction-label {
    color: #eee4da;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.transaction-value {
    color: white;
    font-size: 14px;
    font-weight: bold;
    font-family: monospace;
    cursor: pointer;
    word-break: break-all;
    transition: opacity 0.3s;
}

.transaction-value:hover {
    opacity: 0.8;
    text-decoration: underline;
}


/* Панель: New Game сверху, NORMAL и SCORE внизу 50/50 */
.game-controls-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.game-controls-panel .new-game-btn {
    align-self: flex-start;
}

/* Строка NORMAL + SCORE */
.controls-row {
    display: flex;
    gap: 8px;
}

/* NORMAL слева - 50% */
.element-indicator {
    flex: 1;
    background: #A8A878;
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

/* SCORE справа - 50% */
.score-box-small {
    flex: 1;
    background: #bbada0;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

.score-box-small .score-label {
    color: #eee4da;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.score-box-small .score-value {
    color: white;
    font-size: 20px;
    font-weight: bold;
}

/* Цвета для разных стихий */
.element-indicator-normal { background: #A8A878; }
.element-indicator-fire { background: #F08030; }
.element-indicator-water { background: #6890F0; }
.element-indicator-electric { background: #F8D030; color: #333; }
.element-indicator-grass { background: #78C850; }
.element-indicator-ice { background: #98D8D8; color: #333; }
.element-indicator-fighting { background: #C03028; }
.element-indicator-poison { background: #A040A0; }
.element-indicator-ground { background: #E0C068; color: #333; }
.element-indicator-flying { background: #A890F0; }
.element-indicator-psychic { background: #F85888; }
.element-indicator-bug { background: #A8B820; }
.element-indicator-rock { background: #B8A038; }
.element-indicator-ghost { background: #705898; }
.element-indicator-dragon { background: #7038F8; }
.element-indicator-dark { background: #705848; }
.element-indicator-steel { background: #B8B8D0; color: #333; }
.element-indicator-fairy { background: #EE99AC; }

.game-container {
    position: relative;
    background: #bbada0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 20px;
    /* Оптимизации для мобильных свайпов */
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Убираем задержку тапа на iOS */
    -webkit-tap-highlight-color: transparent;
    /* GPU ускорение контейнера */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: contents;
    /* Предотвращаем bounce scroll на iOS */
    overscroll-behavior: none;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    position: relative;
    /* Оптимизации рендеринга */
    contain: layout style paint;
    will-change: contents;
    /* GPU ускорение */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Предотвращение перерисовки */
    isolation: isolate;
}

.cell {
    background: #cdc1b4;
    border-radius: 3px;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 35px;
    font-weight: bold;
    color: #776e65;
    transition: all 0.15s ease-in-out;
    position: relative;
    overflow: hidden;
}

/* Пиксельная травка с покачиванием */
.cell::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20%;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 2px,
            #3d8c40 2px,
            #3d8c40 4px,
            transparent 4px,
            transparent 8px
        ),
        linear-gradient(to top, 
            #2d5a1e 0%,
            #3d8c40 30%,
            #4aba4f 60%,
            #6ed86e 80%,
            transparent 100%
        );
    border-radius: 0 0 3px 3px;
    z-index: 0;
    animation: grassSway 2s ease-in-out infinite;
}

/* Второй слой травинок */
.cell::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 12%;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 6px,
            #4aba4f 6px,
            #4aba4f 8px,
            transparent 8px,
            transparent 12px
        );
    z-index: 1;
    animation: grassSway 2.5s ease-in-out infinite reverse;
}

/* Анимация покачивания */
@keyframes grassSway {
    0%, 100% { transform: skewX(0deg); }
    25% { transform: skewX(2deg); }
    75% { transform: skewX(-2deg); }
}

.tile {
    background: rgba(238, 228, 218, 0.2);
    border-radius: 3px;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* GPU ускорение для плавности */
    will-change: transform, opacity;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Плавные анимации перемещения - работают везде */
    transition: transform 0.12s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                opacity 0.1s ease-out;
    animation: tileAppear 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Плавное появление плитки */
@keyframes tileAppear {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Анимация слияния */
@keyframes tileMerge {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

.tile.merged {
    animation: tileMerge 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Мобильные оптимизации */
@media (max-width: 500px) {
    .tile {
        /* Ещё более плавные анимации на мобильных */
        transition: transform 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        animation: tileAppear 0.12s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
}

/* Пиксельная травка под покемоном */
.tile::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 22%;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 3px,
            #2d7a30 3px,
            #2d7a30 5px,
            transparent 5px,
            transparent 10px
        ),
        linear-gradient(to top, 
            #1e4d20 0%,
            #2d7a30 25%,
            #3d9a40 50%,
            #5dc85d 75%,
            transparent 100%
        );
    border-radius: 0 0 3px 3px;
    z-index: 0;
    animation: grassSway 1.8s ease-in-out infinite;
}

/* Второй слой травинок на тайле */
.tile::before {
    content: '';
    position: absolute;
    bottom: 2%;
    left: 0;
    right: 0;
    height: 10%;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 8px,
            #5dc85d 8px,
            #5dc85d 10px,
            transparent 10px,
            transparent 14px
        );
    z-index: 4;
    animation: grassSway 2.2s ease-in-out infinite reverse;
}

.pokemon-sprite {
    width: 85%;
    height: 70%;
    object-fit: contain;
    position: absolute;
    top: 2%;
    left: 7.5%;
    z-index: 2;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.tile-number {
    position: absolute;
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 30px;
    font-weight: 900;
    color: #0052FF;
    z-index: 10;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    letter-spacing: 0.5px;
    text-shadow: 
        2px 2px 4px rgba(255, 255, 255, 1),
        -1px -1px 3px rgba(255, 255, 255, 1),
        1px -1px 3px rgba(255, 255, 255, 1),
        -1px 1px 3px rgba(255, 255, 255, 1),
        0 0 8px rgba(255, 255, 255, 0.9),
        0 0 15px rgba(0, 82, 255, 0.5);
    pointer-events: none;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.3);
}

/* Адаптивные размеры цифр для разных значений */
.tile-number-1k {
    font-size: 26px;
}

.tile-number-10k {
    font-size: 24px;
}

.tile-number-100k {
    font-size: 22px;
}

@keyframes appear {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* ============================================ */
/* СИСТЕМА СТИХИЙ ПОКЕМОНОВ */
/* ============================================ */

/* Базовые цвета плиток */
.tile-2 { background: rgba(238, 228, 218, 0.3); }
.tile-4 { background: rgba(237, 224, 200, 0.3); }
.tile-8 { background: rgba(242, 177, 121, 0.3); }
.tile-16 { background: rgba(245, 149, 99, 0.3); }
.tile-32 { background: rgba(246, 124, 95, 0.3); }
.tile-64 { background: rgba(246, 94, 59, 0.3); }
.tile-128 { background: rgba(237, 207, 114, 0.3); }
.tile-256 { background: rgba(237, 204, 97, 0.3); }
.tile-512 { background: rgba(237, 200, 80, 0.3); }
.tile-1024 { background: rgba(237, 197, 63, 0.3); }
.tile-2048 { background: rgba(237, 194, 46, 0.3); }
.tile-super { background: rgba(60, 58, 50, 0.3); }

/* ============================================ */
/* СТИХИЯ: NORMAL (2-16) */
/* ============================================ */
.element-normal {
    background: linear-gradient(135deg, rgba(168, 168, 120, 0.4) 0%, rgba(200, 200, 170, 0.4) 100%) !important;
    border: 2px solid rgba(168, 168, 120, 0.6) !important;
}

/* ============================================ */
/* СТИХИЯ: FIRE (32-64) 🔥 */
/* ============================================ */
.element-fire {
    background: linear-gradient(135deg, rgba(240, 128, 48, 0.5) 0%, rgba(255, 80, 0, 0.5) 100%) !important;
    border: 2px solid #F08030 !important;
    animation: fireGlow 3s ease-in-out infinite alternate;
    box-shadow: 0 0 15px rgba(255, 100, 0, 0.6), inset 0 0 20px rgba(255, 200, 100, 0.3);
}

.element-fire .pokemon-sprite {
    animation: fireGlow 3s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 100, 0, 0.8));
}

.element-fire .tile-number {
    color: #FFFFFF !important;
    text-shadow: 
        -2px -2px 0 #8B0000,
        2px -2px 0 #8B0000,
        -2px 2px 0 #8B0000,
        2px 2px 0 #8B0000,
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(139, 0, 0, 0.8) !important;
    -webkit-text-stroke: 1px #8B0000;
}

@keyframes fireGlow {
    0% { box-shadow: 0 0 15px rgba(255, 100, 0, 0.6), inset 0 0 20px rgba(255, 200, 100, 0.3); }
    100% { box-shadow: 0 0 25px rgba(255, 50, 0, 0.8), inset 0 0 30px rgba(255, 150, 50, 0.5); }
}

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

/* Частицы огня */
.particles-fire {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 3;
}

.particles-fire::before,
.particles-fire::after {
    content: '🔥';
    position: absolute;
    font-size: 12px;
    animation: fireParticle 1s ease-out infinite;
    opacity: 0;
}

.particles-fire::before {
    left: 20%;
    animation-delay: 0s;
}

.particles-fire::after {
    left: 60%;
    animation-delay: 0.5s;
}

@keyframes fireParticle {
    0% { bottom: 10%; opacity: 1; transform: scale(0.5); }
    100% { bottom: 90%; opacity: 0; transform: scale(1) translateX(10px); }
}

/* ============================================ */
/* СТИХИЯ: WATER (128-256) 💧 */
/* ============================================ */
.element-water {
    background: linear-gradient(135deg, rgba(104, 144, 240, 0.5) 0%, rgba(0, 100, 200, 0.5) 100%) !important;
    border: 2px solid #6890F0 !important;
    animation: waterWave 2s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(100, 150, 255, 0.6), inset 0 0 20px rgba(150, 200, 255, 0.3);
}

.element-water .pokemon-sprite {
    animation: waterBob 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(100, 150, 255, 0.8));
}

.element-water .tile-number {
    color: #FFFFFF !important;
    text-shadow: 
        -2px -2px 0 #00008B,
        2px -2px 0 #00008B,
        -2px 2px 0 #00008B,
        2px 2px 0 #00008B,
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(0, 0, 139, 0.8) !important;
    -webkit-text-stroke: 1px #00008B;
}

@keyframes waterWave {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(100, 150, 255, 0.6), inset 0 0 20px rgba(150, 200, 255, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 25px rgba(50, 100, 255, 0.8), inset 0 0 30px rgba(100, 180, 255, 0.5);
        transform: scale(1.02);
    }
}

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

/* Частицы воды */
.particles-water::before,
.particles-water::after {
    content: '💧';
    position: absolute;
    font-size: 10px;
    animation: waterDrop 1.5s ease-in infinite;
    opacity: 0;
}

.particles-water::before {
    left: 30%;
    animation-delay: 0s;
}

.particles-water::after {
    left: 70%;
    animation-delay: 0.7s;
}

@keyframes waterDrop {
    0% { top: 10%; opacity: 1; }
    100% { top: 80%; opacity: 0; }
}

/* ============================================ */
/* СТИХИЯ: ELECTRIC (512-1024) ⚡ */
/* Плавное свечение без резких движений */
/* ============================================ */
.element-electric {
    background: linear-gradient(135deg, rgba(248, 208, 48, 0.5) 0%, rgba(255, 230, 0, 0.5) 100%) !important;
    border: 2px solid #F8D030 !important;
    animation: electricSpark 3s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 230, 0, 0.5), inset 0 0 20px rgba(255, 255, 150, 0.3);
}

.element-electric .pokemon-sprite {
    animation: electricGlow 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 230, 0, 0.7)) brightness(1.05);
}

.element-electric .tile-number {
    color: #1a1a1a !important;
    text-shadow: 
        -2px -2px 0 #FFFFFF,
        2px -2px 0 #FFFFFF,
        -2px 2px 0 #FFFFFF,
        2px 2px 0 #FFFFFF,
        0 0 8px rgba(255, 255, 255, 0.9),
        0 0 15px rgba(255, 230, 0, 0.5) !important;
    -webkit-text-stroke: 1px #FFFFFF;
}

@keyframes electricSpark {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(255, 230, 0, 0.5), inset 0 0 20px rgba(255, 255, 150, 0.3);
    }
    50% { 
        box-shadow: 0 0 25px rgba(255, 230, 0, 0.7), inset 0 0 30px rgba(255, 255, 200, 0.4);
    }
}

@keyframes electricGlow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 230, 0, 0.7)) brightness(1.05); }
    50% { filter: drop-shadow(0 0 12px rgba(255, 230, 0, 0.8)) brightness(1.1); }
}

/* Частицы электричества - плавное появление */
.particles-electric::before,
.particles-electric::after {
    content: '⚡';
    position: absolute;
    font-size: 14px;
    animation: electricBolt 2s ease-in-out infinite;
    opacity: 0;
}

.particles-electric::before {
    left: 15%;
    top: 20%;
}

.particles-electric::after {
    right: 15%;
    bottom: 20%;
    animation-delay: 1s;
}

@keyframes electricBolt {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* ============================================ */
/* СТИХИЯ: GRASS (2048-4096) 🌿 */
/* ============================================ */
.element-grass {
    background: linear-gradient(135deg, rgba(120, 200, 80, 0.5) 0%, rgba(60, 150, 40, 0.5) 100%) !important;
    border: 2px solid #78C850 !important;
    animation: grassGrow 2s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(100, 180, 80, 0.6), inset 0 0 20px rgba(150, 220, 100, 0.3);
}

.element-grass .pokemon-sprite {
    animation: grassSway 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(100, 180, 80, 0.8));
}

.element-grass .tile-number {
    color: #FFFFFF !important;
    font-weight: 800 !important;
    text-shadow: 
        -3px -3px 0 #004000,
        3px -3px 0 #004000,
        -3px 3px 0 #004000,
        3px 3px 0 #004000,
        0 0 12px rgba(255, 255, 255, 1),
        0 0 20px rgba(0, 100, 0, 0.8) !important;
    -webkit-text-stroke: 2px #004000;
}

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

/* Частицы травы */
.particles-grass::before,
.particles-grass::after {
    content: '🍃';
    position: absolute;
    font-size: 12px;
    animation: leafFloat 2s ease-in-out infinite;
    opacity: 0;
}

.particles-grass::before {
    left: 10%;
    animation-delay: 0s;
}

.particles-grass::after {
    right: 10%;
    animation-delay: 1s;
}

@keyframes leafFloat {
    0% { top: 80%; opacity: 0; transform: rotate(0deg); }
    50% { opacity: 1; }
    100% { top: 10%; opacity: 0; transform: rotate(180deg); }
}

/* ============================================ */
/* СТИХИЯ: ICE (8192-16384) ❄️ */
/* ============================================ */
.element-ice {
    background: linear-gradient(135deg, rgba(152, 216, 216, 0.6) 0%, rgba(100, 180, 220, 0.6) 100%) !important;
    border: 2px solid #98D8D8 !important;
    animation: iceShimmer 4s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(150, 220, 255, 0.5), inset 0 0 18px rgba(200, 240, 255, 0.3);
}

.element-ice .pokemon-sprite {
    animation: iceFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(150, 220, 255, 0.7)) brightness(1.05);
}

.element-ice .tile-number {
    color: #1a1a1a !important;
    text-shadow: 
        -2px -2px 0 #FFFFFF,
        2px -2px 0 #FFFFFF,
        -2px 2px 0 #FFFFFF,
        2px 2px 0 #FFFFFF,
        0 0 10px rgba(255, 255, 255, 1),
        0 0 20px rgba(100, 180, 255, 0.8) !important;
    -webkit-text-stroke: 1px #FFFFFF;
}

@keyframes iceShimmer {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(150, 220, 255, 0.5), inset 0 0 18px rgba(200, 240, 255, 0.3);
        filter: brightness(1);
    }
    50% { 
        box-shadow: 0 0 18px rgba(160, 230, 255, 0.6), inset 0 0 22px rgba(210, 245, 255, 0.4);
        filter: brightness(1.03);
    }
}

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

/* Частицы льда */
.particles-ice::before,
.particles-ice::after {
    content: '❄️';
    position: absolute;
    font-size: 10px;
    animation: snowfall 2s linear infinite;
    opacity: 0;
}

.particles-ice::before {
    left: 20%;
    animation-delay: 0s;
}

.particles-ice::after {
    left: 70%;
    animation-delay: 1s;
}

@keyframes snowfall {
    0% { top: 0; opacity: 1; transform: translateX(0) rotate(0deg); }
    100% { top: 80%; opacity: 0; transform: translateX(10px) rotate(180deg); }
}

/* ============================================ */
/* СТИХИЯ: ROCK (32768-65536) 🪨 */
/* ============================================ */
.element-rock {
    background: linear-gradient(135deg, rgba(184, 160, 56, 0.5) 0%, rgba(140, 110, 40, 0.5) 100%) !important;
    border: 3px solid #B8A038 !important;
    animation: rockTremble 4s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(180, 150, 80, 0.6), inset 0 0 20px rgba(200, 180, 100, 0.3);
}

.element-rock .pokemon-sprite {
    animation: rockShake 4s ease-in-out infinite;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.element-rock .tile-number {
    color: #FFFFFF !important;
    text-shadow: 
        -2px -2px 0 #3d2817,
        2px -2px 0 #3d2817,
        -2px 2px 0 #3d2817,
        2px 2px 0 #3d2817,
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(61, 40, 23, 0.8) !important;
    -webkit-text-stroke: 1px #3d2817;
    font-weight: 900 !important;
}

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

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

/* Частицы камня */
.particles-rock::before,
.particles-rock::after {
    content: '💥';
    position: absolute;
    font-size: 10px;
    animation: rockCrumble 1s ease-out infinite;
    opacity: 0;
}

.particles-rock::before {
    left: 25%;
    bottom: 20%;
}

.particles-rock::after {
    right: 25%;
    bottom: 30%;
    animation-delay: 0.5s;
}

@keyframes rockCrumble {
    0% { opacity: 1; transform: scale(0.5); }
    100% { opacity: 0; transform: scale(1) translateY(10px); }
}

/* ============================================ */
/* СТИХИЯ: PSYCHIC (131072-262144) 🔮 */
/* ============================================ */
.element-psychic {
    background: linear-gradient(135deg, rgba(248, 88, 136, 0.5) 0%, rgba(180, 60, 180, 0.5) 100%) !important;
    border: 2px solid #F85888 !important;
    animation: psychicPulse 4s ease-in-out infinite;
    box-shadow: 0 0 18px rgba(250, 100, 150, 0.5), inset 0 0 20px rgba(255, 150, 200, 0.3);
}

.element-psychic .pokemon-sprite {
    animation: psychicFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(250, 100, 150, 0.7));
}

.element-psychic .tile-number {
    color: #FFFFFF !important;
    text-shadow: 
        -2px -2px 0 #4B0082,
        2px -2px 0 #4B0082,
        -2px 2px 0 #4B0082,
        2px 2px 0 #4B0082,
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 15px rgba(75, 0, 130, 0.6) !important;
    -webkit-text-stroke: 1px #4B0082;
}

@keyframes psychicPulse {
    0%, 100% { 
        box-shadow: 0 0 18px rgba(250, 100, 150, 0.5), inset 0 0 20px rgba(255, 150, 200, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 22px rgba(250, 100, 180, 0.6), inset 0 0 25px rgba(255, 165, 210, 0.4);
        transform: scale(1.01);
    }
}

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

@keyframes psychicGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

/* Частицы психики */
.particles-psychic::before,
.particles-psychic::after {
    content: '✨';
    position: absolute;
    font-size: 12px;
    animation: psychicSparkle 1.5s ease-in-out infinite;
    opacity: 0;
}

.particles-psychic::before {
    top: 20%;
    left: 20%;
}

.particles-psychic::after {
    bottom: 20%;
    right: 20%;
    animation-delay: 0.75s;
}

@keyframes psychicSparkle {
    0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

/* ============================================ */
/* СТИХИЯ: DRAGON (524288+) 🐉 */
/* ============================================ */
.element-dragon {
    background: linear-gradient(135deg, rgba(112, 56, 248, 0.6) 0%, rgba(80, 0, 180, 0.6) 100%) !important;
    border: 3px solid #7038F8 !important;
    animation: dragonAura 4s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(120, 60, 255, 0.6), 0 0 40px rgba(80, 0, 180, 0.3), inset 0 0 25px rgba(180, 100, 255, 0.3);
}

.element-dragon .pokemon-sprite {
    animation: dragonRoar 4s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(120, 60, 255, 0.8)) brightness(1.08);
}

.element-dragon .tile-number {
    color: #FFFFFF !important;
    text-shadow: 
        -2px -2px 0 #1a0033,
        2px -2px 0 #1a0033,
        -2px 2px 0 #1a0033,
        2px 2px 0 #1a0033,
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(120, 60, 255, 0.8) !important;
    -webkit-text-stroke: 1px #1a0033;
}

@keyframes dragonAura {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(120, 60, 255, 0.6), 0 0 40px rgba(80, 0, 180, 0.3), inset 0 0 25px rgba(180, 100, 255, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 25px rgba(130, 70, 255, 0.7), 0 0 50px rgba(90, 20, 200, 0.4), inset 0 0 30px rgba(190, 120, 255, 0.4);
        transform: scale(1.01);
    }
}

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

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

/* Частицы дракона */
.particles-dragon::before,
.particles-dragon::after {
    content: '🔥';
    position: absolute;
    font-size: 14px;
    animation: dragonFlame 0.8s ease-out infinite;
    opacity: 0;
}

.particles-dragon::before {
    left: 10%;
    bottom: 30%;
    content: '💜';
}

.particles-dragon::after {
    right: 10%;
    top: 30%;
    content: '⭐';
    animation-delay: 0.4s;
}

@keyframes dragonFlame {
    0% { opacity: 0; transform: scale(0.3) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
    100% { opacity: 0; transform: scale(0.3) rotate(360deg); }
}

/* ============================================ */
/* СТИХИЯ: POISON ☠️ */
/* ============================================ */
.element-poison {
    background: linear-gradient(135deg, rgba(160, 64, 160, 0.5) 0%, rgba(100, 40, 130, 0.5) 100%) !important;
    border: 2px solid #A040A0 !important;
    animation: poisonBubble 4s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(160, 64, 160, 0.6), inset 0 0 25px rgba(200, 100, 200, 0.3);
}
.element-poison .pokemon-sprite { animation: poisonWobble 4s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(160, 64, 160, 0.8)) hue-rotate(-10deg); }
.element-poison .tile-number { color: #FFFFFF !important; text-shadow: -2px -2px 0 #4a004a, 2px -2px 0 #4a004a, -2px 2px 0 #4a004a, 2px 2px 0 #4a004a, 0 0 10px rgba(255,255,255,0.8) !important; -webkit-text-stroke: 1px #4a004a; }
@keyframes poisonBubble { 0%,100% { transform: scale(1); } 50% { transform: scale(1.01); } }
@keyframes poisonWobble { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.particles-poison::before, .particles-poison::after { content: '💀'; position: absolute; font-size: 10px; animation: poisonRise 4s ease-out infinite; opacity: 0; }
.particles-poison::before { left: 20%; } .particles-poison::after { left: 70%; animation-delay: 2s; }
@keyframes poisonRise { 0%,100% { opacity: 0; } 50% { opacity: 0.5; } }

/* ============================================ */
/* СТИХИЯ: GROUND 🌍 */
/* ============================================ */
.element-ground {
    background: linear-gradient(135deg, rgba(224, 192, 104, 0.5) 0%, rgba(180, 140, 60, 0.5) 100%) !important;
    border: 3px solid #E0C068 !important;
    animation: groundQuake 4s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(200, 160, 80, 0.6), inset 0 0 20px rgba(220, 180, 100, 0.3);
}
.element-ground .pokemon-sprite { animation: groundShake 4s ease-in-out infinite; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4)); }
.element-ground .tile-number { color: #FFFFFF !important; text-shadow: -2px -2px 0 #4d3508, 2px -2px 0 #4d3508, -2px 2px 0 #4d3508, 2px 2px 0 #4d3508, 0 0 10px rgba(255,255,255,0.8) !important; -webkit-text-stroke: 1px #4d3508; }
@keyframes groundQuake { 0%,100% { transform: scale(1); } 50% { transform: scale(1.01); } }
@keyframes groundShake { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.particles-ground::before, .particles-ground::after { content: '🌋'; position: absolute; font-size: 12px; animation: groundErupt 4s ease-out infinite; opacity: 0; }
@keyframes groundErupt { 0%,100% { opacity: 0; } 50% { opacity: 0.5; } }

/* ============================================ */
/* СТИХИЯ: FLYING 🦅 */
/* Плавные мягкие движения без резких рывков */
/* ============================================ */
.element-flying {
    background: linear-gradient(135deg, rgba(168, 144, 240, 0.5) 0%, rgba(120, 180, 255, 0.5) 100%) !important;
    border: 2px solid #A890F0 !important;
    animation: flyingFloat 4s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(168, 144, 240, 0.5), inset 0 0 20px rgba(200, 180, 255, 0.25);
}
.element-flying .pokemon-sprite { animation: flyingSoar 4s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(168, 144, 240, 0.6)); }
.element-flying .tile-number { color: #FFFFFF !important; text-shadow: -2px -2px 0 #2e2878, 2px -2px 0 #2e2878, -2px 2px 0 #2e2878, 2px 2px 0 #2e2878, 0 0 10px rgba(255,255,255,0.8) !important; -webkit-text-stroke: 1px #2e2878; }
@keyframes flyingFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes flyingSoar { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-3px) rotate(1deg); } }
.particles-flying::before, .particles-flying::after { content: '🌬️'; position: absolute; font-size: 12px; animation: windBlow 3s linear infinite; opacity: 0; }
@keyframes windBlow { 0% { left: 100%; opacity: 0.6; } 100% { left: -20%; opacity: 0; } }

/* ============================================ */
/* СТИХИЯ: BUG 🐛 */
/* ============================================ */
.element-bug {
    background: linear-gradient(135deg, rgba(168, 184, 32, 0.5) 0%, rgba(120, 140, 20, 0.5) 100%) !important;
    border: 2px solid #A8B820 !important;
    animation: bugCrawl 4s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(168, 184, 32, 0.6), inset 0 0 20px rgba(200, 210, 80, 0.3);
}
.element-bug .pokemon-sprite { animation: bugWiggle 4s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(168,184,32,0.8)); }
.element-bug .tile-number { color: #FFFFFF !important; text-shadow: -2px -2px 0 #3d4a08, 2px -2px 0 #3d4a08, -2px 2px 0 #3d4a08, 2px 2px 0 #3d4a08, 0 0 10px rgba(255,255,255,0.8) !important; -webkit-text-stroke: 1px #3d4a08; }
@keyframes bugCrawl { 0%,100% { transform: scale(1); } 50% { transform: scale(1.01); } }
@keyframes bugWiggle { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.particles-bug::before, .particles-bug::after { content: '🦋'; position: absolute; font-size: 10px; animation: bugFly 4s ease-in-out infinite; opacity: 0; }
@keyframes bugFly { 0%,100% { opacity: 0; transform: translate(0,0); } 50% { opacity: 0.6; transform: translate(5px, -5px); } }

/* ============================================ */
/* СТИХИЯ: FIGHTING 🥊 */
/* ============================================ */
.element-fighting {
    background: linear-gradient(135deg, rgba(192, 48, 40, 0.5) 0%, rgba(150, 30, 30, 0.5) 100%) !important;
    border: 3px solid #C03028 !important;
    animation: fightingPunch 4s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(192, 48, 40, 0.7), inset 0 0 25px rgba(220, 80, 70, 0.4);
}
.element-fighting .pokemon-sprite { animation: fightingStrike 4s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(192,48,40,0.9)); }
.element-fighting .tile-number { color: #FFFFFF !important; text-shadow: -2px -2px 0 #4d0f0f, 2px -2px 0 #4d0f0f, -2px 2px 0 #4d0f0f, 2px 2px 0 #4d0f0f, 0 0 10px rgba(255,255,255,0.8) !important; -webkit-text-stroke: 1px #4d0f0f; font-weight: 900 !important; }
@keyframes fightingPunch { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
@keyframes fightingStrike { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.particles-fighting::before, .particles-fighting::after { content: '💥'; position: absolute; font-size: 14px; animation: fightingImpact 3s ease-out infinite; opacity: 0; }
@keyframes fightingImpact { 0%,100% { opacity: 0; transform: scale(0.8); } 50% { opacity: 0.5; transform: scale(1.1); } }

/* ============================================ */
/* СТИХИЯ: GHOST 👻 */
/* ============================================ */
.element-ghost {
    background: linear-gradient(135deg, rgba(112, 88, 152, 0.6) 0%, rgba(80, 50, 120, 0.6) 100%) !important;
    border: 2px solid #705898 !important;
    animation: ghostPhase 4s ease-in-out infinite;
    box-shadow: 0 0 18px rgba(112, 88, 152, 0.5), inset 0 0 20px rgba(150, 120, 200, 0.3);
}
.element-ghost .pokemon-sprite { animation: ghostFloat 4s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(112,88,152,0.7)) opacity(0.95); }
.element-ghost .tile-number { color: #FFFFFF !important; text-shadow: -2px -2px 0 #1a0033, 2px -2px 0 #1a0033, -2px 2px 0 #1a0033, 2px 2px 0 #1a0033, 0 0 10px rgba(255,255,255,0.8) !important; -webkit-text-stroke: 1px #1a0033; }
@keyframes ghostPhase { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.95; transform: scale(1.01); } }
@keyframes ghostFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.particles-ghost::before, .particles-ghost::after { content: '👁️'; position: absolute; font-size: 10px; animation: ghostEyes 4s ease-in-out infinite; opacity: 0; }
@keyframes ghostEyes { 0%,100% { opacity: 0; } 50% { opacity: 0.5; } }

/* ============================================ */
/* СТИХИЯ: DARK 🌑 */
/* Более светлые тона для комфорта глаз */
/* ============================================ */
.element-dark {
    background: linear-gradient(135deg, rgba(140, 115, 100, 0.7) 0%, rgba(80, 65, 60, 0.7) 100%) !important;
    border: 2px solid #8a7060 !important;
    animation: darkPulse 3s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(60, 50, 45, 0.5), inset 0 0 20px rgba(120, 100, 90, 0.3);
}
.element-dark .pokemon-sprite { animation: darkLurk 3s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(60,50,45,0.7)) brightness(1); }
.element-dark .tile-number { color: #FFFFFF !important; text-shadow: -2px -2px 0 #3d3530, 2px -2px 0 #3d3530, -2px 2px 0 #3d3530, 2px 2px 0 #3d3530, 0 0 10px rgba(255,255,255,0.9) !important; -webkit-text-stroke: 1px #3d3530; }
@keyframes darkPulse { 0%,100% { box-shadow: 0 0 15px rgba(60,50,45,0.5); } 50% { box-shadow: 0 0 20px rgba(80,70,60,0.6); } }
@keyframes darkLurk { 0%,100% { transform: scale(1); } 50% { transform: scale(0.99); } }
.particles-dark::before, .particles-dark::after { content: '🌙'; position: absolute; font-size: 10px; animation: darkOrb 3s ease-in-out infinite; opacity: 0; }
@keyframes darkOrb { 0%,100% { opacity: 0; transform: scale(0.8); } 50% { opacity: 0.5; transform: scale(1); } }

/* ============================================ */
/* СТИХИЯ: STEEL ⚔️ */
/* Мягкий металлический блеск без ослепления */
/* ============================================ */
.element-steel {
    background: linear-gradient(135deg, rgba(170, 170, 195, 0.5) 0%, rgba(130, 130, 155, 0.5) 100%) !important;
    border: 2px solid #a0a0b8 !important;
    animation: steelShine 4s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(170, 170, 195, 0.4), inset 0 0 15px rgba(200, 200, 220, 0.3);
}
.element-steel .pokemon-sprite { animation: steelGlint 4s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(170,170,195,0.6)) brightness(1.02); }
.element-steel .tile-number { color: #2a2a35 !important; text-shadow: -1px -1px 0 #e8e8f0, 1px -1px 0 #e8e8f0, -1px 1px 0 #e8e8f0, 1px 1px 0 #e8e8f0, 0 0 6px rgba(255,255,255,0.7) !important; -webkit-text-stroke: 1px #e8e8f0; }
@keyframes steelShine { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.05); } }
@keyframes steelGlint { 0%,100% { filter: brightness(1.02); } 50% { filter: brightness(1.08); } }
.particles-steel::before, .particles-steel::after { content: '✨'; position: absolute; font-size: 10px; animation: steelSparkle 3s ease-out infinite; opacity: 0; }
@keyframes steelSparkle { 0%,100% { opacity: 0; transform: scale(0.8); } 50% { opacity: 0.5; transform: scale(1); } }

/* ============================================ */
/* СТИХИЯ: FAIRY 🧚 */
/* Мягкое розовое сияние без резких движений */
/* ============================================ */
.element-fairy {
    background: linear-gradient(135deg, rgba(238, 153, 172, 0.45) 0%, rgba(255, 182, 193, 0.45) 100%) !important;
    border: 2px solid #EE99AC !important;
    animation: fairySparkle 4s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(238, 153, 172, 0.5), inset 0 0 20px rgba(255, 200, 210, 0.3);
}
.element-fairy .pokemon-sprite { animation: fairyDance 5s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(238,153,172,0.7)) brightness(1.05); }
.element-fairy .tile-number { color: #FFFFFF !important; text-shadow: -2px -2px 0 #8B2252, 2px -2px 0 #8B2252, -2px 2px 0 #8B2252, 2px 2px 0 #8B2252, 0 0 8px rgba(255,255,255,0.7) !important; -webkit-text-stroke: 1px #8B2252; }
@keyframes fairySparkle { 0%,100% { box-shadow: 0 0 15px rgba(238,153,172,0.5); } 50% { box-shadow: 0 0 20px rgba(255,182,193,0.6); } }
@keyframes fairyDance { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-2px) rotate(1deg); } }
.particles-fairy::before, .particles-fairy::after { content: '💕'; position: absolute; font-size: 10px; animation: fairyHeart 4s ease-in-out infinite; opacity: 0; }
@keyframes fairyHeart { 0%,100% { opacity: 0; transform: scale(0.7) translateY(0); } 50% { opacity: 0.6; transform: scale(1) translateY(-8px); } }

/* ============================================ */
/* СТИХИЯ: COSMIC 🌌 */
/* ============================================ */
.element-cosmic {
    background: linear-gradient(135deg, rgba(61, 26, 120, 0.7) 0%, rgba(20, 10, 60, 0.7) 100%) !important;
    border: 2px solid #3D1A78 !important;
    animation: cosmicWarp 5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(100, 50, 200, 0.5), 0 0 40px rgba(50, 20, 150, 0.3), inset 0 0 25px rgba(150, 100, 255, 0.3);
}
.element-cosmic .pokemon-sprite { animation: cosmicOrbit 5s ease-in-out infinite; filter: drop-shadow(0 0 12px rgba(100,50,200,0.7)) brightness(1.08); }
.element-cosmic .tile-number { color: #FFFFFF !important; text-shadow: -2px -2px 0 #1a0a3c, 2px -2px 0 #1a0a3c, -2px 2px 0 #1a0a3c, 2px 2px 0 #1a0a3c, 0 0 12px rgba(255,255,255,0.9), 0 0 18px rgba(150,100,255,0.6) !important; -webkit-text-stroke: 1px #1a0a3c; }
@keyframes cosmicWarp { 0%,100% { transform: scale(1); } 50% { transform: scale(1.01); } }
@keyframes cosmicOrbit { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.particles-cosmic::before, .particles-cosmic::after { content: '⭐'; position: absolute; font-size: 10px; animation: cosmicStar 5s ease-in-out infinite; opacity: 0; }
@keyframes cosmicStar { 0%,100% { opacity: 0; transform: scale(0.8); } 50% { opacity: 0.5; transform: scale(1); } }

/* ============================================ */
/* СТИХИЯ: SHADOW 🖤 */
/* Более светлые тени для комфорта глаз */
/* ============================================ */
.element-shadow {
    background: linear-gradient(135deg, rgba(70, 65, 90, 0.7) 0%, rgba(50, 45, 65, 0.7) 100%) !important;
    border: 2px solid #5a5575 !important;
    animation: shadowConsume 4s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(70, 65, 90, 0.5), inset 0 0 20px rgba(90, 85, 110, 0.3);
}
.element-shadow .pokemon-sprite { animation: shadowMerge 4s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(70,65,90,0.7)) brightness(0.95); }
.element-shadow .tile-number { color: #FFFFFF !important; text-shadow: -2px -2px 0 #3a3550, 2px -2px 0 #3a3550, -2px 2px 0 #3a3550, 2px 2px 0 #3a3550, 0 0 10px rgba(255,255,255,0.9) !important; -webkit-text-stroke: 1px #3a3550; }
@keyframes shadowConsume { 0%,100% { box-shadow: 0 0 15px rgba(70,65,90,0.5); transform: scale(1); } 50% { box-shadow: 0 0 20px rgba(80,75,100,0.6); transform: scale(1.01); } }
@keyframes shadowMerge { 0%,100% { opacity: 1; } 50% { opacity: 0.9; } }
.particles-shadow::before, .particles-shadow::after { content: '💜'; position: absolute; font-size: 10px; animation: shadowVoid 4s ease-in-out infinite; opacity: 0; }
@keyframes shadowVoid { 0%,100% { opacity: 0; transform: scale(0.9); } 50% { opacity: 0.4; transform: scale(1.1); } }

/* ============================================ */
/* СТИХИЯ: LEGENDARY ✨ */
/* Нежное золотистое сияние без ослепления */
/* ============================================ */
.element-legendary {
    background: linear-gradient(135deg, rgba(230, 195, 80, 0.45) 0%, rgba(220, 175, 70, 0.45) 50%, rgba(210, 160, 60, 0.45) 100%) !important;
    border: 3px solid #d4b050 !important;
    animation: legendaryGlory 4s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(220, 190, 80, 0.5), inset 0 0 25px rgba(240, 220, 150, 0.3);
}
.element-legendary .pokemon-sprite { animation: legendaryAscend 4s ease-in-out infinite; filter: drop-shadow(0 0 12px rgba(220,190,80,0.6)) brightness(1.08); }
.element-legendary .tile-number { color: #3a3020 !important; text-shadow: -1px -1px 0 #f5f0e0, 1px -1px 0 #f5f0e0, -1px 1px 0 #f5f0e0, 1px 1px 0 #f5f0e0, 0 0 8px rgba(255,255,255,0.8) !important; -webkit-text-stroke: 1px #f5f0e0; }
@keyframes legendaryGlory { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
@keyframes legendaryAscend { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.02); } }
.particles-legendary::before, .particles-legendary::after { content: '✨'; position: absolute; font-size: 12px; animation: legendarySparkle 3s ease-out infinite; opacity: 0; }
.particles-legendary::before { top: 10%; left: 10%; animation-delay: 0s; }
.particles-legendary::after { bottom: 10%; right: 10%; animation-delay: 1.5s; content: '⭐'; }
@keyframes legendarySparkle { 0%,100% { opacity: 0; transform: scale(0.7) rotate(0deg); } 50% { opacity: 0.6; transform: scale(1) rotate(90deg); } }

/* ============================================ */
/* БЕЙДЖ СТИХИИ */
/* ============================================ */
.element-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    font-size: 14px;
    z-index: 5;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

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

/* Контейнер частиц */
.element-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 3;
}

/* ============================================ */
/* УВЕДОМЛЕНИЕ О СМЕНЕ СТИХИИ */
/* ============================================ */

.element-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    animation: notificationAppear 0.5s ease-out;
}

.element-notification.fade-out {
    animation: notificationFadeOut 0.5s ease-out forwards;
}

.element-notification-content {
    padding: 30px 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.element-notification-emoji {
    display: block;
    font-size: 80px;
    margin-bottom: 15px;
    animation: emojiPulse 0.5s ease-in-out infinite alternate;
}

.element-notification-text {
    display: block;
    font-size: 32px;
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.element-notification-score {
    display: block;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: bold;
}

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

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

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

/* Стили уведомлений для каждой стихии (22 стихии) */
.element-notification-content.element-normal { background: linear-gradient(135deg, rgba(168, 168, 120, 0.95), rgba(200, 200, 170, 0.95)); }
.element-notification-content.element-fire { background: linear-gradient(135deg, rgba(240, 128, 48, 0.95), rgba(255, 80, 0, 0.95)); }
.element-notification-content.element-water { background: linear-gradient(135deg, rgba(104, 144, 240, 0.95), rgba(0, 100, 200, 0.95)); }
.element-notification-content.element-electric { background: linear-gradient(135deg, rgba(248, 208, 48, 0.95), rgba(255, 230, 0, 0.95)); }
.element-notification-content.element-grass { background: linear-gradient(135deg, rgba(120, 200, 80, 0.95), rgba(60, 150, 40, 0.95)); }
.element-notification-content.element-poison { background: linear-gradient(135deg, rgba(160, 64, 160, 0.95), rgba(100, 40, 130, 0.95)); }
.element-notification-content.element-ground { background: linear-gradient(135deg, rgba(224, 192, 104, 0.95), rgba(180, 140, 60, 0.95)); }
.element-notification-content.element-flying { background: linear-gradient(135deg, rgba(168, 144, 240, 0.95), rgba(120, 180, 255, 0.95)); }
.element-notification-content.element-bug { background: linear-gradient(135deg, rgba(168, 184, 32, 0.95), rgba(120, 140, 20, 0.95)); }
.element-notification-content.element-rock { background: linear-gradient(135deg, rgba(184, 160, 56, 0.95), rgba(140, 110, 40, 0.95)); }
.element-notification-content.element-ice { background: linear-gradient(135deg, rgba(152, 216, 216, 0.95), rgba(100, 180, 220, 0.95)); }
.element-notification-content.element-fighting { background: linear-gradient(135deg, rgba(192, 48, 40, 0.95), rgba(150, 30, 30, 0.95)); }
.element-notification-content.element-psychic { background: linear-gradient(135deg, rgba(248, 88, 136, 0.95), rgba(180, 60, 180, 0.95)); }
.element-notification-content.element-ghost { background: linear-gradient(135deg, rgba(112, 88, 152, 0.95), rgba(80, 50, 120, 0.95)); }
.element-notification-content.element-dark { background: linear-gradient(135deg, rgba(140, 115, 100, 0.95), rgba(100, 85, 75, 0.95)); }
.element-notification-content.element-steel { background: linear-gradient(135deg, rgba(184, 184, 208, 0.95), rgba(140, 140, 170, 0.95)); }
.element-notification-content.element-fairy { background: linear-gradient(135deg, rgba(238, 153, 172, 0.95), rgba(255, 182, 193, 0.95)); }
.element-notification-content.element-dragon { background: linear-gradient(135deg, rgba(112, 56, 248, 0.95), rgba(80, 0, 180, 0.95)); }
.element-notification-content.element-cosmic { background: linear-gradient(135deg, rgba(61, 26, 120, 0.95), rgba(20, 10, 60, 0.95)); }
.element-notification-content.element-shadow { background: linear-gradient(135deg, rgba(90, 85, 110, 0.95), rgba(70, 65, 90, 0.95)); }
.element-notification-content.element-legendary { background: linear-gradient(135deg, rgba(230, 200, 100, 0.95), rgba(220, 185, 85, 0.95)); animation: legendaryNotification 3s ease-in-out infinite alternate; }
@keyframes legendaryNotification { 0% { box-shadow: 0 0 15px rgba(220,190,80,0.5); } 100% { box-shadow: 0 0 20px rgba(220,190,80,0.6); } }

/* ============================================ */
/* ИНДИКАТОР ТЕКУЩЕЙ СТИХИИ */
/* ============================================ */

.element-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.indicator-emoji {
    font-size: 24px;
    animation: indicatorPulse 1.5s ease-in-out infinite;
}

.indicator-name {
    font-size: 12px;
    letter-spacing: 1px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

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

/* Цвета индикатора для каждой стихии (22 стихии) */
.element-indicator-normal { background: linear-gradient(135deg, #A8A878, #C8C8AA); }
.element-indicator-fire { background: linear-gradient(135deg, #F08030, #FF4500); }
.element-indicator-water { background: linear-gradient(135deg, #6890F0, #0064C8); }
.element-indicator-electric { background: linear-gradient(135deg, #F8D030, #FFE600); }
.element-indicator-grass { background: linear-gradient(135deg, #78C850, #3C9628); }
.element-indicator-poison { background: linear-gradient(135deg, #A040A0, #642882); }
.element-indicator-ground { background: linear-gradient(135deg, #E0C068, #B48C3C); }
.element-indicator-flying { background: linear-gradient(135deg, #A890F0, #78B4FF); }
.element-indicator-bug { background: linear-gradient(135deg, #A8B820, #788C14); }
.element-indicator-rock { background: linear-gradient(135deg, #B8A038, #8C6E28); }
.element-indicator-ice { background: linear-gradient(135deg, #98D8D8, #64B4DC); }
.element-indicator-fighting { background: linear-gradient(135deg, #C03028, #961E1E); }
.element-indicator-psychic { background: linear-gradient(135deg, #F85888, #B43CB4); }
.element-indicator-ghost { background: linear-gradient(135deg, #705898, #503278); }
.element-indicator-dark { background: linear-gradient(135deg, #8a7060, #6a5545); }
.element-indicator-steel { background: linear-gradient(135deg, #B8B8D0, #8C8CAA); }
.element-indicator-fairy { background: linear-gradient(135deg, #EE99AC, #FFB6C1); }
.element-indicator-dragon { background: linear-gradient(135deg, #7038F8, #5000B4); }
.element-indicator-cosmic { background: linear-gradient(135deg, #3D1A78, #140A3C); }
.element-indicator-shadow { background: linear-gradient(135deg, #6a6580, #5a5575); }
.element-indicator-legendary { background: linear-gradient(135deg, #d4b050, #c9a545); animation: legendaryIndicator 3s ease-in-out infinite alternate; }
@keyframes legendaryIndicator { 0% { box-shadow: 0 0 8px rgba(210,175,70,0.4); } 100% { box-shadow: 0 0 12px rgba(210,175,70,0.5); } }

/* ============================================ */
/* ТЕМЫ ФОНА ДЛЯ GRID ПО СТИХИЯМ (22 стихии) */
/* Мягкие приглушённые цвета для комфорта глаз */
/* ============================================ */

.element-theme-normal { background: #a39b8b; }
.element-theme-fire { background: linear-gradient(135deg, #5c3d2e, #7a5a4a); box-shadow: inset 0 0 20px rgba(180, 80, 40, 0.15); }
.element-theme-water { background: linear-gradient(135deg, #3a4a5c, #4a5a6c); box-shadow: inset 0 0 20px rgba(80, 120, 160, 0.15); }
.element-theme-electric { background: linear-gradient(135deg, #6a5a3a, #7a6a4a); box-shadow: inset 0 0 20px rgba(180, 160, 80, 0.15); }
.element-theme-grass { background: linear-gradient(135deg, #3a5a3a, #4a6a4a); box-shadow: inset 0 0 20px rgba(80, 140, 80, 0.15); }
.element-theme-poison { background: linear-gradient(135deg, #4a3a4a, #5a4a5a); box-shadow: inset 0 0 20px rgba(120, 80, 120, 0.15); }
.element-theme-ground { background: linear-gradient(135deg, #5a4a3a, #6a5a4a); box-shadow: inset 0 0 20px rgba(140, 110, 70, 0.15); }
.element-theme-flying { background: linear-gradient(135deg, #4a5a6a, #6a7a8a); box-shadow: inset 0 0 20px rgba(120, 140, 180, 0.15); }
.element-theme-bug { background: linear-gradient(135deg, #4a5a3a, #5a6a4a); box-shadow: inset 0 0 20px rgba(120, 140, 60, 0.15); }
.element-theme-rock { background: linear-gradient(135deg, #5a5045, #6a6055); box-shadow: inset 0 0 20px rgba(100, 90, 60, 0.15); }
.element-theme-ice { background: linear-gradient(135deg, #4a5a6a, #6a8090); box-shadow: inset 0 0 20px rgba(140, 180, 200, 0.15); }
.element-theme-fighting { background: linear-gradient(135deg, #4a3030, #5a4040); box-shadow: inset 0 0 20px rgba(140, 60, 60, 0.15); }
.element-theme-psychic { background: linear-gradient(135deg, #5a4a5a, #7a6a7a); box-shadow: inset 0 0 20px rgba(160, 100, 140, 0.15); }
.element-theme-ghost { background: linear-gradient(135deg, #3a3a4a, #4a4a5a); box-shadow: inset 0 0 20px rgba(90, 80, 110, 0.15); }
.element-theme-dark { background: linear-gradient(135deg, #4a4540, #5a5550); box-shadow: inset 0 0 15px rgba(80, 70, 65, 0.2); }
.element-theme-steel { background: linear-gradient(135deg, #5a5a64, #6a6a74); box-shadow: inset 0 0 20px rgba(140, 140, 160, 0.15); }
.element-theme-fairy { background: linear-gradient(135deg, #6a5560, #7a6570); box-shadow: inset 0 0 20px rgba(160, 120, 140, 0.15); }
.element-theme-dragon { background: linear-gradient(135deg, #3a3050, #4a4060); box-shadow: inset 0 0 20px rgba(100, 80, 140, 0.15); }
.element-theme-cosmic { background: linear-gradient(135deg, #2a2040, #3a3050); box-shadow: inset 0 0 20px rgba(80, 60, 120, 0.2); }
.element-theme-shadow { background: linear-gradient(135deg, #4a4560, #5a5570); box-shadow: inset 0 0 15px rgba(70, 65, 90, 0.2); }
.element-theme-legendary { background: linear-gradient(135deg, #6a5a40, #7a6a50); box-shadow: inset 0 0 15px rgba(200, 175, 90, 0.15); animation: legendaryTheme 4s ease-in-out infinite alternate; }
@keyframes legendaryTheme { 0% { box-shadow: inset 0 0 15px rgba(200, 175, 90, 0.15); } 100% { box-shadow: inset 0 0 20px rgba(200, 175, 90, 0.2); } }

/* Стили ячеек по стихиям (22 стихии) */
.cell-fire { background: rgba(255, 100, 0, 0.2); }
.cell-water { background: rgba(100, 150, 255, 0.2); }
.cell-electric { background: rgba(255, 230, 0, 0.2); }
.cell-grass { background: rgba(100, 200, 100, 0.2); }
.cell-poison { background: rgba(160, 64, 160, 0.2); }
.cell-ground { background: rgba(200, 160, 80, 0.2); }
.cell-flying { background: rgba(168, 144, 240, 0.2); }
.cell-bug { background: rgba(168, 184, 32, 0.2); }
.cell-rock { background: rgba(180, 150, 100, 0.2); }
.cell-ice { background: rgba(200, 240, 255, 0.2); }
.cell-fighting { background: rgba(192, 48, 40, 0.2); }
.cell-psychic { background: rgba(250, 100, 200, 0.2); }
.cell-ghost { background: rgba(112, 88, 152, 0.2); }
.cell-dark { background: rgba(40, 30, 30, 0.3); }
.cell-steel { background: rgba(184, 184, 208, 0.2); }
.cell-fairy { background: rgba(238, 153, 172, 0.2); }
.cell-dragon { background: rgba(150, 100, 255, 0.2); }
.cell-cosmic { background: rgba(100, 50, 200, 0.2); }
.cell-shadow { background: rgba(0, 0, 0, 0.3); }
.cell-legendary { background: rgba(255, 215, 0, 0.2); }

.tile-128 .tile-number { font-size: 28px; }
.tile-256 .tile-number { font-size: 28px; }
.tile-512 .tile-number { font-size: 26px; }
.tile-1024 .tile-number { font-size: 24px; }
.tile-2048 .tile-number { font-size: 22px; }
.tile-super .tile-number { font-size: 20px; }

/* Специальные стили для Dragon и Legendary стихий */
.element-dragon .tile-number,
.element-cosmic .tile-number,
.element-shadow .tile-number,
.element-legendary .tile-number {
    font-size: 22px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
}

.element-legendary .tile-number {
    font-size: 20px;
    background: linear-gradient(135deg, rgba(230, 200, 100, 0.4), rgba(220, 185, 85, 0.4));
    border: 1px solid rgba(220, 190, 80, 0.5);
}

.game-over {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(238, 228, 218, 0.9);
    border-radius: 6px;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.game-over.show {
    display: flex;
}

.game-over-message {
    text-align: center;
    color: #776e65;
}

.game-over-message h2 {
    margin-bottom: 20px;
    font-size: 48px;
}

.game-over-message button {
    background: #8f7a66;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 15px 30px;
    min-height: 48px;
    min-width: 120px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.game-over-message button:hover {
    background: #9f8a76;
}

/* Web3 кнопки */
.web3-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    margin-bottom: 10px;
}

.web3-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    min-height: 42px;
    min-width: 42px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    /* Плавные переходы */
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.25s ease,
                background 0.3s ease;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    will-change: transform, box-shadow;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Для ripple эффекта */
    position: relative;
    overflow: hidden;
}

.web3-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}

.web3-btn:active::after {
    width: 200px;
    height: 200px;
    opacity: 1;
    transition: width 0s, height 0s, opacity 0s;
}

.web3-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.web3-btn:active {
    transform: scale(0.92);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.08s ease, box-shadow 0.1s ease;
}

.web3-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gm-btn {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: #333;
    box-shadow: 0 4px 20px rgba(246, 211, 101, 0.4);
}

.gm-btn:hover {
    background: linear-gradient(135deg, #fda085 0%, #f6d365 100%);
    box-shadow: 0 8px 30px rgba(246, 211, 101, 0.5);
}

.gm-btn:active {
    box-shadow: 0 2px 10px rgba(246, 211, 101, 0.3);
}

.deploy-btn {
    background: linear-gradient(135deg, #4a5a6a 0%, #5a6a7a 100%);
    color: white;
}

.deploy-btn:hover {
    background: linear-gradient(135deg, #5a6a7a 0%, #6a7a8a 100%);
}

.test-btn {
    background: linear-gradient(135deg, #F08030 0%, #FF4500 50%, #7038F8 100%);
    color: white;
    animation: testBtnGlow 2s ease-in-out infinite;
}

.test-btn:hover {
    background: linear-gradient(135deg, #7038F8 0%, #FF4500 50%, #F08030 100%);
    transform: translateY(-2px) scale(1.05);
}

@keyframes testBtnGlow {
    0%, 100% { box-shadow: 0 4px 15px rgba(240, 128, 48, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(112, 56, 248, 0.6); }
}

/* Подсказка тестового режима */
.test-mode-hint {
    display: none;
    background: linear-gradient(135deg, #4a5568 0%, #5a6578 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
    animation: hintPulse 2s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(60, 70, 90, 0.3);
}

.test-mode-hint strong {
    color: #f0c040;
}

@keyframes hintPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 15px rgba(60, 70, 90, 0.3); }
    50% { transform: scale(1.02); box-shadow: 0 6px 20px rgba(70, 80, 100, 0.4); }
}

.btn-icon {
    font-size: 20px;
}

.btn-text {
    letter-spacing: 0.5px;
}

.web3-status {
    text-align: center;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    min-height: 0;
    transition: all 0.3s ease;
}

.web3-status:empty {
    display: none;
    padding: 0;
    margin: 0;
}

.web3-status.success {
    background: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
}

.web3-status.error {
    background: rgba(244, 67, 54, 0.2);
    color: #c62828;
}

.web3-status.loading {
    background: rgba(33, 150, 243, 0.2);
    color: #1565c0;
}

.wallet-info {
    text-align: center;
    margin-bottom: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-family: monospace;
    min-height: 0;
}

.wallet-info:empty {
    display: none;
}

.wallet-info.connected {
    background: linear-gradient(135deg, rgba(59, 91, 167, 0.15) 0%, rgba(255, 203, 5, 0.15) 100%);
    color: #3B5BA7;
    border: 1px solid rgba(59, 91, 167, 0.3);
}

.wallet-name {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #3B5BA7;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.instructions {
    text-align: center;
    color: #999;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 8px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.instructions-desktop {
    display: block;
}

.instructions-mobile {
    display: none;
}

@media (max-width: 600px) {
    .instructions-desktop {
        display: none;
    }
    .instructions-mobile {
        display: block;
        font-size: 11px;
    }
}

/* GM Counter */
.gm-counter-container {
    margin-bottom: 15px;
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

/* Компактная версия GM counter */
.gm-counter-container.compact {
    margin-bottom: 8px;
    margin-top: 8px;
}

.gm-counter-container.compact .gm-counter-box {
    padding: 8px 14px;
    min-width: auto;
    gap: 10px;
    border-radius: 25px;
}

.gm-counter-container.compact .gm-counter-icon {
    width: 32px;
    height: 32px;
}

.gm-counter-container.compact .gm-counter-label {
    font-size: 10px;
}

.gm-counter-container.compact .gm-counter-value {
    font-size: 18px;
}

.gm-counter-container.compact .gm-counter-date {
    display: none;
}

.gm-counter-box {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    border-radius: 16px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(253, 160, 133, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    min-width: 220px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.gm-counter-box:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(253, 160, 133, 0.5), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.gm-counter-box.pulse-glow {
    animation: gmCounterGlow 0.5s ease-out;
}

@keyframes gmCounterGlow {
    0% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 4px 20px rgba(253, 160, 133, 0.4); }
    100% { box-shadow: 0 4px 20px rgba(253, 160, 133, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2); }
}

.gm-counter-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.gm-pokemon-sprite {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

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

@keyframes celebrate {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1) rotate(-3deg);
    }
    50% {
        transform: scale(1.15) rotate(3deg);
    }
    75% {
        transform: scale(1.1) rotate(-3deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.gm-counter-content {
    flex: 1;
    text-align: left;
}

.gm-counter-label {
    color: rgba(0, 0, 0, 0.7);
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.gm-counter-value {
    color: #333;
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.5);
    transition: transform 0.2s ease;
}

.gm-counter-date {
    color: rgba(0, 0, 0, 0.6);
    font-size: 11px;
    font-weight: 500;
}

/* GM Cooldown Timer */
.gm-cooldown {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    border-radius: 8px;
    font-size: 11px;
    color: white;
    font-weight: 600;
    animation: gmCooldownPulse 2s ease-in-out infinite;
}

.gm-cooldown-icon {
    font-size: 12px;
}

.gm-cooldown-timer {
    font-weight: 700;
    font-family: 'Courier New', monospace;
    min-width: 50px;
    text-align: center;
}

@keyframes gmCooldownPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.9; }
}

/* GM Panel Cooldown */
.gm-cooldown-panel {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    padding: 10px 15px !important;
    border-radius: 12px;
    margin-top: 5px;
}

.gm-cooldown-highlight {
    font-weight: 700;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
}

/* ============================================ */
/* Мотивирующие покемоны */
/* ============================================ */

.game-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 900px;
}

.motivator-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    max-width: 160px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    animation: motivatorFloat 3s ease-in-out infinite;
}

.motivator-left {
    animation-delay: 0s;
}

.motivator-right {
    animation-delay: 1.5s;
}

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

.motivator-container:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.motivator-bubble {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border-radius: 20px;
    padding: 12px 16px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #ffd54f;
    max-width: 140px;
    text-align: center;
    animation: bubblePulse 2s ease-in-out infinite;
}

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

.motivator-bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid #fff59d;
}

.motivator-bubble::before {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 14px solid #ffd54f;
}

.bubble-text {
    font-size: 13px;
    font-weight: bold;
    color: #333;
    line-height: 1.4;
    display: block;
}

.motivator-pokemon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
    border-radius: 50%;
    animation: pokemonBounce 1s ease-in-out infinite;
}

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

.motivator-sprite {
    width: 80px;
    height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.motivator-container:hover .motivator-sprite {
    transform: scale(1.15);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.motivator-name {
    font-size: 14px;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #4a6080 0%, #6a80a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Стили для разных уровней мотивации */
.motivator-container.level-starter .motivator-bubble {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #64b5f6;
}
.motivator-container.level-starter .motivator-bubble::after {
    border-top-color: #bbdefb;
}
.motivator-container.level-starter .motivator-bubble::before {
    border-top-color: #64b5f6;
}

.motivator-container.level-good .motivator-bubble {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #81c784;
}
.motivator-container.level-good .motivator-bubble::after {
    border-top-color: #c8e6c9;
}
.motivator-container.level-good .motivator-bubble::before {
    border-top-color: #81c784;
}

.motivator-container.level-great .motivator-bubble {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc80 100%);
    border-color: #ffb74d;
}
.motivator-container.level-great .motivator-bubble::after {
    border-top-color: #ffcc80;
}
.motivator-container.level-great .motivator-bubble::before {
    border-top-color: #ffb74d;
}

.motivator-container.level-amazing .motivator-bubble {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
    border-color: #f48fb1;
}
.motivator-container.level-amazing .motivator-bubble::after {
    border-top-color: #f8bbd9;
}
.motivator-container.level-amazing .motivator-bubble::before {
    border-top-color: #f48fb1;
}

.motivator-container.level-legendary .motivator-bubble {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    border-color: #ba68c8;
    animation: legendaryGlow 1.5s ease-in-out infinite;
}
.motivator-container.level-legendary .motivator-bubble::after {
    border-top-color: #e1bee7;
}
.motivator-container.level-legendary .motivator-bubble::before {
    border-top-color: #ba68c8;
}

.motivator-container.level-god .motivator-bubble {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-color: #ffd54f;
    animation: godGlow 1s ease-in-out infinite;
}
.motivator-container.level-god .motivator-bubble::after {
    border-top-color: #ffecb3;
}
.motivator-container.level-god .motivator-bubble::before {
    border-top-color: #ffd54f;
}

@keyframes legendaryGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(186, 104, 200, 0.5); }
    50% { box-shadow: 0 0 25px rgba(186, 104, 200, 0.8); }
}

@keyframes godGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
    50% { box-shadow: 0 0 35px rgba(255, 215, 0, 1); }
}

/* ============================================ */
/* Переключатель языков */
/* ============================================ */

.language-selector {
    position: relative;
    margin-top: 10px;
    z-index: 10000;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    min-height: 44px;
    min-width: 44px;
    background: linear-gradient(135deg, #4a5568 0%, #5a6578 100%);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.lang-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.lang-icon {
    font-size: 16px;
}

.lang-current {
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lang-dropdown {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.95);
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3), 
                0 -2px 10px rgba(0, 0, 0, 0.1),
                inset 0 -1px 0 rgba(255, 255, 255, 0.8);
    padding: 10px 0;
    margin-bottom: 10px;
    z-index: 10000;
    min-width: 160px;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Скрыто по умолчанию */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Плавные переходы */
    transition: opacity 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                visibility 0.25s;
    /* GPU ускорение */
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Для правого покемона - dropdown тоже вверх */
#lang-dropdown-right {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(10px) scale(0.95);
}

#lang-dropdown-right.show {
    transform: translateX(0) translateY(0) scale(1);
}

/* Плавное появление элементов внутри dropdown */
.lang-dropdown .lang-option {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
}

.lang-dropdown.show .lang-option {
    opacity: 1;
    transform: translateX(0);
}

/* Последовательная анимация появления */
.lang-dropdown.show .lang-option:nth-child(1) { transition-delay: 0.02s; }
.lang-dropdown.show .lang-option:nth-child(2) { transition-delay: 0.04s; }
.lang-dropdown.show .lang-option:nth-child(3) { transition-delay: 0.06s; }
.lang-dropdown.show .lang-option:nth-child(4) { transition-delay: 0.08s; }
.lang-dropdown.show .lang-option:nth-child(5) { transition-delay: 0.1s; }
.lang-dropdown.show .lang-option:nth-child(6) { transition-delay: 0.12s; }
.lang-dropdown.show .lang-option:nth-child(7) { transition-delay: 0.14s; }
.lang-dropdown.show .lang-option:nth-child(8) { transition-delay: 0.16s; }
.lang-dropdown.show .lang-option:nth-child(9) { transition-delay: 0.18s; }
.lang-dropdown.show .lang-option:nth-child(10) { transition-delay: 0.2s; }

.lang-dropdown::-webkit-scrollbar {
    width: 6px;
}

.lang-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.lang-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.lang-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    min-height: 48px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 14px;
    color: #333;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    border-radius: 8px;
    margin: 2px 6px;
    width: calc(100% - 12px);
    /* GPU ускорение для плавности */
    will-change: transform, background;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.lang-option:hover {
    background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 100%);
    transform: translateX(4px);
}

.lang-option:active {
    transform: scale(0.97) translateX(4px);
    background: linear-gradient(135deg, #d2e3fc 0%, #c2d9f7 100%);
    transition: transform 0.1s ease;
}

.lang-option.active {
    background: linear-gradient(135deg, #4285f4 0%, #3367d6 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.4);
}

.lang-option.active:hover {
    background: linear-gradient(135deg, #5a95f5 0%, #4477e6 100%);
    transform: translateX(4px);
}

.lang-option-flag {
    font-size: 20px;
    line-height: 1;
}

.lang-option-name {
    flex: 1;
    font-weight: 500;
}

.lang-option-code {
    font-size: 11px;
    text-transform: uppercase;
    opacity: 0.6;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.lang-option.active {
    background: linear-gradient(135deg, #4a5568 0%, #5a6578 100%);
    color: white;
}

.lang-option-flag {
    font-size: 18px;
    line-height: 1;
}

.lang-option-name {
    font-weight: 500;
}

.lang-option-code {
    font-size: 10px;
    opacity: 0.7;
    margin-left: auto;
    text-transform: uppercase;
}

/* Скрываем мотиваторы на маленьких экранах */
@media (max-width: 800px) {
    .game-wrapper {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
        gap: 12px;
    }
    
    /* Игра занимает всю ширину сверху */
    .container {
        order: 0;
        width: 100%;
        max-width: 500px;
    }
    
    /* Оба покемона в ряд под игрой */
    .motivator-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-width: auto;
        max-width: 160px;
        padding: 10px 12px;
        gap: 8px;
        order: 1;
    }
    
    .motivator-pokemon {
        width: 70px;
        height: 70px;
    }
    
    .motivator-sprite {
        width: 60px;
        height: 60px;
    }
    
    .motivator-bubble {
        max-width: 140px;
        padding: 8px 12px;
    }
    
    .motivator-bubble::after,
    .motivator-bubble::before {
        display: none;
    }
    
    .bubble-text {
        font-size: 12px;
    }
    
    .motivator-name {
        font-size: 11px;
    }
    
    .language-selector {
        margin-top: 5px;
    }
    
    .lang-btn {
        padding: 6px 10px;
        min-height: 38px;
        font-size: 11px;
    }
}

@media (max-width: 500px) {
    body {
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
        /* Предотвращаем bounce scroll на iOS */
        overscroll-behavior: none;
        -webkit-overflow-scrolling: auto;
    }

    .container {
        padding: 16px;
    }

    h1 {
        font-size: 36px;
        margin-bottom: 12px;
    }

    .game-controls-panel {
        gap: 6px;
        margin-bottom: 8px;
    }

    .controls-row {
        gap: 6px;
    }

    .element-indicator {
        padding: 8px;
        font-size: 11px;
    }

    .score-box-small {
        padding: 6px;
    }

    .score-box-small .score-label {
        font-size: 9px;
    }

    .score-box-small .score-value {
        font-size: 18px;
    }

    .score-box {
        min-width: 90px;
        padding: 8px 14px;
    }

    .new-game-btn {
        padding: 10px 16px;
        font-size: 15px;
    }

    .game-container {
        padding: 8px;
        margin-bottom: 12px;
        /* Оптимизации для мобильных свайпов */
        -webkit-overflow-scrolling: touch;
    }

    .grid-container {
        gap: 6px;
    }

    .cell {
        font-size: 28px;
        /* Отключаем анимации травы */
        animation: none !important;
    }
    
    .cell::before,
    .cell::after {
        animation: none !important;
    }

    .tile-number {
        font-size: 24px;
        padding: 2px 4px;
    }
    
    .pokemon-sprite {
        width: 80%;
        height: 65%;
        top: 2%;
        left: 10%;
    }

    .tile-128 .tile-number { font-size: 20px; }
    .tile-256 .tile-number { font-size: 20px; }
    .tile-512 .tile-number { font-size: 18px; }
    .tile-1024 .tile-number { font-size: 16px; }
    .tile-2048 .tile-number { font-size: 15px; }
    
    .tile-number-1k { font-size: 18px !important; }
    .tile-number-10k { font-size: 16px !important; }
    .tile-number-100k { font-size: 15px !important; }
    
    .element-dragon .tile-number,
    .element-cosmic .tile-number,
    .element-shadow .tile-number,
    .element-legendary .tile-number {
        font-size: 15px !important;
        padding: 2px 5px;
    }

    .web3-buttons {
        gap: 8px;
        margin-bottom: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .web3-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .gm-counter-container {
        margin-bottom: 12px;
    }

    .gm-counter-box {
        padding: 12px 16px;
        min-width: 160px;
    }

    .gm-counter-icon {
        width: 48px;
        height: 48px;
    }

    .gm-counter-value {
        font-size: 26px;
    }

    .instructions {
        font-size: 13px;
    }

    /* Компактные мотиваторы на маленьких экранах */
    .motivator-container {
        padding: 8px 10px;
        gap: 6px;
        border-radius: 14px;
        max-width: 48%;
        flex: 1;
    }
    
    .motivator-pokemon {
        width: 55px;
        height: 55px;
    }
    
    .motivator-sprite {
        width: 45px;
        height: 45px;
    }
    
    .motivator-bubble {
        padding: 6px 8px;
        max-width: 120px;
        border-radius: 12px;
    }
    
    .bubble-text {
        font-size: 10px;
    }
    
    .motivator-name {
        font-size: 9px;
    }
    
    .lang-btn {
        padding: 5px 8px;
        min-height: 34px;
        min-width: 34px;
        font-size: 10px;
    }
    
    .lang-icon {
        font-size: 14px;
    }
    
    /* ============================================ */
    /* МОБИЛЬНЫЕ ОПТИМИЗАЦИИ ПРОИЗВОДИТЕЛЬНОСТИ */
    /* ============================================ */
    
    /* Отключаем ВСЕ тяжёлые анимации на мобильных */
    .tile {
        animation: none !important;
        transition: none !important;
    }
    
    .tile::before,
    .tile::after {
        animation: none !important;
    }
    
    /* Отключаем все частицы */
    .element-particles,
    .particles-fire,
    .particles-water,
    .particles-electric,
    .particles-grass,
    .particles-ice,
    .particles-dragon,
    .particles-psychic,
    .particles-rock,
    .particles-poison,
    .particles-ground,
    .particles-flying,
    .particles-bug,
    .particles-fighting,
    .particles-ghost,
    .particles-dark,
    .particles-steel,
    .particles-fairy,
    .particles-cosmic,
    .particles-shadow,
    .particles-legendary {
        display: none !important;
    }
    
    /* Отключаем анимации стихий на плитках */
    .element-fire,
    .element-water,
    .element-electric,
    .element-grass,
    .element-ice,
    .element-rock,
    .element-psychic,
    .element-dragon,
    .element-poison,
    .element-ground,
    .element-flying,
    .element-bug,
    .element-fighting,
    .element-ghost,
    .element-dark,
    .element-steel,
    .element-fairy,
    .element-cosmic,
    .element-shadow,
    .element-legendary {
        animation: none !important;
    }
    
    .element-fire .pokemon-sprite,
    .element-water .pokemon-sprite,
    .element-electric .pokemon-sprite,
    .element-grass .pokemon-sprite,
    .element-ice .pokemon-sprite,
    .element-rock .pokemon-sprite,
    .element-psychic .pokemon-sprite,
    .element-dragon .pokemon-sprite,
    .element-poison .pokemon-sprite,
    .element-ground .pokemon-sprite,
    .element-flying .pokemon-sprite,
    .element-bug .pokemon-sprite,
    .element-fighting .pokemon-sprite,
    .element-ghost .pokemon-sprite,
    .element-dark .pokemon-sprite,
    .element-steel .pokemon-sprite,
    .element-fairy .pokemon-sprite,
    .element-cosmic .pokemon-sprite,
    .element-shadow .pokemon-sprite,
    .element-legendary .pokemon-sprite {
        animation: none !important;
        filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3)) !important;
    }
    
    .element-fire .tile-number,
    .element-water .tile-number,
    .element-electric .tile-number,
    .element-psychic .tile-number,
    .element-legendary .tile-number {
        animation: none !important;
    }
    
    .motivator-container {
        animation: none !important;
    }
    
    .motivator-pokemon {
        animation: none !important;
    }
    
    .motivator-bubble {
        animation: none !important;
    }
    
    .element-badge {
        animation: none !important;
    }
    
    .indicator-emoji {
        animation: none !important;
    }
    
    /* Упрощаем box-shadow на мобильных */
    .element-fire,
    .element-water,
    .element-electric,
    .element-ice,
    .element-dragon,
    .element-psychic,
    .element-legendary {
        box-shadow: none !important;
    }
}

/* ============================================
   Подсказка прокрутки (мобильная)
   ============================================ */
.scroll-hint {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 20px rgba(255, 165, 0, 0.5);
    z-index: 1000;
    animation: scrollHintBounce 2s ease-in-out infinite;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.scroll-hint-text {
    display: block;
    margin-bottom: 4px;
}

.scroll-hint-arrow {
    font-size: 20px;
    animation: arrowBounce 1s ease-in-out infinite;
}

@keyframes scrollHintBounce {
    0%, 100% { 
        transform: translateX(-50%) translateY(0);
        box-shadow: 0 4px 20px rgba(255, 165, 0, 0.5);
    }
    50% { 
        transform: translateX(-50%) translateY(-8px);
        box-shadow: 0 8px 30px rgba(255, 165, 0, 0.7);
    }
}

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

.scroll-hint.hide {
    animation: scrollHintFadeOut 0.5s ease-out forwards;
}

@keyframes scrollHintFadeOut {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
        pointer-events: none;
    }
}

/* Показываем только на мобильных */
@media (max-width: 800px) {
    .scroll-hint {
        display: block;
    }
}

@media (max-width: 500px) {
    .scroll-hint {
        padding: 10px 16px;
        font-size: 13px;
        bottom: 75px;
    }
    
    .scroll-hint-arrow {
        font-size: 18px;
    }
}

/* ============================================
   НИЖНЯЯ ПАНЕЛЬ НАВИГАЦИИ
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    justify-content: space-around;
    align-items: center;
    background: linear-gradient(180deg, rgba(37, 45, 56, 0.98) 0%, rgba(30, 36, 44, 0.99) 100%);
    padding: 8px 5px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* Быстрое появление */
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.15s ease, transform 0.15s ease;
    will-change: transform, opacity;
    touch-action: manipulation;
}

.bottom-nav[style*="display: flex"] {
    opacity: 1;
    transform: translateY(0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    min-width: 50px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.1s ease, 
                background 0.1s ease, 
                transform 0.1s ease;
    border-radius: 12px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    will-change: transform, background;
    /* GPU ускорение */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.nav-item:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.nav-item:active {
    transform: scale(0.9);
    transition: transform 0.03s ease;
    background: rgba(255, 255, 255, 0.2);
}

.nav-item.active {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
}

.nav-item.active .nav-icon {
    transform: scale(1.15);
}

.nav-icon {
    font-size: 22px;
    transition: transform 0.1s ease;
    will-change: transform;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ============================================
   ОБЩИЕ СТИЛИ ПАНЕЛЕЙ МЕНЮ
   ============================================ */
.menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 25, 0);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Быстрые переходы */
    transition: opacity 0.15s ease,
                background 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0.3s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    /* GPU ускорение */
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: opacity, background;
}

.menu-panel.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background: rgba(10, 15, 25, 0.95);
}

.menu-panel-content {
    background: linear-gradient(135deg, #252d38 0%, #2a3340 50%, #303a48 100%);
    border-radius: 24px;
    width: 92%;
    max-width: 500px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6),
                0 10px 30px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    /* Начальное состояние для анимации */
    transform: translateY(20px) scale(0.97);
    opacity: 0;
    /* Быстрый переход */
    transition: transform 0.15s ease,
                opacity 0.12s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.menu-panel.show .menu-panel-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Быстрое закрытие */
.menu-panel.closing {
    opacity: 0;
    background: rgba(10, 15, 25, 0);
    transition: opacity 0.12s ease,
                background 0.12s ease,
                visibility 0.12s;
}

.menu-panel.closing .menu-panel-content {
    transform: translateY(15px) scale(0.98);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.55, 0.06, 0.68, 0.19),
                opacity 0.2s ease-out;
}

.menu-header {
    position: sticky;
    top: 0;
    padding: 18px 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.menu-header h2 {
    margin: 0;
    font-size: 22px;
    color: #333;
}

.menu-close-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    color: #333;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.menu-close-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: rotate(90deg);
}

.menu-close-btn:active {
    transform: scale(0.9);
    transition: transform 0.1s ease;
}

/* ============================================
   ПАНЕЛЬ ПРОФИЛЯ
   ============================================ */
.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.profile-header h2 {
    color: white;
}

.profile-body {
    padding: 25px 20px;
    text-align: center;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.profile-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.4);
}

.profile-avatar-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.profile-level {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.4);
}

.profile-name {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

.profile-title {
    font-size: 14px;
    color: #FFD700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ============================================
   XP & LEVEL SYSTEM
   ============================================ */
.xp-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 15px 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.xp-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
    font-size: 14px;
}

.xp-current {
    color: #00ff88;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.xp-separator {
    color: rgba(255, 255, 255, 0.4);
}

.xp-needed {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.xp-label {
    color: #FFD700;
    font-weight: bold;
    margin-left: 5px;
    text-transform: uppercase;
    font-size: 12px;
}

.xp-bar-container {
    position: relative;
    height: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #00cc6a, #00ff88);
    background-size: 200% 100%;
    border-radius: 8px;
    transition: width 0.5s ease-out;
    position: relative;
    animation: xpShine 2s ease-in-out infinite;
}

.xp-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 8px 8px 0 0;
}

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

.xp-bar-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 8px;
    box-shadow: inset 0 0 15px rgba(0, 255, 136, 0.3);
}

.xp-total-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 12px;
}

.xp-total-label {
    color: rgba(255, 255, 255, 0.5);
}

.xp-total-value {
    color: #FFD700;
    font-weight: bold;
    font-size: 14px;
}

/* Level Progress Section */
.level-progress-section {
    background: rgba(102, 126, 234, 0.15);
    border-radius: 16px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.level-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.level-progress-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.level-progress-percent {
    color: #667eea;
    font-weight: bold;
    font-size: 14px;
}

.level-progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.5s ease-out;
    animation: levelShine 3s ease-in-out infinite;
}

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

.level-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.level-max {
    color: #FFD700;
    font-weight: bold;
}

/* Level Up Notification */
.level-up-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 10000;
    text-align: center;
    pointer-events: none;
    animation: levelUpPop 2.5s ease-out forwards;
}

@keyframes levelUpPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    15% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    25% { transform: translate(-50%, -50%) scale(1); }
    80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}

.level-up-content {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98), rgba(22, 33, 62, 0.98));
    border: 3px solid #FFD700;
    border-radius: 25px;
    padding: 30px 50px;
    box-shadow: 
        0 0 50px rgba(255, 215, 0, 0.5),
        0 0 100px rgba(255, 215, 0, 0.3),
        inset 0 0 30px rgba(255, 215, 0, 0.1);
}

.level-up-stars {
    font-size: 30px;
    margin-bottom: 10px;
    animation: starPulse 0.5s ease-in-out infinite alternate;
}

@keyframes starPulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.level-up-title {
    font-size: 28px;
    font-weight: 900;
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.level-up-level {
    font-size: 64px;
    font-weight: 900;
    color: white;
    text-shadow: 
        0 0 30px rgba(255, 255, 255, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.5);
    line-height: 1;
    margin-bottom: 10px;
}

.level-up-title-new {
    font-size: 16px;
    color: #00ff88;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.level-up-pokemon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
    margin-top: 15px;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
    animation: pokemonBounce 0.5s ease-in-out infinite alternate;
}

@keyframes pokemonBounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

/* XP Gain Notification */
.xp-gain-notification {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    animation: xpGainFly 2s ease-out forwards;
}

@keyframes xpGainFly {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.8); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    80% { opacity: 1; transform: translateX(-50%) translateY(-30px) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-60px) scale(0.8); }
}

.xp-gain-content {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.9), rgba(0, 204, 106, 0.9));
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 
        0 4px 20px rgba(0, 255, 136, 0.5),
        0 0 40px rgba(0, 255, 136, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.xp-gain-content .xp-icon {
    margin-right: 8px;
}

/* Profile Level Badge Enhanced */
.profile-level {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 100%;
    color: #1a1a2e;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 
        0 4px 15px rgba(255, 165, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: levelBadgeShine 3s ease-in-out infinite;
}

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

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 25px;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.profile-stat:hover {
    transform: scale(1.05);
}

.profile-stat-icon {
    font-size: 20px;
    margin-bottom: 5px;
}

.profile-stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
}

.profile-stat-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

.profile-element-section {
    margin-bottom: 20px;
}

.profile-element-section h3,
.profile-elements-unlocked h3 {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-current-element {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 25px;
    border-radius: 25px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.profile-current-element .element-emoji {
    font-size: 28px;
}

.profile-current-element .element-name {
    font-size: 16px;
    font-weight: bold;
    color: white;
}

.elements-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.element-badge-small {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 18px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.element-badge-small.unlocked {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
}

.element-badge-small.locked {
    opacity: 0.3;
    filter: grayscale(100%);
}

.element-badge-small:hover {
    transform: scale(1.2);
}

/* ============================================
   AVATAR COLLECTION
   ============================================ */
.profile-avatar-collection {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar-collection h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.avatar-collection-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 15px;
}

.avatar-section {
    margin-bottom: 20px;
}

.avatar-section-title {
    font-size: 13px;
    color: #FFD700;
    margin-bottom: 12px;
    font-weight: 600;
}

.avatar-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
}

.avatar-collection-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-collection-item.unlocked {
    border-color: rgba(76, 175, 80, 0.4);
    background: linear-gradient(145deg, rgba(76, 175, 80, 0.15) 0%, rgba(76, 175, 80, 0.05) 100%);
}

.avatar-collection-item.unlocked:hover {
    transform: translateY(-3px);
    border-color: rgba(76, 175, 80, 0.7);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.3);
}

.avatar-collection-item.locked {
    opacity: 0.7;
}

.avatar-collection-item.locked:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.avatar-collection-item.selected {
    border-color: #FFD700 !important;
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.05) 100%) !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.avatar-collection-item.legendary {
    border-color: rgba(255, 215, 0, 0.4);
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 140, 0, 0.05) 100%);
}

.avatar-collection-item.legendary.unlocked {
    animation: avatarLegendaryGlow 2s ease-in-out infinite;
}

@keyframes avatarLegendaryGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); }
}

.avatar-collection-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    image-rendering: pixelated;
    margin-bottom: 5px;
    animation: avatarBounce 2s ease-in-out infinite;
}

.avatar-collection-item.locked .avatar-collection-img {
    filter: grayscale(80%) brightness(0.6);
    animation: none;
}

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

.avatar-collection-name {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.avatar-lock {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-selected {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.5);
}

/* Avatar notifications */
.avatar-change-notification,
.avatar-locked-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12000;
    animation: avatarNotifSlide 0.4s ease-out;
}

@keyframes avatarNotifSlide {
    from { transform: translateX(-50%) translateY(-100%); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.avatar-change-content,
.avatar-locked-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.avatar-change-content {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.avatar-locked-content {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.avatar-change-img,
.avatar-locked-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    image-rendering: pixelated;
}

.avatar-change-title,
.avatar-locked-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

.avatar-change-name,
.avatar-locked-hint {
    font-size: 14px;
    color: white;
    font-weight: 600;
}

.avatar-change-notification.fade-out,
.avatar-locked-notification.fade-out {
    animation: avatarNotifFadeOut 0.5s ease-out forwards;
}

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

/* ============================================
   ПАНЕЛЬ GM
   ============================================ */
.gm-header {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.gm-body {
    padding: 30px 20px;
    text-align: center;
}

.gm-big-counter {
    margin-bottom: 25px;
}

.gm-big-pokemon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 12px rgba(255, 165, 0, 0.4));
    margin-bottom: 15px;
    animation: gmBounce 2s ease-in-out infinite;
}

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

.gm-big-value {
    font-size: 64px;
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    line-height: 1;
}

.gm-big-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
}

.gm-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
}

.gm-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.gm-info-icon {
    font-size: 18px;
}

.gm-send-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    border: none;
    padding: 18px 50px;
    border-radius: 30px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(255, 165, 0, 0.4);
    margin-bottom: 20px;
    touch-action: manipulation;
}

.gm-send-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 35px rgba(255, 165, 0, 0.6);
}

.gm-description {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

/* ============================================
   ПАНЕЛЬ ОБУЧЕНИЯ
   ============================================ */
.tutorial-header {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.tutorial-content {
    max-height: 90vh;
}

.tutorial-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.tutorial-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tutorial-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.tutorial-section h3 {
    color: #38ef7d;
    font-size: 16px;
    margin-bottom: 12px;
}

.tutorial-section p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.7;
}

.tutorial-section strong {
    color: #FFD700;
}

.tutorial-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.08);
    padding: 12px 15px;
    border-radius: 10px;
}

.control-icon {
    font-size: 20px;
    min-width: 60px;
    text-align: center;
}

.control-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.merge-example {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.merge-tile {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(238, 228, 218, 0.9);
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    color: #776e65;
}

.merge-tile.result {
    background: linear-gradient(135deg, #edc22e, #edc53f);
    color: #776e65;
    animation: mergeGlow 1s ease-in-out infinite alternate;
}

@keyframes mergeGlow {
    from { box-shadow: 0 0 5px rgba(237, 197, 63, 0.5); }
    to { box-shadow: 0 0 15px rgba(237, 197, 63, 0.8); }
}

.merge-plus, .merge-equals {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: bold;
}

.elements-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.element-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.element-item span {
    font-size: 16px;
}

.tutorial-section.tips ul {
    padding-left: 20px;
    margin: 0;
}

.tutorial-section.tips li {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 8px;
}

.tutorial-section.tips li::marker {
    color: #38ef7d;
}

/* ============================================
   ПАНЕЛЬ НАСТРОЕК
   ============================================ */
.settings-header {
    background: linear-gradient(135deg, #4a5568 0%, #5a6578 100%);
}

.settings-header h2 {
    color: white;
}

.settings-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.settings-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.theme-switcher {
    display: flex;
    gap: 10px;
}

.theme-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
    touch-action: manipulation;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.theme-btn.active {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
    color: #FFD700;
}

.theme-icon {
    font-size: 28px;
}

.theme-name {
    font-size: 12px;
    font-weight: 600;
}

.brightness-control {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
}

.brightness-icon {
    font-size: 20px;
}

#brightness-slider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

#brightness-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.4);
}

#brightness-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.4);
}

.brightness-value {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 8px;
}

.toggle-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 26px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.danger-zone {
    background: rgba(244, 67, 54, 0.1);
    margin: 0 -20px -20px;
    padding: 20px;
    border-radius: 0 0 20px 20px;
}

.settings-danger-btn {
    width: 100%;
    padding: 12px 20px;
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    border-radius: 10px;
    color: #ff6b6b;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.settings-danger-btn:hover {
    background: rgba(244, 67, 54, 0.4);
}

.settings-warning {
    color: rgba(255, 107, 107, 0.8);
    font-size: 12px;
    text-align: center;
    margin-top: 10px;
}

/* ============================================
   ТЕМЫ (Light / Dark / Auto)
   ============================================ */
body.theme-light {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

body.theme-light .container {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

body.theme-light .bottom-nav {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 247, 250, 0.99) 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

body.theme-light .nav-item {
    color: rgba(0, 0, 0, 0.5);
}

body.theme-light .nav-item:hover {
    color: rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.05);
}

body.theme-light .nav-item.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

body.theme-light .motivator-container {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ============================================
   АДАПТИВНОСТЬ МЕНЮ
   ============================================ */
@media (max-width: 600px) {
    .bottom-nav {
        padding: 6px 2px;
    }
    
    .nav-item {
        padding: 6px 8px;
        min-width: 45px;
    }
    
    .nav-icon {
        font-size: 20px;
    }
    
    .nav-label {
        font-size: 9px;
    }
    
    .menu-panel-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .menu-header {
        padding: 15px;
    }
    
    .menu-header h2 {
        font-size: 18px;
    }
    
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gm-big-value {
        font-size: 48px;
    }
    
    .gm-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .tutorial-body {
        padding: 15px;
    }
    
    .elements-list {
        grid-template-columns: 1fr;
    }
}

/* Добавляем отступ снизу для контента из-за навигации */
body {
    padding-bottom: 80px !important;
}

@media (max-width: 500px) {
    body {
        padding-bottom: 70px !important;
    }
}

/* ============================================
   ГЛАВНОЕ МЕНЮ
   ============================================ */
.main-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 15000;
    /* GPU-ускорение */
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Плавные переходы */
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.main-menu.hide {
    opacity: 0;
    transform: scale(1.08);
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.55, 0.06, 0.68, 0.19),
                transform 0.35s cubic-bezier(0.55, 0.06, 0.68, 0.19);
}

@keyframes menuFadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(1.08); pointer-events: none; }
}

.main-menu-content {
    text-align: center;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    /* GPU-ускорение */
    transform: translateZ(0);
    will-change: transform, opacity;
    /* Плавное появление содержимого */
    animation: contentFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

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

.menu-logo {
    margin-bottom: 20px;
    animation: logoFloat 3s ease-in-out infinite;
}

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

.menu-pokemon-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 20px rgba(240, 128, 48, 0.5));
    transition: opacity 0.2s ease-out;
    transform: translateZ(0);
}

.menu-title {
    font-size: 42px;
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 2px 2px 0 #333;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.menu-subtitle {
    font-size: 18px;
    color: #f8d030;
    margin-bottom: 35px;
    text-shadow: 0 0 10px rgba(248, 208, 48, 0.5);
}

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

.menu-buttons-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.menu-buttons-row .menu-secondary-btn {
    flex: 1;
    padding: 12px 15px;
    font-size: 14px;
}

.menu-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    padding: 20px 40px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: none;
    border-radius: 50px;
    font-size: 24px;
    /* GPU-ускорение и плавность */
    transform: translateZ(0);
    will-change: transform, box-shadow;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    font-weight: 900;
    color: #333;
    cursor: pointer;
    /* Плавные переходы */
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                background 0.3s ease;
    box-shadow: 0 8px 30px rgba(255, 165, 0, 0.5);
    text-transform: uppercase;
    /* Ripple эффект */
    position: relative;
    overflow: hidden;
    letter-spacing: 3px;
    animation: playBtnPulse 2s ease-in-out infinite;
}

@keyframes playBtnPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 30px rgba(255, 165, 0, 0.5); }
    50% { transform: scale(1.02); box-shadow: 0 12px 40px rgba(255, 165, 0, 0.7); }
}

.menu-play-btn:hover {
    transform: scale(1.05) translateZ(0);
    box-shadow: 0 15px 50px rgba(255, 165, 0, 0.8);
}

.menu-play-btn:active {
    transform: scale(0.92) translateZ(0);
    transition: transform 0.08s ease;
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.4);
}

/* Ripple эффект для кнопки Play */
.menu-play-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
    opacity: 0;
    pointer-events: none;
}

.menu-play-btn:active::after {
    width: 300px;
    height: 300px;
    opacity: 1;
    transition: width 0s, height 0s, opacity 0s;
}

.play-icon {
    font-size: 28px;
}

.menu-secondary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    /* Плавные переходы */
    transition: background 0.25s ease, 
                border-color 0.25s ease, 
                transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease;
    /* GPU-ускорение и плавность */
    transform: translateZ(0);
    will-change: transform, background;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    /* Для ripple */
    position: relative;
    overflow: hidden;
}

.menu-secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px) translateZ(0);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.menu-secondary-btn:active {
    transform: scale(0.93) translateZ(0);
    transition: transform 0.08s ease;
    background: rgba(255, 255, 255, 0.25);
}

/* Ripple эффект */
.menu-secondary-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}

.menu-secondary-btn:active::after {
    width: 200px;
    height: 200px;
    opacity: 1;
    transition: width 0s, height 0s, opacity 0s;
}

.menu-stats-preview {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
}

.menu-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.menu-stat-icon {
    font-size: 24px;
}

.menu-stat-value {
    font-size: 22px;
    font-weight: bold;
    color: #FFD700;
}

.menu-stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

/* Level Stat Special Styling */
.menu-stat.level-stat {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.1));
    padding: 10px 15px;
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.menu-stat.level-stat .menu-stat-value {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    font-size: 26px;
}

.menu-stat.level-stat .menu-stat-icon {
    animation: starGlow 2s ease-in-out infinite;
}

@keyframes starGlow {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.1); filter: brightness(1.3); }
}

.menu-footer {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.menu-footer p {
    margin: 0;
}

/* Скрываем игру пока не нажата кнопка Играть */
.game-wrapper {
    display: none;
}

/* Мотиваторы - видны сразу при появлении игры */
.motivator-container {
    opacity: 1;
    transform: translateY(0);
}

/* Адаптивность главного меню */
@media (max-width: 500px) {
    .main-menu-content {
        padding: 20px;
    }
    
    .menu-pokemon-logo {
        width: 120px;
        height: 120px;
    }
    
    .menu-title {
        font-size: 32px;
    }
    
    .menu-subtitle {
        font-size: 16px;
        margin-bottom: 25px;
    }
    
    .menu-play-btn {
        padding: 18px 35px;
        font-size: 20px;
    }
    
    .menu-secondary-btn {
        padding: 12px 25px;
        font-size: 14px;
    }
    
    .menu-stats-preview {
        gap: 15px;
    }
    
    .menu-stat-value {
        font-size: 18px;
    }
}

/* ============================================
   ОТКЛЮЧЕНИЕ ЧАСТИЦ
   ============================================ */
body.no-particles .element-particles,
body.no-particles .particles-fire,
body.no-particles .particles-water,
body.no-particles .particles-electric,
body.no-particles .particles-grass,
body.no-particles .particles-ice,
body.no-particles .particles-dragon,
body.no-particles .particles-psychic,
body.no-particles .particles-rock,
body.no-particles .particles-poison,
body.no-particles .particles-ground,
body.no-particles .particles-flying,
body.no-particles .particles-bug,
body.no-particles .particles-fighting,
body.no-particles .particles-ghost,
body.no-particles .particles-dark,
body.no-particles .particles-steel,
body.no-particles .particles-fairy,
body.no-particles .particles-cosmic,
body.no-particles .particles-shadow,
body.no-particles .particles-legendary {
    display: none !important;
}

body.no-particles .tile::before,
body.no-particles .tile::after,
body.no-particles .cell::before,
body.no-particles .cell::after {
    animation: none !important;
}

body.no-particles .element-fire,
body.no-particles .element-water,
body.no-particles .element-electric,
body.no-particles .element-grass,
body.no-particles .element-ice,
body.no-particles .element-rock,
body.no-particles .element-psychic,
body.no-particles .element-dragon,
body.no-particles .element-legendary {
    animation: none !important;
}

body.no-particles .element-fire .pokemon-sprite,
body.no-particles .element-water .pokemon-sprite,
body.no-particles .element-electric .pokemon-sprite,
body.no-particles .element-grass .pokemon-sprite,
body.no-particles .element-ice .pokemon-sprite,
body.no-particles .element-psychic .pokemon-sprite,
body.no-particles .element-dragon .pokemon-sprite,
body.no-particles .element-legendary .pokemon-sprite {
    animation: none !important;
}

/* ============================================
   СКРЫТИЕ КНОПКИ ЛИДЕРБОРДА (используем меню)
   ============================================ */
.leaderboard-btn-container {
    display: none;
}

/* ============================================
   Welcome Screen - Грозный покемон при загрузке
   ============================================ */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e2530 0%, #252d38 50%, #2a3442 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: welcomeAppear 0.5s ease-out;
}

@keyframes welcomeAppear {
    from {
        opacity: 0;
        transform: scale(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.welcome-screen.welcome-fade-out {
    animation: welcomeFadeOut 0.5s ease-out forwards;
}

@keyframes welcomeFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

.welcome-content {
    text-align: center;
    padding: 40px;
}

.welcome-pokemon {
    margin-bottom: 20px;
    animation: pokemonFloat 3s ease-in-out infinite;
}

@keyframes pokemonFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.welcome-pokemon-img {
    width: 300px;
    height: 300px;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(240, 128, 48, 0.8));
    animation: pokemonGlow 2s ease-in-out infinite alternate;
}

@keyframes pokemonGlow {
    from { filter: drop-shadow(0 0 30px rgba(240, 128, 48, 0.8)); }
    to { filter: drop-shadow(0 0 50px rgba(240, 128, 48, 1)); }
}

.welcome-title {
    font-size: 48px;
    color: #fff;
    text-shadow: 0 0 20px rgba(240, 128, 48, 0.8);
    margin-bottom: 10px;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 0 20px rgba(240, 128, 48, 0.8); }
    50% { text-shadow: 0 0 40px rgba(240, 128, 48, 1), 0 0 60px rgba(240, 128, 48, 0.5); }
}

.welcome-subtitle {
    font-size: 24px;
    color: #f8d030;
    margin-bottom: 15px;
}

.welcome-pokemon-name {
    font-size: 20px;
    color: #98d8d8;
    margin-bottom: 30px;
}

.welcome-btn {
    background: linear-gradient(135deg, #f08030 0%, #c03028 100%);
    color: #fff;
    border: none;
    padding: 18px 50px;
    min-height: 48px;
    min-width: 120px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(240, 128, 48, 0.5);
    transition: all 0.3s ease;
    animation: btnPulse 1.5s ease-in-out infinite;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@keyframes btnPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 5px 20px rgba(240, 128, 48, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 8px 30px rgba(240, 128, 48, 0.8); }
}

.welcome-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 40px rgba(240, 128, 48, 1);
}

@media (max-width: 500px) {
    .welcome-pokemon-img {
        width: 200px;
        height: 200px;
    }
    
    .welcome-title {
        font-size: 32px;
    }
    
    .welcome-subtitle {
        font-size: 18px;
    }
    
    .welcome-btn {
        padding: 15px 40px;
        font-size: 20px;
    }
}

/* ============================================
   СИСТЕМА ДОСТИЖЕНИЙ
   ============================================ */

/* Кнопка открытия панели достижений */
.achievements-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    min-height: 44px;
    min-width: 44px;
    background: linear-gradient(135deg, #c9a545 0%, #b89535 100%);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(180, 150, 60, 0.25);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.achievements-toggle-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 15px rgba(180, 150, 60, 0.35);
}

.achievements-count {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

/* Панель достижений */
.achievements-panel {
    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;
    backdrop-filter: blur(5px);
    /* Плавные переходы */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.achievements-panel.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

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

.achievements-panel-content {
    background: linear-gradient(135deg, #252d38 0%, #2a3340 50%, #303a48 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    /* Плавная анимация появления */
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    will-change: transform, opacity;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.achievements-panel.show .achievements-panel-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

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

.achievements-panel-content::-webkit-scrollbar {
    width: 8px;
}

.achievements-panel-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.achievements-panel-content::-webkit-scrollbar-thumb {
    background: rgba(180, 150, 70, 0.4);
    border-radius: 4px;
}

.achievements-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #c9a545 0%, #b89535 100%);
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.achievements-header h2 {
    color: #333;
    font-size: 24px;
    margin: 0;
    flex: 1;
}

.achievements-progress {
    position: relative;
    width: 150px;
    height: 24px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.achievements-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 12px;
    transition: width 0.5s ease;
}

.achievements-progress span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.achievements-close-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    color: #333;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.achievements-close-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: rotate(90deg);
}

/* Статистика */
.achievements-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: scale(1.05);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
}

.stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

/* Список достижений */
.achievements-list {
    padding: 20px;
}

.achievements-category {
    margin-bottom: 25px;
}

.achievements-category h3 {
    color: #c9a545;
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(200, 170, 70, 0.25);
}

.achievements-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.achievement-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: transform 0.1s ease, background 0.1s ease, box-shadow 0.1s ease;
    cursor: pointer;
    gap: 12px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.achievement-item.unlocked {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
}

.achievement-item.unlocked:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.achievement-item.locked {
    opacity: 1;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.3);
}

.achievement-item.locked:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.achievement-item.locked:hover .status-locked {
    transform: scale(1.1);
    animation: lockShake 0.5s ease-in-out;
}

@keyframes lockShake {
    0%, 100% { transform: scale(1.1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-10deg); }
    75% { transform: scale(1.1) rotate(10deg); }
}

.achievement-item.legendary.unlocked {
    background: linear-gradient(135deg, rgba(220, 190, 80, 0.2) 0%, rgba(210, 150, 60, 0.2) 100%);
    border-color: #c9a545;
    animation: legendaryShine 5s ease-in-out infinite;
}

.achievement-item.has-avatar.unlocked {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.3) 0%, rgba(75, 0, 130, 0.3) 100%);
    border-color: rgba(138, 43, 226, 0.6);
}

.achievement-item.has-avatar.legendary.unlocked {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4) 0%, rgba(138, 43, 226, 0.4) 100%);
    border-color: #FFD700;
}

@keyframes legendaryShine {
    0%, 100% { box-shadow: 0 0 8px rgba(220, 190, 80, 0.2); }
    50% { box-shadow: 0 0 12px rgba(220, 190, 80, 0.3); }
}

.achievement-icon-wrapper {
    position: relative;
    min-width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.achievement-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    background: linear-gradient(145deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.2) 100%);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

/* Animated Pokemon avatars - always colorful! */
.achievement-avatar {
    width: 56px;
    height: 56px;
    object-fit: contain;
    padding: 2px;
    transition: all 0.3s ease;
    image-rendering: pixelated;
}

.achievement-avatar.preview-avatar {
    animation: pokemonBounce 2s ease-in-out infinite;
}

.achievement-avatar.unlocked-avatar {
    animation: pokemonCelebrate 4s ease-in-out infinite;
    filter: drop-shadow(0 0 5px rgba(200, 180, 80, 0.4));
}

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

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

/* Emoji icons - also animated! */
.emoji-icon {
    font-size: 36px;
    transition: all 0.3s ease;
}

.emoji-icon.preview-emoji {
    animation: emojiBounce 2s ease-in-out infinite;
}

.emoji-icon.unlocked-emoji {
    animation: emojiPulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.5));
}

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

@keyframes emojiPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.5)); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8)); }
}

/* Status indicators */
.status-locked {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 14px;
    background: linear-gradient(135deg, #555 0%, #333 100%);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.status-unlocked {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 14px;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.5);
    animation: checkPulse 2s ease-in-out infinite;
}

@keyframes checkPulse {
    0%, 100% { box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3); }
    50% { box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4); }
}

.achievement-item:hover .achievement-icon {
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.4);
}

.achievement-item:hover .achievement-avatar {
    animation-duration: 0.5s;
}

.achievement-item:hover .emoji-icon {
    animation-duration: 0.5s;
}

.achievement-info {
    flex: 1;
    min-width: 0;
}

.achievement-name {
    font-size: 13px;
    color: white;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.achievement-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
    margin-bottom: 4px;
}

.achievement-xp {
    font-size: 11px;
    color: #4CAF50;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(56, 142, 60, 0.3) 100%);
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.achievement-xp.legendary-xp {
    color: #c9a545;
    background: linear-gradient(135deg, rgba(220, 190, 80, 0.2) 0%, rgba(210, 150, 60, 0.2) 100%);
    border: 1px solid rgba(220, 190, 80, 0.35);
}

@keyframes xpShine {
    0%, 100% { box-shadow: 0 0 4px rgba(220, 190, 80, 0.2); }
    50% { box-shadow: 0 0 6px rgba(220, 190, 80, 0.3); }
}

/* Colorful animated badges */
.achievement-badge {
    font-size: 11px;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    text-align: center;
    min-width: 70px;
    flex-shrink: 0;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* Locked badge - still colorful but dimmed */
.achievement-badge.locked-badge {
    background: linear-gradient(135deg, #5a6db8 0%, #6a5090 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    opacity: 0.8;
}

/* Unlocked badge - soft glow */
.achievement-badge.unlocked-badge {
    background: linear-gradient(135deg, #2a8a7a 0%, #4ac070 100%);
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 3px 10px rgba(56, 200, 125, 0.25);
}

/* Legendary badge - soft golden glow */
.achievement-badge.legendary-badge {
    background: linear-gradient(135deg, #d090d8 0%, #d8707a 50%, #d4b040 100%);
    border: 2px solid rgba(220, 190, 80, 0.4);
    box-shadow: 0 3px 12px rgba(220, 190, 80, 0.3);
    font-size: 12px;
}

@keyframes badgeGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.85; }
}

@keyframes badgeCelebrate {
    0%, 100% { box-shadow: 0 3px 10px rgba(56, 200, 125, 0.25); }
    50% { box-shadow: 0 3px 12px rgba(56, 200, 125, 0.35); }
}

@keyframes legendaryBadge {
    0%, 100% { 
        box-shadow: 0 3px 12px rgba(220, 190, 80, 0.3);
    }
    50% { 
        box-shadow: 0 3px 15px rgba(220, 190, 80, 0.4);
    }
}

.achievement-item:hover .achievement-badge {
    transform: scale(1.1);
}

.achievement-item.locked .achievement-desc {
    color: rgba(255, 255, 255, 0.7);
}

.achievement-item.locked .achievement-name {
    color: rgba(255, 255, 255, 0.9);
}

/* Уведомление о достижении */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 11000;
    animation: achievementSlideIn 0.5s ease-out;
}

@keyframes achievementSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.achievement-notification.fade-out {
    animation: achievementSlideOut 0.5s ease-out forwards;
}

@keyframes achievementSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.achievement-notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.achievement-notification.legendary .achievement-notification-content {
    background: linear-gradient(135deg, #B8860B 0%, #FFD700 50%, #FFA500 100%);
    animation: legendaryPulse 0.5s ease-in-out infinite alternate;
}

@keyframes legendaryPulse {
    from { box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4); }
    to { box-shadow: 0 8px 50px rgba(255, 215, 0, 0.8); }
}

.achievement-notification-icon {
    font-size: 48px;
    animation: iconBounce 0.5s ease-out;
}

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

.achievement-notification-info {
    display: flex;
    flex-direction: column;
}

.achievement-notification-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.achievement-notification-name {
    font-size: 18px;
    font-weight: bold;
    color: white;
    margin: 3px 0;
}

.achievement-notification-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.achievement-notification-xp {
    font-size: 16px;
    font-weight: bold;
    color: #00ff88;
    margin-top: 5px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    animation: xpPulse 0.5s ease-in-out infinite alternate;
}

@keyframes xpPulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

/* Avatar notification styles */
.achievement-notification.has-avatar .achievement-notification-content {
    background: linear-gradient(135deg, #4A0080 0%, #8B00FF 50%, #9932CC 100%);
}

.notification-avatar-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    animation: iconBounce 0.5s ease-out;
}

.achievement-notification-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.achievement-notification-avatar img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.achievement-notification-avatar span {
    font-size: 12px;
    font-weight: 600;
    color: #E0B0FF;
    text-shadow: 0 0 10px rgba(224, 176, 255, 0.5);
}

/* Responsive styles */
@media (max-width: 600px) {
    .achievements-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .achievements-grid {
        gap: 8px;
    }
    
    .achievement-notification {
        right: 10px;
        left: 10px;
    }
    
    .achievement-notification-content {
        width: 100%;
    }
    
    .achievement-notification-icon {
        font-size: 36px;
    }
    
    .notification-avatar-img {
        width: 36px;
        height: 36px;
    }
    
    .achievement-notification-name {
        font-size: 16px;
    }
    
    .achievement-desc {
        font-size: 9px;
    }
}

@media (max-width: 400px) {
    .achievements-grid {
        gap: 8px;
    }
    
    .achievements-header h2 {
        font-size: 20px;
    }
    
    .achievements-progress {
        width: 100px;
    }
    
    .achievement-item {
        padding: 10px;
        gap: 10px;
    }
    
    .achievement-icon-wrapper {
        min-width: 50px;
        height: 50px;
    }
    
    .achievement-icon {
        font-size: 24px;
        width: 50px;
        height: 50px;
    }
    
    .achievement-avatar {
        width: 46px;
        height: 46px;
    }
    
    .emoji-icon {
        font-size: 28px;
    }
    
    .status-locked,
    .status-unlocked {
        font-size: 11px;
        width: 20px;
        height: 20px;
    }
    
    .achievement-name {
        font-size: 11px;
    }
    
    .achievement-desc {
        font-size: 9px;
    }
    
    .achievement-badge {
        font-size: 9px;
        padding: 5px 8px;
        min-width: 55px;
    }
    
    .achievement-xp {
        font-size: 9px;
        padding: 2px 6px;
    }
}

/* ============================================
   СИСТЕМА ЛИДЕРБОРДА
   ============================================ */

.leaderboard-btn-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.leaderboard-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    min-height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, #3B5BA7 0%, #2A75BB 100%);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    box-shadow: 0 3px 12px rgba(59, 91, 167, 0.4);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.leaderboard-toggle-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(59, 91, 167, 0.5);
}

.leaderboard-toggle-btn:active {
    transform: scale(0.93);
    box-shadow: 0 2px 8px rgba(59, 91, 167, 0.3);
    transition: transform 0.08s ease, box-shadow 0.1s ease;
}

.best-score-badge {
    background: rgba(255, 203, 5, 0.9);
    color: #333;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

/* Панель лидерборда */
.leaderboard-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
    /* Плавные переходы */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.leaderboard-panel.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.leaderboard-panel-content {
    background: linear-gradient(135deg, #252d38 0%, #2a3340 50%, #303a48 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 20px rgba(180, 150, 80, 0.1);
    /* Плавная анимация появления */
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}

.leaderboard-panel.show .leaderboard-panel-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.leaderboard-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.leaderboard-header h2 {
    color: #333;
    font-size: 24px;
    margin: 0;
    flex: 1;
}

.leaderboard-best {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
}

.best-label {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.7);
    font-weight: 600;
}

.best-value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.leaderboard-close-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    color: #333;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.leaderboard-close-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: rotate(90deg);
}

/* Список лидерборда */
.leaderboard-list {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.leaderboard-list::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 4px;
}

.leaderboard-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.leaderboard-empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
    display: block;
}

.leaderboard-empty-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.leaderboard-empty-hint {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* Запись лидерборда */
.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

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

.leaderboard-entry.top-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 180, 0, 0.3) 100%);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.leaderboard-entry.top-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2) 0%, rgba(160, 160, 160, 0.2) 100%);
    border-color: rgba(192, 192, 192, 0.4);
}

.leaderboard-entry.top-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2) 0%, rgba(180, 100, 40, 0.2) 100%);
    border-color: rgba(205, 127, 50, 0.4);
}

.entry-rank {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    border-radius: 50%;
    flex-shrink: 0;
}

.leaderboard-entry.top-1 .entry-rank {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.leaderboard-entry.top-2 .entry-rank {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    color: #333;
}

.leaderboard-entry.top-3 .entry-rank {
    background: linear-gradient(135deg, #CD7F32, #B4642D);
    color: #fff;
}

.entry-rank.default {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.entry-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.entry-score {
    font-size: 22px;
    font-weight: bold;
    color: #FFD700;
}

.leaderboard-entry.top-1 .entry-score {
    animation: goldShine 2s ease-in-out infinite;
}

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

.entry-date {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.entry-element {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.entry-element-emoji {
    font-size: 18px;
}

/* Footer лидерборда */
.leaderboard-footer {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
}

.leaderboard-clear-btn {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.4);
    color: #ff6b6b;
    padding: 10px 20px;
    min-height: 44px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.leaderboard-clear-btn:hover {
    background: rgba(244, 67, 54, 0.4);
    transform: scale(1.05);
}

/* Новый рекорд! */
.new-record-badge {
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    animation: recordPulse 1s ease-in-out infinite;
}

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

/* Уведомление о новом рекорде */
.record-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11000;
    animation: recordAppear 0.5s ease-out;
}

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

.record-notification.fade-out {
    animation: recordFadeOut 0.5s ease-out forwards;
}

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

.record-notification-content {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 30px 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 50px rgba(255, 215, 0, 0.5);
}

.record-trophy {
    font-size: 80px;
    display: block;
    margin-bottom: 15px;
    animation: trophyBounce 0.5s ease-out;
}

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

.record-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.record-score {
    font-size: 48px;
    font-weight: bold;
    color: #333;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Адаптивность лидерборда */
@media (max-width: 500px) {
    .leaderboard-panel-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .leaderboard-header {
        padding: 15px;
    }
    
    .leaderboard-header h2 {
        font-size: 20px;
    }
    
    .leaderboard-entry {
        padding: 12px;
        gap: 10px;
    }
    
    .entry-rank {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .entry-score {
        font-size: 18px;
    }
    
    .entry-element {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .record-notification-content {
        padding: 25px 35px;
    }
    
    .record-trophy {
        font-size: 60px;
    }
    
    .record-title {
        font-size: 22px;
    }
    
    .record-score {
        font-size: 36px;
    }
}

/* ============================================ */
/* ВСПЛЫВАЮЩЕЕ ОКНО ПРИ СТАРТЕ ИГРЫ */
/* ============================================ */

.swipe-hint-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
    /* GPU ускорение */
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.swipe-hint-popup.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.swipe-hint-content {
    background: linear-gradient(145deg, #3d1a78, #5a2d9f);
    border-radius: 25px;
    padding: 30px 25px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 215, 0, 0.4);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.swipe-hint-pokemon {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 5px;
    margin-bottom: 15px;
}

.swipe-hint-pokemon-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    image-rendering: pixelated;
}

.swipe-hint-pokemon-img:nth-child(2) {
    width: 80px;
    height: 80px;
}

.swipe-hint-hearts {
    font-size: 24px;
    margin-bottom: 10px;
}

.swipe-hint-title {
    font-size: 28px;
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 2px 2px 0 #333;
    margin-bottom: 10px;
}

.swipe-hint-text {
    font-size: 16px;
    color: #fff;
    line-height: 1.5;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.swipe-hint-arrow {
    margin-bottom: 20px;
}

.arrow-bounce {
    display: inline-block;
    font-size: 40px;
    color: #FFD700;
}

.swipe-hint-btn {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #333;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(255, 165, 0, 0.5),
                inset 0 2px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.swipe-hint-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 165, 0, 0.7);
}

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

/* Адаптив для маленьких экранов */
@media (max-width: 380px) {
    .swipe-hint-content {
        padding: 25px 20px;
    }
    
    .swipe-hint-pokemon-img {
        width: 55px;
        height: 55px;
    }
    
    .swipe-hint-pokemon-img:nth-child(2) {
        width: 65px;
        height: 65px;
    }
}

/* ============================================
   ГЛОБАЛЬНЫЕ МОБИЛЬНЫЕ ОПТИМИЗАЦИИ
   ============================================ */

/* Оптимизации для тач-устройств (iPhone, Android) */
@media (hover: none) and (pointer: coarse) {
    /* Отключаем hover эффекты на тач-устройствах */
    * {
        -webkit-tap-highlight-color: transparent !important;
    }
    
    /* Быстрый отклик на все интерактивные элементы */
    button, a, .clickable, [onclick] {
        touch-action: manipulation;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Плавные переходы для всех анимированных элементов */
    .tile, .menu-panel, .menu-panel-content, .lang-dropdown, 
    .bottom-nav, .nav-item, .web3-btn, .menu-play-btn, .menu-secondary-btn {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    /* Ускоренные тапы для кнопок */
    .menu-play-btn:active,
    .menu-secondary-btn:active,
    .nav-item:active,
    .web3-btn:active {
        transition-duration: 0.08s !important;
    }
    
    /* Предотвращение случайного зума */
    input, select, textarea {
        font-size: 16px !important; /* iOS не зумит при 16px+ */
    }
}

/* Оптимизации для iOS Safari */
@supports (-webkit-touch-callout: none) {
    body {
        /* Предотвращаем bounce эффект */
        overscroll-behavior-y: none;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Безопасные области для iPhone X+ */
    .bottom-nav {
        padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    }
    
    .main-menu {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
}

/* Оптимизации для Android */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* Оптимизация скролла */
    .menu-panel-content,
    .profile-body,
    .tutorial-body,
    .settings-body,
    .gm-body,
    .leaderboard-list {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* Оптимизации производительности анимаций */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU-ускорение для часто анимируемых элементов */
.tile,
.menu-panel,
.menu-panel-content,
.lang-dropdown,
.bottom-nav,
.nav-item,
.menu-play-btn,
.menu-secondary-btn,
.web3-btn,
.pokemon-sprite {
    will-change: transform, opacity;
    contain: layout style paint;
}

/* ============================================ */
/* ОПТИМИЗАЦИИ ДЛЯ НОУТБУКОВ С ТАЧСКРИНОМ */
/* ============================================ */

/* Гибридные устройства (ноутбуки с тачскрином) */
@media (pointer: fine) and (any-pointer: coarse) {
    /* Увеличиваем область нажатия для кнопок */
    button, .web3-btn, .menu-play-btn, .menu-secondary-btn, .new-game-btn, .nav-item {
        min-height: 44px;
        min-width: 44px;
        cursor: pointer;
    }
}

/* Универсальные стили для кликабельных элементов */
button, 
.web3-btn, 
.menu-play-btn, 
.menu-secondary-btn, 
.new-game-btn, 
.nav-item,
.gm-send-btn,
.leaderboard-toggle-btn,
[onclick] {
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    /* Убираем задержку на всех устройствах */
    -ms-touch-action: manipulation;
}

/* Активное состояние кнопок */
button:active, 
.web3-btn:active, 
.menu-play-btn:active, 
.menu-secondary-btn:active, 
.new-game-btn:active,
.gm-send-btn:active {
    transform: scale(0.95) !important;
    opacity: 0.9;
}

/* Убеждаемся что кнопки кликабельны */
.new-game-btn,
.web3-btn,
.gm-send-btn,
#gm-btn,
#deploy-btn,
#test-btn {
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

/* Game controls panel должна быть поверх всего */
.game-controls-panel {
    position: relative;
    z-index: 100;
}

/* Web3 buttons контейнер */
.web3-buttons {
    position: relative;
    z-index: 100;
}
