/* 气泡消除游戏样式 */
.game-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    z-index: -1;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header-content h1 {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-subtitle {
    font-size: 1.2em;
    margin: 0;
    opacity: 0.9;
}

.score-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.score-box {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-width: 80px;
}

.score-label {
    font-size: 0.9em;
    margin-bottom: 5px;
    opacity: 0.9;
}

.score-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.best-score {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
}

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

.button {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

.button.secondary {
    background: linear-gradient(45deg, #fa709a 0%, #fee140 100%);
    box-shadow: 0 4px 15px rgba(250, 112, 154, 0.3);
}

.button.secondary:hover {
    box-shadow: 0 8px 25px rgba(250, 112, 154, 0.4);
}

.button.third {
    background: linear-gradient(45deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
    box-shadow: 0 4px 15px rgba(168, 237, 234, 0.3);
}

.button.third:hover {
    box-shadow: 0 8px 25px rgba(168, 237, 234, 0.4);
}

.game-board-container {
    position: relative;
    margin: 30px auto;
    max-width: 500px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bubble {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.bubble:hover {
    transform: scale(1.1);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.bubble.selected {
    transform: scale(1.15);
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8),
        0 4px 15px rgba(0, 0, 0, 0.3);
    animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); }
    to { box-shadow: 0 0 30px rgba(255, 255, 255, 1); }
}

.bubble.removing {
    animation: bubblePop 0.5s ease-out forwards;
}

@keyframes bubblePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(0); opacity: 0; }
}

.bubble.falling {
    animation: bubbleFall 0.5s ease-in forwards;
}

@keyframes bubbleFall {
    to { transform: translateY(500px); opacity: 0; }
}

/* 气泡颜色 */
.bubble.red { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%); }
.bubble.blue { background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%); }
.bubble.green { background: linear-gradient(135deg, #45b7d1 0%, #96c93d 100%); }
.bubble.yellow { background: linear-gradient(135deg, #f7b733 0%, #fc4a1a 100%); }
.bubble.purple { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.bubble.orange { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }

/* 游戏覆盖层 */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.overlay-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.overlay-content h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 2em;
}

.final-score, .level-info {
    margin: 15px 0;
    font-size: 1.2em;
    color: #555;
}

.final-score span:last-child,
.level-info span:last-child {
    font-weight: bold;
    color: #4facfe;
    font-size: 1.5em;
}

.new-record {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    margin: 15px 0;
    font-weight: bold;
    animation: celebrate 0.5s ease-in-out infinite alternate;
}

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

.game-over-buttons,
.level-complete-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.level-complete-info {
    margin: 20px 0;
}

.level-complete-info p {
    margin: 10px 0;
    font-size: 1.1em;
    color: #555;
}

/* 游戏说明 */
.game-instructions {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 15px;
    margin-top: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-instructions h3,
.game-instructions h4 {
    color: white;
    text-align: center;
    margin-bottom: 20px;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

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

.instruction-icon {
    font-size: 2em;
    min-width: 50px;
    text-align: center;
}

.instruction-text {
    color: white;
    line-height: 1.4;
}

.instruction-text strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.game-tips ul {
    color: white;
    padding-left: 20px;
    line-height: 1.6;
}

.game-tips li {
    margin-bottom: 8px;
}

.color-guide {
    margin-top: 20px;
}

.color-samples {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.color-sample {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 0.8em;
}

/* 粒子效果和增强动画 */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
}

.particle-red { background: #ff6b6b; }
.particle-blue { background: #42a5f5; }
.particle-green { background: #66bb6a; }
.particle-yellow { background: #ffeb3b; }
.particle-purple { background: #ab47bc; }
.particle-orange { background: #ff7043; }

.particle-explosion {
    animation: particleExplode 1.2s ease-out forwards;
}

@keyframes particleExplode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx, 50px), var(--dy, 50px)) scale(0);
        opacity: 0;
    }
}

/* 连击效果 */
.combo-text {
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3em;
    font-weight: bold;
    color: #ff6b6b;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    z-index: 1000;
    pointer-events: none;
    animation: comboAnimation 2s ease-out forwards;
}

@keyframes comboAnimation {
    0% {
        transform: translateX(-50%) scale(0) rotate(-180deg);
        opacity: 0;
    }
    30% {
        transform: translateX(-50%) scale(1.2) rotate(0deg);
        opacity: 1;
    }
    70% {
        transform: translateX(-50%) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scale(0.8) rotate(0deg) translateY(-50px);
        opacity: 0;
    }
}

/* 浮动分数动画 */
.floating-score {
    position: absolute;
    font-size: 1.5em;
    font-weight: bold;
    color: #4facfe;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    z-index: 1000;
    pointer-events: none;
    animation: floatingScore 2s ease-out forwards;
}

@keyframes floatingScore {
    0% {
        transform: scale(0.5) translateY(0);
        opacity: 0;
    }
    20% {
        transform: scale(1.2) translateY(-10px);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(-100px);
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        margin: 10px;
        padding: 15px;
    }
    
    .header-content h1 {
        font-size: 2em;
    }
    
    .score-container {
        gap: 10px;
    }
    
    .score-box {
        padding: 12px 18px;
        min-width: 70px;
    }
    
    .score-value {
        font-size: 1.4em;
    }
    
    .game-board {
        padding: 20px;
        gap: 3px;
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .color-samples {
        gap: 10px;
    }
    
    .color-sample {
        width: 50px;
        height: 50px;
        font-size: 0.7em;
    }
    
    .overlay-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .combo-text {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .game-board {
        grid-template-columns: repeat(8, 1fr);
        padding: 15px;
    }
    
    .header-content h1 {
        font-size: 1.8em;
    }
    
    .score-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .button {
        width: 200px;
    }
    
    .combo-text {
        font-size: 1.5em;
    }
}