/* Основные переменные для цветовой схемы */
:root {
    --primary-color: #2C3E50;
    --secondary-color: #1ABC9C;
    --game-background: linear-gradient(135deg, #406285 0%, #27ac91 100%);
    --text-color: #ffffff;
    --canvas-bg: rgba(0, 0, 0, 0.3);
}

/* === ПРОСТОЕ ОТКЛЮЧЕНИЕ НЕЖЕЛАТЕЛЬНЫХ ВЗАИМОДЕЙСТВИЙ === */
/* Отключение выделения текста для всего сайта */
* {
    user-select: none;
    -webkit-user-select: none;
}

/* Исключения для интерактивных элементов */
input, textarea, [contenteditable="true"] {
    user-select: text;
    -webkit-user-select: text;
}

/* Canvas - отключение касаний */
#game-canvas {
    touch-action: none;
}

/* === СТИЛИ ЗАГРУЗОЧНОГО ЭКРАНА === */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: var(--game-background); */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.5s ease-out;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    max-width: 500px;
    width: 90%;
    padding: 40px;
}

.loading-logo {
    margin-bottom: 50px;
}

.loading-orb {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #1ABC9C, #2C3E50, #34495E, #16A085);
    background-size: 200% 200%;
    animation: orb-glow 3s ease-in-out infinite, orb-rotate 8s linear infinite;
    box-shadow: 
        0 0 30px rgba(26, 188, 156, 0.4),
        0 0 60px rgba(44, 62, 80, 0.3),
        0 0 90px rgba(22, 160, 133, 0.2);
    position: relative;
}

.loading-orb::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 30%;
    height: 30%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent);
    border-radius: 50%;
    animation: orb-highlight 3s ease-in-out infinite;
}

@keyframes orb-glow {
    0%, 100% {
        background-position: 0% 50%;
        transform: scale(1);
    }
    50% {
        background-position: 100% 50%;
        transform: scale(1.05);
    }
}

@keyframes orb-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes orb-highlight {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

.loading-title {
    font-size: 2.5rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: title-glow 2s ease-in-out infinite alternate;
    color: white;
}

@keyframes title-glow {
    from {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    }
    to {
        text-shadow: 
            2px 2px 4px rgba(0, 0, 0, 0.5),
            0 0 20px rgba(255, 255, 255, 0.3);
    }
}

.loading-progress-container {
    margin: 40px 0;
}

.loading-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        #1ABC9C 0%, 
        #2C3E50 25%, 
        #34495E 50%, 
        #16A085 75%, 
        #48C9B0 100%);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.3s ease-out;
    animation: progress-shimmer 2s linear infinite;
    border-radius: 20px;
    position: relative;
}

.loading-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    animation: progress-light 1.5s ease-in-out infinite;
}

@keyframes progress-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes progress-light {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(100px); }
}

.loading-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

.loading-tips {
    margin-top: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading-tips p {
    margin: 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    animation: tip-fade 4s ease-in-out infinite;
}

@keyframes tip-fade {
    0%, 90%, 100% { opacity: 0.8; }
    45% { opacity: 1; }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .loading-orb {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }
    
    .loading-title {
        font-size: 2rem;
    }
    
    .loading-content {
        padding: 20px;
    }
    
    .loading-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .loading-orb {
        width: 60px;
        height: 60px;
    }
    
    .loading-title {
        font-size: 1.5rem;
    }
    
    .loading-tips {
        padding: 15px;
    }
    
    .loading-tips p {
        font-size: 0.9rem;
    }
}

/* === КОНЕЦ СТИЛЕЙ ЗАГРУЗОЧНОГО ЭКРАНА === */



/* Стили главного меню */
.main-menu {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: var(--game-background); */
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    overflow: hidden;
}

/* Красивый скроллбар только для модального окна справки */
.help-modal-content::-webkit-scrollbar {
    width: 8px;
}

.help-modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.help-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.help-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.menu-content {
    text-align: center;
    max-width: 540px;
    width: 100%;
    padding: 20px 20px 30px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.menu-title {
    font-size: 2.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: glowing-text 2s ease-in-out infinite alternate;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Анимированный шар в заголовке меню */
.menu-orb {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 26px;
    background: radial-gradient(circle at 30% 30%, #1ABC9C, #2C3E50, #34495E, #16A085);
    background-size: 200% 200%;
    animation: menu-orb-glow 3s ease-in-out infinite, menu-orb-rotate 8s linear infinite;
    box-shadow: 
        0 0 15px rgba(26, 188, 156, 0.4),
        0 0 30px rgba(44, 62, 80, 0.3),
        0 0 45px rgba(22, 160, 133, 0.2);
    position: relative;
    flex-shrink: 0;
}

.menu-orb::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 25%;
    width: 20%;
    height: 20%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.7), transparent);
    border-radius: 50%;
    /* Убираем анимацию для постоянной подсветки */
}

@keyframes menu-orb-glow {
    0%, 100% {
        background-position: 0% 50%;
        transform: scale(1);
    }
    50% {
        background-position: 80% 50%;
        transform: scale(1.05);
    }
}

@keyframes menu-orb-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



.menu-subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 12px;
}

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

.menu-button {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 6px 12px 12px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: white;
    min-height: 60px;
}

.menu-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.menu-button-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.menu-button-title {
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
}

.menu-button-desc {
    font-size: 0.8rem;
    opacity: 0.7;
    line-height: 1.2;
    margin: 0;
}



