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

body {
    font-family: 'Arial', sans-serif;
    background-color: #e3f2fd;
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

.head {
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.level-container {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 20px;
    font-weight: bold;
}

.level-label {
    opacity: 0.9;
}

.level-value {
    font-size: 28px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, #bbdefb 0%, #e3f2fd 100%);
    overflow: hidden;
}

/* Режим 1: 50/50 разделение */
.content.mode-1 .demo-area {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid #2196f3;
    padding: 20px;
}

.content.mode-1 .user-area {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-top: 3px solid #2196f3;
}

/* Режим 2: 75/25 разделение (картинки/слово) */
.content.mode-2 .demo-area {
    flex: 3;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 4px solid #f5576c;
    padding: 20px;
}

.content.mode-2 .user-area {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-top: 4px solid #f5576c;
}

/* Начальный экран */
.start-screen {
    text-align: center;
    padding: 40px 20px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.start-screen h1 {
    font-size: 42px;
    color: #1976d2;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.subtitle {
    font-size: 24px;
    color: #555;
    margin-bottom: 40px;
    font-weight: 300;
}

/* Режим 1: 6 слов (3×2) - ИСПРАВЛЕНО */
.options-container.mode-1 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 900px;
    padding: 20px;
    height: 100%;
}

/* Исправление для кнопок в режиме 1 */
.option-btn.mode-1 {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-wrap: break-word;
}

/* Режим 2: 4 картинки (2×2) */
.options-container.mode-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    width: 100%;
    max-width: 800px;
    padding: 30px;
    height: 100%;
}

.option-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: capitalize;
    min-height: 80px;
    border: 3px solid transparent;
}

.option-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653d8c 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border-color: #ffd700;
}

.option-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Режим 2: Большие картинки */
.option-btn.mode-2 {
    padding: 0;
    min-height: 250px;
    background: white;
    border: 4px solid #f093fb;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.option-btn.mode-2:hover {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
    transform: scale(1.03);
    border-color: #f5576c;
    box-shadow: 0 12px 35px rgba(0,0,0,0.25);
}

.option-btn.mode-2:active {
    transform: scale(0.98);
}

.option-image {
    width: 85%;
    height: 85%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 15px;
    background-color: white;
    padding: 15px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.option-btn.mode-2:hover .option-image {
    transform: scale(1.08);
    border-color: #ffd700;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

/* Режим 2: Слово внизу */
.word-container {
    text-align: center;
    padding: 10px;
    width: 100%;
}

.word-text {
    font-size: 36px;
    font-weight: bold;
    color: #f5576c;
    text-transform: capitalize;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(245, 87, 108, 0.2);
    letter-spacing: 2px;
}

.word-audio-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 12px 35px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
    display: inline-block;
    min-width: 180px;
    border: none;
    margin: 0 auto;
}

.word-audio-btn:hover {
    background: linear-gradient(135deg, #e67bf5 0%, #f0425a 100%);
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.5);
}

.word-audio-btn:active {
    transform: scale(0.98);
}

/* Добавления для выбора режима */
.mode-selection {
    margin-top: 40px;
    text-align: center;
}

.mode-selection h2 {
    font-size: 28px;
    color: #1976d2;
    margin-bottom: 30px;
}

.mode-btn-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.mode-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 280px;
    border: 3px solid transparent;
}

.mode-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653d8c 100%);
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.35);
    border-color: #ffd700;
}

.mode-btn:active {
    transform: translateY(0);
}

.mode-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.mode-title {
    font-size: 22px;
    margin-bottom: 10px;
}

.mode-desc {
    font-size: 14px;
    opacity: 0.9;
    text-align: center;
    margin-top: 8px;
}

/* Footer */
.footer {
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0.8;
}

/* Эффекты мигания */
.flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
}

.flash-correct {
    background-color: rgba(76, 175, 80, 0.5);
    animation: flash 0.3s ease;
}

.flash-wrong {
    background-color: rgba(244, 67, 54, 0.5);
    animation: flash 0.3s ease;
}

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

/* Временные сообщения */
.temporary-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px 60px;
    border-radius: 20px;
    font-size: 32px;
    font-weight: bold;
    z-index: 10000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: fadeInOut 1.5s ease;
}

.temporary-message.success {
    background: linear-gradient(135deg, #4CAF50 0%, #81C784 100%);
    color: white;
}

.temporary-message.error {
    background: linear-gradient(135deg, #F44336 0%, #E57373 100%);
    color: white;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    10%, 90% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Экран окончания игры */
.game-over-screen {
    text-align: center;
    padding: 40px 20px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.game-over-screen h1 {
    font-size: 48px;
    color: #4CAF50;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.2);
    animation: celebrate 1s ease-in-out infinite alternate;
}

@keyframes celebrate {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.game-over-screen .subtitle {
    font-size: 28px;
    color: #2E7D32;
    margin-bottom: 20px;
    font-weight: bold;
}

.congrats-text {
    font-size: 22px;
    color: #1B5E20;
    margin-bottom: 40px;
    line-height: 1.5;
}

/* Утилиты */
.hidden {
    display: none !important;
}

.error {
    color: #f44336;
    font-weight: bold;
}

.footer {
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    opacity: 0.9;
    padding: 0 20px;
}

.footer-text {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: auto;
}

.footer-text span {
    opacity: 0.8;
    font-weight: bolder;
    font-size: 1.1em;
}

.footer-text span:not(:last-child)::after {
    content: '•';
    margin-left: 15px;
    opacity: 0.6;
}