/**
 * Angle Dojo - Martial Arts Dojo Theme
 *
 * Step into the dojo to master angles, protractors and lines. Deep indigo
 * night skies and charcoal mats set the scene, with belt-colored accents,
 * warm tatami tan panels, and a crimson sensei accent.
 * Builds on top of kid-friendly-theme.css
 *
 * Color Palette:
 * - Deep Indigo: #312E81 (page background, dojo night sky, titles)
 * - Charcoal: #1F2233 (cards, mats, deep shadows)
 * - Tatami Tan: #D9C7A3 (panels, figure backgrounds, soft highlights)
 * - Belt Gold: #E8B84B (arcs, progress, accents, brown-belt trim)
 * - Crimson Sensei: #D64541 (vertex dots, hard belt, error states)
 */

body {
    background: linear-gradient(160deg, #2A2750 0%, #312E81 45%, #1F2233 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, #262945 0%, #1F2233 100%);
    border: 4px solid #E8B84B;
    border-radius: 25px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

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

.dojo-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: #E8B84B;
    text-align: center;
    margin: 20px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.kid-friendly-body {
    color: #D9C7A3;
    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: #E8B84B;
    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 #E8B84B;
    border-radius: 18px;
    padding: 24px 20px;
    position: relative;
    overflow: hidden;
}

.kid-difficulty-card:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 25px rgba(232, 184, 75, 0.35);
}

.kid-difficulty-card.easy {
    background: linear-gradient(135deg, #3A3D5C 0%, #2A2C44 100%);
    border-color: #F5F0E1;
}

.kid-difficulty-card.medium {
    background: linear-gradient(135deg, #4A3A2A 0%, #34281C 100%);
    border-color: #8B5A2B;
}

.kid-difficulty-card.hard {
    background: linear-gradient(135deg, #2A2C44 0%, #15151F 100%);
    border-color: #D64541;
}

/* Belt stripe accents on the difficulty cards */
.belt-stripe {
    height: 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.4);
}

.belt-stripe.white-belt {
    background: linear-gradient(90deg, #FFFFFF 0%, #E5E5E5 100%);
}

.belt-stripe.brown-belt {
    background: linear-gradient(90deg, #8B5A2B 0%, #5C3A1A 100%);
}

.belt-stripe.black-belt {
    background: linear-gradient(90deg, #2B2B2B 0%, #000000 60%, #D64541 100%);
}

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

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

.difficulty-example {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1F2233;
    background: rgba(232, 184, 75, 0.85);
    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, #3A3D5C 0%, #2A2C44 100%);
    border: 3px solid #E8B84B;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
}

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

.practice-mode-card p {
    font-size: 1.2rem;
    color: #D9C7A3;
    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: #D9C7A3;
}

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

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

/* Progress Bar */
.kid-progress-bar {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #E8B84B;
    border-radius: 15px;
    height: 25px;
    margin-bottom: 30px;
    overflow: hidden;
}

.kid-progress-fill {
    background: linear-gradient(90deg, #E8B84B 0%, #F5D77E 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: #E8B84B;
    margin-bottom: 25px;
    line-height: 1.4;
}

/* SVG Angle / Figure Display */
.angle-container {
    background: radial-gradient(circle at 50% 40%, #2D3050 0%, #1A1C2C 100%);
    border: 4px solid #E8B84B;
    border-radius: 20px;
    padding: 20px;
    margin: 0 auto;
    max-width: 420px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), inset 0 0 30px rgba(0, 0, 0, 0.3);
}

.angle-svg {
    display: block;
    width: 100%;
    max-width: 360px;
    height: auto;
    margin: 0 auto;
}

.angle-svg .angle-label {
    font-family: 'Fredoka', sans-serif;
    font-size: 20px;
    font-weight: 700;
    fill: #E8B84B;
}

.angle-svg .angle-label.q {
    fill: #D64541;
    font-size: 26px;
}

/* 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: #F5F0E1;
    background: linear-gradient(135deg, #3A3D5C 0%, #2A2C44 100%);
    border: 3px solid #E8B84B;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.kid-answer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(232, 184, 75, 0.4);
    background: linear-gradient(135deg, #45487A 0%, #34375C 100%);
}

.kid-answer-btn.correct {
    background: linear-gradient(135deg, #4F7942 0%, #6FA35B 100%);
    border-color: #8FD17A;
    color: #FFFFFF;
    animation: pulse 0.5s ease-in-out;
}

.kid-answer-btn.incorrect {
    background: linear-gradient(135deg, #D64541 0%, #A8302C 100%);
    border-color: #F08B88;
    color: #FFFFFF;
    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, #4F7942 0%, #6FA35B 100%);
    color: #FFFFFF;
    border: 3px solid #8FD17A;
}

.feedback-message.incorrect {
    background: linear-gradient(135deg, #D64541 0%, #A8302C 100%);
    color: #FFFFFF;
    border: 3px solid #F08B88;
}

/* 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, #3A3D5C 0%, #2A2C44 100%);
    border: 3px solid #E8B84B;
    border-radius: 20px;
    padding: 25px;
}

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

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

/* Missed Problems Section */
.missed-problems {
    background: linear-gradient(135deg, #2A2C44 0%, #1F2233 100%);
    border: 3px solid #E8B84B;
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

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

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

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

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

.correct-answer {
    color: #8FD17A;
    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.4);
}

.kid-btn-primary {
    background: linear-gradient(135deg, #E8B84B 0%, #F5D77E 100%);
    color: #1F2233;
    border: 3px solid #C99A2E;
}

.kid-btn-secondary {
    background: linear-gradient(135deg, #4A4D6E 0%, #34375C 100%);
    color: #F5F0E1;
    border: 3px solid #6A6D90;
}

.kid-btn-accent {
    background: linear-gradient(135deg, #D64541 0%, #A8302C 100%);
    color: #FFFFFF;
    border: 3px solid #8A2421;
}

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

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

    .dojo-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;
    }

    .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;
    }

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

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

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

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

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

    .angle-container {
        padding: 12px;
    }

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