/* ===== 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-x: 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 {
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    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.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

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

/* ===== Word Card (for learning) ===== */
.word-learn-card {
    background: var(--card-bg);
    border-radius: 30px;
    padding: 30px 40px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* ===== Letter Buttons in Word ===== */
.word-letters {
    display: flex;
    gap: 10px;
}

.word-letter {
    width: 90px;
    height: 100px;
    border-radius: 20px;
    border: none;
    font-size: 4rem;
    font-family: var(--font-display);
    font-weight: 700;
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.15s ease;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.word-letter:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

.word-letter.active {
    transform: translateY(-5px) scale(1.05);
}

/* ===== Slider for Blending ===== */
.word-slider-container {
    width: 100%;
    max-width: 300px;
    height: 50px;
    position: relative;
    margin: 10px 0;
}

.word-slider-track {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    display: flex;
    overflow: hidden;
}

.word-slider-zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.word-slider-zone.active {
    opacity: 1;
}

.word-slider-handle {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 10;
}

.word-slider-handle.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.1);
}

.slider-hint {
    font-size: 1rem;
    color: #666;
}

/* ===== Blend Buttons ===== */
.blend-buttons {
    display: flex;
    gap: 10px;
}

.blend-btn {
    padding: 12px 25px;
    border-radius: 25px;
    border: none;
    font-size: 1.1rem;
    font-family: var(--font-display);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.blend-btn.slow {
    background: linear-gradient(145deg, #4CAF50, #2E7D32);
    color: white;
    box-shadow: 0 5px 0 #1B5E20;
}

.blend-btn.fast {
    background: linear-gradient(145deg, #FF9800, #F57C00);
    color: white;
    box-shadow: 0 5px 0 #E65100;
}

.blend-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 currentColor;
}

/* ===== Got It Button ===== */
.got-it-btn {
    background: linear-gradient(145deg, #2196F3, #1976D2);
    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 #0D47A1;
    transition: all 0.15s ease;
    margin-top: 10px;
}

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

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

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

.quiz-word-choice {
    background: var(--card-bg);
    border: 4px solid #ddd;
    border-radius: 25px;
    padding: 20px 30px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.1);
}

.quiz-word-choice:hover {
    transform: translateY(-5px);
    box-shadow: 0 13px 0 rgba(0, 0, 0, 0.1);
}

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

.quiz-word-choice.correct {
    border-color: #4CAF50;
    background: #E8F5E9;
}

.quiz-word-choice.wrong {
    border-color: #f44336;
    background: #FFEBEE;
    opacity: 0.6;
}

.quiz-word-letters {
    display: flex;
    gap: 5px;
}

.quiz-letter {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

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

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

/* Newest word being learned gets highlighted */
.word-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-word {
    font-weight: 700;
    margin-right: 8px;
}

/* ===== Hear Again Button ===== */
.hear-again-btn {
    background: linear-gradient(145deg, #9C27B0, #7B1FA2);
    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 #4A148C;
    transition: all 0.15s ease;
    margin-top: 10px;
}

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

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

.sentence-display {
    background: var(--card-bg);
    padding: 20px 40px;
    border-radius: 20px;
    margin-bottom: 25px;
}

.sentence-display span {
    font-size: 3rem;
    font-weight: 700;
}

.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) {
    .word-letter {
        width: 70px;
        height: 80px;
        font-size: 3rem;
    }
    
    .quiz-letter {
        font-size: 2.5rem;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
}

