/**
 * Array Arcade - Retro Arcade Theme
 *
 * A glowing retro arcade cabinet vibe: dark purple screen, hot pink and
 * cyan glow, pixel-style headings. Distinct from Multiplication Mayhem's
 * navy/Orbitron neon-space look (different hues + pixel typography).
 * Builds on top of kid-friendly-theme.css
 *
 * Color Palette:
 * - Midnight Purple: #241245 (backgrounds, arcade screen)
 * - Grape Violet: #3A2566 (cards, panels, answer buttons)
 * - Hot Pink: #FF2E97 (primary buttons, glow accents)
 * - Arcade Cyan: #21E6F0 (borders, counters, secondary accents)
 * - Lemon Glow: #FFE14D (score, stars, highlights, blanks)
 */

body {
    background:
        linear-gradient(rgba(33, 230, 240, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(33, 230, 240, 0.06) 1px, transparent 1px),
        linear-gradient(160deg, #241245 0%, #1B0E33 55%, #3A1357 100%);
    background-size: 28px 28px, 28px 28px, cover;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    font-family: 'Baloo 2', cursive, sans-serif;
    color: #F4F0FF;
}

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

.kid-game-card {
    background: linear-gradient(160deg, #2D1B4E 0%, #241245 100%);
    border: 4px solid #21E6F0;
    border-radius: 18px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 0 25px rgba(255, 46, 151, 0.35), 0 8px 30px rgba(0, 0, 0, 0.5);
    color: #F4F0FF;
}

/* Mascot */
.arcade-mascot {
    font-size: 5rem;
    text-align: center;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.arcade-mascot.excited {
    animation: bounce 0.6s ease-in-out 3;
}

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

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

/* Title */
.kid-friendly-title {
    font-family: 'Press Start 2P', 'Baloo 2', cursive;
    font-size: 1.8rem;
    line-height: 1.5;
    color: #FFE14D;
    text-shadow: 3px 3px 0 #FF2E97;
    text-align: center;
    margin: 20px 0;
}

.kid-friendly-body {
    color: #E6DEFF;
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 30px;
}

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

.section-title {
    font-family: 'Press Start 2P', 'Baloo 2', cursive;
    font-size: 1.1rem;
    color: #21E6F0;
    text-align: center;
    margin-bottom: 25px;
}

.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;
    background: #3A2566;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.kid-difficulty-card:hover {
    transform: translateY(-5px) scale(1.03);
}

.kid-difficulty-card.easy {
    background: linear-gradient(160deg, #14543F 0%, #1B7A59 100%);
    border: 3px solid #2EE6A8;
}

.kid-difficulty-card.easy:hover {
    box-shadow: 0 0 20px rgba(46, 230, 168, 0.5);
}

.kid-difficulty-card.medium {
    background: linear-gradient(160deg, #6A4E10 0%, #93701B 100%);
    border: 3px solid #FFE14D;
}

.kid-difficulty-card.medium:hover {
    box-shadow: 0 0 20px rgba(255, 225, 77, 0.5);
}

.kid-difficulty-card.hard {
    background: linear-gradient(160deg, #5E1040 0%, #87195C 100%);
    border: 3px solid #FF2E97;
}

.kid-difficulty-card.hard:hover {
    box-shadow: 0 0 20px rgba(255, 46, 151, 0.5);
}

.difficulty-title {
    font-family: 'Press Start 2P', 'Baloo 2', cursive;
    font-size: 1rem;
    color: #FFFFFF;
    margin-bottom: 12px;
}

.difficulty-description {
    font-size: 1rem;
    color: #E6DEFF;
    margin-bottom: 8px;
}

.difficulty-example {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: #FFE14D;
    background: rgba(0, 0, 0, 0.35);
    padding: 5px 10px;
    border-radius: 8px;
    margin-top: 10px;
}

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

.practice-mode-card {
    background: linear-gradient(160deg, #3A2566 0%, #4B2E85 100%);
    border: 3px solid #FFE14D;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
}

.practice-mode-card h3 {
    font-family: 'Press Start 2P', 'Baloo 2', cursive;
    font-size: 1rem;
    color: #FFE14D;
    margin-bottom: 15px;
}

.practice-mode-card p {
    font-size: 1.2rem;
    color: #E6DEFF;
    margin-bottom: 20px;
}

/* 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: 'Press Start 2P', 'Baloo 2', cursive;
    font-size: 0.9rem;
    color: #21E6F0;
}

.score-display {
    font-family: 'Press Start 2P', 'Baloo 2', cursive;
    font-size: 0.9rem;
    color: #FFE14D;
}

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

/* Progress Bar */
.kid-progress-bar {
    background: rgba(33, 230, 240, 0.15);
    border: 2px solid #21E6F0;
    border-radius: 15px;
    height: 25px;
    margin-bottom: 30px;
    overflow: hidden;
}

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

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

.question-text {
    font-family: 'Baloo 2', cursive;
    font-size: 1.8rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 20px;
}

/* Visual Area: arrays, pairs, sequences */
.visual-area {
    margin: 20px 0;
    min-height: 40px;
}

.array-grid {
    display: inline-block;
    background: rgba(0, 0, 0, 0.3);
    border: 3px solid #21E6F0;
    border-radius: 15px;
    padding: 18px 24px;
    box-shadow: 0 0 15px rgba(33, 230, 240, 0.25);
}

.array-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 4px 0;
}

.array-token {
    font-size: 2.2rem;
    line-height: 1;
}

.addition-sentence {
    font-family: 'Baloo 2', cursive;
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFE14D;
    margin-top: 15px;
}

.pairs-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
}

.pair-chip {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #21E6F0;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 1.6rem;
    line-height: 1;
}

.pair-chip.leftover {
    border: 2px dashed #FFE14D;
    box-shadow: 0 0 12px rgba(255, 225, 77, 0.4);
}

.seq-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.seq-chip {
    font-family: 'Press Start 2P', 'Baloo 2', cursive;
    font-size: 1.1rem;
    color: #FFFFFF;
    background: #3A2566;
    border: 3px solid #21E6F0;
    border-radius: 12px;
    padding: 14px 16px;
}

.seq-chip.blank {
    color: #FFE14D;
    border: 3px dashed #FFE14D;
    background: rgba(255, 225, 77, 0.1);
    box-shadow: 0 0 12px rgba(255, 225, 77, 0.4);
}

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

.kid-answer-btn {
    font-family: 'Baloo 2', cursive;
    font-size: 1.4rem;
    font-weight: 700;
    color: #FFFFFF;
    background: #3A2566;
    border: 3px solid #FF2E97;
    border-radius: 15px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.kid-answer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 18px rgba(255, 46, 151, 0.5);
    background: #4B2E85;
}

.kid-answer-btn.correct {
    background: #14543F;
    border-color: #2EE6A8;
    color: #B9FFE3;
    box-shadow: 0 0 18px rgba(46, 230, 168, 0.6);
    animation: pulse 0.5s ease-in-out;
}

.kid-answer-btn.incorrect {
    background: #5E1040;
    border-color: #FF4D6D;
    color: #FFC2CF;
    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: 'Baloo 2', cursive;
    font-size: 1.4rem;
    font-weight: 700;
    padding: 15px 25px;
    border-radius: 15px;
    display: inline-block;
}

.feedback-message.correct {
    background: rgba(46, 230, 168, 0.15);
    color: #2EE6A8;
    border: 3px solid #2EE6A8;
}

.feedback-message.incorrect {
    background: rgba(255, 77, 109, 0.15);
    color: #FF8FA5;
    border: 3px solid #FF4D6D;
}

/* Results Screen */
.kid-stars {
    font-size: 4rem;
    text-align: center;
    margin: 30px 0;
}

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

.result-stat {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border: 3px solid #21E6F0;
    border-radius: 15px;
    padding: 25px;
}

.stat-value {
    font-family: 'Press Start 2P', 'Baloo 2', cursive;
    font-size: 2.2rem;
    color: #FFE14D;
    margin-bottom: 12px;
}

.stat-label {
    font-family: 'Baloo 2', cursive;
    font-size: 1.1rem;
    font-weight: 600;
    color: #21E6F0;
}

/* Missed Problems Section */
.missed-problems {
    background: rgba(0, 0, 0, 0.3);
    border: 3px solid #FF2E97;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
}

.missed-title {
    font-family: 'Press Start 2P', 'Baloo 2', cursive;
    font-size: 1.1rem;
    color: #FF2E97;
    text-align: center;
    margin-bottom: 25px;
}

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

.missed-item {
    background: #3A2566;
    border: 2px solid #21E6F0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.missed-question {
    font-family: 'Baloo 2', cursive;
    font-size: 1.1rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 15px;
}

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

.your-answer {
    color: #FF8FA5;
    font-weight: 600;
}

.correct-answer {
    color: #2EE6A8;
    font-weight: 600;
}

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

/* Buttons */
.kid-btn {
    font-family: 'Baloo 2', cursive;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 15px 35px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.kid-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 18px rgba(255, 46, 151, 0.45);
}

.kid-btn-primary {
    background: linear-gradient(135deg, #FF2E97 0%, #C2187A 100%);
    color: #FFFFFF;
    border: 3px solid #FF2E97;
}

.kid-btn-secondary {
    background: #3A2566;
    color: #E6DEFF;
    border: 3px solid #6C3FC9;
}

.kid-btn-accent {
    background: linear-gradient(135deg, #FFE14D 0%, #E8B70F 100%);
    color: #241245;
    border: 3px solid #FFE14D;
}

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

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

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

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

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

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

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

    .array-token {
        font-size: 1.7rem;
    }

    .array-grid {
        padding: 12px 16px;
    }

    .seq-chip {
        font-size: 0.85rem;
        padding: 10px 12px;
    }

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

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

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

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

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

    .game-content {
        padding: 10px;
    }

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

    .arcade-mascot {
        font-size: 3rem;
    }

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

    .array-token {
        font-size: 1.4rem;
    }

    .array-row {
        gap: 5px;
    }

    .seq-chip {
        font-size: 0.75rem;
        padding: 8px 10px;
    }

    .kid-btn {
        font-size: 1rem;
        padding: 12px 25px;
    }
}
