/* 🎮 ENGLISH ADVENTURE - MAIN STYLES */

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

:root {
    --primary: #4A90E2;
    --secondary: #7ED321;
    --warning: #F5A623;
    --danger: #D0021B;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-dark: #2C3E50;
    --text-light: #ECF0F1;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
}

body.dark-mode {
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --text-dark: #ECF0F1;
    --card-bg: rgba(30, 30, 50, 0.95);
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stats {
    display: flex;
    gap: 15px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    font-size: 16px;
}

.stat-icon {
    font-size: 20px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-small, .btn-large, .btn-icon {
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-primary {
    background: var(--secondary);
    color: white;
    padding: 12px 30px;
    font-size: 18px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(126, 211, 33, 0.4);
}

.btn-secondary {
    background: var(--primary);
    color: white;
    padding: 12px 30px;
    font-size: 18px;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
}

.btn-danger {
    background: var(--danger);
    color: white;
    padding: 12px 30px;
    font-size: 16px;
}

.btn-small {
    background: white;
    color: var(--primary);
    padding: 8px 16px;
    font-size: 14px;
}

.btn-large {
    padding: 18px 50px;
    font-size: 22px;
}

.btn-icon {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.btn-icon:hover {
    transform: scale(1.1);
}

.btn-primary:active, .btn-secondary:active, .btn-icon:active, .answer-btn:active {
    transform: scale(0.95);
}

/* Loading Screen */
#loadingScreen {
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
}

.mascot {
    font-size: 120px;
    animation: bounce 1s infinite;
}

.game-title {
    font-size: 48px;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin: 20px 0;
}

.tagline {
    font-size: 20px;
    color: white;
    margin-bottom: 30px;
}

.loading-bar {
    width: 300px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 30px;
}

.loading-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s;
}

/* Game Modes */
.game-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.mode-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.mode-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.mode-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--primary);
}

.mode-card p {
    color: #7f8c8d;
    margin-bottom: 15px;
}

.mode-stats {
    font-weight: bold;
    color: var(--warning);
}

/* Daily Quest Banner */
.daily-quest-banner {
    background: linear-gradient(135deg, #F5A623 0%, #F76B1C 100%);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    margin-top: 30px;
}

.quest-icon {
    font-size: 40px;
}

.quest-info {
    flex: 1;
}

.quest-title {
    font-size: 18px;
    font-weight: bold;
}

.quest-progress {
    font-size: 14px;
    opacity: 0.9;
}

/* Level Selection */
.world-info {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--card-bg);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.world-icon {
    font-size: 64px;
}

.world-details h3 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 5px;
}

.world-details p {
    color: #7f8c8d;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.level-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    position: relative;
}

.level-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.level-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-card.locked:hover {
    transform: none;
}

.level-number {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 10px;
}

.level-stars {
    font-size: 16px;
}

.level-lock {
    font-size: 32px;
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.game-stats {
    display: flex;
    gap: 20px;
}

.progress-info {
    font-size: 18px;
    font-weight: bold;
}

.game-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Word Hunt Game */
.word-display {
    text-align: center;
    margin-bottom: 40px;
}

.word-emoji {
    font-size: 120px;
    margin-bottom: 20px;
    animation: bounce 0.5s;
}

.word-text {
    font-size: 48px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 10px;
}

.word-pronunciation {
    font-size: 20px;
    color: #7f8c8d;
    font-style: italic;
}

.answer-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 600px;
    width: 100%;
}

.answer-btn {
    background: white;
    border: 3px solid var(--primary);
    border-radius: 15px;
    padding: 25px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-dark);
}

.answer-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.answer-btn.correct {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
    animation: pulse 0.5s;
}

.answer-btn.wrong {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    animation: shake 0.5s;
}

/* Listening Game */
.listening-container {
    text-align: center;
}

.speaker-icon {
    font-size: 120px;
    cursor: pointer;
    transition: transform 0.3s;
}

.speaker-icon:hover {
    transform: scale(1.1);
}

.speaker-icon.playing {
    animation: pulse 1s infinite;
}

.image-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 600px;
    margin: 30px auto 0;
}

.image-option {
    background: white;
    border: 3px solid var(--primary);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.image-option:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.option-emoji {
    font-size: 80px;
    margin-bottom: 10px;
}

.option-label {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-dark);
}

/* Spelling Game */
.spelling-container {
    text-align: center;
    width: 100%;
}

.spelling-word {
    font-size: 100px;
    margin-bottom: 30px;
}

.spelling-input-container {
    margin: 30px 0;
}

.spelling-input {
    font-size: 32px;
    padding: 20px;
    border: 3px solid var(--primary);
    border-radius: 15px;
    text-align: center;
    width: 100%;
    max-width: 400px;
    font-family: inherit;
}

.spelling-hint {
    font-size: 18px;
    color: #7f8c8d;
    margin-top: 15px;
}

.letter-hints {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.letter-hint {
    width: 40px;
    height: 50px;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    background: white;
}

.submit-btn {
    margin-top: 30px;
    padding: 15px 50px;
    font-size: 24px;
}

/* Result Screen */
#resultScreen {
    align-items: center;
    justify-content: center;
}

.result-content {
    background: var(--card-bg);
    border-radius: 30px;
    padding: 50px;
    text-align: center;
    box-shadow: var(--shadow);
    max-width: 600px;
}

.result-mascot {
    font-size: 120px;
    animation: bounce 1s;
}

.result-content h2 {
    font-size: 36px;
    color: var(--primary);
    margin: 20px 0;
}

.stars-earned {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 64px;
    margin: 30px 0;
}

.star {
    animation: starPop 0.5s forwards;
    opacity: 0;
}

.star:nth-child(1) { animation-delay: 0.2s; }
.star:nth-child(2) { animation-delay: 0.4s; }
.star:nth-child(3) { animation-delay: 0.6s; }

.star.earned {
    opacity: 1;
}

.star.empty {
    opacity: 0.3;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.result-stat {
    padding: 20px;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 15px;
}

.result-label {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.result-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary);
}

.result-rewards {
    margin: 20px 0;
    font-size: 24px;
    font-weight: bold;
    color: var(--secondary);
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* 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: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 24px;
    color: var(--primary);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 10px;
}

.setting-item label {
    font-size: 18px;
}

.setting-item input[type="checkbox"] {
    width: 50px;
    height: 25px;
    cursor: pointer;
}

.setting-item select {
    padding: 8px 15px;
    border-radius: 8px;
    border: 2px solid var(--primary);
    font-size: 16px;
}

.pause-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

/* Toast */
.toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--text-dark);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Achievement Popup */
.achievement-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.5s;
    max-width: 350px;
}

.achievement-popup.show {
    opacity: 1;
    transform: translateX(0);
}

.achievement-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.achievement-icon {
    font-size: 48px;
}

.achievement-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 5px;
}

.achievement-desc {
    font-size: 14px;
    color: #7f8c8d;
}

/* Responsive */
@media (max-width: 768px) {
    .game-title {
        font-size: 36px;
    }

    .mode-card {
        padding: 20px;
    }

    .mode-icon {
        font-size: 48px;
    }

    .word-emoji {
        font-size: 80px;
    }

    .word-text {
        font-size: 32px;
    }

    .answer-options {
        grid-template-columns: 1fr;
    }

    .result-stats {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }

    .levels-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

.spacer {
    width: 50px;
}

.level-theme{font-size:10px;line-height:1.2;color:#666;text-align:center;margin-top:2px;padding:0 2px}
