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

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 50%, #6bcb77 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    width: 100vw;
    height: 100vh;
    max-width: 800px;
    max-height: 600px;
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

#start-screen h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

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

#start-screen p {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 30px;
}

.game-btn {
    padding: 15px 40px;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6);
}

.game-btn:active {
    transform: translateY(-1px);
}

#learn-screen h2 {
    font-size: 2rem;
    color: #666;
    margin-bottom: 30px;
}

.color-display {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
    animation: pulse 2s ease infinite;
}

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

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

.color-option {
    padding: 20px 30px;
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.color-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.color-option:active {
    transform: translateY(-2px);
}

.color-option.correct {
    animation: correctAnim 0.5s ease;
}

.color-option.wrong {
    animation: wrongAnim 0.5s ease;
}

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

@keyframes wrongAnim {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: bold;
    pointer-events: none;
    opacity: 0;
    z-index: 100;
}

.feedback.show {
    animation: feedbackAnim 1s ease forwards;
}

@keyframes feedbackAnim {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

#end-screen h1 {
    font-size: 3rem;
    color: #ff6b6b;
    margin-bottom: 20px;
}

#end-screen p {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 15px;
}

.final-score {
    font-size: 2rem !important;
    color: #6bcb77 !important;
    font-weight: bold;
    margin-bottom: 30px !important;
}

/* 颜色定义 */
.color-red { background: #ff6b6b; }
.color-yellow { background: #ffd93d; }
.color-blue { background: #4facfe; }
.color-green { background: #6bcb77; }
.color-orange { background: #ff8c42; }
.color-purple { background: #c9b1ff; }

/* 响应式设计 */
@media (max-width: 768px) {
    #start-screen h1 {
        font-size: 2rem;
    }

    #start-screen p {
        font-size: 1.2rem;
    }

    .color-display {
        width: 150px;
        height: 150px;
    }

    .color-options {
        gap: 15px;
    }

    .color-option {
        padding: 15px 20px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    #game-container {
        border-radius: 0;
    }

    #start-screen h1 {
        font-size: 1.5rem;
    }

    .color-display {
        width: 120px;
        height: 120px;
    }

    .color-options {
        grid-template-columns: 1fr;
        max-width: 300px;
    }

    .color-option {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* 庆祝动画 */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    animation: fall 3s linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(600px) rotate(720deg);
        opacity: 0;
    }
}
