#exercise-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
#exercise-container .card,
#exercise-container .fragment-card {
    max-width: 500px;
    width: 100%;
    min-width: 300px;
}

.exercise-sidebar {
    height: calc(100vh - 70px);
    overflow-y: auto;
    border-right: 1px solid #dee2e6;
}
.exercise-item {
    cursor: pointer;
    transition: all 0.2s;
}
.exercise-item:hover {
    background-color: #f8f9fa;
}
.exercise-item.active {
    background-color: #e9ecef;
    font-weight: bold;
}
.exercise-content {
    height: calc(100vh - 70px);
    overflow-y: auto;
}
.fragment-card {
    transition: all 0.2s;
    border: 1px solid #dee2e6;
}
.fragment-card:hover {
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.fragment-card.correct {
    border-left: 4px solid #28a745;
}
.fragment-card.incorrect {
    border-left: 4px solid #dc3545;
}
.hidden {
    display: none;
}
.karma-points {
    animation: pop 0.3s ease;
    font-weight: bold;
    color: #28a745;
}
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.flashcard {
    perspective: 1000px;
}
.flashcard-inner {
    position: relative;
    width: 100%;
    height: 200px;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}
.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 20px;
}
.flashcard-front {
    background-color: #4e73df;
    color: white;
}
.flashcard-back {
    background-color: #1cc88a;
    color: white;
    transform: rotateY(180deg);
}
.audio-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.record-indicator {
    width: 12px;
    height: 12px;
    background-color: #dc3545;
    border-radius: 50%;
    margin-right: 5px;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}
.fragment-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}
.exercise-completion {
    text-align: center;
    padding: 20px;
}
.lesson-element {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}
.lesson-element:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}
.lesson-element.active {
    background-color: #c8e8ffe9;
    border-color: #d75fff9b;
}
.theory-item {
    border-left: 3px solid #2196f3;
}
.exercise-item {
    border-left: 3px solid #ff9800;
}
.exercise-completed {
    opacity: 0.7;
    background-color: #8fff8f;
}
.clickable-element {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.clickable-element:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    transform: translateX(5px);
}
/* Стили для упражнений с аудио */
.audio-visualization {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background: #f8f9fa;
}

.flashcard {
    perspective: 1000px;
    height: 200px;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border: 1px solid #e2abf5;
    border-radius: 8px;
}

.flashcard-back {
    transform: rotateY(180deg);
    background-color: #56d6e2;
}

/* Анимации для кнопок записи */
.record-button.recording {
    animation: pulse 1.5s infinite;
}

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

/* Стили для скрытых элементов */
.hidden {
    display: none !important;
}

/* Стили для кнопок воспроизведения */
.play-button:disabled,
.record-button:disabled,
.stop-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Дополнительные стили для визуализации аудио */
canvas {
    border-radius: 4px;
}

/* Стили для кнопок с иконками */
.btn i {
    margin-right: 0.3rem;
}

/* Memory Cards Game Styles */
.memory-game-container {
    max-width: 800px;
    margin: 0 auto;
}

.memory-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.game-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.2rem;
}

.memory-board {
    display: grid;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    min-height: 400px;
}

.memory-board.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.memory-card {
    width: 120px;
    height: 120px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.memory-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.memory-card.matched .card-inner {
    transform: rotateY(180deg);
}

.memory-card.matched .card-back {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #28a745;
}

.memory-card.hint {
    animation: pulse-hint 2s ease-in-out;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #5274f984;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
}

.card-front {
    background: linear-gradient(135deg, #5274f984, #a700b3);
    color: white;
}

.card-back {
    background: white;
    color: #333;
    transform: rotateY(180deg);
    position: relative;
}

.card-content {
    text-align: center;
    font-size: 14px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.card-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    background: #6c757d;
    color: white;
}

.card-badge.foreign {
    background: #dc3545;
}

.card-badge.native {
    background: #28a745;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.game-complete {
    text-align: center;
    padding: 2rem;
}

.game-summary {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Анимации */
@keyframes pulse-hint {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(255, 193, 7, 0.5); }
}

/* Адаптивность */
@media (max-width: 768px) {
    .memory-game-header {
        flex-direction: column;
        text-align: center;
    }
    
    .game-stats {
        justify-content: center;
    }
    
    .memory-card {
        width: 100px;
        height: 100px;
    }
    
    .card-content {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .memory-card {
        width: 80px;
        height: 80px;
    }
    
    .card-content {
        font-size: 11px;
    }
    
    .game-stats {
        gap: 1rem;
    }
}

/* Assemble Sentence Exercise Styles */
.assemble-exercise-container {
    max-width: 800px;
    margin: 0 auto;
}

.native-sentence {
    border-left: 4px solid #007bff;
}

.assembly-area {
    border-left: 4px solid #28a745;
}

.selected-words-area {
    min-height: 80px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.selected-words-area:not(:empty) {
    background-color: #f8f9fa;
    border-color: #28a745;
}

.words-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 60px;
    align-items: center;
}

.word-bubble {
    display: inline-block;
    padding: 8px 16px;
    background-color: #6a00ff;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    font-size: 14px;
    border: 2px solid transparent;
}

.word-bubble:hover {
    background-color: #3e17b4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.word-bubble.selected {
    background-color: rgb(90, 218, 120);
    cursor: pointer;
}

.word-bubble.selected:hover {
    background-color: #218854;
    transform: translateY(-2px);
}

.word-bubble.hint {
    animation: pulse-hint 2s ease-in-out;
    background-color: #ffc107;
    color: #212529;
}

.word-bubble.incorrect {
    background-color: #dc3545;
}

.min-height-100 {
    min-height: 100px;
}

/* Анимации */
@keyframes pulse-hint {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 rgba(255, 193, 7, 0.4);
    }
    50% { 
        transform: scale(1.1); 
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.8);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .word-bubble {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .selected-words-area,
    .words-pool {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .word-bubble {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .controls-area .d-md-flex {
        flex-direction: column;
    }
    
    .controls-area .btn {
        margin-bottom: 5px;
    }
}

/* Простая клавиатура */
.keyboard-container {
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #dee6e6;
    border-radius: 5px;
    background: #2c7bca;
}

.keyboard-symbols {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 0px;
    flex-wrap: wrap;
}

.keyboard-key {
    min-width: 25px;
    height: 25px;
    font-size: 14px;
    padding: 0 5px;
}

.keyboard-controls {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.keyboard-space {
    flex: 1;
    max-width: 100px;
}

.toggle-keyboard-btn {
    margin-top: 5px;
    width: 10%;
}