html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden; /* Предотвращаем горизонтальный скролл */
    width: 100%;
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    position: relative;
}

.game-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 100px;
}

.question-text {
    font-size: 28px;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.input-section {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
}

button {
    padding: 12px 25px;
    background-color: #c1f0c1;
    border: none;
    border-radius: 5px;
    color: #333;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
}

.rock-container {
    width: 200px;
    height: 200px;
    margin: 40px 0; /* Увеличиваем отступ сверху для короны */
    position: relative;
}

.rock {
    width: 100%;
    height: 100%;
    background-color: #666;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.crown {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%) rotate(5deg);
    font-size: 50px;
    z-index: 2;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}

#score {
    color: #666;
    font-size: 16px;
    margin: 10px 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.loading {
    display: none;
    margin: 20px 0;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #666;
    border-radius: 50%;
    animation: bounce 0.5s ease-in-out infinite;
}

.dot:nth-child(2) {
    animation-delay: 0.1s;
}

.dot:nth-child(3) {
    animation-delay: 0.2s;
}

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

.ai-response {
    display: none;
    font-size: 24px;
    font-weight: bold;
    margin: 20px 0;
}

.ai-response.victory {
    color: #4CAF50;
}

.ai-response.defeat {
    color: #f44336;
}

#result {
    color: #666;
    margin: 10px 0;
}

.battle-text {
    font-size: 24px;
    text-align: center;
    margin-bottom: 20px;
    position: static; /* Убираем абсолютное позиционирование */
}

.battle-text .beats {
    color: #2ecc71;
    display: inline;
    font-size: 24px;
    margin: 0 5px; /* Уменьшаем отступы с 10px до 5px */
}

.battle-text .beats.defeat {
    color: #ff6b6b;
}

.explanation {
    color: #666;
    margin: 10px 0;
    font-size: 18px;
    text-align: center;
    max-width: 600px;
    text-transform: none; /* Отключаем все трансформации текста */
}

.history {
    margin-top: 20px;
    text-align: center;
}

.history-chain {
    font-size: 24px;
    margin-bottom: 10px;
}

.history-labels {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
}

.history-item {
    color: #666;
}

.game-controls {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;  /* Увеличиваем отступ между кнопками */
    align-items: center;
}

.share-btn {
    background-color: #c1f0c1;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    font-weight: bold;
    width: fit-content;  /* Ширина по содержимому */
}

.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;  /* Занимает всю ширину */
}

.control-buttons button {
    background-color: white;
    border: 1px solid #ddd;
    color: #666;
    padding: 8px 20px;
}

.control-buttons button:hover {
    background-color: #f5f5f5;
}

#nextButton {
    margin-bottom: 10px;  /* Добавляем отступ снизу для кнопки */
}

#nextButton button {
    background-color: white;
    border: 1px solid #ddd;
    padding: 12px 30px;  /* Увеличиваем размер кнопки */
    font-size: 18px;     /* Увеличиваем размер шрифта */
}

#nextButton button:hover {
    background-color: #f5f5f5;
}

.new-game-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: white;
    border: 1px solid #ddd;
    color: #666;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-game-btn:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .input-section {
        max-width: 100%;
    }

    .rock-container {
        width: 150px;
        height: 150px;
    }

    .crown {
        font-size: 40px;
        top: -40px;
    }

    #score {
        flex-direction: column;
        gap: 5px;
    }

    .new-game-btn {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Добавляем медиа-запрос для планшетов */
@media (min-width: 481px) and (max-width: 1024px) {
    .game-controls {
        margin-top: 50px;
        margin-bottom: 30px;
    }

    .share-btn {
        margin-bottom: 20px;
    }

    .rock-container {
        width: 180px;
        height: 180px;
        margin: 50px 0; /* Ещё больше отступ для планшетов */
    }

    .crown {
        font-size: 45px;
        top: -45px; /* Фиксированное положение короны */
        transform: translateX(-50%) rotate(5deg);
    }

    button {
        font-size: 18px;  /* Увеличиваем шрифт кнопок на планшетах */
        padding: 15px 30px;
    }
}

.explanation.error {
    color: #ff6b6b;
    font-size: 16px;
    padding: 10px;
    border-radius: 5px;
    background-color: rgba(255, 107, 107, 0.1);
    margin: 10px 0;
} 