/* Общие стили */
body {
    font-family: 'Helvetica', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #eeaf3b 0%, #d88f06 100%);
    min-height: 100vh;
    margin: 0;
    padding: 20px;

    background-image: url('background.jpg'); /* путь к вашему файлу */
    background-size: cover;                 /* масштабирует изображение на весь экран, сохраняя пропорции */
    background-position: center;            /* центрирует изображение */
    background-repeat: no-repeat;           /* не повторять */
    background-attachment: fixed;           /* фиксирует фон при прокрутке (опционально) */
}


/* Стили для экрана выбора исполнителя */
.artist-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.artist-container {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.artist-container h1 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.artist-container > p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

.artist-input-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.artist-input {
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1.1rem;
    text-align: center;
    transition: border-color 0.3s ease;
}

.artist-input:focus {
    outline: none;
    border-color: #d88f06;
    box-shadow: 0 0 0 3px rgba(216, 143, 6, 0.1);
}

.artist-button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #eeaf3b 0%, #d88f06 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.artist-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(216, 143, 6, 0.4);
}

.artist-message {
    min-height: 24px;
    font-weight: bold;
    margin-top: 1rem;
}

/* Стиль для информации о сложности в квизе */
.difficulty-info {
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: #333;
    border-left: 4px solid #eeaf3b;
    text-align: center;
    font-size: 0.9rem;
}

/* Индикатор загрузки */
.loading-indicator {
    text-align: center;
    height: 45px;              /* фиксированная высота (подберите под свой спиннер) */
    overflow: hidden;          /* чтобы при скрытии содержимое не вылезало */
    transition: height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
    padding: 10px;             /* отступы вокруг спиннера */
}

.loading-indicator.hidden {
    height: 0;
    opacity: 0;
    padding: 0;                /* убираем отступы, чтобы высота точно стала 0 */
}

