/* Color Clash Game Styles */

.game-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.game-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    color: white;
    backdrop-filter: blur(15px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

.game-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shine 3s infinite;
    pointer-events: none;
}

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

.header-content h1 {
    margin: 0 0 15px 0;
    font-size: 3em;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    background: linear-gradient(45deg, #fff, #f0f8ff, #e6e6fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { 
        text-shadow: 2px 2px 8px rgba(0,0,0,0.5), 0 0 20px rgba(255,255,255,0.3);
        filter: brightness(1);
    }
    to { 
        text-shadow: 2px 2px 8px rgba(0,0,0,0.5), 0 0 30px rgba(255,255,255,0.6);
        filter: brightness(1.1);
    }
}

.header-content p {
    margin: 0;
    opacity: 0.95;
    font-size: 1.1em;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.game-controls {
    margin: 20px 0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.game-controls .button {
    margin: 0;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: 2px solid rgba(255,255,255,0.2);
}

.game-controls .button.secondary {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.game-controls .button.third {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.game-controls .button:disabled {
    background: linear-gradient(135deg, #ccc, #999);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.game-controls .button:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.color-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

.color-selector label {
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.color-select {
    padding: 8px 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-weight: bold;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.color-select option {
    padding: 5px;
    font-weight: bold;
}

.score-display {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    font-weight: bold;
    font-size: 16px;
    margin-top: 15px;
}

.score-display span {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.score-display span:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.game-area {
    position: relative;
    text-align: center;
    margin-bottom: 25px;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 20px;
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.1);
}

#gameCanvas {
    border: 4px solid #333;
    border-radius: 15px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 50%, #fff3e0 100%);
    box-shadow: 
        0 8px 25px rgba(0,0,0,0.15),
        inset 0 2px 10px rgba(255,255,255,0.8);
    max-width: 100%;
    height: auto;
    transition: all 0.3s ease;
}

#gameCanvas:hover {
    box-shadow: 
        0 12px 35px rgba(0,0,0,0.2),
        inset 0 2px 10px rgba(255,255,255,0.8);
    transform: translateY(-2px);
}

.game-over, .level-complete {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(0,0,0,0.9), rgba(30,30,30,0.95));
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: modalAppear 0.5s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.new-record, .perfect-game, .level-perfect {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #333;
    padding: 10px 20px;
    border-radius: 10px;
    margin: 15px 0;
    font-weight: bold;
    animation: celebrate 1s ease-in-out infinite alternate;
}

@keyframes celebrate {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.game-instructions {
    background: rgba(255,255,255,0.1);
    padding: 25px;
    border-radius: 15px;
    margin-top: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.game-instructions h3 {
    color: white;
    margin-top: 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.game-instructions ul {
    color: white;
    opacity: 0.9;
    list-style-type: none;
    padding-left: 0;
}

.game-instructions li {
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.game-instructions li:before {
    content: '🎮 ';
    margin-right: 8px;
}

.color-guide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.1);
    padding: 12px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
}

.color-ball {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.color-ball.red { background-color: #ff4444; }
.color-ball.blue { background-color: #4444ff; }
.color-ball.green { background-color: #44ff44; }
.color-ball.yellow { background-color: #ffff44; }
.color-ball.purple { background-color: #ff44ff; }
.color-ball.orange { background-color: #ff8844; }

.color-item span {
    color: white;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.game-message, .error-message {
    background: rgba(255,255,255,0.15);
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

.game-message h3, .error-message h3 {
    color: white;
    margin-top: 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.game-message p, .error-message p {
    color: white;
    opacity: 0.9;
    margin: 8px 0;
}

.error-message {
    background: rgba(255,69,58,0.15);
    border-color: rgba(255,69,58,0.5);
}

.saved-data, .level-bonus, .collision-stats {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid rgba(255,255,255,0.2);
}

.saved-data p, .level-bonus p, .collision-stats p {
    margin: 5px 0;
    font-size: 14px;
}

.saved-data span, .level-bonus span, .collision-stats span {
    font-weight: bold;
    color: #ffd700;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        margin: 10px;
        padding: 15px;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .color-selector {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .score-display {
        gap: 15px;
        font-size: 14px;
    }
    
    .score-display span {
        padding: 6px 12px;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
    
    .header-content h1 {
        font-size: 2em;
    }
    
    .color-guide {
        grid-template-columns: 1fr;
    }
    
    .game-over, .level-complete {
        padding: 20px;
        max-width: 90%;
    }
}