/* Сброс стандартных стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

/* Основные стили для тела страницы */
body {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a, #333); /* Тема по умолчанию */
    color: #fff;
    transition: background 0.5s, color 0.5s;
    overflow-x: hidden; /* Запрещаем только горизонтальную прокрутку */
}

/* Контейнер для анимаций */
.theme-animations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Чтобы анимации не мешали взаимодействию */
    z-index: -1; /* Помещаем анимации под игровой контейнер */
}

/* Скрываем все анимации по умолчанию */
.space-animations,
.sunset-animations,
.ocean-animations,
.default-animations {
    display: none;
}

/* Показываем анимации в зависимости от темы */
body.default-theme .default-animations,
body.space-theme .space-animations,
body.sunset-theme .sunset-animations,
body.ocean-theme .ocean-animations {
    display: block;
}

/* Тема по умолчанию */
body.default-theme {
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    color: #fff;
    animation: pulse-background 10s infinite ease-in-out;
}

@keyframes pulse-background {
    0%, 100% { background: linear-gradient(135deg, #1a1a1a, #2c2c2c); }
    50% { background: linear-gradient(135deg, #2c2c2c, #1a1a1a); }
}

.default-animations .falling-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.default-animations .falling-stars::before,
.default-animations .falling-stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 10px;
    background: #fff;
    opacity: 0;
    animation: fall 5s infinite;
}

.default-animations .falling-stars::before {
    left: 20%;
    animation-delay: 1s;
}

.default-animations .falling-stars::after {
    left: 80%;
    animation-delay: 3s;
}

@keyframes fall {
    0% {
        opacity: 0;
        transform: translateY(-100vh) rotate(45deg);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(45deg);
    }
}

/* Добавляем больше падающих звёзд */
.default-animations .falling-stars .extra-star {
    position: absolute;
    width: 3px;
    height: 12px;
    background: #fff;
    opacity: 0;
    animation: fall 4s infinite;
}

.default-animations .falling-stars .extra-star:nth-child(1) {
    left: 10%;
    animation-delay: 0.5s;
}

.default-animations .falling-stars .extra-star:nth-child(2) {
    left: 30%;
    animation-delay: 2s;
}

.default-animations .falling-stars .extra-star:nth-child(3) {
    left: 50%;
    animation-delay: 1.5s;
}

.default-animations .falling-stars .extra-star:nth-child(4) {
    left: 70%;
    animation-delay: 2.5s;
}

.default-animations .falling-stars .extra-star:nth-child(5) {
    left: 90%;
    animation-delay: 1s;
}

/* Эффект туманного свечения */
.default-animations::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05), transparent 70%);
    animation: glow 15s infinite ease-in-out;
}

