* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --secondary: #10B981;
    --accent: #F59E0B;
    --danger: #EF4444;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --text: #1E293B;
    --text-light: #64748B;
    --border: #E2E8F0;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 90vh;
}

.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: 24px;
}

.screen.active {
    display: flex;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
    padding: 20px 0;
}

.logo {
    font-size: 4rem;
    margin-bottom: 16px;
}

h1 {
    font-family: 'Comic Neue', cursive;
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Game Modes */
.game-modes {
    margin-bottom: 32px;
}

.game-modes h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--text);
    font-size: 1.4rem;
}

.modes-grid {
    display: grid;
    gap: 16px;
}

.mode-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.mode-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.mode-card h3 {
    color: var(--text);
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.mode-card p {
    color: var(--text-light);
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.difficulty {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Player Info */
.player-info {
    margin-bottom: 24px;
}

.stats {
    display: flex;
    justify-content: space-around;
    background: var(--background);
    padding: 20px;
    border-radius: 16px;
    border: 2px solid var(--border);
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.start-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: auto;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
}

.start-btn:active {
    transform: translateY(0);
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--background);
    border-radius: 16px;
}

.game-stats {
    display: flex;
    gap: 20px;
}

.game-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
}

.stat-icon {
    font-size: 1.2rem;
}

.player-avatar .avatar {
    font-size: 2rem;
}

/* Question Area */
.question-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.question-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.question {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.question-hint {
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.answer-btn {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}

.answer-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.answer-number {
    background: var(--primary);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.answer-text {
    font-weight: 600;
}

/* Power Ups */
.power-ups {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 20px 0;
}

.power-up {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 70px;
}

.power-up:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

.powerup-icon {
    font-size: 1.5rem;
}

.powerup-count {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Progress */
.progress-container {
    margin-top: auto;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Results Screen */
.results-header {
    text-align: center;
    margin-bottom: 32px;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.results-header h2 {
    color: var(--text);
    margin-bottom: 16px;
    font-size: 1.8rem;
}

.score-display {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 20px;
    border-radius: 16px;
    display: inline-block;
}

.final-score {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.score-label {
    font-size: 1rem;
    opacity: 0.9;
}

.results-details {
    margin-bottom: 24px;
}

.result-card {
    background: var(--background);
    padding: 20px;
    border-radius: 16px;
    border: 2px solid var(--border);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    color: var(--text);
    font-weight: 600;
}

.result-value {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.rewards {
    margin-bottom: 24px;
}

.rewards h3 {
    text-align: center;
    margin-bottom: 16px;
    color: var(--text);
}

.rewards-grid {
    display: grid;
    gap: 12px;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background);
    border-radius: 12px;
    border: 2px solid var(--border);
}

.reward-icon {
    font-size: 1.2rem;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.action-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.play-again {
    background: var(--primary);
    color: white;
}

.main-menu {
    background: var(--background);
    color: var(--text);
    border: 2px solid var(--border);
}

.action-btn:hover {
    transform: translateY(-2px);
}

/* Shop Screen */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.shop-header h2 {
    color: var(--text);
}

.coin-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
}

.shop-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.shop-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--background);
    border-radius: 12px;
    border: 2px solid var(--border);
}

.item-icon {
    font-size: 2rem;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    color: var(--text);
    margin-bottom: 4px;
}

.item-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.buy-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.buy-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.back-btn {
    background: var(--background);
    color: var(--text);
    border: 2px solid var(--border);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-top: auto;
}

.back-btn:hover {
    background: var(--border);
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.bounce {
    animation: bounce 0.5s ease-in-out;
}

@keyframes correct {
    0% { background: var(--surface); }
    50% { background: var(--secondary); color: white; }
    100% { background: var(--surface); }
}

.correct {
    animation: correct 0.5s ease-in-out;
}

@keyframes incorrect {
    0% { background: var(--surface); }
    50% { background: var(--danger); color: white; }
    100% { background: var(--surface); }
}

.incorrect {
    animation: incorrect 0.5s ease-in-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 20px;
        min-height: calc(100vh - 20px);
    }
    
    .screen {
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .logo {
        font-size: 3rem;
    }
    
    .answers-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .game-stats {
        gap: 12px;
    }
    
    .game-stat {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 5px;
        border-radius: 16px;
        min-height: calc(100vh - 10px);
    }
    
    .screen {
        padding: 16px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .question {
        font-size: 1.2rem;
    }
    
    .power-ups {
        gap: 8px;
    }
    
    .power-up {
        min-width: 60px;
        padding: 8px;
    }
}