:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --text-color: #2C3E50;
    --background-color: #f9f7f7;
}

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

body {
    font-family: 'ZCOOL KuaiLe', sans-serif;
    background: linear-gradient(135deg, #ffd1dc, #ffecb3);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    max-width: 900px;
    width: 95%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    text-shadow: 2px 2px 0 var(--accent-color);
}

.score-board {
    background: var(--secondary-color);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-mode-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mode-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 15px;
    background: #f0f0f0;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.game-board {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.problem-container {
    text-align: center;
    margin-bottom: 2rem;
}

.number-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.number-display > div {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 60px;
}

.total-number, .first-number {
    background: var(--secondary-color);
    color: white;
    border-radius: 10px;
    padding: 0 15px;
    font-weight: bold;
}

.second-number {
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 0 15px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.equals-sign, .plus-sign {
    color: var(--text-color);
    font-weight: bold;
}

.visual-aids {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    min-height: 100px;
}

.number-blocks {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.submit-area {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.submit-button {
    padding: 12px 30px;
    font-size: 1.2rem;
    font-family: 'ZCOOL KuaiLe', cursive;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.submit-button:hover:not(:disabled) {
    background: #45b6ae;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.number-block {
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.number-block:hover {
    transform: translateY(-5px);
}

.answer-box {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

#answer-input {
    width: 100px;
    height: 50px;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    outline: none;
}

#check-answer {
    padding: 0.5rem 2rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

#check-answer:hover {
    background: #45b6ae;
}

.feedback-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
    gap: 1rem;
}

.mascot img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.feedback-message {
    font-size: 1.2rem;
    color: var(--text-color);
    background: #f8f9fa;
    padding: 1rem 2rem;
    border-radius: 50px;
}

.reward-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

@media (max-width: 768px) {
    .game-container {
        padding: 1rem;
        margin-bottom: 100px; /* 为底部的成就星星区域留出空间 */
    }

    h1 {
        font-size: 2rem;
    }

    .mode-btn {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    .number-display {
        font-size: 2rem;
    }
    
    /* 成就星星区域移动端样式 */
    #achievement-area {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    /* 确保反馈容器不会被成就星星遮挡 */
    .feedback-container {
        margin-bottom: 2rem;
    }
}

/* Animation Classes */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

.bounce {
    animation: bounce 0.5s ease;
}

.pop {
    animation: pop 0.3s ease;
}

/* Visual Object Animations */
.visual-object {
    transition: all 0.3s ease;
    position: relative;
}

.visual-object:hover {
    transform: scale(1.1);
    cursor: pointer;
}

.visual-object.clicked {
    opacity: 0.5 !important;
    transform: scale(0.9) !important;
    filter: grayscale(0.3);
    border: 2px solid #4CAF50;
    border-radius: 8px;
    background-color: rgba(76, 175, 80, 0.1);
}

.visual-object.clicked:hover {
    opacity: 0.7 !important;
    transform: scale(0.95) !important;
    border-color: #FF6B6B;
    background-color: rgba(255, 107, 107, 0.1);
}

/* Additional Decorative Elements */
.game-container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 25px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    z-index: -1;
    opacity: 0.1;
} 