@keyframes glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Тема "Космос" */
body.space-theme {
    background: linear-gradient(135deg, #0a0a23, #1b1464);
    color: #e0e0ff;
}

.space-animations .stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.space-animations .stars::before,
.space-animations .stars::after {
    content: '';
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

.space-animations .stars::before {
    width: 2px;
    height: 2px;
    top: 10%;
    left: 30%;
    animation-delay: 0.5s;
}

.space-animations .stars::after {
    width: 3px;
    height: 3px;
    top: 70%;
    left: 60%;
    animation-delay: 1.5s;
}

.space-animations .star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.space-animations .planet {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 30%, #ffcc00 20%, #ff9900 60%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
    animation: rotate-planet 20s linear infinite;
}

.space-animations .planet::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -20px;
    width: 140px;
    height: 2px;
    background: rgba(255, 204, 0, 0.3);
    transform: rotate(20deg);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.space-animations .planet-2 {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 30%, #00b7eb 20%, #0077b6 60%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 183, 235, 0.5);
    animation: rotate-planet 25s linear infinite reverse;
}

.space-animations .planet-2::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -15px;
    width: 110px;
    height: 3px;
    background: rgba(0, 183, 235, 0.3);
    transform: rotate(-15deg);
    box-shadow: 0 0 10px rgba(0, 183, 235, 0.5);
}

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

/* Падающая звезда, созданная вручную */
.space-animations .shooting-star {
    position: absolute;
    width: 15px; /* Размер звезды */
    height: 15px;
    background: radial-gradient(circle, #ffffff 20%, #00b7eb 80%); /* Яркий центр с голубым оттенком */
    border-radius: 50%;
    box-shadow: 0 0 30px #ffffff, 0 0 50px #00b7eb; /* Яркое свечение */
    animation: shoot 6s infinite;
}

.space-animations .shooting-star::before {
    content: '';
    position: absolute;
    top: -100px; /* Шлейф теперь сверху, чтобы звезда падала вниз */
    left: 50%;
    width: 3px;
    height: 100px;
    background: linear-gradient(to bottom, #00b7eb, transparent); /* Градиентный шлейф сверху вниз */
    transform: translateX(-50%);
    box-shadow: 0 0 10px #00b7eb; /* Свечение шлейфа */
}

/* Позиционирование и задержка для нескольких падающих звёзд */
.space-animations .shooting-star:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.space-animations .shooting-star:nth-child(2) {
    left: 40%;
    animation-delay: 2s;
}

.space-animations .shooting-star:nth-child(3) {
    left: 70%;
    animation-delay: 4s;
}

@keyframes shoot {
    0% {
        transform: translateY(-100vh); /* Начало сверху */
        opacity: 1;
    }
    100% {
        transform: translateY(100vh); /* Падение вниз */
        opacity: 0;
    }
}

/* Тема "Закат" */
body.sunset-theme {
    background: linear-gradient(135deg, #ff6f61, #ffb347, #8b5a2b);
    color: #fff;
}

.sunset-animations .sun {
    position: absolute;
    top: 10%;
    left: 50%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #ffcc00, #ff6600);
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(255, 102, 0, 0.8);
    animation: sunset 15s infinite, glow 3s infinite;
}

@keyframes sunset {
    0% { transform: translate(-50%, 0); opacity: 1; }
    50% { transform: translate(-50%, 300px); opacity: 0.5; }
    100% { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 40px rgba(255, 102, 0, 0.8); }
    50% { box-shadow: 0 0 60px rgba(255, 102, 0, 1); }
}

.sunset-animations .clouds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.sunset-animations .cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.6); /* Более заметный цвет */
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4); /* Добавляем свечение */
    animation: drift 30s linear infinite;
    clip-path: polygon(
        0% 50%, 10% 30%, 20% 40%, 30% 20%, 40% 30%, 
        50% 10%, 60% 30%, 70% 20%, 80% 40%, 90% 30%, 100% 50%,
        90% 70%, 80% 60%, 70% 80%, 60% 70%, 50% 90%, 
        40% 70%, 30% 80%, 20% 60%, 10% 70%, 0% 50%
    );
}

.sunset-animations .cloud:nth-child(1) {
    width: 300px; /* Увеличиваем размер */
    height: 90px;
    top: 20%;
    left: -300px;
    animation-duration: 25s;
}

.sunset-animations .cloud:nth-child(2) {
    width: 250px;
    height: 75px;
    top: 30%;
    left: -250px;
    animation-duration: 30s;
    animation-delay: 5s;
}

.sunset-animations .cloud:nth-child(3) {
    width: 270px;
    height: 80px;
    top: 25%;
    left: -270px;
    animation-duration: 28s;
    animation-delay: 10s;
}

.sunset-animations .cloud:nth-child(4) {
    width: 320px;
    height: 95px;
    top: 35%;
    left: -320px;
    animation-duration: 32s;
    animation-delay: 15s;
}

@keyframes drift {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(150vw); }
}

.sunset-animations .birds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.sunset-animations .bird {
    position: absolute;
    width: 20px;
    height: 10px;
    background: #000;
    clip-path: polygon(0% 50%, 30% 0%, 50% 50%, 30% 100%, 0% 50%);
    animation: fly 20s linear infinite;
}

.sunset-animations .bird:nth-child(1) {
    top: 15%;
    left: -20px;
    animation-delay: 0s;
}

