* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Neue', 'Bubblegum Sans', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Header */
header {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 20px;
    height: 30px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 20px;
}

.progress-text {
    color: #666;
    font-size: 1.2em;
    font-weight: bold;
}

/* Main Content */
main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Word Family Selector */
.word-family-selector {
    text-align: center;
    margin-bottom: 40px;
}

.word-family-selector h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2em;
}

.family-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.family-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 20px 30px;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Neue', cursive;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.family-button:hover {
    transform: translateY(-5px) rotate(-2deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.family-button:active {
    transform: translateY(-2px) scale(0.95);
}

.family-button.active {
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    transform: scale(1.1);
    animation: activePulse 2s ease infinite;
}

@keyframes activePulse {
    0%, 100% {
        box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
    }
    50% {
        box-shadow: 0 5px 25px rgba(76, 175, 80, 0.8);
    }
}

/* Word Display */
.word-display {
    text-align: center;
    display: none;
}

.word-display.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.word-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 60px;
    border-radius: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.word-text {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.letter {
    font-size: 6em;
    font-weight: bold;
    color: #333;
    background: white;
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    display: inline-block;
    animation: letterPop 0.5s ease;
    min-width: 100px;
    text-align: center;
}

@keyframes letterPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.letter:nth-child(1) {
    animation-delay: 0.1s;
    color: #e91e63;
}

.letter:nth-child(2) {
    animation-delay: 0.2s;
    color: #2196F3;
}

.letter:nth-child(3) {
    animation-delay: 0.3s;
    color: #4CAF50;
}

/* Speak Button */
.speak-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 30px 60px;
    font-size: 2em;
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Neue', cursive;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0 auto;
}

.speak-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.speak-button:active {
    transform: scale(0.98);
}

.speaker-icon {
    font-size: 1.5em;
    animation: pulse 1.5s infinite;
    display: inline-block;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.15);
    }
}

.speak-button.speaking {
    animation: speakingBounce 0.4s ease infinite;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.8);
}

@keyframes speakingBounce {
    0%, 100% {
        transform: scale(1) rotate(-2deg);
    }
    25% {
        transform: scale(1.08) rotate(2deg);
    }
    75% {
        transform: scale(1.08) rotate(-2deg);
    }
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}

.nav-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Neue', cursive;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.nav-button:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Reward Animation */
.reward {
    font-size: 4em;
    margin-top: 20px;
    animation: rewardPop 0.8s ease;
    text-shadow: 2px 2px 8px rgba(255, 215, 0, 0.5);
}

@keyframes rewardPop {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    30% {
        transform: scale(1.5) rotate(180deg);
    }
    60% {
        transform: scale(0.9) rotate(270deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

/* Instructions */
.instructions {
    background: #f0f4ff;
    padding: 30px;
    border-radius: 20px;
    margin-top: 40px;
}

.instructions h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.instructions ul {
    list-style: none;
}

.instructions li {
    padding: 10px 0;
    font-size: 1.3em;
    color: #333;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
}

.settings-button {
    background: white;
    color: #667eea;
    border: 3px solid #667eea;
    padding: 15px 30px;
    font-size: 1.3em;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Neue', cursive;
}

.settings-button:hover {
    background: #667eea;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.setting {
    margin: 20px 0;
}

.setting label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.setting input[type="range"] {
    width: 100%;
}

.setting select {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 2px solid #667eea;
    font-size: 1em;
}

.close-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    font-family: 'Comic Neue', cursive;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
    }
    
    .letter {
        font-size: 4em;
        padding: 20px 25px;
        min-width: 70px;
    }
    
    .speak-button {
        font-size: 1.5em;
        padding: 20px 40px;
    }
    
    .nav-button {
        font-size: 1.2em;
        padding: 15px 25px;
    }
    
    .word-card {
        padding: 40px 20px;
    }
    
    main {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .letter {
        font-size: 3em;
        padding: 15px 20px;
        min-width: 60px;
        gap: 10px;
    }
    
    .word-text {
        gap: 10px;
    }
}