/**
 * Decimal Diner - Retro 1950s Diner Theme
 *
 * Pull up a stool at the chrome counter! Cherry-red booths, checkerboard
 * floors, mint-green walls and a splash of mustard give this decimals game
 * a classic soda-fountain feel. Shaded hundred-grids look like serving trays.
 * Builds on top of kid-friendly-theme.css
 *
 * Color Palette:
 * - Cherry Red: #D7263D (booths, hard card, primary accents, score)
 * - Chrome Silver: #C7CDD1 (counter trim, borders, metallic shine)
 * - Mint Green: #5BC8AC (diner walls, easy card, success states)
 * - Mustard Yellow: #F4B400 (medium card, highlights, stat values)
 * - Charcoal Black: #2B2B2B (checkerboard, text, outlines)
 */

/* ============================================================================
   BASE LAYOUT
   ============================================================================ */

body {
    /* Mint-green diner wall with a soft checkerboard hint */
    background:
        repeating-linear-gradient(
            45deg,
            rgba(43, 43, 43, 0.04) 0,
            rgba(43, 43, 43, 0.04) 18px,
            transparent 18px,
            transparent 36px
        ),
        linear-gradient(135deg, #7FD8C2 0%, #5BC8AC 50%, #3FB39A 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, #FFFDF8 0%, #FBF1DC 100%);
    border: 5px solid #C7CDD1;
    border-radius: 25px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    /* Chrome-trim glow + cherry-red drop shadow */
    box-shadow:
        0 0 0 3px #D7263D,
        0 10px 30px rgba(43, 43, 43, 0.3);
}

/* ============================================================================
   MASCOT & TITLES
   ============================================================================ */

.diner-mascot {
    font-size: 5rem;
    text-align: center;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

.diner-mascot.excited {
    animation: dinerBounce 0.6s ease-in-out 3;
}

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

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

.kid-friendly-title {
    color: #D7263D;
    text-align: center;
    font-size: 2.8rem;
    margin: 10px 0 20px;
    text-shadow: 2px 2px 0 #C7CDD1, 3px 3px 0 rgba(43, 43, 43, 0.2);
}

.kid-friendly-body {
    color: #2B2B2B;
    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: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2B2B2B;
    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: 4px solid #C7CDD1;
    border-radius: 20px;
    text-align: center;
}

.kid-difficulty-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 10px 28px rgba(215, 38, 61, 0.35);
}

.kid-difficulty-card.easy {
    background: linear-gradient(135deg, #A6E7D6 0%, #5BC8AC 100%);
    border-color: #2E9E83;
}

.kid-difficulty-card.medium {
    background: linear-gradient(135deg, #FCDD8A 0%, #F4B400 100%);
    border-color: #C68E00;
}

.kid-difficulty-card.hard {
    background: linear-gradient(135deg, #F0808F 0%, #D7263D 100%);
    border-color: #9E1424;
}

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

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

.difficulty-example {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2B2B2B;
    background: rgba(255, 255, 255, 0.7);
    padding: 6px 10px;
    border-radius: 8px;
    margin-top: 12px;
    display: inline-block;
}

/* ============================================================================
   PRACTICE MODE SECTION
   ============================================================================ */

.practice-mode-section {
    margin: 30px 0;
}

.practice-mode-card {
    background: linear-gradient(135deg, #FCDD8A 0%, #F4B400 100%);
    border: 4px solid #C68E00;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
}

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

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

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

/* ============================================================================
   GAME ACTIONS
   ============================================================================ */

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

/* ============================================================================
   GAME SCREEN HEADER
   ============================================================================ */

.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: #2B2B2B;
}

.question-counter #current-question,
.question-counter #total-questions {
    color: #D7263D;
}

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

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

/* ============================================================================
   PROGRESS BAR
   ============================================================================ */

/* Themeable Alpine progress bar variables (in case a shared bar is used) */
body {
    --progress-bar-bg: rgba(43, 43, 43, 0.15);
    --progress-bar-border: #C7CDD1;
    --progress-fill-bg: linear-gradient(90deg, #D7263D 0%, #F4B400 100%);
    --progress-text-color: #2B2B2B;
}

.kid-progress-bar {
    background: rgba(43, 43, 43, 0.12);
    border: 3px solid #C7CDD1;
    border-radius: 15px;
    height: 26px;
    margin-bottom: 30px;
    overflow: hidden;
}

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

/* ============================================================================
   HUNDRED-GRID "SERVING TRAY"
   ============================================================================ */

.grid-container {
    margin: 0 auto 10px;
    max-width: 360px;
}

.hundred-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 2px;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    padding: 10px;
    /* Chrome serving-tray frame */
    background: linear-gradient(135deg, #E4E8EA 0%, #C7CDD1 100%);
    border: 4px solid #9CA3A8;
    border-radius: 14px;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.6),
        0 6px 18px rgba(43, 43, 43, 0.25);
}

.grid-cell {
    background: #FFFDF8;
    border: 1px solid #C7CDD1;
    border-radius: 2px;
}

.grid-cell.shaded {
    /* Cherry filling on the tray */
    background: linear-gradient(135deg, #E6435A 0%, #D7263D 100%);
    border-color: #9E1424;
}

.grid-caption {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #2B2B2B;
    text-align: center;
    margin-top: 14px;
}

/* ============================================================================
   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: 700;
    color: #2B2B2B;
    background: linear-gradient(135deg, #FFFFFF 0%, #FBF1DC 100%);
    border: 3px solid #C7CDD1;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 0;
}

.kid-answer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(215, 38, 61, 0.3);
    background: linear-gradient(135deg, #FFFFFF 0%, #FCDD8A 100%);
    border-color: #F4B400;
}

.kid-answer-btn.correct {
    background: linear-gradient(135deg, #A6E7D6 0%, #5BC8AC 100%);
    color: #14503F;
    border-color: #2E9E83;
    animation: pulse 0.5s ease-in-out;
}

.kid-answer-btn.incorrect {
    background: linear-gradient(135deg, #F0808F 0%, #D7263D 100%);
    color: #FFFFFF;
    border-color: #9E1424;
    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(-6px); }
    75% { transform: translateX(6px); }
}

/* ============================================================================
   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, #A6E7D6 0%, #5BC8AC 100%);
    color: #14503F;
    border: 3px solid #2E9E83;
}

.feedback-message.incorrect {
    background: linear-gradient(135deg, #F0808F 0%, #D7263D 100%);
    color: #FFFFFF;
    border: 3px solid #9E1424;
}

/* ============================================================================
   RESULTS SCREEN
   ============================================================================ */

.kid-stars {
    font-size: 4rem;
    text-align: center;
    margin: 25px 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, #FBF1DC 0%, #FFFFFF 100%);
    border: 4px solid #C7CDD1;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 14px rgba(43, 43, 43, 0.12);
}

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

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

/* ============================================================================
   MISSED PROBLEMS SECTION
   ============================================================================ */

.missed-problems {
    background: linear-gradient(135deg, #FFF8E8 0%, #FBF1DC 100%);
    border: 4px solid #F4B400;
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(244, 180, 0, 0.2);
}

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

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

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

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

.correct-answer {
    color: #2E9E83;
    font-weight: 700;
}

/* ============================================================================
   RESULTS ACTIONS
   ============================================================================ */

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

/* ============================================================================
   BUTTONS (theme overrides)
   ============================================================================ */

.kid-btn {
    font-family: 'Fredoka', sans-serif;
    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 6px 20px rgba(43, 43, 43, 0.25);
}

.kid-btn-primary {
    background: linear-gradient(135deg, #E6435A 0%, #D7263D 100%);
    color: white;
    border: 3px solid #9E1424;
}

.kid-btn-secondary {
    background: linear-gradient(135deg, #E4E8EA 0%, #C7CDD1 100%);
    color: #2B2B2B;
    border: 3px solid #9CA3A8;
}

.kid-btn-accent {
    background: linear-gradient(135deg, #5BC8AC 0%, #2E9E83 100%);
    color: white;
    border: 3px solid #1F7A66;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

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

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

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

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

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

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

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

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

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

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

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

    .game-content {
        padding: 10px;
    }

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

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

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

    .game-header {
        gap: 10px;
    }

    .question-counter {
        font-size: 1.1rem;
    }

    .score-display {
        font-size: 1.2rem;
    }

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

    .hundred-grid {
        max-width: 260px;
        gap: 1px;
        padding: 8px;
    }

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

    .kid-answer-btn {
        font-size: 1.2rem;
        padding: 15px 10px;
    }

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

    .feedback-message {
        font-size: 1.15rem;
        padding: 12px 18px;
    }
}