.sunset-animations .bird:nth-child(2) {
    top: 18%;
    left: -15px;
    animation-delay: 2s;
}

.sunset-animations .bird:nth-child(3) {
    top: 20%;
    left: -25px;
    animation-delay: 4s;
}

@keyframes fly {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(150vw); }
}

/* Тема "Океан" */
body.ocean-theme {
    background: linear-gradient(135deg, #2e86ab, #a3c1ad);
    color: #fff;
    animation: ocean-gradient 10s infinite alternate; /* Переливающийся градиент */
}

@keyframes ocean-gradient {
    0% { background: linear-gradient(135deg, #2e86ab, #a3c1ad); }
    50% { background: linear-gradient(135deg, #1b6f91, #8ab8a3); }
    100% { background: linear-gradient(135deg, #2e86ab, #a3c1ad); }
}

/* Волны, созданные вручную с помощью CSS */
.ocean-animations .waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px; /* Увеличиваем высоту волн */
    background: linear-gradient(to right, rgba(46, 134, 171, 0.8), rgba(163, 193, 173, 0.8)); /* Более контрастный цвет */
    box-shadow: 0 0 20px rgba(46, 134, 171, 0.5); /* Добавляем свечение */
    clip-path: polygon(
        0% 100%, 5% 70%, 10% 90%, 15% 60%, 20% 80%, 25% 55%, 30% 75%, 35% 50%, 40% 70%, 45% 45%,
        50% 65%, 55% 40%, 60% 60%, 65% 35%, 70% 55%, 75% 30%, 80% 50%, 85% 25%, 90% 45%, 95% 20%, 100% 40%,
        100% 100%, 0% 100%
    );
    animation: wave 10s linear infinite;
    z-index: 0; /* Волны ниже пузырьков */
}

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

.ocean-animations .bubbles {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block; /* Убедимся, что контейнер виден */
    pointer-events: none; /* Чтобы пузырьки не мешали взаимодействию */
    z-index: 1; /* Пузырьки выше волн */
}

/* Пузырьки, созданные с помощью clip-path */
.ocean-animations .bubble {
    position: absolute;
    width: 25px; /* Увеличиваем размер */
    height: 25px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 20%, rgba(46, 134, 171, 0.5) 80%);
    clip-path: circle(50% at 50% 50%); /* Круглая форма */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8); /* Яркое свечение */
    animation: bubble 5s linear infinite;
    z-index: 2; /* Убедимся, что пузырьки выше волн */
}

/* Добавляем блик на пузырьке */
.ocean-animations .bubble::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.9);
    clip-path: circle(50% at 50% 50%);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Пузырьки с разными размерами и задержками */
.ocean-animations .bubble:nth-child(1) {
    width: 25px;
    height: 25px;
    left: 10%;
    bottom: 0;
    animation-delay: 0s;
}

.ocean-animations .bubble:nth-child(2) {
    width: 30px;
    height: 30px;
    left: 15%;
    bottom: 0;
    animation-delay: 0.5s;
}

.ocean-animations .bubble:nth-child(3) {
    width: 20px;
    height: 20px;
    left: 20%;
    bottom: 0;
    animation-delay: 1s;
}

.ocean-animations .bubble:nth-child(4) {
    width: 28px;
    height: 28px;
    left: 25%;
    bottom: 0;
    animation-delay: 1.5s;
}

.ocean-animations .bubble:nth-child(5) {
    width: 22px;
    height: 22px;
    left: 30%;
    bottom: 0;
    animation-delay: 2s;
}

.ocean-animations .bubble:nth-child(6) {
    width: 26px;
    height: 26px;
    left: 35%;
    bottom: 0;
    animation-delay: 2.5s;
}

.ocean-animations .bubble:nth-child(7) {
    width: 24px;
    height: 24px;
    left: 40%;
    bottom: 0;
    animation-delay: 3s;
}

.ocean-animations .bubble:nth-child(8) {
    width: 27px;
    height: 27px;
    left: 45%;
    bottom: 0;
    animation-delay: 3.5s;
}

.ocean-animations .bubble:nth-child(9) {
    width: 23px;
    height: 23px;
    left: 50%;
    bottom: 0;
    animation-delay: 4s;
}

.ocean-animations .bubble:nth-child(10) {
    width: 25px;
    height: 25px;
    left: 55%;
    bottom: 0;
    animation-delay: 0.2s;
}

.ocean-animations .bubble:nth-child(11) {
    width: 29px;
    height: 29px;
    left: 60%;
    bottom: 0;
    animation-delay: 0.7s;
}

.ocean-animations .bubble:nth-child(12) {
    width: 21px;
    height: 21px;
    left: 65%;
    bottom: 0;
    animation-delay: 1.2s;
}

.ocean-animations .bubble:nth-child(13) {
    width: 26px;
    height: 26px;
    left: 70%;
    bottom: 0;
    animation-delay: 1.7s;
}

.ocean-animations .bubble:nth-child(14) {
    width: 24px;
    height: 24px;
    left: 75%;
    bottom: 0;
    animation-delay: 2.2s;
}

.ocean-animations .bubble:nth-child(15) {
    width: 28px;
    height: 28px;
    left: 80%;
    bottom: 0;
    animation-delay: 2.7s;
}

@keyframes bubble {
    0% { transform: translateY(0); opacity: 1; }
    80% { opacity: 1; } /* Задерживаем видимость */
    100% { transform: translateY(-100vh); opacity: 0; }
}

/* Рыбки, созданные вручную */
.ocean-animations .fish {
    position: absolute;
    width: 40px;
    height: 20px;
    background: linear-gradient(to right, #ffcc00, #ff9900);
    clip-path: polygon(
        0% 50%, 20% 30%, 40% 0%, 60% 20%, 80% 0%, 100% 50%, /* Тело */
        80% 100%, 60% 80%, 40% 100%, 20% 70%, 0% 50% /* Хвост */
    );
    animation: swim 15s linear infinite;
}

/* Добавляем плавники */
.ocean-animations .fish::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 20px;
    width: 10px;
    height: 5px;
    background: #ff6600;
    clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
}

.ocean-animations .fish::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 20px;
    width: 10px;
    height: 5px;
    background: #ff6600;
    clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
}

.ocean-animations .fish:nth-child(1) {
    top: 40%;
    left: -50px;
    animation-delay: 0s;
}

.ocean-animations .fish:nth-child(2) {
    top: 50%;
    left: -50px;
    animation-delay: 5s;
    background: linear-gradient(to right, #ff9900, #ff6600);
}

.ocean-animations .fish:nth-child(3) {
    top: 60%;
    left: -50px;
    animation-delay: 10s;
    background: linear-gradient(to right, #ff6600, #ff3300);
}

@keyframes swim {
    0% { transform: translateX(-50px); }
    100% { transform: translateX(150vw); }
}

/* Контейнер игры */
#game-container {
    text-align: center;
    max-width: 600px;
    width: 100%;
    padding: 20px;
    position: relative;
    z-index: 1; /* Чтобы игровой контейнер был поверх анимаций */
}

/* Заголовок */
#header {
    position: relative;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Очки */
#score {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
}

/* Таймер */
#timer {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
}

/* Панель управления */
#controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Стили для кнопок */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background: #00ff88;
    color: #000;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.1s, background 0.3s;
}

