/**
 * Word Problem Wizard - Styles
 * Magical Storybook Theme
 * Colors: Royal purple (#9B59B6), Enchanted green (#2ECC71), Sparkle gold (#F39C12), Magic pink (#E91E63)
 */

/* ============================================================================
   GAME CONTAINER - MAGICAL THEME
   ============================================================================ */

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #9B59B6 0%, #E91E63 50%, #9B59B6 100%);
    font-family: 'Nunito', 'Comic Sans MS', sans-serif;
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Footer positioning */
.game-footer {
    margin-top: auto;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle, rgba(243, 156, 18, 0.3) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    pointer-events: none;
}

.wizard-mascot {
    font-size: 4rem;
    margin: 20px;
    display: inline-block;
    animation: wizardFloat 3s ease-in-out infinite;
}

@keyframes wizardFloat {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

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

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.question-counter {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #F39C12;
}

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

/* ============================================================================
   DIFFICULTY SELECTION - WIZARD THEMED CARDS
   ============================================================================ */

.difficulty-selection {
    margin: 40px 0;
}

.difficulty-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.wizard-difficulty-card {
    background: linear-gradient(135deg, #F8E6FF 0%, #E6F5FF 100%);
    border: 4px solid #9B59B6;
    border-radius: 20px;
    padding: 30px 20px;
    margin: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(155, 89, 182, 0.3);
    min-width: 200px;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.wizard-difficulty-card::before {
    content: '✨';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    opacity: 0.5;
}

.wizard-difficulty-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 30px rgba(233, 30, 99, 0.4);
    border-color: #E91E63;
}

.wizard-difficulty-card.easy {
    border-color: #2ECC71;
}

.wizard-difficulty-card.medium {
    border-color: #F39C12;
}

.wizard-difficulty-card.hard {
    border-color: #E91E63;
}

/* ============================================================================
   STORY BOOK DISPLAY
   ============================================================================ */

.story-book {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFFACD 100%);
    border: 5px solid #8B4513;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    position: relative;
}

.story-book::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    width: 3px;
    height: 100%;
    background: #8B4513;
    opacity: 0.3;
}

.story-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #9B59B6;
    margin-bottom: 20px;
    text-align: center;
}

.story-text {
    font-family: 'Nunito', 'Georgia', serif;
    font-size: 1.3rem;
    line-height: 1.8;
    color: #2C3E50;
    text-align: left;
    font-weight: 500;
}

/* ============================================================================
   HINT SYSTEM
   ============================================================================ */

.hint-btn {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px 30px;
    background: linear-gradient(135deg, #F39C12 0%, #E67E22 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
    margin: 20px 0;
}

.hint-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.4);
}

.hint-box {
    background: linear-gradient(135deg, #E8F8E8 0%, #D5F5D5 100%);
    border: 3px solid #2ECC71;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    animation: fadeIn 0.5s ease;
}

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

.hint-text {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    color: #2C3E50;
    line-height: 1.6;
}

/* ============================================================================
   ANSWER INPUT
   ============================================================================ */

.answer-input-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px auto;
    max-width: 500px;
    flex-wrap: wrap;
}

.answer-input {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    padding: 15px 30px;
    border: 4px solid #9B59B6;
    border-radius: 15px;
    text-align: center;
    min-width: 150px;
    transition: all 0.3s ease;
    background: white;
}

.answer-input:focus {
    outline: none;
    border-color: #E91E63;
    box-shadow: 0 0 0 4px rgba(155, 89, 182, 0.2);
}

.answer-input.correct-input {
    border-color: #2ECC71;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    animation: correctPulse 0.5s ease;
}

.answer-input.incorrect-input {
    border-color: #E91E63;
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
    animation: shake 0.4s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

/* ============================================================================
   FEEDBACK AREA
   ============================================================================ */

.feedback-area {
    margin: 30px 0;
    animation: fadeIn 0.3s ease;
}

.kid-feedback small {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    font-style: italic;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.results-summary {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.result-stat {
    text-align: center;
}

.stat-value {
    font-family: 'Fredoka', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: #9B59B6;
}

.stat-label {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    color: #2C3E50;
    margin-top: 10px;
}

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

.game-actions, .results-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}

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

@media (max-width: 768px) {
    .story-text {
        font-size: 1.1rem;
    }

    .answer-input-container {
        flex-direction: column;
    }

    .answer-input {
        font-size: 1.5rem;
        min-width: 120px;
        width: 100%;
    }

    .game-header {
        font-size: 1rem;
    }

    .question-counter, .score-display {
        font-size: 1rem;
    }

    .results-summary {
        gap: 20px;
    }

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

    .difficulty-options {
        flex-direction: column;
        align-items: center;
    }

    .story-book {
        padding: 20px;
    }

    .hint-text, .story-title {
        font-size: 1rem;
    }
}

/* ============================================================================
   BUTTON OVERRIDES
   ============================================================================ */

.btn-small {
    padding: 8px 20px !important;
    font-size: 0.9rem !important;
}

/* Remove spinner from number input */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}
