* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
}

h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
}

.score-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
}

.score-item .label {
    opacity: 0.9;
    margin-right: 8px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grade Selection */
#grade-selection h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 15px;
    font-size: 2.2em;
}

.grade-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1em;
}

.grade-sections {
    max-width: 1200px;
    margin: 0 auto;
}

.grade-section {
    margin-bottom: 40px;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
}

.section-title {
    color: #667eea;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-align: center;
}

.grade-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
}

.grade-btn-small {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.grade-btn-small:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.grade-btn-small .icon {
    font-size: 2.5em;
    display: block;
    margin-bottom: 10px;
}

.grade-btn-small h4 {
    color: #667eea;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.grade-btn-small p {
    color: #999;
    font-size: 0.9em;
}

/* Main Menu */
.menu-header {
    margin-bottom: 30px;
}

.menu-header .back-btn {
    margin-bottom: 20px;
}

#main-menu h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2em;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.menu-btn {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.menu-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.menu-btn.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.menu-btn.highlight h3,
.menu-btn.highlight p {
    color: white;
}

.menu-btn .icon {
    font-size: 3em;
    display: block;
    margin-bottom: 10px;
}

.menu-btn h3 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 1.3em;
}

.menu-btn p {
    color: #666;
    font-size: 0.95em;
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.back-btn {
    background: #f0f0f0;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #e0e0e0;
    transform: translateX(-3px);
}

#game-title {
    color: #667eea;
    flex-grow: 1;
    text-align: center;
}

.progress {
    background: #f0f0f0;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    color: #667eea;
}

.game-content {
    min-height: 300px;
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.5em;
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.word-display {
    font-size: 3em;
    text-align: center;
    margin: 40px 0;
    color: #667eea;
    font-weight: bold;
    letter-spacing: 5px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.option-btn {
    padding: 20px;
    font-size: 1.2em;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.option-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

.option-btn.correct {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.option-btn.incorrect {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.option-btn:disabled {
    cursor: not-allowed;
}

.feedback {
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    min-height: 40px;
    margin: 20px 0;
    padding: 15px;
    border-radius: 10px;
}

.feedback.correct {
    background: #e8f5e9;
    color: #2e7d32;
}

.feedback.incorrect {
    background: #ffebee;
    color: #c62828;
}

.explanation {
    margin-top: 10px;
    font-size: 0.9em;
    opacity: 0.9;
}

.game-controls {
    text-align: center;
    margin-top: 30px;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    margin-left: 10px;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Sentence Builder */
.word-bank {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.word-bank h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.word-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.word-chip {
    padding: 10px 20px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.word-chip:hover:not(.used) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.word-chip.used {
    opacity: 0.3;
    cursor: not-allowed;
}

.sentence-area {
    background: white;
    border: 3px dashed #667eea;
    border-radius: 10px;
    min-height: 100px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.sentence-area.empty::before {
    content: "Click words to build your sentence here...";
    color: #999;
    font-style: italic;
}

.sentence-word {
    padding: 10px 15px;
    background: #667eea;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sentence-word:hover {
    background: #764ba2;
}

/* Results Screen */
.results-content {
    text-align: center;
    padding: 40px 20px;
}

.results-content h2 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 30px;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.stat-value {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1em;
    opacity: 0.9;
}

.results-actions {
    margin-top: 40px;
}

/* Syllable Display */
.syllable-display {
    display: flex;
    justify-content: center;
    gap: 5px;
    font-size: 2.5em;
    margin: 40px 0;
    flex-wrap: wrap;
}

.syllable {
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    font-weight: bold;
}

/* Letter Grid for Vowels */
.letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.letter-btn {
    padding: 25px;
    font-size: 2em;
    font-weight: bold;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.letter-btn:hover:not(:disabled) {
    transform: scale(1.1);
    border-color: #667eea;
}

.letter-btn.vowel {
    color: #667eea;
}

.letter-btn.consonant {
    color: #764ba2;
}

/* Text Input Fields */
.text-input {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border: 3px solid #e0e0e0;
    border-radius: 10px;
    margin: 20px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.text-input.large {
    min-height: 100px;
    resize: vertical;
}

/* Fill in the Blank */
.fill-sentence {
    font-size: 1.4em;
    line-height: 2;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
}

.blank-input {
    display: inline-block;
    min-width: 150px;
    padding: 5px 15px;
    font-size: 1em;
    border: none;
    border-bottom: 3px solid #667eea;
    background: white;
    text-align: center;
    margin: 0 5px;
    font-family: inherit;
}

.blank-input:focus {
    outline: none;
    border-bottom-color: #764ba2;
    background: #f0f0ff;
}

.blank-input.correct {
    border-bottom-color: #4caf50;
    background: #e8f5e9;
}

.blank-input.incorrect {
    border-bottom-color: #f44336;
    background: #ffebee;
}

/* Word Suggestions */
.word-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.suggestion-chip {
    padding: 8px 16px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

.suggestion-chip:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.suggestion-chip.used {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Error Correction */
.error-sentence {
    font-size: 1.5em;
    padding: 25px;
    background: #fff3cd;
    border: 3px solid #ffc107;
    border-radius: 10px;
    margin: 20px 0;
    line-height: 1.8;
}

.error-word {
    padding: 5px 10px;
    background: #f44336;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 0 3px;
}

.error-word:hover {
    background: #d32f2f;
    transform: scale(1.05);
}

.error-word.selected {
    background: #764ba2;
    box-shadow: 0 0 10px rgba(118, 75, 162, 0.5);
}

.correction-input {
    display: inline-block;
    min-width: 120px;
    padding: 5px 10px;
    font-size: 1em;
    border: 2px solid #667eea;
    border-radius: 5px;
    margin: 0 5px;
}

/* Scavenger Hunt */
.hunt-sentence {
    font-size: 1.5em;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
    line-height: 2;
}

.hunt-word {
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 0 5px;
    border-radius: 5px;
}

.hunt-word:hover {
    background: #e0e0e0;
}

.hunt-word.selected {
    background: #667eea;
    color: white;
}

.hunt-word.correct-selection {
    background: #4caf50;
    color: white;
}

.hunt-word.incorrect-selection {
    background: #f44336;
    color: white;
}

.hunt-instruction {
    font-size: 1.3em;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

/* Mad Libs */
.madlib-container {
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
    margin: 20px 0;
}

.madlib-prompt {
    font-size: 1.2em;
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
}

.madlib-story {
    font-size: 1.4em;
    line-height: 2;
    padding: 20px;
    background: white;
    border-radius: 10px;
    margin-top: 20px;
}

.madlib-blank {
    display: inline-block;
    min-width: 100px;
    padding: 3px 12px;
    border-bottom: 3px dashed #667eea;
    font-weight: bold;
    color: #667eea;
    margin: 0 5px;
}

/* Sentence Expansion */
.expand-container {
    margin: 20px 0;
}

.base-sentence {
    font-size: 1.5em;
    padding: 20px;
    background: #e8f5e9;
    border-left: 5px solid #4caf50;
    border-radius: 10px;
    margin-bottom: 20px;
}

.expansion-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.expansion-chip {
    padding: 15px;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.expansion-chip:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
