/**
 * Prime Patrol - Comic-Book Superhero Police Theme
 *
 * Suit up, hero! Villain numbers are loose downtown. This game has a bold
 * comic-book / police-patrol vibe: badge blues, blazing siren red, gleaming
 * gold badges, and halftone comic energy. Headings use the punchy "Bangers"
 * comic font for that POW! KAPOW! feel.
 * Builds on top of kid-friendly-theme.css
 *
 * Color Palette:
 * - Badge Blue:   #1B3C8C (hero suit, titles, headers, primary accents)
 * - Sky Patrol:   #2E6FE0 (lighter blue gradients, score, progress)
 * - Siren Red:    #E63946 (alerts, hard rank, incorrect, error states)
 * - Gold Badge:   #FFC72C (badges, highlights, easy rank, star ratings)
 * - Comic Ink:    #1A1A2E (bold outlines, comic-book black text/borders)
 */

body {
    background:
        radial-gradient(circle at 20% 15%, rgba(255, 199, 44, 0.18) 0%, transparent 35%),
        radial-gradient(circle at 85% 80%, rgba(230, 57, 70, 0.16) 0%, transparent 38%),
        linear-gradient(135deg, #2E6FE0 0%, #1B3C8C 55%, #122968 100%);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    font-family: 'Nunito', sans-serif;
}

.game-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.kid-game-card {
    position: relative;
    background:
        radial-gradient(rgba(27, 60, 140, 0.06) 1.5px, transparent 1.5px) 0 0 / 16px 16px,
        linear-gradient(135deg, #FFFFFF 0%, #F2F6FF 100%);
    border: 5px solid #1A1A2E;
    border-radius: 22px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 10px 0 rgba(26, 26, 46, 0.35), 0 14px 34px rgba(18, 41, 104, 0.45);
}

/* Mascot */
.hero-mascot {
    font-size: 5rem;
    text-align: center;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 6px rgba(26, 26, 46, 0.35));
    animation: float 3s ease-in-out infinite;
}

.hero-mascot.excited {
    animation: heroBounce 0.6s ease-in-out 3;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes heroBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-22px) scale(1.08); }
}

/* Title */
.kid-friendly-title {
    font-family: 'Bangers', 'Fredoka', cursive;
    font-size: 3.6rem;
    letter-spacing: 2.5px;
    color: #1B3C8C;
    text-align: center;
    margin: 10px 0 18px;
    text-shadow:
        2px 2px 0 #FFC72C,
        4px 4px 0 #1A1A2E;
}

.kid-friendly-body {
    font-family: 'Nunito', sans-serif;
    color: #1A1A2E;
    text-align: center;
    font-size: 1.3rem;
    line-height: 1.5;
    margin-bottom: 30px;
}

/* Difficulty Selection */
.difficulty-selection {
    margin: 40px 0;
}

.section-title {
    font-family: 'Bangers', 'Fredoka', cursive;
    font-size: 2.1rem;
    letter-spacing: 1.5px;
    color: #E63946;
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 1.5px 1.5px 0 #1A1A2E;
}

.difficulty-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kid-difficulty-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 4px solid #1A1A2E;
    border-radius: 18px;
    box-shadow: 0 5px 0 rgba(26, 26, 46, 0.3);
}

.kid-difficulty-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 11px 22px rgba(18, 41, 104, 0.4);
}