.spinner {
    display: block;
    width: 28px;
    height: 28px;
    margin: 0 auto;
    border: 4px solid #e0e0e0; /* чуть темнее */
    border-top: 4px solid #d88f06;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-sizing: border-box; /* чтобы граница не увеличивала размер */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Цвета для разных уровней сложности */
.difficulty-easy {
    color: #4CAF50;
    font-weight: bold;
}

.difficulty-medium {
    color: #ff9800;
    font-weight: bold;
}

.difficulty-hard {
    color: #f44336;
    font-weight: bold;
}

/* Стили для экрана выбора сложности */
.difficulty-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.difficulty-container {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.difficulty-container h1 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.difficulty-container > p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.difficulty-btn {
    padding: 1.5rem;
    border: none;
    border-radius: 10px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.difficulty-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.difficulty-name {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.difficulty-desc {
    display: block;
    font-size: 0.9rem;
    color: #666;
}

/* Кнопка возврата */
.back-button {
    background: none;
    border: 2px solid #6c757d;
    color: #6c757d;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: #6c757d;
    color: white;
}

/* Финальный экран */
.result-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.result-container {
    background: white;
    padding: 2rem 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: fadeIn 0.5s ease-out;
}

.result-container h1 {
    color: #d88f06;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.result-stats {
    text-align: left;
    margin: 2rem 0;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 12px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin: 0.8rem 0;
    font-size: 1.2rem;
}

.result-label {
    font-weight: 600;
    color: #333;
}

.result-value {
    font-weight: bold;
    color: #d88f06;
}

.restart-button, .back-to-artist-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin: 8px;
    transition: all 0.3s ease;
}

.restart-button {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.back-to-artist-button {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.restart-button:hover, .back-to-artist-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* СТИЛИ ДЛЯ ОСНОВНОГО ИНТЕРФЕЙСА КВИЗА */
.audio-player {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 500px;
    width: 90%;
    margin: 2rem auto;
    animation: fadeIn 0.5s ease-in;
}

/* Объявляем кастомный шрифт */
@font-face {
    font-family: 'YAM';
    src: url('fonts/ysm.woff2') format('woff2'),
         url('fonts/ysm.woff') format('woff');
    font-weight: 400; /* Обычный */
    font-style: normal;
    font-display: swap; /* Чтобы текст не был невидим во время загрузки */
}


@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Заголовок квиза */
.quiz-title {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
}

/* Кнопки управления */
.audio-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 1.5rem 0;
    justify-content: center;
}

.audio-controls button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #eeaf3b 0%, #d88f06 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.audio-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.audio-controls button:active {
    transform: translateY(0);
}

/* Информация о треке */
.track-info {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 8px solid #d88f06;
}

.track-info p {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
}

/* Полоса прогресса */
.audio-progress {
    margin: 1.5rem 0;
}

progress {
    width: 100%;
    height: 12px;
    border-radius: 10px;
    border: none;
    background: #f0f0f0;
}

progress::-webkit-progress-bar {
    background: #f0f0f0;
    border-radius: 10px;
}

progress::-webkit-progress-value {
    background: linear-gradient(135deg, #eeaf3b 0%, #d88f06 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

progress::-moz-progress-bar {
    background: linear-gradient(135deg, #eeaf3b 0%, #d88f06 100%);
    border-radius: 10px;
}

/* Поле ввода ответа */
.answer-input {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    padding: 0.6rem;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

#answer {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    margin-right: 10px;
    width: 300px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#answer:focus {
    outline: none;
    border-color: #d88f06;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.answer-button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 8px;
    margin-top: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.answer-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

#answerMessage {
    display: block;
    margin-top: 12px;
    font-weight: bold;
    font-size: 14px;
    min-height: 20px;
}

/* Кнопка рестарт */
#restartButton {
    padding: 14px 28px;
    font-size: 16px;
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A52 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 20px auto;
    display: block;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

/* Регулятор громкости */
.volume-control {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.volume-control label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

#volumeSlider {
    -webkit-appearance: none;
    appearance: none;
    width: 200px;
    margin: 0 12px;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #d88f06 0%, #d88f06 var(--fill-percent, 100%), #e0e0e0 var(--fill-percent, 100%), #e0e0e0 100%);
    outline: none;
}

/* таймер и счетчик */
.quiz-stats {
    display: flex;
    justify-content: space-between;
    margin: 10px 0 20px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: 600;
}
.timer-display, .score-display {
    font-size: 1rem;
    color: #333;
}
#timerValue, #scoreValue {
    font-weight: bold;
    color: #d88f06;
}

/* Стили для ползунка в Chrome/Safari/Edge */
#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #d88f06;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Стили для ползунка в Firefox */
#volumeSlider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: #d88f06;
    cursor: pointer;
}

/* Стили для трека в Firefox */
#volumeSlider::-moz-range-track {
    height: 6px;
    background: linear-gradient(135deg, #eeaf3b 0%, #d88f06 100%);
    border-radius: 3px;
}

#volumeValue {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}


#restartButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.difficulty-screen, .audio-player {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.difficulty-screen.hidden, .audio-player.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .audio-player {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem auto;
    }
    
    .difficulty-container {
        padding: 2rem;
    }
    
    .audio-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .audio-controls button {
        width: 200px;
    }
    
    #answer {
        width: 150px;
        margin-bottom: 10px;
    }
}

/* Стили для заблокированного поля ввода */
#answer:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.7;
}


#restartButton:hover {
    background-color: #45a049;
}

@media (max-width: 768px) {
    .audio-player {
        width: 90%;
        margin: 1rem auto;
    }
    
.track-info {
    margin: 1rem 0;
    font-size: 14px;
    color: #555;
}

.track-info p {
    margin: 0;
}
}

.result-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.share-button, .leaderboard-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-button {
    background: linear-gradient(135deg, #2196F3 0%, #0b7dda 100%);
    color: white;
}

.leaderboard-button {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    color: white;
}

.share-button:hover, .leaderboard-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* Модальные окна */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.leaderboard-content {
    max-width: 500px;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

.alias-input {
    width: 100%;
    padding: 10px;
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 2px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    margin: 15px 0;
}

.error-message {
    color: red;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.modal-submit {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 20px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 1rem;
}