button:hover {
    transform: scale(1.05);
    background: #00cc66;
}

#theme-toggle, #music-toggle, #hint-button {
    padding: 8px 15px;
    font-size: 18px;
}

#restart-button {
    margin: 20px auto;
    padding: 12px 30px;
    font-size: 18px;
    background: #00ff88;
    color: #000;
    border: 2px solid #00cc66;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: block;
}

#restart-button:hover {
    background: #00cc66;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Анимация появления кнопки */
@keyframes button-appear {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

#restart-button.button-appear {
    animation: button-appear 0.5s ease forwards;
}

/* Сообщения */
#message {
    min-height: 30px;
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #ffcc00;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* Сетка игры */
#game-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 20px;
}

.row {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.tile {
    width: 60px;
    height: 60px;
    border: 2px solid #555;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    font-weight: bold;
    text-transform: uppercase;
    background: #222;
    transition: all 0.3s;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.tile.filled {
    border-color: #888;
}

.tile.correct {
    background: #00ff88;
    border-color: #00ff88;
    color: #000;
}

.tile.present {
    background: #ffcc00;
    border-color: #ffcc00;
    color: #000;
}

.tile.absent {
    background: #555;
    border-color: #555;
    color: #fff;
}

/* Анимация покачивания строки */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.row.shake {
    animation: shake 0.5s ease;
}

/* Анимация переворота */
@keyframes flip {
    0% { transform: rotateX(0); }
    50% { transform: rotateX(90deg); }
    100% { transform: rotateX(0); }
}

.tile.flip {
    animation: flip 0.5s ease;
}

/* Анимация появления букв */
@keyframes pop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.tile.pop {
    animation: pop 0.3s ease;
}

/* Подсвечивание активной строки */
.row.active .tile {
    border-color: #00ff88;
    box-shadow: 0 0 5px #00ff88;
}

/* Клавиатура */
#keyboard {
    margin-top: 20px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 5px;
}

.key {
    padding: 15px;
    background: #555;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.key:hover {
    background: #777;
    transform: scale(1.05);
}

.key.correct {
    background: #00ff88;
    color: #000;
}

.key.present {
    background: #ffcc00;
    color: #000;
}

.key.absent {
    background: #333;
    color: #888;
}

/* Стили для объединённых кнопок */
.wide-key {
    padding: 15px 30px; /* Увеличиваем внутренние отступы */
    font-size: 1.2em;
    min-width: 100px; /* Минимальная ширина для широких кнопок */
}

.enter, .backspace {
    font-size: 1em;
}

/* Статистика */
#stats {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#stats h2 {
    margin-bottom: 15px;
    font-size: 1.5em;
}

