/* Game Container Styles */
#quick-test .speed-game {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#quick-test .game-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

#quick-test .game-header h4 {
    font-size: 1.3rem;
    color: #4a4a4a;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#quick-test .game-header .fas {
    color: #6c5ce7;
}

#quick-test .game-description {
    color: #666;
    font-size: 0.95rem;
}

#quick-test .game-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

#quick-test .game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #6c5ce7, #a29bfe);
}

#quick-test .game-footer {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 1rem;
}

/* Game Screens */
#quick-test .game-screen {
    text-align: center;
    padding: 1rem;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#quick-test .hidden {
    display: none;
}

/* Start Screen */
#quick-test #start-screen h1 {
    font-size: 2.2rem;
    color: #6c5ce7;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #6c5ce7, #a29bfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(108, 92, 231, 0.2);
}

#quick-test #start-screen p {
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 1.1rem;
}

#quick-test #start-btn {
    background: linear-gradient(to right, #6c5ce7, #a29bfe);
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 1rem;
}

#quick-test #start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

#quick-test #start-btn:active {
    transform: translateY(1px);
}

/* Game Screen */
#quick-test .game-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: #555;
    padding: 0.8rem 1.2rem;
    background: #f8f9fa;
    border-radius: 50px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#quick-test .game-header i {
    margin-right: 5px;
    color: #6c5ce7;
}

#quick-test #question-text {
    font-size: 1.8rem;
    margin: 1.5rem 0;
    color: #333;
    font-weight: 600;
    min-height: 3rem;
    line-height: 1.4;
}

#quick-test .options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    margin: 2rem 0;
}

#quick-test .option-btn {
    padding: 1.2rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 80px;
}

#quick-test .option-btn:hover {
    border-color: #a29bfe;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#quick-test .option-btn:active {
    transform: translateY(1px);
}

#quick-test .option-btn.correct {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
    animation: pulse 0.5s;
}

#quick-test .option-btn.wrong {
    background: #ff5252;
    color: white;
    border-color: #ff5252;
    animation: shake 0.5s;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-8px); }
    80% { transform: translateX(8px); }
}

/* Progress Bar */
#quick-test #progress-container {
    margin: 2.5rem 0 1.5rem;
}

#quick-test #progress-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 0.8rem;
    overflow: hidden;
    position: relative;
}

#quick-test #progress-fill {
    height: 100%;
    width: 5%;
    background: linear-gradient(to right, #6c5ce7, #a29bfe);
    border-radius: 5px;
    transition: width 0.5s ease;
}

#quick-test #progress-text {
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

/* Result Screen */
#quick-test #result-title {
    font-size: 2rem;
    color: #6c5ce7;
    margin-bottom: 1.5rem;
}

#quick-test #result-message {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 2rem;
    line-height: 1.5;
}

#quick-test .stars-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 1.5rem 0;
}

#quick-test .star {
    font-size: 2rem;
    color: #e0e0e0;
}

#quick-test .star.filled {
    color: #ffc107;
    animation: bounce 0.5s;
}

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

#quick-test #solution-video {
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#quick-test .video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

#quick-test .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

#quick-test .button-group {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

#quick-test .button-group button {
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

#quick-test #next-level-btn {
    background: linear-gradient(to right, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

#quick-test #retry-btn {
    background: white;
    color: #6c5ce7;
    border: 2px solid #6c5ce7;
}

#quick-test #next-level-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

#quick-test #retry-btn:hover {
    background: #f8f9fa;
    transform: translateY(-3px);
}

/* Final Screen */
#quick-test #final-screen {
    padding: 2rem;
}

#quick-test #final-screen h1 {
    font-size: 2.5rem;
    color: #6c5ce7;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#quick-test #final-screen p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

#quick-test #final-score {
    font-weight: bold;
    color: #6c5ce7;
    font-size: 1.4em;
}

#quick-test #final-stars .star {
    font-size: 2.5rem;
}

#quick-test #other-lessons-btn {
    background: linear-gradient(to right, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    font-size: 1.2rem;
    border-radius: 50px;
    margin-top: 2rem;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
    transition: all 0.3s ease;
}

#quick-test #other-lessons-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

/* Loading Spinner */
#quick-test .loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(108, 92, 231, 0.2);
    border-radius: 50%;
    border-top-color: #6c5ce7;
    animation: spin 1s ease-in-out infinite;
    margin: 1rem 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse Animation */
#quick-test .pulse-animation {
    animation: pulse 2s infinite;
}

/* MathJax specific styles */
#quick-test .MJX-TEX {
    font-size: 1.1em;
    line-height: 1.2;
}

#quick-test mjx-container[jax="CHTML"] {
    display: inline-block;
    vertical-align: middle;
}

/* Responsive Design */
@media (max-width: 768px) {
    #quick-test .options-grid {
        grid-template-columns: 1fr;
    }
    
    #quick-test .game-header {
        flex-direction: column;
        gap: 0.8rem;
        align-items: center;
    }
    
    #quick-test #question-text {
        font-size: 1.5rem;
    }
    
    #quick-test .button-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    #quick-test .button-group button {
        width: 100%;
    }
    
    #quick-test #start-screen h1 {
        font-size: 1.8rem;
    }
    
    #quick-test #result-title, #final-screen h1 {
        font-size: 1.8rem;
    }
}

/* Confetti canvas */
#quick-test canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
}

.place {
    display: block;
    margin: auto;
    width: 100%;
}