.kid-difficulty-card.easy {
    background: linear-gradient(135deg, #FFE699 0%, #FFC72C 100%);
    border-color: #1A1A2E;
}

.kid-difficulty-card.medium {
    background: linear-gradient(135deg, #6FA0F0 0%, #2E6FE0 100%);
    border-color: #1A1A2E;
}

.kid-difficulty-card.hard {
    background: linear-gradient(135deg, #F38088 0%, #E63946 100%);
    border-color: #1A1A2E;
}

.difficulty-title {
    font-family: 'Bangers', 'Fredoka', cursive;
    font-size: 1.7rem;
    letter-spacing: 1px;
    color: #1A1A2E;
    margin-bottom: 10px;
}

.difficulty-description {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #1A1A2E;
    margin-bottom: 8px;
}

.difficulty-example {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1A1A2E;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(26, 26, 46, 0.4);
    padding: 5px 10px;
    border-radius: 8px;
    margin-top: 10px;
}

/* Practice Mode Section */
.practice-mode-section {
    margin: 30px 0;
}

.practice-mode-card {
    background: linear-gradient(135deg, #FFE699 0%, #FFC72C 100%);
    border: 4px solid #1A1A2E;
    border-radius: 18px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 0 rgba(26, 26, 46, 0.3);
}

.practice-mode-card h3 {
    font-family: 'Bangers', 'Fredoka', cursive;
    font-size: 1.8rem;
    letter-spacing: 1px;
    color: #1B3C8C;
    margin-bottom: 15px;
}

.practice-mode-card p {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1A1A2E;
    margin-bottom: 20px;
}

#missed-count {
    font-weight: 800;
    color: #E63946;
}

/* Game Actions */
.game-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.question-counter {
    font-family: 'Bangers', 'Fredoka', cursive;
    font-size: 1.6rem;
    letter-spacing: 1px;
    color: #1B3C8C;
}

.score-display {
    font-family: 'Bangers', 'Fredoka', cursive;
    font-size: 1.7rem;
    letter-spacing: 1px;
    color: #E63946;
}

.btn-small {
    padding: 8px 16px;
    font-size: 1rem;
}

/* Progress Bar */
.kid-progress-bar {
    background: rgba(26, 26, 46, 0.12);
    border: 3px solid #1A1A2E;
    border-radius: 15px;
    height: 26px;
    margin-bottom: 30px;
    overflow: hidden;
}

.kid-progress-fill {
    background: linear-gradient(90deg, #FFC72C 0%, #2E6FE0 100%);
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 12px;
}

/* Problem Display */
.problem-display {
    text-align: center;
    margin: 30px 0;
}

.question-text {
    font-family: 'Bangers', 'Fredoka', cursive;
    font-size: 2.4rem;
    letter-spacing: 1px;
    line-height: 1.25;
    color: #1A1A2E;
    background: linear-gradient(135deg, #FFFFFF 0%, #EAF1FF 100%);
    border: 4px solid #1A1A2E;
    border-radius: 18px;
    padding: 24px 22px;
    margin: 0 auto 10px;
    max-width: 620px;
    box-shadow: 0 5px 0 rgba(26, 26, 46, 0.28);
}

/* Answer Choices */
.answer-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

/* When choices are long text (prime/composite reasons), stack them */
.answer-choices.text-choices {
    grid-template-columns: 1fr;
}

.kid-answer-btn {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1A1A2E;
    background: linear-gradient(135deg, #FFFFFF 0%, #EAF1FF 100%);
    border: 4px solid #1B3C8C;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 0 rgba(27, 60, 140, 0.4);
    min-width: auto;
    margin: 0;
}

/* Long reason-text choices read better at a smaller, left-aligned size */
.answer-choices.text-choices .kid-answer-btn {
    font-family: 'Nunito', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: left;
    line-height: 1.4;
    padding: 16px 20px;
}

.kid-answer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 16px rgba(46, 111, 224, 0.45);
    background: linear-gradient(135deg, #6FA0F0 0%, #2E6FE0 100%);
    color: #FFFFFF;
    border-color: #1A1A2E;
}

.kid-answer-btn.correct {
    background: linear-gradient(135deg, #FFE699 0%, #FFC72C 100%);
    color: #1A1A2E;
    border-color: #1A1A2E;
    box-shadow: 0 4px 0 rgba(26, 26, 46, 0.35);
    animation: pulse 0.5s ease-in-out;
}

.kid-answer-btn.incorrect {
    background: linear-gradient(135deg, #F38088 0%, #E63946 100%);
    color: #FFFFFF;
    border-color: #1A1A2E;
    box-shadow: 0 4px 0 rgba(26, 26, 46, 0.35);
    animation: shake 0.5s ease-in-out;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Feedback Area */
.feedback-area {
    margin-top: 30px;
    text-align: center;
}

.feedback-message {
    font-family: 'Bangers', 'Fredoka', cursive;
    font-size: 1.7rem;
    letter-spacing: 1px;
    padding: 16px 28px;
    border-radius: 15px;
    border: 4px solid #1A1A2E;
    display: inline-block;
    box-shadow: 0 5px 0 rgba(26, 26, 46, 0.28);
}

.feedback-message.correct {
    background: linear-gradient(135deg, #FFE699 0%, #FFC72C 100%);
    color: #1A1A2E;
}

.feedback-message.incorrect {
    background: linear-gradient(135deg, #F38088 0%, #E63946 100%);
    color: #FFFFFF;
}

/* Results Screen */
.kid-stars {
    font-size: 4rem;
    text-align: center;
    margin: 25px 0;
    filter: drop-shadow(0 3px 4px rgba(26, 26, 46, 0.3));
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.result-stat {
    text-align: center;
    background: linear-gradient(135deg, #EAF1FF 0%, #FFFFFF 100%);
    border: 4px solid #1A1A2E;
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 5px 0 rgba(26, 26, 46, 0.25);
}

.stat-value {
    font-family: 'Bangers', 'Fredoka', cursive;
    font-size: 3.6rem;
    letter-spacing: 1px;
    color: #1B3C8C;
    margin-bottom: 8px;
}

.stat-label {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #E63946;
}

/* Missed Problems Section */
.missed-problems {
    background: linear-gradient(135deg, #FFFFFF 0%, #EAF1FF 100%);
    border: 4px solid #1A1A2E;
    border-radius: 18px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 5px 0 rgba(26, 26, 46, 0.2);
}

.missed-title {
    font-family: 'Bangers', 'Fredoka', cursive;
    font-size: 2rem;
    letter-spacing: 1px;
    color: #1B3C8C;
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 1.5px 1.5px 0 #FFC72C;
}

.missed-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.missed-item {
    background: #FFFFFF;
    border: 3px solid #2E6FE0;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.missed-question {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1A1A2E;
    margin-bottom: 15px;
}

.missed-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 1rem;
}

.your-answer {
    color: #E63946;
    font-weight: 700;
}

.correct-answer {
    color: #1B3C8C;
    font-weight: 700;
}

/* Results Actions */
.results-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

/* Buttons */
.kid-btn {
    font-family: 'Bangers', 'Fredoka', cursive;
    font-size: 1.35rem;
    letter-spacing: 1px;
    padding: 14px 34px;
    border: 4px solid #1A1A2E;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: none;
    box-shadow: 0 5px 0 rgba(26, 26, 46, 0.35);
}

.kid-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 16px rgba(26, 26, 46, 0.3);
}

.kid-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(26, 26, 46, 0.35);
}

.kid-btn-primary {
    background: linear-gradient(135deg, #2E6FE0 0%, #1B3C8C 100%);
    color: #FFFFFF;
}

.kid-btn-secondary {
    background: linear-gradient(135deg, #FFFFFF 0%, #D7E1F2 100%);
    color: #1A1A2E;
}

.kid-btn-accent {
    background: linear-gradient(135deg, #FFE699 0%, #FFC72C 100%);
    color: #1A1A2E;
}

/* Utility Classes */
.kid-hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kid-game-card {
        padding: 25px;
    }

    .hero-mascot {
        font-size: 4rem;
    }

    .kid-friendly-title {
        font-size: 2.6rem;
    }

    .kid-friendly-body {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 1.7rem;
    }

    .difficulty-options {
        grid-template-columns: 1fr;
    }

    .question-text {
        font-size: 1.8rem;
        padding: 20px 16px;
    }

    .answer-choices {
        grid-template-columns: 1fr 1fr;
    }

    .answer-choices.text-choices {
        grid-template-columns: 1fr;
    }

    .results-summary {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 2.7rem;
    }

    .missed-items-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .game-content {
        padding: 10px;
    }

    .kid-game-card {
        padding: 20px;
    }

    .hero-mascot {
        font-size: 3.2rem;
    }

    .kid-friendly-title {
        font-size: 2.2rem;
    }

    .question-text {
        font-size: 1.5rem;
    }

    .answer-choices {
        grid-template-columns: 1fr;
    }

    .answer-choices.text-choices .kid-answer-btn {
        font-size: 1.05rem;
    }

    .kid-btn {
        font-size: 1.1rem;
        padding: 12px 24px;
    }

    .game-header {
        gap: 10px;
    }
}
