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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000;
    overflow: hidden;
}

@font-face {
    font-family: 'GameFont';
    src: url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap');
    font-display: swap;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2a6c 0%, #b21f1f 50%, #fdbb2d 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.overlay-content {
    text-align: center;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.18);
    max-width: 80%;
    animation: float 3s ease-in-out infinite;
}

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

.overlay-content h1 {
    font-size: 5rem;
    margin-bottom: 1rem;
    text-shadow: 0 4px 8px rgba(0,0,0,0.5);
    background: linear-gradient(90deg, #fff, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'GameFont', sans-serif;
    letter-spacing: 2px;
}

.overlay-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.overlay-content button {
    display: block;
    margin: 1rem auto;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    background: linear-gradient(90deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.overlay-content button:hover {
    background: linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.2));
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.5);
}

.overlay-content button:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    color: white;
    z-index: 100;
}

.score-display {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 0 4px 8px rgba(0,0,0,0.8);
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.score-display #score {
    font-size: 2.2rem;
    color: #ffd700;
    margin-right: 20px;
}

.score-display #distance {
    font-size: 1.5rem;
    opacity: 0.9;
}

.coins-display {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 0 4px 8px rgba(0,0,0,0.8);
    background: rgba(255, 215, 0, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.coins-display::before {
    content: '💰';
    font-size: 1.5rem;
}

.powerups {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 25px;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 25px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.powerup-slot {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.powerup-slot::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.powerup-slot:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .overlay-content {
        padding: 2rem;
        max-width: 90%;
    }
    
    .overlay-content h1 {
        font-size: 3rem;
    }
    
    .overlay-content p {
        font-size: 1.2rem;
    }
    
    .overlay-content button {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .score-display, .coins-display {
        font-size: 1.2rem;
        padding: 8px 15px;
    }
    
    .score-display #score {
        font-size: 1.5rem;
        margin-right: 10px;
    }
    
    .powerups {
        bottom: 20px;
        padding: 10px 20px;
        gap: 15px;
    }
    
    .powerup-slot {
        width: 50px;
        height: 50px;
    }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in forwards;
}

/* 添加游戏开始倒计时动画 */
.countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 4px 8px rgba(0,0,0,0.5);
    z-index: 2000;
    animation: countdown 1s ease-in-out forwards;
}

@keyframes countdown {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

/* 添加分数增加动画 */
.score-popup {
    position: absolute;
    color: #ffd700;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 1500;
    animation: scorePopup 1s ease-out forwards;
}

@keyframes scorePopup {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-50px); opacity: 0; }
}

.character-grid, .skin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin: 2rem 0;
}

.character-item, .skin-item {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 1.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.character-item::before, .skin-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shine 4s infinite;
}

.character-item:hover, .skin-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.5);
}

.character-preview, .skin-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.character-item:hover .character-preview,
.skin-item:hover .skin-preview {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.unlock-button {
    margin-top: 1.5rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.3));
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.unlock-button:hover {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.4), rgba(255, 165, 0, 0.4));
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.7);
}

@media (max-width: 768px) {
    .character-grid, .skin-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .character-item, .skin-item {
        padding: 1.2rem;
    }
    
    .character-preview, .skin-preview {
        width: 90px;
        height: 90px;
        font-size: 2rem;
    }
    
    .unlock-button {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

.tasks-list, .rewards-list, .achievements-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.task-item, .reward-item, .achievement-item {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 1.8rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.task-item::before, .reward-item::before, .achievement-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shine 5s infinite;
}

.task-item:hover, .reward-item:hover, .achievement-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.5);
}

.task-progress, .season-progress, .achievement-progress {
    margin: 1.2rem 0;
}

.progress-bar {
    width: 100%;
    height: 25px;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 0.8rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049, #3d8b40);
    border-radius: 12px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.claim-button {
    margin-top: 1.5rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.3), rgba(69, 160, 73, 0.3));
    border: 2px solid rgba(76, 175, 80, 0.5);
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.claim-button:hover {
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.4), rgba(69, 160, 73, 0.4));
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(76, 175, 80, 0.7);
}

.claim-button:disabled {
    background: rgba(255,255,255,0.1);
    cursor: not-allowed;
    transform: none;
    border-color: rgba(255,255,255,0.2);
    box-shadow: none;
}

.reward-item.locked {
    opacity: 0.6;
    filter: grayscale(50%);
}

.reward-item.unlocked {
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.1);
}

.achievement-item.completed {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.2);
}

.achievement-item.completed::before {
    content: '✓';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: #4CAF50;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.season-info {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 1.8rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.season-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}