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

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 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: 2.5rem;
    color: #667eea;
    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.2rem;
    color: #666;
    margin-bottom: 30px;
}

.game-btn {
    padding: 15px 40px;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

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

/* 游戏画面 */
.game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 15px 20px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    margin-bottom: 20px;
}

.drop-zone {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 15px;
    margin-bottom: 20px;
}

.target {
    width: 120px;
    height: 120px;
    background: white;
    border: 3px dashed #667eea;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
    cursor: pointer;
}

.target.highlight {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    transform: scale(1.05);
}

.target-outline {
    width: 80px;
    height: 80px;
    opacity: 0.5;
}

.target-outline.circle {
    background: #667eea;
    border-radius: 50%;
}

.target-outline.square {
    background: #f093fb;
    border-radius: 10px;
}

.target-outline.triangle {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 80px solid #f5576c;
    background: transparent;
    border-radius: 0;
}

.target-outline.star {
    width: 80px;
    height: 80px;
    background: #4facfe;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    border-radius: 0;
}

.draggables {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 20px;
    min-height: 120px;
}

.draggable {
    width: 100px;
    height: 100px;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
    touch-action: none;
}

.draggable:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.draggable.circle {
    background: #667eea;
    border-radius: 50%;
}

.draggable.square {
    background: #f093fb;
    border-radius: 15px;
}

.draggable.triangle {
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 100px solid #f5576c;
    background: transparent;
}

.draggable.star {
    background: #4facfe;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.draggable.matched {
    opacity: 0;
    transform: scale(0);
    transition: all 0.5s;
}

/* 反馈信息 */
.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: #f5576c;
    margin-bottom: 20px;
}

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

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

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

    .drop-zone {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .target {
        width: 90px;
        height: 90px;
    }

    .target-outline {
        width: 60px;
        height: 60px;
    }

    .target-outline.triangle {
        border-left-width: 30px;
        border-right-width: 30px;
        border-bottom-width: 60px;
    }

    .draggable {
        width: 70px;
        height: 70px;
    }

    .draggable.triangle {
        border-left-width: 35px;
        border-right-width: 35px;
        border-bottom-width: 70px;
    }

    .game-info {
        font-size: 1rem;
        padding: 10px;
    }
}

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

    .drop-zone {
        gap: 8px;
    }

    .target {
        width: 70px;
        height: 70px;
    }

    .target-outline {
        width: 50px;
        height: 50px;
    }

    .target-outline.triangle {
        border-left-width: 25px;
        border-right-width: 25px;
        border-bottom-width: 50px;
    }

    .draggable {
        width: 60px;
        height: 60px;
    }

    .draggable.triangle {
        border-left-width: 30px;
        border-right-width: 30px;
        border-bottom-width: 60px;
    }
}

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

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