/**
 * Place Value Peaks - Mountain Climbing Theme
 *
 * Scale the place value mountain! Cool granite slate, fresh snow white,
 * glacier blue, evergreen pines, and a warm sunrise-gold summit give this
 * game a crisp, high-altitude alpine feel.
 * Builds on top of kid-friendly-theme.css
 *
 * Color Palette:
 * - Granite Slate: #3E4A5B (titles, borders, rock faces, place-value chart frame)
 * - Snow White:    #F7FAFC (cards, number tiles, clean backgrounds)
 * - Glacier Blue:  #2E86C1 (score accents, medium card, comparison numbers)
 * - Evergreen:     #2E8B57 (success states, easy card, primary buttons)
 * - Sunrise Gold:  #E6A817 (summit/hard card, highlights, underlined digit)
 */

body {
    background: linear-gradient(180deg, #BFE3F2 0%, #DCEEF6 40%, #EAF3F7 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 {
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F6FA 100%);
    border: 4px solid #3E4A5B;
    border-radius: 25px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 8px 30px rgba(62, 74, 91, 0.3);
}

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

.peaks-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 {
    color: #3E4A5B;
    text-align: center;
    margin: 20px 0;
}

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

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

.section-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #3E4A5B;
    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;
    border: 3px solid #3E4A5B;
}

.kid-difficulty-card:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 25px rgba(46, 134, 193, 0.4);
}

