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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.title {
    font-size: 2rem;
    color: #ff6b6b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.parent-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.difficulty-selector {
    padding: 0.5rem;
    border: 2px solid #4ecdc4;
    border-radius: 20px;
    background: white;
    font-family: inherit;
    font-weight: bold;
    color: #333;
}

.main-content {
    flex: 1;
    padding: 2rem;
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: block;
}

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

.menu-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 400px;
    margin: 0 auto;
    padding-top: 3rem;
}

.menu-btn {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.menu-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.chart-btn {
    background: linear-gradient(45deg, #ff9a9e 0%, #fecfef 100%);
    color: #333;
}

.challenge-btn {
    background: linear-gradient(45deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.game-btn {
    background: linear-gradient(45deg, #ffd89b 0%, #19547b 100%);
    color: white;
}

.game-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    color: #666;
}

.plays-left {
    display: block;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.back-btn {
    padding: 0.5rem 1rem;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #ff5252;
    transform: translateX(-5px);
}

.chart-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-top: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.chart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.2rem;
}

.chart-table th, .chart-table td {
    padding: 1rem;
    text-align: center;
    border: 2px solid #4ecdc4;
    min-width: 60px;
}

.chart-table th {
    background: linear-gradient(45deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    font-weight: bold;
}

.chart-table td {
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.chart-table td:hover {
    background: #4ecdc4;
    color: white;
    transform: scale(1.1);
    border-radius: 10px;
}

.flashcard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.progress {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4ecdc4;
}

.flashcard-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.flashcard {
    background: white;
    padding: 3rem;
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-width: 400px;
    animation: cardFlip 0.5s ease-in-out;
}

@keyframes cardFlip {
    0% { transform: rotateY(-90deg); }
    100% { transform: rotateY(0deg); }
}

.question {
    font-size: 3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 2rem;
}

.answer-input {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

#answer {
    padding: 1rem;
    font-size: 2rem;
    border: 3px solid #4ecdc4;
    border-radius: 15px;
    text-align: center;
    width: 200px;
    font-family: inherit;
}

#submit-answer {
    padding: 1rem 2rem;
    font-size: 1.5rem;
    background: #4ecdc4;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#submit-answer:hover {
    background: #44a08d;
    transform: scale(1.05);
}

.feedback {
    margin-top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    min-height: 2rem;
}

.feedback.correct {
    color: #4caf50;
    animation: correctAnswer 0.5s ease-in-out;
}

.feedback.incorrect {
    color: #f44336;
    animation: shake 0.5s ease-in-out;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.challenge-complete {
    text-align: center;
    background: white;
    padding: 3rem;
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    animation: celebrationPulse 1s ease-in-out infinite alternate;
}

@keyframes celebrationPulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.challenge-complete h3 {
    font-size: 2.5rem;
    color: #4caf50;
    margin-bottom: 1rem;
}

#play-reward-game {
    padding: 1rem 2rem;
    font-size: 1.5rem;
    background: linear-gradient(45deg, #ffd89b 0%, #19547b 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.game-info {
    display: flex;
    gap: 2rem;
    font-weight: bold;
    color: #333;
}

#game-canvas {
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
    border: 3px solid #333;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.game-controls {
    text-align: center;
    margin-top: 1rem;
}

#start-game {
    padding: 1rem 2rem;
    font-size: 1.5rem;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#start-game:hover {
    background: #45a049;
    transform: scale(1.05);
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

#play-again {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background: #4ecdc4;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 1rem;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .title {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .menu-btn {
        font-size: 1.2rem;
        padding: 1rem;
    }
    
    .question {
        font-size: 2rem;
    }
    
    .flashcard {
        min-width: 300px;
        padding: 2rem;
    }
    
    #game-canvas {
        width: 100%;
        height: auto;
        max-width: 600px;
    }
}