/* 全局样式 - 儿童友好设计 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.5s ease-out;
}

.title {
    font-size: 28px;
    color: #ff6b6b;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.stars-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.3);
}

.star-count {
    font-weight: bold;
    color: #ff6b6b;
}

/* 项目区域 */
.game-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.5s ease-out;
    position: relative;
}

.game-section.locked {
    opacity: 0.6;
    filter: grayscale(0.5);
}

.game-title {
    font-size: 24px;
    color: #4ecdc4;
    margin-bottom: 8px;
    text-align: center;
}

.game-desc {
    text-align: center;
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

/* 关卡卡片 */
.level-card {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
}

.level-card:active {
    transform: scale(0.95);
}

.level-card:not(.locked):hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.level-card.locked {
    background: linear-gradient(135deg, #b0b0b0 0%, #8a8a8a 100%);
    cursor: not-allowed;
}

.level-number {
    font-size: 32px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.level-stars {
    font-size: 14px;
    margin-top: 5px;
}

.level-lock {
    position: absolute;
    font-size: 24px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.lock-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* 项目页面样式 */
.game-page {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.game-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.back-btn {
    font-size: 32px;
    cursor: pointer;
    transition: transform 0.2s;
}

.back-btn:active {
    transform: scale(0.9);
}

.game-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.level-title {
    font-size: 20px;
    color: #ff6b6b;
    font-weight: bold;
}

.timer {
    font-size: 24px;
    color: #4ecdc4;
    font-weight: bold;
}

/* 项目区域 */
.game-area {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 30px 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-instruction {
    font-size: 22px;
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-weight: bold;
}

.animals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 350px;
}

.animal-card {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border: 4px solid transparent;
}

.animal-card:active {
    transform: scale(0.95);
}

.animal-card.selected {
    border-color: #00b894;
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 184, 148, 0.4);
}

.animal-card.wrong {
    border-color: #d63031;
    background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
    animation: shake 0.5s;
}

.animal-card.correct {
    animation: bounce 0.6s;
}

/* 结果弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 25px;
    padding: 40px 30px;
    max-width: 90%;
    text-align: center;
    animation: popIn 0.3s ease-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #ff6b6b;
}

.modal-content p {
    font-size: 20px;
    margin-bottom: 25px;
    color: #666;
}

.star-rating {
    font-size: 48px;
    margin: 20px 0;
}

.btn {
    padding: 15px 40px;
    font-size: 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

/* 动画效果 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2) rotate(-10deg); }
    50% { transform: scale(1.3); }
    75% { transform: scale(1.2) rotate(10deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 响应式设计 */
@media (max-width: 360px) {
    .title {
        font-size: 24px;
    }
    
    .animals-grid {
        gap: 10px;
    }
    
    .animal-card {
        font-size: 48px;
    }
}

/* 禁止长按选择 */
.animal-card, .level-card, .btn {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