/* Стили кнопки возврата в меню */
.header-left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.back-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 8px 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}



/* Стили заголовка с относительным позиционированием */
.game-header {
    position: relative;
    /* margin-bottom: 6px; */
}

/* Стили таймера */
.timer-display {
    color: #E74C3C !important;
    font-weight: bold !important;
    font-size: 1.4rem !important;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.timer-display.warning {
    animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {
    0%, 100% { color: #E74C3C; }
    50% { color: #C0392B; }
}

/* Стили предстартового отсчета */
.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.countdown-overlay.hidden {
    display: none;
}

.countdown-number {
    font-size: 8rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    animation: countdown-bounce 1s ease-in-out;
}

.countdown-text {
    font-size: 1.5rem;
    color: white;
    margin-top: 20px;
    opacity: 0.8;
}

@keyframes countdown-bounce {
    0% { 
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .menu-button {
        flex-direction: column;
        text-align: center;
        gap: 4px;
        padding: 5px 10px 10px 10px;
        min-height: 50px;
    }
    
    .menu-button-icon {
        font-size: 2rem;
    }
    
    .menu-button-title {
        font-size: 1.3rem;
    }
    
    .countdown-number {
        font-size: 6rem;
    }
    
    .back-button {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    
    .menu-orb {
        width: 50px;
        height: 50px;
        margin-bottom: 16px;
    }
    
    .menu-content {
        padding: 15px 15px 25px 15px;
    }
    
    .language-selector {
        margin: 32px 0 32px 0;
        gap: 8px;
    }
    
    .language-select::after {
        right: 8px;
        border-left: 3px solid transparent;
        border-right: 3px solid transparent;
        border-top: 5px solid white;
    }
}

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

/* Отключение скролла для всех элементов кроме справки */
html {
    overflow: hidden;
}

/* Скрытие скролла для игровых элементов */
.game-main,
#game-canvas {
    overflow: hidden;
}

/* Firefox скроллбар только для модального окна справки */
.help-modal-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Arial', sans-serif;
    background: var(--game-background);
    min-height: 100vh;
    display: flex;
    align-items: center; 
    justify-content: center;
    color: var(--text-color);
    overflow: hidden;
}

.game-container {
   /* Увеличил чтобы поместилась панель слева (644 + 200 + отступы) */
    width: 100%;
    padding: 0 10px;
    text-align: center;
    overflow: visible; /* Изменил чтобы панель была видна */
}

/* Стили шапки игры */
.game-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: glowing-text 2s ease-in-out infinite alternate;
}

@keyframes glowing-text {
    from {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    }
    to {
        text-shadow: 2px 2px 20px rgba(255, 255, 255, 0.8);
    }
}

/* Новая стильная info-panel */
.info-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    padding: 15px 8px;
    border-radius: 15px 15px 0 0;
    background: linear-gradient(135deg, 
        rgba(44, 62, 80, 0.95) 0%, 
        rgba(26, 188, 156, 0.85) 50%, 
        rgba(22, 160, 133, 0.9) 100%);
    position: relative;
    overflow: hidden;
}

/* Новые стильные info-block элементы */
.info-block {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        rgba(255, 255, 255, 0.1) 100%);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 42px;
    cursor: default;
}

.info-block-bonus {
  gap: 8px;
}

.restart-game-button {
    padding: 4px !important;
}

.info-block-score {
    min-width: 110px;
    grid-column: 2 / 4;
}

/* Эффект при наведении на info-block */
.info-block:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.35) 0%, 
        rgba(255, 255, 255, 0.2) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        0 0 15px rgba(255, 255, 255, 0.3);
}

/* Стильные лейблы */
.info-label {
    margin-right: 6px;
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* Стильные кнопки в панели */
.info-panel-button {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    min-width: 80px;
    white-space: nowrap;
}

/* Эффекты для кнопок */
.info-panel-button:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.15) 100%);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.info-panel-button:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Кнопка бонусов с особым стилем */


.bonus-button .bonus-icon {
    font-size: 1.2em;
}

.bonus-button .bonus-text {
    font-size: 0.85em;
    font-weight: 500;
}

.bonus-button:hover {
    background: linear-gradient(135deg, 
        rgba(231, 76, 60, 0.9) 0%, 
        rgba(192, 57, 43, 1) 100%);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
}



