/* 泡泡龙游戏样式 */

:root {
    --bubble-red-color: #ff6b6b;
    --bubble-blue-color: #4ecdc4;
    --bubble-green-color: #95e1d3;
    --bubble-yellow-color: #f9ca24;
    --bubble-purple-color: #a29bfe;
    --bubble-orange-color: #fd79a8;
}

.game-container {
    max-width: 1200px;
    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: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.game-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.header-content h1 {
    color: white;
    margin: 0;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #fff, #e3f2fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin: 10px 0 0;
    font-size: 1.1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

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

.score-box {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-width: 80px;
}

.score-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.score-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    margin-bottom: 5px;
    font-weight: 500;
}

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

.best-score .score-value {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.button:hover::before {
    left: 100%;
}

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

.button.secondary {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.button.secondary:hover {
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
}

.button.third {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.game-board-container {
    position: relative;
    margin: 30px auto;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 瞄准线画布 */
.aim-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0.8;
}

.game-board {
    position: relative;
    width: 100%;
    height: 500px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.05) 100%);
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: crosshair;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 射击器样式 */
.shooter-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.shooter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.current-bubble, .next-bubble {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    background-clip: padding-box;
}

.current-bubble {
    width: 50px;
    height: 50px;
    border-width: 4px;
    animation: shooterPulse 2s ease-in-out infinite;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 
                0 0 15px rgba(255, 255, 255, 0.3),
                inset 0 3px 6px rgba(255, 255, 255, 0.4);
}

@keyframes shooterPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 
                    0 0 15px rgba(255, 255, 255, 0.3),
                    inset 0 3px 6px rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 
                    0 0 25px rgba(255, 255, 255, 0.5),
                    inset 0 4px 8px rgba(255, 255, 255, 0.5);
    }
}

.current-bubble:hover {
    transform: scale(1.2) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(255, 255, 255, 0.6),
                inset 0 4px 8px rgba(255, 255, 255, 0.6) !important;
    animation: none;
    border-color: rgba(255, 255, 255, 1);
}

.next-bubble {
    width: 30px;
    height: 30px;
    border-width: 2px;
    opacity: 0.8;
}

/* 泡泡颜色 */
.bubble, .current-bubble, .next-bubble {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bubble::before, .current-bubble::before, .next-bubble::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 20%;
    width: 30%;
    height: 30%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), transparent 70%);
    border-radius: 50%;
}

.red, .bubble.red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #e63946);
}

.blue, .bubble.blue {
    background: radial-gradient(circle at 30% 30%, #4ecdc4, #457b9d);
}

.green, .bubble.green {
    background: radial-gradient(circle at 30% 30%, #95e1d3, #2d6a4f);
}

.yellow, .bubble.yellow {
    background: radial-gradient(circle at 30% 30%, #f9ca24, #f0932b);
}

.purple, .bubble.purple {
    background: radial-gradient(circle at 30% 30%, #a29bfe, #6c5ce7);
}

.orange, .bubble.orange {
    background: radial-gradient(circle at 30% 30%, #fd79a8, #e84393);
}

/* 游戏中的泡泡 */
.bubble {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bubble:hover {
    transform: scale(1.15);
    z-index: 5;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.4);
}

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

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

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

@keyframes bubbleFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(600px) rotate(360deg);
        opacity: 0;
    }
}

/* 射击中的泡泡 */
.shooting-bubble {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    position: absolute;
    z-index: 15;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.shooting-bubble.shooting-active {
    animation: shootingPulse 0.1s ease-in-out infinite alternate;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 4px 15px rgba(0, 0, 0, 0.4);
}

@keyframes shootingPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

/* 确保射击泡泡也有颜色样式 */
.shooting-bubble.red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #e63946);
    border-color: rgba(255, 107, 107, 0.6);
}

.shooting-bubble.blue {
    background: radial-gradient(circle at 30% 30%, #4ecdc4, #457b9d);
    border-color: rgba(78, 205, 196, 0.6);
}

.shooting-bubble.green {
    background: radial-gradient(circle at 30% 30%, #95e1d3, #2d6a4f);
    border-color: rgba(149, 225, 211, 0.6);
}

.shooting-bubble.yellow {
    background: radial-gradient(circle at 30% 30%, #f9ca24, #f0932b);
    border-color: rgba(249, 202, 36, 0.6);
}

.shooting-bubble.purple {
    background: radial-gradient(circle at 30% 30%, #a29bfe, #6c5ce7);
    border-color: rgba(162, 155, 254, 0.6);
}

.shooting-bubble.orange {
    background: radial-gradient(circle at 30% 30%, #fd79a8, #e84393);
    border-color: rgba(253, 121, 168, 0.6);
}

.shooting-bubble::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 25%;
    width: 25%;
    height: 25%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), transparent 70%);
    border-radius: 50%;
}

/* Enhanced visual effects animations */
@keyframes shootFlash {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

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

@keyframes trailFade {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.3);
    }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

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

.overlay-content {
    background: linear-gradient(145deg, #667eea, #764ba2);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    margin: 20px;
}

.overlay-content h2 {
    margin: 0 0 20px;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.final-score, .level-info {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    font-size: 1.2em;
}

.new-record {
    color: #ffd700;
    font-size: 1.5em;
    font-weight: bold;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

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

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

.game-instructions h3 {
    color: white;
    margin: 0 0 20px;
    font-size: 1.5em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

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

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.instruction-text {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

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

.game-tips h4 {
    color: white;
    margin: 0 0 15px;
    font-size: 1.2em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.game-tips ul {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    margin: 0;
    padding-left: 20px;
}

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

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

.color-guide h4 {
    color: white;
    margin: 0 0 15px;
    font-size: 1.2em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

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

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

.color-sample::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 25%;
    width: 25%;
    height: 25%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), transparent 70%);
    border-radius: 50%;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        margin: 10px;
        padding: 15px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .header-content h1 {
        font-size: 2em;
    }
    
    .score-container {
        justify-content: center;
    }
    
    .game-board-container {
        margin: 20px auto;
        padding: 15px;
    }
    
    .game-board {
        height: 400px;
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .instruction-item {
        padding: 15px;
    }
    
    .game-over-buttons, .level-complete-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .button {
        width: 200px;
    }
}

/* 粒子效果 */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 50;
}

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

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