/* ===== CSS Variables ===== */
:root {
    --sky-top: #87CEEB;
    --sky-bottom: #E0F6FF;
    --grass-light: #7CB342;
    --grass-dark: #558B2F;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.15);
    
    --font-display: 'Fredoka', sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-display);
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 60%, var(--grass-light) 60%, var(--grass-dark) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== App Container ===== */
.app-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* ===== Header ===== */
.header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--card-bg);
    color: var(--grass-dark);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s;
}

.back-btn:hover {
    transform: scale(1.05);
}

/* ===== Progress Dots ===== */
.progress-dots {
    display: flex;
    gap: 10px;
}

.dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.dot.completed {
    background: #4CAF50;
    border-color: #2E7D32;
    color: white;
}

.dot.current {
    background: white;
    border-color: #FFD700;
    color: #333;
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.dot.learning {
    animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1.15); }
    50% { transform: scale(1.25); }
}

/* ===== Main Letter Area ===== */
.letter-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
    width: 100%;
    max-width: 600px;
}

/* ===== Learn Card ===== */
.learn-card {
    width: 280px;
    height: 320px;
    background: var(--card-bg);
    border-radius: 40px;
    border: 8px solid #FF6B6B;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 15px 0 rgba(0, 0, 0, 0.1),
        var(--shadow-soft);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.learn-card:hover {
    transform: translateY(-5px);
}

.learn-card:active {
    transform: translateY(5px);
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.1);
}

.big-letter {
    font-size: 14rem;
    font-weight: 700;
    text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

/* ===== Tap Hint ===== */
.tap-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: bounce 1s ease-in-out infinite;
}

.tap-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.hand {
    font-size: 3.5rem;
    animation: tap 1.5s ease-in-out infinite;
}

.hint-text {
    font-size: 1.3rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

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

@keyframes tap {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.1); }
}

/* ===== Got It Button ===== */
.got-it-btn {
    background: linear-gradient(145deg, #4CAF50, #2E7D32);
    color: white;
    border: none;
    padding: 18px 45px;
    font-size: 1.4rem;
    font-family: var(--font-display);
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 
        0 8px 0 #1B5E20,
        0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.15s ease;
}

.got-it-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 11px 0 #1B5E20, 0 15px 40px rgba(0, 0, 0, 0.25);
}

.got-it-btn:active {
    transform: translateY(3px);
    box-shadow: 0 4px 0 #1B5E20;
}

/* ===== Quiz Screen ===== */
.quiz-prompt {
    background: var(--card-bg);
    padding: 25px 40px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 10px;
}

.prompt-text {
    font-size: 2rem;
    color: #555;
}

.target-letter {
    font-size: 3.5rem;
    font-weight: 700;
}

/* ===== Quiz Choices ===== */
.quiz-choices {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.quiz-choice {
    width: 120px;
    height: 140px;
    border-radius: 25px;
    border: none;
    font-size: 5rem;
    font-family: var(--font-display);
    font-weight: 700;
    color: white;
    cursor: pointer;
    box-shadow: 
        0 10px 0 rgba(0, 0, 0, 0.2),
        0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.15s ease;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.quiz-choice:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 0 rgba(0, 0, 0, 0.2), 0 15px 40px rgba(0, 0, 0, 0.2);
}

.quiz-choice:active {
    transform: translateY(5px);
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.2);
}

.quiz-choice.correct {
    animation: correct-pulse 0.5s ease-out;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.8);
}

.quiz-choice.wrong {
    animation: wrong-shake 0.5s ease-out;
    opacity: 0.6;
}

@keyframes correct-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

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

/* ===== Progress Display (per letter) ===== */
.progress-display {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.letter-progress {
    background: var(--card-bg);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 1.3rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Newest letter being learned gets highlighted */
.letter-progress.newest {
    background: linear-gradient(145deg, #FFF9C4, #FFF59D);
    border: 3px solid #F9A825;
    box-shadow: 0 4px 15px rgba(249, 168, 37, 0.4);
    transform: scale(1.1);
    animation: pulse-newest 2s ease-in-out infinite;
}

@keyframes pulse-newest {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.15); }
}

.progress-letter {
    font-weight: 700;
    font-size: 1.5rem;
}

/* ===== Hear Again Button ===== */
.hear-again-btn {
    background: linear-gradient(145deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.2rem;
    font-family: var(--font-display);
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 5px 0 #0D47A1;
    transition: all 0.15s ease;
    margin-top: 10px;
}

.hear-again-btn:hover {
    transform: translateY(-2px);
}

.hear-again-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0D47A1;
}

/* ===== Complete Screen ===== */
.complete-message {
    text-align: center;
    color: white;
}

.complete-message h2 {
    font-size: 2.5rem;
    margin-bottom: 25px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

.learned-letters {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.complete-letter {
    width: 60px;
    height: 70px;
    background: var(--card-bg);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #4CAF50;
    box-shadow: var(--shadow-soft);
}

.restart-btn {
    background: linear-gradient(145deg, #FF6B6B, #E53935);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.3rem;
    font-family: var(--font-display);
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 0 #C62828;
    transition: all 0.15s ease;
}

.restart-btn:hover {
    transform: translateY(-3px);
}

.restart-btn:active {
    transform: translateY(3px);
    box-shadow: 0 4px 0 #C62828;
}

/* ===== Responsive ===== */
@media (max-width: 500px) {
    .learn-card {
        width: 240px;
        height: 280px;
    }
    
    .big-letter {
        font-size: 11rem;
    }
    
    .quiz-choice {
        width: 100px;
        height: 120px;
        font-size: 4rem;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
}
