/**
 * Deep Sea Sums - Deep Ocean Adventure Theme
 *
 * A submarine voyage through tide pools, coral reefs, and the deep trench!
 * Builds on top of kid-friendly-theme.css
 *
 * Color Palette:
 * - Deep Navy: #0B2545 (ocean depths background, dark text)
 * - Ocean Teal: #14919B (primary accents, borders, buttons)
 * - Aqua Glow: #5BE3E8 (highlights, progress bar, focus states)
 * - Coral Pink: #FF7F66 (score display, warm accents)
 * - Sea Sand: #F2E9D8 (card backgrounds, light surfaces)
 */

body {
    background: linear-gradient(180deg, #5BE3E8 0%, #14919B 35%, #0B2545 100%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    font-family: 'Nunito', sans-serif;
    position: relative;
}

/* Drifting bubbles in the water */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
    z-index: 0;
}

body::before {
    width: 60px;
    height: 60px;
    left: 8%;
    bottom: -80px;
    animation: bubble-rise 14s linear infinite;
}

body::after {
    width: 32px;
    height: 32px;
    right: 10%;
    bottom: -50px;
    animation: bubble-rise 10s linear 3s infinite;
}

@keyframes bubble-rise {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 1; }
    100% { transform: translateY(-110vh); opacity: 0; }
}

.game-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Porthole-style game card */
.kid-game-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F2E9D8 100%);
    border: 4px solid #14919B;
    border-radius: 25px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 8px 30px rgba(11, 37, 69, 0.45), inset 0 0 0 6px rgba(91, 227, 232, 0.25);
}

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

.sea-mascot.excited {
    animation: bounce 0.6s ease-in-out 3;
}

@keyframes swim {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(8px) translateY(-6px); }
    50% { transform: translateX(0) translateY(-10px); }
    75% { transform: translateX(-8px) translateY(-4px); }
}

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

/* Titles */
.kid-friendly-title {
    color: #0B2545;
    text-align: center;
    margin: 20px 0;
}

.kid-friendly-body {
    color: #0B2545;
    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: #14919B;
    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 #14919B;
}

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

.kid-difficulty-card.easy {
    background: linear-gradient(135deg, #D2F8F5 0%, #A5EDE6 100%);
    border-color: #14919B;
}

.kid-difficulty-card.medium {
    background: linear-gradient(135deg, #A9E4F0 0%, #5BC8E8 100%);
    border-color: #1B6F8C;
}

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

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

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

.difficulty-example {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0B2545;
    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, #FFB3A0 0%, #FF7F66 100%);
    border: 3px solid #C94F38;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
}

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

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

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

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

/* Progress Bar (the submarine's depth gauge) */
.kid-progress-bar {
    background: rgba(11, 37, 69, 0.2);
    border: 2px solid #14919B;
    border-radius: 15px;
    height: 25px;
    margin-bottom: 30px;
    overflow: hidden;
}

.kid-progress-fill {
    background: linear-gradient(90deg, #14919B 0%, #5BE3E8 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.8rem;
    font-weight: 700;
    color: #14919B;
    margin-bottom: 25px;
}

/* Horizontal problem (Tide Pool facts) */
.horizontal-problem {
    font-family: 'Fredoka', sans-serif;
    font-size: 3.2rem;
    font-weight: 700;
    color: #0B2545;
    background: rgba(91, 227, 232, 0.18);
    border: 3px solid #14919B;
    border-radius: 20px;
    display: inline-block;
    padding: 20px 40px;
    margin: 10px 0;
    font-variant-numeric: tabular-nums;
}

/* Vertical column problem (Coral Reef & Deep Trench) */
.vertical-problem {
    font-family: 'Fredoka', sans-serif;
    font-size: 3.4rem;
    font-weight: 700;
    color: #0B2545;
    background: rgba(91, 227, 232, 0.18);
    border: 3px solid #14919B;
    border-radius: 20px;
    display: inline-block;
    padding: 25px 45px;
    margin: 10px 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.v-row {
    min-width: 3ch;
}

.v-operator {
    color: #FF7F66;
    margin-right: 18px;
}

.v-line {
    border-bottom: 5px solid #0B2545;
    border-radius: 3px;
    margin: 8px 0;
}

.v-answer {
    color: #14919B;
}

/* 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.6rem;
    font-weight: 600;
    color: #0B2545;
    background: linear-gradient(135deg, #FFFFFF 0%, #D2F8F5 100%);
    border: 3px solid #14919B;
    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(91, 227, 232, 0.5);
    background: linear-gradient(135deg, #A9E4F0 0%, #5BE3E8 100%);
}

.kid-answer-btn.correct {
    background: linear-gradient(135deg, #98FB98 0%, #90EE90 100%);
    border-color: #228B22;
    animation: pulse 0.5s ease-in-out;
}

.kid-answer-btn.incorrect {
    background: linear-gradient(135deg, #FFB3A0 0%, #FF7F66 100%);
    border-color: #C94F38;
    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, #98FB98 0%, #90EE90 100%);
    color: #1B5E20;
    border: 3px solid #228B22;
}

.feedback-message.incorrect {
    background: linear-gradient(135deg, #FFB3A0 0%, #FF7F66 100%);
    color: #7C2D12;
    border: 3px solid #C94F38;
}

/* 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, #D2F8F5 0%, #FFFFFF 100%);
    border: 3px solid #14919B;
    border-radius: 20px;
    padding: 25px;
}

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

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

/* Missed Problems Section */
.missed-problems {
    background: linear-gradient(135deg, #E8FBFC 0%, #D2F8F5 100%);
    border: 3px solid #14919B;
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(11, 37, 69, 0.15);
}

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

.missed-question {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #0B2545;
    margin-bottom: 15px;
    font-variant-numeric: tabular-nums;
}

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

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

.correct-answer {
    color: #228B22;
    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, #14919B 0%, #5BE3E8 100%);
    color: #FFFFFF;
    border: 3px solid #0E6E76;
}

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

.kid-btn-accent {
    background: linear-gradient(135deg, #FF9C85 0%, #FF7F66 100%);
    color: #FFFFFF;
    border: 3px solid #C94F38;
}

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

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

    .sea-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.5rem;
    }

    .horizontal-problem {
        font-size: 2.4rem;
        padding: 15px 25px;
    }

    .vertical-problem {
        font-size: 2.6rem;
        padding: 20px 30px;
    }

    .answer-choices {
        grid-template-columns: repeat(2, 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;
    }

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

    .horizontal-problem {
        font-size: 2rem;
        padding: 12px 20px;
    }

    .vertical-problem {
        font-size: 2.2rem;
        padding: 15px 25px;
    }

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