/* Základné štýly */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #333;
    font-family: 'Arial', sans-serif;
}

.game-container {
    position: relative;
}

#gameCanvas {
    background-color: #000;
    max-width: 100%;
    height: auto;
}

/* Tlačidlá */
.button {
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.button:hover {
    background: #45a049;
    transform: scale(1.05);
}

.button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Modálne okná */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Rečové cvičenia */
.speech-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.speech-content {
    position: relative;
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.speech-content img {
    max-width: 200px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.speech-content h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

.attempts-info {
    font-size: 16px;
    color: #666;
    margin: 10px 0;
}

#startRecording {
    background: #2196F3;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px 0;
}

#startRecording:hover:not(:disabled) {
    background: #1976D2;
    transform: scale(1.05);
}

#startRecording:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.result-message {
    font-size: 16px;
    font-weight: bold;
    margin: 10px 0;
    min-height: 20px;
}

#startRecording:hover {
    background: #1976D2;
    transform: scale(1.05);
}

#startRecording:active {
    transform: scale(0.95);
}

/* Efekty pre správne/nesprávne odpovede */
.correct-answer {
    animation: correctPulse 0.5s ease-out;
}

.wrong-answer {
    animation: wrongShake 0.5s ease-in-out;
}

@keyframes correctPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

@keyframes wrongShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Game Over modal */
.game-over-modal {
    background: rgba(0, 0, 0, 0.95);
}

.game-over-content {
    background: linear-gradient(145deg, #2c3e50, #3498db);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

.game-over-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-over-content p {
    margin: 10px 0;
    font-size: 18px;
}

.game-over-buttons {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Level Complete modal */
.level-complete-modal {
    background: rgba(0, 0, 0, 0.95);
}

.level-complete-content {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    color: white;
}

/* Animácia pre hviezdy */
.star {
    font-size: 40px;
    color: #FFD700;
    animation: starPop 0.5s ease-out;
    display: inline-block;
    margin: 0 10px;
}

@keyframes starPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Mobile controls */
.mobile-controls {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    gap: 20px;
}

@media (max-width: 800px) {
    .mobile-controls {
        display: flex;
    }
}

/* Debug panel */
.debug-panel {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 10px;
    color: white;
    font-family: monospace;
    font-size: 14px;
    z-index: 100;
}

.debug-panel button {
    background: #444;
    color: white;
    border: none;
    padding: 5px 10px;
    margin-bottom: 10px;
    cursor: pointer;
    border-radius: 5px;
}

.debug-panel button:hover {
    background: #666;
}



/* ====================================== */
/* POSLUCHOVÉ CVIČENIE - MODAL & DIALÓG */
/* ====================================== */

#zvuky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

#blur-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 9999;
}

.listening-exercise-dialog {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    animation: dialogSlideIn 0.4s ease-out;
}

@keyframes dialogSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dialog-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid #3498db;
    padding-bottom: 20px;
}

.dialog-header h2 {
    font-family: "Luckiest Guy", sans-serif;
    font-size: 32px;
    color: #2c3e50;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.progress-indicator {
    font-family: "Luckiest Guy", sans-serif;
    font-size: 18px;
    color: #7f8c8d;
}

.dialog-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.listening-info {
    background: #ecf0f1;
    border-radius: 15px;
    padding: 20px;
    border-left: 5px solid #3498db;
}

.instruction-text {
    font-family: Arial, sans-serif;
    font-size: 18px;
    color: #2c3e50;
    margin: 0;
    line-height: 1.6;
}

.attempts-display {
    text-align: center;
    font-family: "Luckiest Guy", sans-serif;
    font-size: 20px;
    color: #2c3e50;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
}

.attempts-display span {
    color: #f39c12;
    font-weight: bold;
}

/* Tlačidlá pre prehrávanie zvukov */
.sound-buttons-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
}

.sound-play-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3498db, #5dade2);
    border: 4px solid #2980b9;
    border-radius: 20px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    min-width: 120px;
}

.sound-play-btn img {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.sound-play-btn span {
    font-family: "Luckiest Guy", sans-serif;
    font-size: 16px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    text-transform: uppercase;
}

.sound-play-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.sound-play-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* Kontajner pre tlačidlá odpovedí */
.listening-buttons-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 5px 0;
    flex-wrap: nowrap;
    flex-direction: row;
}

/* Tlačidlá pre posluchové cvičenie */
.listening-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border: 4px solid #1e8449;
    border-radius: 25px;
    padding: 20px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.listening-btn img {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.listening-btn span {
    font-family: "Luckiest Guy", sans-serif;
    font-size: 18px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hover efekty */
.listening-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.listening-btn:hover img {
    transform: scale(0.98);
}

.listening-btn:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
    left: 100%;
}

/* Click efekt */
.listening-btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Špecifické farby pre tlačidlá */
.listening-btn-same {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-color: #1e8449;
}

.listening-btn-same:hover {
    background: linear-gradient(135deg, #2ecc71, #58d68d);
    border-color: #27ae60;
}

.listening-btn-different {
    background: linear-gradient(135deg, #e74c3c, #ec7063);
    border-color: #c0392b;
}

.listening-btn-different:hover {
    background: linear-gradient(135deg, #ec7063, #f1948a);
    border-color: #e74c3c;
}

/* Kontajner pre výsledky */
.listening-result {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.listening-result.show {
    opacity: 1;
    transform: translateY(0);
}

/* Výsledok - správny/nesprávny */
.result-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #fff;
    padding: 20px 30px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-family: "Luckiest Guy", sans-serif;
    font-size: 24px;
}

.result-container.correct {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    animation: correctPulse 0.6s ease-out;
}

.result-container.incorrect {
    background: linear-gradient(135deg, #e74c3c, #ec7063);
    color: white;
    animation: wrongShake 0.6s ease-in-out;
}

@keyframes correctPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 20px rgba(39, 174, 96, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

@keyframes wrongShake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-15px);
    }
    40%, 80% {
        transform: translateX(15px);
    }
}

/* Responzívny dizajn */
@media (max-width: 768px) {
    .listening-exercise-dialog {
        padding: 25px;
        max-width: 95%;
    }
    
    .dialog-header h2 {
        font-size: 24px;
    }
    
    .listening-buttons-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .listening-btn {
        width: 100%;
        min-width: unset;
    }
    
    .sound-buttons-container {
        flex-direction: column;
        gap: 15px;
    }
}