#stats p {
    margin-bottom: 10px;
    font-size: 1.1em;
}

#guess-distribution {
    margin-top: 20px;
}

#guess-distribution h3 {
    margin-bottom: 10px;
    font-size: 1.2em;
}

.distribution-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.distribution-label {
    width: 30px;
    text-align: right;
    margin-right: 10px;
    font-size: 1em;
}

.distribution-bar {
    flex: 1;
    height: 20px;
    background: #333;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.distribution-bar-fill {
    height: 100%;
    background: #00ff88;
    border-radius: 5px;
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.5s ease;
}

/* Фейерверк */
#fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Индикатор загрузки */
#loading {
    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;
    font-size: 2em;
    color: #fff;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

#loading.visible {
    opacity: 1;
    visibility: visible;
}

/* Адаптивность */
@media (max-width: 600px) {
    .tile {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }

    .key {
        padding: 10px;
        font-size: 1em;
    }

    .wide-key {
        padding: 10px 20px;
        min-width: 80px;
        font-size: 1em;
    }

    .enter, .backspace {
        font-size: 0.9em;
    }

    h1 {
        font-size: 2em;
    }

    #score, #timer {
        font-size: 16px;
    }

    button {
        padding: 8px 15px;
        font-size: 14px;
    }

    #restart-button {
        padding: 10px 25px;
        font-size: 16px;
    }

    .space-animations .planet,
    .space-animations .planet-2 {
        width: 60px;
        height: 60px;
    }

    .space-animations .shooting-star {
        width: 10px;
        height: 10px;
    }

    .space-animations .shooting-star::before {
        width: 2px;
        height: 60px;
    }

    .sunset-animations .sun {
        width: 60px;
        height: 60px;
    }

    .sunset-animations .cloud {
        width: 200px !important;
        height: 60px !important;
    }

    .ocean-animations .fish {
        width: 30px;
        height: 15px;
    }

    .ocean-animations .bubble {
        width: 15px !important;
        height: 15px !important;
    }

    .ocean-animations .waves {
        height: 100px;
    }
}