/* Сброс базовых стилей */
body {
    margin: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #0f172a;
    color: white;
    user-select: none;
}

/* Слой интерфейса поверх Canvas */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 10;
}

/* Верхняя панель с заданием */
#info-container {
    padding: 20px;
    text-align: center;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0) 100%);
}

#question-counter {
    font-size: 1.2em;
    color: #94a3b8;
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#sentence-prompt {
    font-size: 1.8em;
    font-weight: 800;
    text-shadow: 0 4px 6px rgba(0,0,0,0.5);
    margin-bottom: 10px;
    color: #38bdf8;
    letter-spacing: 0.5px;
}

#message {
    font-size: 1.8em;
    font-weight: bold;
    height: 40px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    opacity: 0;
    transform: translateY(-10px);
}

#message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Нижняя панель с кнопками и звуком */
#controls-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 20px;
    position: relative;
    pointer-events: auto; /* Включаем клики для интерфейса */
}

#controls {
    text-align: center;
}

button {
    padding: 15px 35px;
    font-size: 1.2em;
    cursor: pointer;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 12px;
    margin: 0 10px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1.5px;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    background: #475569;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Специальный стиль для кнопки Назад */
#back-button {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.4);
}

#back-button:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.6);
}

/* Управление громкостью */
#audio-controls {
    position: absolute;
    right: 20px;
    bottom: 20px;
    background: rgba(30, 41, 59, 0.8);
    padding: 10px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#audio-controls label {
    font-size: 0.9em;
    font-weight: 600;
    color: #cbd5e1;
}

input[type="range"] {
    cursor: pointer;
    accent-color: #38bdf8;
}

/* Финальный экран (Поздравление) */
#end-screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    z-index: 50;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto; /* Включаем клики для финального экрана */
    text-align: center;
}

#end-title {
    font-size: 4em;
    color: #facc15;
    margin-bottom: 20px;
    text-shadow: 0 4px 15px rgba(250, 204, 21, 0.5);
    letter-spacing: 2px;
}

#end-screen p {
    font-size: 1.5em;
    color: #e2e8f0;
    margin-bottom: 40px;
}

#restart-button {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.4);
    font-size: 1.5em;
    padding: 20px 50px;
}

#restart-button:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.6);
}

/* Сцена Three.js */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}