/* Стильный счет */
.info-label-score {
    color: #F1C40F;
    font-weight: 800;
    font-size: 1.2rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Специальные стили для важных показателей */
.info-emoji {
    font-size: 0.9rem;
    margin-right: 4px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Стили для значений */
.info-block span:not(.info-label):not(.info-emoji) {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Блок с бонусами - особый стиль */
.info-block:has(.bonus-button) {
    background: linear-gradient(135deg, 
        rgba(46, 204, 113, 0.3) 0%, 
        rgba(22, 160, 133, 0.2) 100%);
    border-color: rgba(46, 204, 113, 0.5);
}

/* Стили для Canvas */
.game-main {
    display: flex;
    justify-content: center;
    position: relative;
}

#game-canvas {
    background: var(--canvas-bg);
    border-radius: 0 0 15px 15px;
    cursor: default;
    touch-action: none;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#game-canvas:active {
    cursor: grabbing;
}

/* Модальные окна */
.modal-window {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

.modal-window.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    max-width: 420px;
    width: 92%;
    max-height: 80vh;
    overflow-y: scroll;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modal-appear 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    word-wrap: break-word;
}

/* Красивый скроллбар для обычных модальных окон */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

@keyframes modal-appear {
    from {
        transform: scale(0.7) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.modal-content p {
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.5;
    white-space: pre-line;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.button {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
    min-width: 120px;
    text-align: center;
}

.button.primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.button.secondary {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
}

.button.secondary:hover {
    background: #f8f9fa;
    border-color: #aaa;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {

    .game-header {
        max-width: 520px;
        margin: 0 auto;
    }

    /* Переопределяем стили панели для планшетов */
    .info-panel {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 10px;
    }

    .info-block {
        flex-grow: 1;
        min-height: 35px;
        padding: 5px 8px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    .info-panel-button {
        padding: 6px;
        min-width: 60px;
    }

    .info-label {
        margin-right: 3px;
    }

    .info-label-score {
        font-size: 1rem;
    }

    .info-emoji {
        font-size: 1.1rem;
    }
    
    #game-canvas {
        width: 100vw;
        border-radius: 0;
        backdrop-filter: none;
        height: auto;
        max-width: 520px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .game-title {
        font-size: 2rem;
        gap: 12px;
    }
    
    .modal-content {
        width: 95%;
        max-width: 400px;
    }
    
    .modal-buttons {
        justify-content: center;
        max-width: 100%;
    }
    
    .button {
        font-size: 0.8rem;
        padding: 10px 16px;
        min-width: 100px;
        flex: 1;
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.5rem;
        gap: 8px;
    }

    .menu-subtitle {
     font-size: 0.9rem;
    }
    
    /* Стили панели для маленьких мобильных */
    .info-panel {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        padding: 8px;
    }

    .info-block {
        min-height: 30px;
        padding: 4px 6px;
        /* font-size: 0.8rem; */
        border-radius: 8px;
    }

    .info-panel-button {
        /* padding: 4px; */
        min-width: 50px;
    }

    .info-label {
        margin-right: 2px;
    }

    .info-label-score {
        font-size: 0.9rem;
    }

    /* .info-emoji {
        font-size: 1rem;
    } */

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
        max-width: calc(100vw - 40px);
    }
    
    .modal-content p {
        font-size: 1rem;
    }
    
    .button {
        padding: 12px 16px;
        font-size: 0.85rem;
        min-width: auto;
        width: 100%;
    }
    
    .menu-title {
        font-size: 2rem;
    }

    .menu-title span {
        display: block;
        width: 90%;
    }
    

    
    .main-menu {
        padding: 5px 0;
    }
    
    .menu-content {
        padding: 10px 10px 20px 10px;
        min-height: calc(100vh - 10px);
        position: relative;
        bottom: 20px;
       
    }
    
    
    .menu-buttons {
        gap: 8px;
    }
    
    .menu-button {
        padding: 4px 8px 8px 8px;
        min-height: 45px;
    }
    
    

}

/* Модальное окно рекламы */
.ad-modal-content {
    position: relative;
    background: linear-gradient(135deg, #E67E22, #D35400);
    color: white;
    text-align: center;
}

.ad-modal-content h2 {
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ad-modal-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Модальное окно справки */
.help-modal-content {
    position: relative;
    background: linear-gradient(135deg, #2C3E50 0%, #1ABC9C 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.help-modal-content h2 {
    color: #ffffff;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.help-content h3 {
    color: #48C9B0;
    font-size: 1.1rem;
    margin: 20px 0 10px 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.help-content h3:first-child {
    margin-top: 0;
}

.help-content p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 8px 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.help-content strong {
    color: #F1C40F;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.help-content {
    text-align: left;
}


/* Анимация для подсвеченных шариков */
.hint-highlight {
    animation: hint-glow 2s ease-in-out infinite;
}

@keyframes hint-glow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8)) 
                drop-shadow(0 0 16px rgba(255, 215, 0, 0.6))
                drop-shadow(0 0 24px rgba(255, 215, 0, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(255, 215, 0, 1)) 
                drop-shadow(0 0 24px rgba(255, 215, 0, 0.8))
                drop-shadow(0 0 36px rgba(255, 215, 0, 0.6));
    }
}

/* Анимация для активной кнопки молотка */
.hammer-button.active,
.hammer-button-main.active {
    animation: hammer-pulse 1s ease-in-out infinite;
    background: linear-gradient(135deg, #8B4513, #654321) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 0 20px rgba(139, 69, 19, 0.6);
    transform: scale(1.05);
}

@keyframes hammer-pulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(139, 69, 19, 0.6);
    }
    50% { 
        box-shadow: 0 0 30px rgba(139, 69, 19, 0.9);
    }
}

/* Стили для отключенных кнопок */
.info-panel-button:disabled {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    color: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    transform: none;
}

.info-panel-button:disabled:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border-color: rgba(255, 255, 255, 0.2);
    transform: none;
    box-shadow: none;
}

/* Курсор молотка */
.hammer-cursor {
    cursor: crosshair !important;
}

/* Подсветка камней для молотка */
.stone-highlight {
    animation: stone-target 1.5s ease-in-out infinite;
}

@keyframes stone-target {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(139, 69, 19, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(139, 69, 19, 1));
    }
}

/* Эффект удара молотка убран - используется только эмодзи */

/* ВРЕМЕННЫЕ СТИЛИ ДЛЯ ТЕСТИРОВАНИЯ - УДАЛИТЬ ПОСЛЕ ТЕСТА */
.test-btn {
    background: linear-gradient(135deg, #E67E22, #D35400);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.test-btn:hover {
    background: linear-gradient(135deg, #D35400, #E67E22);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.test-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Переключатель языков - выпадающий список */
.language-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 36px 0 36px 0;
    gap: 12px;
}

.language-dropdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.help-button,
.sound-toggle-button {
    background: linear-gradient(135deg, #34495E, #2C3E50);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 6px 10px;
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    outline: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.help-button:hover,
.sound-toggle-button:hover {
    background: linear-gradient(135deg, #2C3E50, #34495E);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.help-button:active,
.sound-toggle-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Стили для включенного звука */
.sound-toggle-button.sound-enabled {
    background: linear-gradient(135deg, #1ABC9C, #16A085);
    border-color: rgba(255, 255, 255, 0.4);
}

.sound-toggle-button.sound-enabled:hover {
    background: linear-gradient(135deg, #16A085, #1ABC9C);
}

.language-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.language-select {
    background: linear-gradient(135deg, #34495E, #2C3E50);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 6px 10px;
    color: white;
    height: 44px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    outline: none;
    min-width: 140px;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    position: relative;
}

.language-select:hover {
    background: linear-gradient(135deg, #2C3E50, #34495E);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.language-select:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.3), 0 6px 20px rgba(0, 0, 0, 0.2);
}

.language-select option {
    background-color: #1a1a1a !important;
    background-image: none !important;
    color: #ffffff !important;
    padding: 12px 16px !important;
    font-weight: 600 !important;
    border: 1px solid #333333 !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8) !important;
}

.language-select option:hover,
.language-select option:focus {
    background-color: #2C3E50 !important;
    background-image: none !important;
    color: #ffffff !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8) !important;
}

.language-select option:checked,
.language-select option:selected {
    background-color: #1ABC9C !important;
    background-image: none !important;
    color: #ffffff !important;
    font-weight: bold !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8) !important;
}

/* Дополнительная поддержка для светлых тем */
@media (prefers-color-scheme: light) {
    .language-select option {
        background-color: #333333 !important;
        color: #ffffff !important;
        border-color: #555555 !important;
    }
    
    .language-select option:hover,
    .language-select option:focus {
        background-color: #2C3E50 !important;
        color: #ffffff !important;
    }
    
    .language-select option:checked,
    .language-select option:selected {
        background-color: #1ABC9C !important;
        color: #ffffff !important;
    }
}

/* Дополнительная поддержка для темных тем */
@media (prefers-color-scheme: dark) {
    .language-select option {
        background-color: #1a1a1a !important;
        color: #ffffff !important;
        border-color: #333333 !important;
    }
    
    .language-select option:hover,
    .language-select option:focus {
        background-color: #2C3E50 !important;
        color: #ffffff !important;
    }
    
    .language-select option:checked,
    .language-select option:selected {
        background-color: #1ABC9C !important;
        color: #ffffff !important;
    }
}

/* Кастомная стрелка для select */
.language-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Принудительные стили для опций */
    color-scheme: dark;
}

/* Контейнер для селектора с стрелкой */
.language-dropdown {
    position: relative;
    display: inline-block;
}

/* Стрелка как псевдоэлемент для плавной анимации */
.language-dropdown::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid white;
    transition: transform 0.3s ease;
    pointer-events: none;
}

/* Анимация стрелки при открытии селекта */
.language-dropdown.open::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Дополнительные стили для принудительного контраста */
.language-select option {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Стили для мобильных устройств */
@media (max-width: 768px) {
    .language-label {
        font-size: 0.8rem;
    }
    
}

@media (max-width: 480px) {
    .language-dropdown {
        gap: 6px;
    }
    
    .help-button,
    .sound-toggle-button {
        /* font-size: 1rem; */
        padding: 8px 14px;
    }
    
    .help-modal-content {
        max-width: 95vw;
        max-height: 90vh;
        margin: 20px;
    }
    
    .help-content h3 {
        font-size: 1rem;
        margin: 15px 0 8px 0;
    }
    
    .help-content p {
        font-size: 0.9rem;
        margin: 6px 0;
    }
    
    .language-label {
        font-size: 0.75rem;
    }
    

}

/* Система нотификаций */
.notification-container {
    position: fixed !important;
    top: 80px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 99999 !important;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: auto;
    height: auto;
}

.notification {
    background: linear-gradient(135deg, #1ABC9C, #16A085) !important;
    color: white !important;
    padding: 18px 28px !important;
    border-radius: 15px !important;
    box-shadow: 0 10px 35px rgba(26, 188, 156, 0.6), 0 0 20px rgba(26, 188, 156, 0.3) !important;
    font-size: 1.2rem !important;
    font-weight: bold !important;
    text-align: center !important;
    min-width: 320px !important;
    max-width: 450px !important;
    border: 3px solid rgba(255, 255, 255, 0.4) !important;
    animation: notification-slide-in 0.6s ease-out !important;
    position: relative !important;
    overflow: hidden !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: notification-shine 2s ease-in-out;
}

.notification.notification-hide {
    animation: notification-slide-out 0.4s ease-in;
}

@keyframes notification-slide-in {
    0% {
        transform: translateY(-150%) scale(0.7);
        opacity: 0;
    }
    50% {
        transform: translateY(-20%) scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes notification-slide-out {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-150%) scale(0.7);
        opacity: 0;
    }
}

@keyframes notification-shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Адаптивные стили для нотификаций */
@media (max-width: 768px) {
    .notification-container {
        top: 80px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: auto !important;
    }
    
    .notification {
        min-width: 280px !important;
        max-width: calc(100vw - 40px) !important;
        font-size: 1rem !important;
        padding: 16px 22px !important;
    }
}

@media (max-width: 480px) { 
    .notification-container {
        top: 80px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: auto !important;
    }
    
    .notification {
        min-width: 250px !important;
        max-width: calc(100vw - 20px) !important;
        font-size: 0.95rem !important;
        padding: 14px 18px !important;
    }
}


/* Анимация финальной победы */
.victory-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2C3E50 0%, #1ABC9C 100%);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    animation: victory-fade-in 1s ease-out;
}

.victory-title {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    animation: victory-bounce 1.5s ease-out;
}

.victory-subtitle {
    font-size: 1.5rem;
    margin-bottom: 40px;
    opacity: 0.9;
    animation: victory-slide-up 1s ease-out 0.5s both;
}

.victory-button {
    background: linear-gradient(135deg, #1ABC9C, #16A085);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: victory-slide-up 1s ease-out 1.5s both;
}

.victory-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(26, 188, 156, 0.4);
}

@keyframes victory-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes victory-bounce {
    0% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translateY(20px) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes victory-slide-up {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===============================
   🏆 СТИЛИ ТАБЛИЦЫ ЛИДЕРОВ
   =============================== */

/* Кнопка лидербордов в меню */
.leaderboard-button {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.leaderboard-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.leaderboard-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.5);
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.leaderboard-button:hover::before {
    left: 100%;
}

.leaderboard-button:active {
    transform: translateY(-1px) scale(1.02);
}

/* Модальное окно лидербордов */
.leaderboard-modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

/* Скролл для модального окна лидеров */
.leaderboard-modal-content::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.leaderboard-modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.leaderboard-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Firefox скроллбар для лидеров */
.leaderboard-modal-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.1);
}

/* Вкладки переключения режимов */
.leaderboard-tabs {
    display: flex;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
}

.leaderboard-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    color: rgba(0, 0, 0, 0.7);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.leaderboard-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.leaderboard-tab:hover {
    color: rgba(0, 0, 0, 0.9);
    background: rgba(0, 0, 0, 0.1);
}

.leaderboard-tab:hover::before {
    left: 100%;
}

.leaderboard-tab.active {
    background: linear-gradient(135deg, #1ABC9C, #16A085);
    color: white;
    box-shadow: 0 2px 10px rgba(26, 188, 156, 0.3);
}

.leaderboard-tab.active:hover {
    background: linear-gradient(135deg, #16A085, #138D75);
}

/* Контейнер таблицы лидеров */
.leaderboard-content {
    min-height: 300px;
    position: relative;
}

/* Состояние загрузки */
.leaderboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: rgba(0, 0, 0, 0.8);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #1ABC9C;
    border-radius: 50%;
    animation: spinner-rotate 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spinner-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Таблица лидеров */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
    /* Настройка ширины колонок */
    table-layout: fixed;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Конкретные ширины колонок */
.leaderboard-table th:nth-child(1),
.leaderboard-table td:nth-child(1) {
    width: 80px; /* Узкая колонка для места (максимум 2 цифры) */
    text-align: center;
    padding: 15px 10px;
}

.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
    width: auto; /* Широкая колонка для имени игрока */
    min-width: 150px;
}

.leaderboard-table th:nth-child(3),
.leaderboard-table td:nth-child(3) {
    width: 100px; /* Средняя колонка для очков */
    text-align: right;
}

.leaderboard-table th {
    background: linear-gradient(135deg, #2C3E50, #34495E);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Убираем эффект наведения на строки таблицы */
.leaderboard-table tr {
    transition: none; /* Убираем анимацию */
}

/* Полностью убираем эффект hover для строк таблицы */
.leaderboard-table tbody tr:hover {
    background: transparent; /* Убираем изменение фона */
    transform: none; /* Убираем смещение */
}

/* Позиции в таблице */
.leaderboard-rank {
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
}

.leaderboard-rank.rank-1 {
    color: #f1c40f;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.leaderboard-rank.rank-2 {
    color: #95a5a6;
    text-shadow: 0 0 10px rgba(149, 165, 166, 0.5);
}

.leaderboard-rank.rank-3 {
    color: #e67e22;
    text-shadow: 0 0 10px rgba(230, 126, 34, 0.5);
}

/* Имя игрока */
.leaderboard-name {
    font-weight: 500;
    color: #333;
    word-wrap: break-word; /* Перенос длинных имен */
}

/* Очки */
.leaderboard-score {
    font-weight: bold;
    color: #1ABC9C;
    text-align: right;
    font-size: 1.1rem;
}



/* Сообщения о состоянии */
.leaderboard-message {
    text-align: center;
    padding: 40px 20px;
    color: rgba(0, 0, 0, 0.7);
    font-size: 1.1rem;
}

.leaderboard-message.no-data {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    border: 2px dashed rgba(0, 0, 0, 0.2);
}

.leaderboard-message.unauthorized {
    background: rgba(231, 76, 60, 0.1);
    border: 2px solid rgba(231, 76, 60, 0.3);
    border-radius: 10px;
    color: rgba(231, 76, 60, 0.9);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .leaderboard-button {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .leaderboard-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .leaderboard-tab {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    /* Адаптивные ширины колонок для планшетов */
    .leaderboard-table th:nth-child(1),
    .leaderboard-table td:nth-child(1) {
        padding: 12px 8px;
    }
    
    .leaderboard-table th:nth-child(2),
    .leaderboard-table td:nth-child(2) {
        min-width: 120px;
    }
    
    .leaderboard-table th:nth-child(3),
    .leaderboard-table td:nth-child(3) {
        width: 80px;
    }
    
    .leaderboard-table th {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .leaderboard-button {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .leaderboard-modal-content {
        width: 98%;
        max-height: 90vh;
    }
    
    .leaderboard-tabs {
        flex-direction: column;
    }
    
    .leaderboard-tab {
        padding: 12px;
        font-size: 0.85rem;
    }
    
    .leaderboard-table {
        font-size: 0.8rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 10px;
    }
    
    /* Компактные ширины колонок для мобильных */
    .leaderboard-table th:nth-child(1),
    .leaderboard-table td:nth-child(1) {
        
        padding: 8px 5px;
    }
    
    .leaderboard-table th:nth-child(2),
    .leaderboard-table td:nth-child(2) {
        min-width: 100px;
        padding: 8px 6px;
    }
    
    .leaderboard-table th:nth-child(3),
    .leaderboard-table td:nth-child(3) {
        width: 70px;
        padding: 8px 6px;
    }
    
    .leaderboard-rank {
        font-size: 1rem;
    }
    
    .leaderboard-score {
        font-size: 1rem;
    }
    
    .leaderboard-message {
        padding: 30px 15px;
        font-size: 1rem;
    }
}

/* === СТИЛИ ДЛЯ КОМПАКТНОЙ УНИВЕРСАЛЬНОЙ ПАНЕЛИ === */
.info-panel-mobile {
display: flex !important;
    column-gap: 8px;
    padding: 0 12px;
    height: 70px; /* Компактная высота */
    border-radius: 15px 15px 0 0;
    background: linear-gradient(135deg, 
        rgba(44, 62, 80, 0.95) 0%, 
        rgba(26, 188, 156, 0.85) 50%, 
        rgba(22, 160, 133, 0.9) 100%);
    position: relative;
    overflow: hidden;
    align-items: center;
    max-width: 640px; /* Точно такая же ширина как у канваса */
    margin: 0 auto; /* Центрирование панели */
}

.info-block-mobile {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        rgba(255, 255, 255, 0.1) 100%);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 20px;
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.info-block-mobile.info-block-score-mobile {
    min-width: 60px;
    flex: 1;
}

.info-block-mobile-time-mode {
  border-radius: 50%;
  transition: all 0.3s ease ;
}

.info-block-mobile-time-mode:hover{
  background: linear-gradient(135deg, 
  rgba(255, 255, 255, 0.4) 0%, 
  rgba(255, 255, 255, 0.25) 100%);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.info-label-mobile {
    margin-right: 4px;
    margin-bottom: -3px;
    font-weight: 600;
    color: white;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.9;
}

.info-label-score-mobile {
    color: #F1C40F;
    font-weight: 700;
    font-size: 1.2rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.options-button {
    background: #40404099;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
     padding: 4px;
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

@media (min-width: 480px) {

.options-button:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.4) 0%, 
        rgba(255, 255, 255, 0.25) 100%);
    transform: scale(1.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

}

.options-button:active {
    transform: scale(0.95);
}

.timer-display-mobile {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.timer-display-mobile.warning {
    color: #e74c3c;
    animation: timer-pulse 1s ease-in-out infinite;
}

.menu-return-button-compact {
    background: none;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.menu-return-button-compact:hover {
    transform: scale(1.1);
}

.menu-return-button-compact:active {
    transform: scale(0.95);
}

/* === СТИЛИ ДЛЯ ВЫДВИЖНОЙ ПАНЕЛИ ОПЦИЙ === */
.mobile-options-panel {
    position: absolute;
    top: 100%;
    left: 50%; /* Центрируем относительно родителя */
    transform: translateX(-50%) translateY(-10px); /* Центрируем и смещаем вверх */
    max-width: 640px; /* Точно такая же ширина как у header */
    width: 100%; /* Адаптивная ширина до максимума */
    background: linear-gradient(135deg, 
        rgba(44, 62, 80, 0.98) 0%, 
        rgba(26, 188, 156, 0.95) 50%, 
        rgba(22, 160, 133, 0.98) 100%);
    
    border-top: none;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-options-panel.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0); /* Сохраняем центрирование при показе */
    pointer-events: all;
}

.mobile-options-content {
    padding: 15px;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    align-items: start;
    max-width: 640px; /* Точно такая же ширина как у канваса и info-panel-mobile */
    margin: 0 auto; /* Центрирование панели */
}

/* Стили для remaining-moves-mobile удалены - элемент перенесен в десктопную панель */

.mobile-option-button {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    padding: 12px 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    min-height: 60px;
    text-align: center;
}

.mobile-option-button:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.15) 100%);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.mobile-option-button:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.bonus-button-mobile {
    background: linear-gradient(135deg, 
        rgba(231, 76, 60, 0.8) 0%, 
        rgba(192, 57, 43, 0.9) 100%);
    border-color: rgba(255, 255, 255, 0.5);

}

.bonus-button-mobile:hover {
    background: linear-gradient(135deg, 
        rgba(231, 76, 60, 0.9) 0%, 
        rgba(192, 57, 43, 1) 100%);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
}


/* Управление видимостью через класс hidden */
.info-panel-mobile.hidden {
    display: none !important;
}

@media (max-width: 480px) {

  .info-panel-mobile {
    height: 60px;
    padding: 3px 3px 3px 9px;
  }
    .mobile-options-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px;
    }
    
    .mobile-option-button {
        padding: 6px;
        min-height: 55px;
    }
    
    .info-block-mobile {
        font-size: 1rem;
    }
  
}


.game-action-button {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    min-height: 70px;
    text-align: center;
}

.game-action-button:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        rgba(255, 255, 255, 0.1) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.game-action-button:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.action-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.bonus-mobile {
  display: none;
}

.action-text {
    font-size: 0.85rem;
    line-height: 1.2;
    text-align: center;
}


/* Специальные стили для кнопки бонуса */
.bonus-button-main {
    background: linear-gradient(135deg, 
        rgba(231, 76, 60, 0.8) 0%, 
        rgba(192, 57, 43, 0.9) 100%);
    border-color: rgba(255, 255, 255, 0.4);
}

.bonus-button-main:hover {
    background: linear-gradient(135deg, 
        rgba(231, 76, 60, 0.9) 0%, 
        rgba(192, 57, 43, 1) 100%);
    box-shadow: 0 0 25px rgba(231, 76, 60, 0.6);
}

/* Контейнер для канваса */
.game-canvas-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* Стили для кнопок в режиме отключения (disabled) */
.game-action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.game-action-button:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
}

/* Новые стили для панелей действий */

/* === УНИВЕРСАЛЬНАЯ АДАПТИВНАЯ ПАНЕЛЬ ДЕЙСТВИЙ === */
.game-actions-panel {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: linear-gradient(135deg, rgb(58 80 102 / 95%) 0%, rgb(35 143 121 / 90%) 50%, rgb(15 90 76 / 95%) 100%);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Стили для отображения оставшихся ходов */
.remaining-moves-display {
    text-align: center;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ДЕСКТОП: Панель слева от канваса */
@media (min-width: 768px) {
    .game-actions-panel {
        position: absolute;
        left: -200px;
        top: 60px;
        flex-direction: column;
        max-width: 180px;
        height: fit-content;
    }
    
    .remaining-moves-display {
        margin-bottom: 4px;
    }
}

@media (max-width: 1100px) {
    .action-text {
        display: none; /* На мобильных показываем только иконки */
    }

    .game-action-button {
        min-height: auto;
        padding: 5px;
    }

    .game-actions-panel {
        left: -110px;
    }

    #game-canvas {
        width: 60vw;
    }

    .info-panel-mobile {
        width: 60vw;
    }

    .mobile-options-panel {
        max-width: 60vw;
    }
    .bonus-desc {
      display: none;
    }
  
    .bonus-mobile {
      display: block;
      font-size: 1.1rem !important;
    }
}

/* МОБИЛЬНЫЕ: Панель под канвасом горизонтально */
@media (max-width: 768px) {

    .game-actions-panel {
        position: relative;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        width: 94%;
        margin-top: 10px;
        padding: 5px 10px;
        box-shadow: none;
        gap: 8px;
    }

    .remaining-moves-display {
        padding: 5px;
    }

    .game-canvas-container {
        flex-direction: column-reverse;
    }

    .game-actions-panel {
        left: 0;
    }
    

    .game-action-button {
        min-height: auto;
        padding: 4px;
    }

    .action-icon {
        font-size: 1.1rem;
        margin-bottom: 0;
    }

    #game-canvas {
        width: 94%;
    }

    .info-panel-mobile {
        width: 94%;
    }

    .mobile-options-panel {
        max-width: 94%;
    }
}

@media (max-width: 480px) {

    .game-container {
        padding: 0 4px;
    }
    #game-canvas {
        width: 98%;
    }

    .info-panel-mobile {
        width: 98%;
    }

    .mobile-options-panel {
        max-width: 98%;
    }

    .game-actions-panel {
        width: 98%;
    }

    .bonus-button-main {
      padding: 0 !important;
    }

    .bonus-mobile {
      display: block;
      font-size: 0.9rem !important;
    }
}

@media (max-width: 390px) {

    .menu-content {
        padding: 30px 10px 20px 10px;
        bottom: 30px;
    }

    .bonus-mobile {
      font-size: 0.7rem !important;
    }


    .menu-title {
        font-size: 1.6rem;
    }
    .menu-orb {
        width: 40px;
        height: 40px;
    }
    .game_title {
        font-size: 1.5rem;
    }

    .language-selector {
        margin: 26px 0 20px 0; 
    }

    .language-select {
        height: 34px;
    }

    .help-button,
    .sound-toggle-button {
       font-size: 1rem;
       padding: 6px 8px;
    }

    .menu-button {
        padding: 2px 4px 6px 4px;
        min-height: auto;
    }

    .menu-button-icon {
        font-size: 1.5rem;
    }

    .menu-button-title {
        font-size: 1.2rem;
    }
    
    /* Стили панели для очень маленьких экранов */
    .info-panel {
        gap: 3px;
        padding: 6px;
    }

    .info-block {
        min-height: 26px;
        padding: 3px 4px;
        font-size: 0.7rem;
        border-radius: 6px;
    }

    .info-panel-button {
        font-size: 0.9rem;
        padding: 4px;
        min-width: 40px;
    }

    .info-label {
        font-size: 0.75rem;
        margin-right: 1px;
    }

    .info-label-score {
        font-size: 0.8rem;
    }

    .info-emoji {
        font-size: 0.9rem;
    }
}

@media (max-width: 380px) {

    .info-panel-mobile {
        height: 40px;
      }

      .options-button {
        font-size: 1.2rem;
        padding: 2px;
      }

      .info-block-mobile {
        padding: 3px;
      }

      #game-canvas {
        width: 85%;
    }

    .info-panel-mobile {
        width: 85%;
    }

    .mobile-options-panel {
        max-width: 85%;
    }

    .game-actions-panel {
        width: 85%;
    }

    .action-icon {
      font-size: 1rem;
    }
    .game-action-button {
        padding: 3px;
    }

    .remaining-moves-display {
        padding: 3px;
    }

    .game-actions-panel { 
      margin-top: 0;
      border-radius: 0 0 15px 15px;
    }

}

@media (max-width: 350px) {
    #game-canvas {
        width: 75%;
    }

    .info-panel-mobile {
        width: 75%;
    }

    .mobile-options-panel {
        max-width: 75%;
    }

    .game-actions-panel {
        width: 75%;
        gap: 2px;
        padding: 3px;
    }

    .info-block-mobile {
        font-size: 0.7rem;
    }

    .info-panel-mobile {
        column-gap: 2px;
    }

    .game-action-button {
        padding: 0;
        height: 30px;
    }

    .remaining-moves-display {
        font-size: 0.9rem;
        padding: 0;
    }

    .info-label-score-mobile {
       font-size: 0.8rem;
    }

    .info-label-mobile {
        font-size: 0.6rem;
    }
}

/* Стили для кнопок без бонусов (визуально отключенные, но кликабельные) */
.game-action-button.no-bonuses,
.mobile-option-button.no-bonuses,
.info-panel-button.no-bonuses {
    opacity: 0.5 !important;
    cursor: pointer !important;
    pointer-events: auto !important; /* Разрешаем события клика */
    filter: grayscale(50%);
    transition: all 0.3s ease;
}

.game-action-button.no-bonuses:hover,
.mobile-option-button.no-bonuses:hover,
.info-panel-button.no-bonuses:hover {
    transform: none !important;
    box-shadow: none !important;
    background: inherit !important;
    opacity: 0.5 !important;
}

/* ===========================
   🏆 ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ЛИДЕРБОРДА
   =========================== */

.leaderboard-separator {
    text-align: center;
    margin: 15px 0;
    font-size: 18px;
    color: #888;
    font-weight: bold;
}

/* Кнопка закрытия модального окна (крестик) */
.modal-close-button {
    position: absolute;
    top: 7px;
    right: 7px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.594);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close-button:hover {
    color: rgba(255, 255, 255, 1);
    background-color: rgba(63, 63, 63, 0.327);
    transform: scale(1.1);
}

.modal-close-button:active {
    transform: scale(0.95);
    background-color: rgba(255, 255, 255, 0.2);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .modal-close-button {
        top: 10px;
        right: 15px;
        font-size: 24px;
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .modal-close-button {
        top: 8px;
        right: 12px;
        font-size: 22px;
        width: 26px;
        height: 26px;
    }
}

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

.modal-window.hidden {
    opacity: 0;
    pointer-events: none;
}

/* === ПРОСТОЕ МАСШТАБИРОВАНИЕ ПО ВЫСОТЕ === */

/* Адаптивное масштабирование всей страницы при недостатке высоты */
@media (max-height: 800px) and (min-width: 769px) {
    body {
        transform: scale(0.8);
        transform-origin: top center;
    }

    .modal-window {
      backdrop-filter: blur(4px);
      background: transparent !important;
    }

    .countdown-overlay {
      backdrop-filter: blur(4px);
      background: transparent !important;
    }
}

@media (max-height: 700px) and (min-width: 769px) {
    body {
        transform: scale(0.7);
        transform-origin: top center;
    }
}

@media (max-height: 600px) and (min-width: 769px) {
    body {
        transform: scale(0.6);
        transform-origin: top center;
    }
}

@media (max-height: 500px) and (min-width: 769px) {
    body {
        transform: scale(0.5);
        transform-origin: top center;
    }
}

@media (max-height: 400px) and (min-width: 769px) {
    body {
        transform: scale(0.3);
        transform-origin: top center;
    }
}

@media (max-height: 300px) and (min-width: 769px) {
    body {
        transform: scale(0.2);
        transform-origin: top center;
    }
}

@media (max-height: 200px) and (min-width: 769px) {
  body {
      transform: scale(0.1);
      transform-origin: top center;
  }
}

/* Для мобильных устройств - более мягкое масштабирование */
/* @media (max-height: 700px) and (max-width: 768px) {
  body {
      transform: scale(0.9);
      transform-origin: top center;
  }
}

@media (max-height: 600px) and (max-width: 768px) {
  body {
      transform: scale(0.8);
      transform-origin: top center;
  }
}

@media (max-height: 500px) and (max-width: 768px) {
  body {
      transform: scale(0.7);
      transform-origin: top center;
  }
} */