.kid-difficulty-card.easy {
    background: linear-gradient(135deg, #B5E4C7 0%, #88CFA4 100%);
    border-color: #2E8B57;
}

.kid-difficulty-card.medium {
    background: linear-gradient(135deg, #AED6F1 0%, #7FB8E0 100%);
    border-color: #2E86C1;
}

.kid-difficulty-card.hard {
    background: linear-gradient(135deg, #F5D58A 0%, #E6A817 100%);
    border-color: #C8870B;
}

.difficulty-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #2C3E50;
    margin-bottom: 10px;
}

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

.difficulty-example {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2C3E50;
    background: rgba(255, 255, 255, 0.6);
    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, #AED6F1 0%, #7FB8E0 100%);
    border: 3px solid #2E86C1;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
}

.practice-mode-card h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.6rem;
    color: #1B4F72;
    margin-bottom: 15px;
}

.practice-mode-card p {
    font-size: 1.2rem;
    color: #2C3E50;
    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: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #3E4A5B;
}

.score-display {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #2E86C1;
}

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

/* Progress Bar */
.kid-progress-bar {
    background: rgba(62, 74, 91, 0.18);
    border: 2px solid #3E4A5B;
    border-radius: 15px;
    height: 25px;
    margin-bottom: 30px;
    overflow: hidden;
}

.kid-progress-fill {
    background: linear-gradient(90deg, #2E8B57 0%, #88CFA4 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: 'Fredoka', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: #3E4A5B;
    margin-bottom: 25px;
    line-height: 1.4;
}

/* Place Value Visual Container */
.place-value-container {
    background: linear-gradient(135deg, #FFFFFF 0%, #EAF3F7 100%);
    border: 4px solid #3E4A5B;
    border-radius: 20px;
    padding: 30px 20px;
    margin: 0 auto;
    max-width: 620px;
    box-shadow: 0 4px 15px rgba(62, 74, 91, 0.2);
}

/* Big number display (digit tiles) */
.pv-number-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    font-family: 'Fredoka', sans-serif;
}

.pv-digit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    font-size: 2.8rem;
    font-weight: 700;
    color: #3E4A5B;
    background: linear-gradient(135deg, #F7FAFC 0%, #DCEEF6 100%);
    border: 2px solid #2E86C1;
    border-radius: 10px;
    padding: 8px 4px;
}

.pv-underline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    font-size: 2.8rem;
    font-weight: 700;
    color: #FFFFFF;
    background: linear-gradient(135deg, #E6A817 0%, #C8870B 100%);
    border: 3px solid #C8870B;
    border-radius: 10px;
    padding: 8px 4px;
    text-decoration: underline;
    text-underline-offset: 4px;
    box-shadow: 0 3px 10px rgba(230, 168, 23, 0.4);
}

.pv-comma {
    font-size: 2.8rem;
    font-weight: 700;
    color: #3E4A5B;
    align-self: flex-end;
}

/* Compare display */
.pv-compare-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-family: 'Fredoka', sans-serif;
}

.pv-compare-num {
    font-size: 2.6rem;
    font-weight: 700;
    color: #2E86C1;
}

.pv-compare-box {
    font-size: 2.6rem;
    font-weight: 700;
    color: #FFFFFF;
    background: linear-gradient(135deg, #3E4A5B 0%, #2C3E50 100%);
    border-radius: 12px;
    min-width: 60px;
    padding: 6px 14px;
}

/* Ten-times relationship */
.pv-tentimes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-family: 'Fredoka', sans-serif;
}

.pv-tentimes-num {
    font-size: 2.4rem;
    font-weight: 700;
    color: #E6A817;
    background: rgba(230, 168, 23, 0.12);
    border: 2px solid #E6A817;
    border-radius: 10px;
    padding: 8px 16px;
}

.pv-tentimes-vs {
    font-size: 1.2rem;
    font-weight: 600;
    color: #3E4A5B;
}

/* Round display */
.pv-round {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.pv-round-target {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #2E8B57;
    background: rgba(46, 139, 87, 0.12);
    border: 2px dashed #2E8B57;
    border-radius: 12px;
    padding: 8px 20px;
}

/* 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: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2C3E50;
    background: linear-gradient(135deg, #FFFFFF 0%, #EAF3F7 100%);
    border: 3px solid #3E4A5B;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Symbol comparison choices: big & bold */
.kid-answer-btn.symbol-choice {
    font-size: 2.4rem;
}

/* Word/expanded choices: smaller text, wrap nicely */
.kid-answer-btn.word-choice,
.kid-answer-btn.expanded-choice {
    font-size: 1.15rem;
    line-height: 1.4;
    word-break: break-word;
}

.kid-answer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(46, 134, 193, 0.4);
    background: linear-gradient(135deg, #AED6F1 0%, #7FB8E0 100%);
}

.kid-answer-btn.correct {
    background: linear-gradient(135deg, #B5E4C7 0%, #88CFA4 100%);
    border-color: #2E8B57;
    animation: pulse 0.5s ease-in-out;
}

.kid-answer-btn.incorrect {
    background: linear-gradient(135deg, #F5B7B1 0%, #E6857B 100%);
    border-color: #C0392B;
    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: 'Fredoka', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    padding: 15px 25px;
    border-radius: 15px;
    display: inline-block;
}

.feedback-message.correct {
    background: linear-gradient(135deg, #B5E4C7 0%, #88CFA4 100%);
    color: #1E5631;
    border: 3px solid #2E8B57;
}

.feedback-message.incorrect {
    background: linear-gradient(135deg, #F5B7B1 0%, #E6857B 100%);
    color: #6E1E14;
    border: 3px solid #C0392B;
}

/* 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: linear-gradient(135deg, #EAF3F7 0%, #FFFFFF 100%);
    border: 3px solid #3E4A5B;
    border-radius: 20px;
    padding: 25px;
}

.stat-value {
    font-family: 'Fredoka', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: #2E86C1;
    margin-bottom: 10px;
}

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

/* Missed Problems Section */
.missed-problems {
    background: linear-gradient(135deg, #F0F6FA 0%, #EAF3F7 100%);
    border: 3px solid #3E4A5B;
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(62, 74, 91, 0.15);
}

.missed-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #3E4A5B;
    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: #FFFFFF;
    border: 2px solid #2E86C1;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.missed-question {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 15px;
}

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

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

.correct-answer {
    color: #2E8B57;
    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: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 15px 35px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.kid-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.kid-btn-primary {
    background: linear-gradient(135deg, #2E8B57 0%, #45A56E 100%);
    color: white;
    border: 3px solid #2E8B57;
}

.kid-btn-secondary {
    background: linear-gradient(135deg, #D3D3D3 0%, #A9A9A9 100%);
    color: #2C3E50;
    border: 3px solid #808080;
}

.kid-btn-accent {
    background: linear-gradient(135deg, #2E86C1 0%, #5499D6 100%);
    color: white;
    border: 3px solid #1B4F72;
}

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

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

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

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

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

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

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

    .pv-digit,
    .pv-underline {
        min-width: 38px;
        font-size: 2.2rem;
    }

    .pv-comma {
        font-size: 2.2rem;
    }

    .pv-compare-num {
        font-size: 2rem;
    }

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

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

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

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

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

    .game-content {
        padding: 10px;
    }

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

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

    .place-value-container {
        padding: 20px 12px;
    }

    .pv-digit,
    .pv-underline {
        min-width: 30px;
        font-size: 1.8rem;
        padding: 6px 2px;
    }

    .pv-comma {
        font-size: 1.8rem;
    }

    .pv-compare-row {
        gap: 12px;
    }

    .pv-compare-num {
        font-size: 1.7rem;
    }

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

    .kid-answer-btn {
        font-size: 1.3rem;
    }

    .kid-answer-btn.word-choice,
    .kid-answer-btn.expanded-choice {
        font-size: 1.05rem;
    }

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