/* Container for both welcome and quiz sections */
.container-mind-tester {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"><defs><linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:#ff6f61;stop-opacity:1" /><stop offset="100%" style="stop-color:#6e8efb;stop-opacity:1" /></linearGradient></defs><rect width="800" height="600" fill="url(#grad)"/><circle cx="100" cy="100" r="50" fill="#ffd700" opacity="0.3" /><circle cx="700" cy="500" r="70" fill="#00ff88" opacity="0.3" /><path d="M200,150 Q300,50 400,150 T600,150" stroke="#fff" stroke-width="5" fill="none" opacity="0.5" /><path d="M150,450 Q250,350 350,450 T550,450" stroke="#ff0" stroke-width="5" fill="none" opacity="0.5" /></svg>') no-repeat center center;
    background-size: cover;
    border-radius: 15px;
    padding: 40px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
}

/* Base content box styles for all sections */
.content-box {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    max-width: 700px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

/* Differentiate content boxes with border colors */
.content-box-initial { border: 3px solid #28a745; } /* Green for initial screen */
.content-box-how-to-play { border: 3px solid #ffc107; background: rgba(255, 255, 255, 0.9); } /* Yellow for how-to-play */
.content-box-class { border: 3px solid #007bff; background: rgba(255, 255, 255, 0.9); } /* Blue for class selection */
.content-box-topic { border: 3px solid #17a2b8; background: rgba(255, 255, 255, 0.8); } /* Teal for topic selection */
.content-box-quiz { border: 3px solid #17a2b8; background: rgba(255, 255, 255, 0.8); } /* Teal for quiz, matching topic */

/* Button styles for welcome, class, and topic sections */
.kid-button, .class-option, .topic-option, .back-button {
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.kid-button:hover, .class-option:hover, .topic-option:hover, .back-button:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}
.back-button { font-size: 1rem; padding: 8px 16px; }

/* Title styling */
.title-line {
    color: #007bff;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

/* Quiz-specific styles */
.sound-control {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}
#loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    height: 200px;
}
#quiz-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}
.option-button {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    background-color: #e9ecef;
    color: #212529;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    text-align: left;
}
.option-button:hover:not(.correct):not(.incorrect):not(.disabled) {
    background-color: #dee2e6;
    transform: translateY(-2px);
}
.option-button.correct {
    background-color: #28a745 !important;
    color: white !important;
}
.option-button.incorrect {
    background-color: #dc3545 !important;
    color: white !important;
}
.option-button.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.result-screen {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
}

/* Responsive tweaks */
@media (max-width: 576px) {
    .container-mind-tester {
        padding: 20px;
        min-height: 400px;
    }
    .content-box {
        padding: 20px;
    }
    .display-4 { font-size: 2.5rem; }
    .kid-button, .class-option, .topic-option, .back-button, .option-button {
        font-size: 0.9rem;
        padding: 8px 16px;
    }
    .title-line { display: block !important; }
}
