/**
 * Perimeter & Area Explorer - Treasure Map Theme
 *
 * Treasure map and explorer-themed geometry game
 * Builds on top of kid-friendly-theme.css
 *
 * Color Palette:
 * - Old Parchment: #D2B48C
 * - Ocean Blue: #1E90FF
 * - Gold: #FFD700
 * - Forest Green: #228B22
 */

/* ============================================================================
   THEME BACKGROUND OVERRIDE
   ============================================================================ */

body {
    background: linear-gradient(135deg, #1E90FF 0%, #D2B48C 50%, #228B22 100%);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================================
   FOOTER POSITIONING
   ============================================================================ */

.game-footer {
    margin-top: auto;
}

/* ============================================================================
   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: #1E90FF;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.score-display {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* ============================================================================
   DIFFICULTY SELECTION
   ============================================================================ */

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

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

/* ============================================================================
   PROBLEM DISPLAY
   ============================================================================ */

.problem-display {
    margin: 40px 0;
}

.question-text {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 30px;
}

/* ============================================================================
   SHAPE DISPLAY
   ============================================================================ */

.shape-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin: 30px 0;
}

.shape-rectangle,
.shape-square {
    position: relative;
    background: linear-gradient(135deg, #D2B48C 0%, #C4A57B 100%);
    border: 4px solid #228B22;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(34, 139, 34, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}

.shape-label-top {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1E90FF;
    background: white;
    padding: 5px 15px;
    border-radius: 15px;
    border: 2px solid #1E90FF;
}

.shape-label-side {
    position: absolute;
    left: -35px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1E90FF;
    background: white;
    padding: 5px 15px;
    border-radius: 15px;
    border: 2px solid #1E90FF;
}

.shape-dimensions {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.dimension-label {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #7F8C8D;
    background: #F0F8FF;
    padding: 10px 20px;
    border-radius: 15px;
    border: 2px solid #1E90FF;
}

.dimension-label span {
    color: #FFD700;
    font-weight: 700;
    font-size: 1.4rem;
}

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

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

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

.answer-input:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2);
}

.answer-input::placeholder {
    color: #BDC3C7;
    font-size: 1.2rem;
}

.answer-unit {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #7F8C8D;
}

.answer-input.correct-input {
    border-color: #228B22;
    background: linear-gradient(135deg, #F0FFF0 0%, #E0FFE0 100%);
    animation: correctPulse 0.5s ease;
    box-shadow: 0 0 20px rgba(34, 139, 34, 0.3);
}

.answer-input.incorrect-input {
    border-color: #DC143C;
    background: linear-gradient(135deg, #FFF5EE 0%, #FFE4E1 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: #1E90FF;
}

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

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

.missed-problems {
    background: linear-gradient(135deg, #FFF8DC 0%, #FAEBD7 100%);
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    border: 3px solid #D2B48C;
    box-shadow: 0 4px 15px rgba(210, 180, 140, 0.2);
}

.missed-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.missed-item {
    background: white;
    border: 2px solid #228B22;
    border-radius: 15px;
    padding: 15px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #2C3E50;
    text-align: center;
    box-shadow: 0 2px 8px rgba(34, 139, 34, 0.15);
}

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

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

.practice-mode-option {
    margin: 30px 0;
    text-align: center;
}

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

@media (max-width: 768px) {
    .answer-input-container {
        flex-direction: column;
    }

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

    .answer-unit {
        font-size: 1rem;
    }

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

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

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

    .shape-label-top {
        font-size: 1rem;
        top: -30px;
    }

    .shape-label-side {
        font-size: 1rem;
        left: -30px;
    }

    .dimension-label {
        font-size: 1rem;
    }

    .dimension-label span {
        font-size: 1.2rem;
    }

    .results-summary {
        gap: 20px;
    }

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

    .missed-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

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

/* ============================================================================
   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;
}
