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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.tab-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: rgba(255,255,255,0.1);
    border-radius: 50px;
    padding: 5px;
    backdrop-filter: blur(10px);
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    color: white;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.2);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

main {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-height: 600px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 2rem;
    text-align: center;
}

h3 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.rule-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    background: #fafafa;
}

.vowel-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.vowel-group {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
}

.vowel-group.back {
    background: #ffebee;
    border: 2px solid #f44336;
}

.vowel-group.front {
    background: #e3f2fd;
    border: 2px solid #2196f3;
}

.vowel-group.rounded {
    background: #fff3e0;
    border: 2px solid #ff9800;
}

.vowel-group.unrounded {
    background: #f3e5f5;
    border: 2px solid #9c27b0;
}

.vowel-group h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.vowels {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.examples {
    margin-top: 30px;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.example {
    background: #667eea;
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.example small {
    display: block;
    margin-top: 8px;
    opacity: 0.8;
    font-style: italic;
}

.practice-section {
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 15px;
    background: #f8f9fa;
}

.practice-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.practice-section input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 15px;
}

.practice-section input:focus {
    outline: none;
    border-color: #667eea;
}

button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

button:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

button:active {
    transform: translateY(0);
}

.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
}

.result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.vowel-breakdown {
    margin-top: 15px;
}

.vowel-breakdown h5 {
    margin-bottom: 10px;
    color: #666;
}

.vowel-tag {
    display: inline-block;
    padding: 5px 10px;
    margin: 2px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
}

.vowel-tag.back {
    background: #f44336;
}

.vowel-tag.front {
    background: #2196f3;
}

.vowel-tag.back.rounded {
    background: #ff5722;
}

.vowel-tag.front.rounded {
    background: #03a9f4;
}

.suffix-practice {
    padding: 20px;
    border-radius: 15px;
    background: #f0f4ff;
}

.suffix-options {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.suffix-option {
    background: #764ba2;
    min-width: 80px;
}

.suffix-option:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.suffix-option.correct {
    background: #4caf50;
}

.suffix-option.incorrect {
    background: #f44336;
}

#quiz-container {
    max-width: 600px;
    margin: 0 auto;
}

#quiz-question {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

#quiz-options {
    margin-bottom: 20px;
}

#quiz-options label {
    display: block;
    padding: 12px 15px;
    margin: 8px 0;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#quiz-options label:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

#quiz-options input[type="radio"] {
    margin-right: 10px;
}

#quiz-score {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
    margin-top: 20px;
}

.builder-section {
    max-width: 800px;
    margin: 0 auto;
}

.word-construction {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.current-word {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    border: 2px dashed #ddd;
}

.vowel-analysis {
    margin-top: 15px;
}

.root-words, .suffixes {
    margin-bottom: 25px;
}

.word-buttons, .suffix-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.word-btn, .suffix-btn {
    background: #764ba2;
    font-size: 0.9rem;
    padding: 10px 15px;
}

.word-btn:hover, .suffix-btn:hover {
    background: #6a4190;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tab-nav {
        flex-wrap: wrap;
        border-radius: 15px;
    }
    
    .tab-btn {
        margin: 2px;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .vowel-groups {
        grid-template-columns: 1fr;
    }
    
    .example-grid {
        grid-template-columns: 1fr;
    }
    
    .suffix-options {
        justify-content: center;
    }
    
    .current-word {
        font-size: 1.5rem;
    }
    
    .word-buttons, .suffix-buttons {
        gap: 8px;
    }
    
    .word-btn, .suffix-btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}