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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.upload-section {
    text-align: center;
    margin-bottom: 20px;
}

.upload-section input,
.upload-section button {
    margin: 5px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* БЛОК АВАТАРА: один квадрат, внутри по очереди картинка или видео */

.avatar-box {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto 24px;
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid #667eea;
    background: #000;
    display: block; /* важно, чтобы НЕ было flex */
}

/* и картинка, и видео занимают весь квадрат и лежат друг на друге */
.avatar-box img,
.avatar-box video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* по умолчанию видео скрыто, показываем его из JS */
#avatarVideo {
    display: none;
}

.controls {
    text-align: center;
    margin: 20px 0;
}

button {
    padding: 12px 25px;
    margin: 0 10px;
    border: none;
    border-radius: 25px;
    background: #667eea;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.transcription,
.response {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #f9f9f9;
}

h3 {
    color: #333;
    margin-bottom: 10px;
}

#questionText,
#responseText {
    min-height: 60px;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #ddd;
}

#responseAudio {
    width: 100%;
    margin-top: 10px;
}

.status {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    border-radius: 5px;
}

#statusMessage {
    font-weight: bold;
    color: #666;
}

.recording {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}
