/* Addition Adventure Game Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #3B82F6;
    --primary-light: #93C5FD;
    --secondary: #F59E0B;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --text: #1E293B;
    --text-muted: #64748B;
    --success: #10B981;
    --error: #EF4444;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#game-container {
    width: 100%;
    max-width: 600px;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Header */
#game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--background);
    border-bottom: 1px solid #E5E7EB;
}

.game-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
}

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

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--surface);
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.icon-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Game Area */
#game-area {
    padding: 20px;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    margin-bottom: 24px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Equation */
.equation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.number-block {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    border: 3px solid var(--primary-light);
    border-radius: 16px;
    padding: 16px;
    min-width: 100px;
    text-align: center;
}

.items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
    min-height: 50px;
    align-items: center;
}

.item {
    font-size: 24px;
    animation: popIn 0.3s ease backwards;
}

.number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.operator {
    font-size: 40px;
    font-weight: 700;
    color: var(--text);
}

.answer-block {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 3px dashed var(--secondary);
    border-radius: 16px;
    padding: 24px 32px;
    font-size: 40px;
    font-weight: 700;
    color: var(--secondary);
    min-width: 100px;
    text-align: center;
    transition: all 0.3s;
}

.answer-block.correct {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border: 3px solid var(--success);
    color: var(--success);
    animation: celebrate 0.5s ease;
}

.answer-block.wrong {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border: 3px solid var(--error);
    color: var(--error);
    animation: shake 0.5s ease;
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes celebrate {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Answers */
.answers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.answer-btn {
    padding: 24px;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    background: var(--surface);
    border: 3px solid #E5E7EB;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.answer-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
    border-color: var(--primary);
}

.answer-btn.correct {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border-color: var(--success);
}

.answer-btn.wrong {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border-color: var(--error);
}

/* Feedback */
.feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 64px;
    z-index: 50;
    animation: feedbackPop 0.5s ease;
}

.feedback.hidden {
    display: none;
}

@keyframes feedbackPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.stars {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-content h2 {
    font-size: 28px;
    color: var(--text);
    margin-bottom: 8px;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 32px;
}

.result-stat {
    display: flex;
    flex-direction: column;
}

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

.result-label {
    font-size: 14px;
    color: var(--text-muted);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: var(--background);
    color: var(--text);
    border: 2px solid #E5E7EB;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Responsive */
@media (max-width: 480px) {
    .equation {
        gap: 8px;
    }

    .number-block {
        padding: 12px;
        min-width: 70px;
    }

    .number {
        font-size: 24px;
    }

    .operator {
        font-size: 28px;
    }

    .answer-block {
        padding: 16px 20px;
        font-size: 28px;
        min-width: 70px;
    }

    .answers {
        gap: 8px;
    }

    .answer-btn {
        padding: 16px;
        font-size: 22px;
    }

    .item {
        font-size: 18px;
    }

    .items {
        min-height: 36px;
    }

    .stats {
        gap: 12px;
    }

    .stat-value {
        font-size: 16px;
    }
}