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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    overflow: hidden;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    padding: 20px;
    text-align: center;
    max-width: 700px;
    width: 95%;
}

h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 2.2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 15px 0;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    flex-wrap: wrap;
    gap: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.info-label {
    font-size: 0.8em;
    opacity: 0.9;
    margin-bottom: 3px;
}

.info-value {
    font-size: 1.1em;
    font-weight: bold;
}

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

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.game-board {
    margin: 15px auto;
    position: relative;
    background: linear-gradient(180deg, #87CEEB 0%, #98FB98 50%, #FFB6C1 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: inline-block;
}

#gameCanvas {
    display: block;
    background: transparent;
    cursor: crosshair;
}

.shooter-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.shooter {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.shooter::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #D2691E 0%, #CD853F 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.shooter::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 6px;
    height: 30px;
    background: #654321;
    transform: translateX(-50%);
    border-radius: 3px;
    transform-origin: bottom center;
    transition: transform 0.1s ease;
}

.current-bubble, .next-bubble {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

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

.current-bubble.shooting {
    animation: shootingPulse 0.2s ease;
}

@keyframes shootingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.bubble {
    position: absolute;
    border-radius: 50%;
    transition: all 0.1s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.bubble.popping {
    animation: bubblePop 0.3s 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 {
    from {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    to {
        transform: translateY(200px) rotate(360deg);
        opacity: 0;
    }
}

.bubble-red { background: radial-gradient(circle at 30% 30%, #ff6b6b, #ee5a52); }
.bubble-blue { background: radial-gradient(circle at 30% 30%, #74b9ff, #0984e3); }
.bubble-green { background: radial-gradient(circle at 30% 30%, #55a3ff, #00b894); }
.bubble-yellow { background: radial-gradient(circle at 30% 30%, #fdcb6e, #f39c12); }
.bubble-purple { background: radial-gradient(circle at 30% 30%, #a29bfe, #6c5ce7); }
.bubble-orange { background: radial-gradient(circle at 30% 30%, #fd79a8, #e17055); }
.bubble-pink { background: radial-gradient(circle at 30% 30%, #fd79a8, #e84393); }

.aim-line {
    position: absolute;
    width: 2px;
    background: rgba(255, 255, 255, 0.6);
    transform-origin: bottom center;
    pointer-events: none;
    border-radius: 1px;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

.score-popup {
    position: absolute;
    font-size: 20px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    animation: scorePopup 1s ease-out forwards;
    pointer-events: none;
    z-index: 100;
}

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

.combo-display {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: scale(0);
    transition: transform 0.3s ease;
}

.combo-display.visible {
    transform: scale(1);
    animation: comboPulse 0.5s ease;
}

@keyframes comboPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.instructions {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
    border-radius: 15px;
    color: white;
    text-align: left;
}

.instructions h3 {
    margin-bottom: 10px;
    font-size: 1.2em;
    text-align: center;
}

.instructions ul {
    margin-left: 20px;
    line-height: 1.6;
}

.instructions li {
    margin: 5px 0;
    font-size: 0.9em;
}

.game-over, .level-complete {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    z-index: 1000;
    animation: popupAppear 0.5s ease;
}

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

.game-over h2, .level-complete h2 {
    font-size: 2em;
    margin-bottom: 20px;
    animation: titleGlow 2s infinite;
}

@keyframes titleGlow {
    0%, 100% { color: #FFD700; }
    50% { color: #FFA500; }
}

.game-over-stats, .level-stats {
    margin: 20px 0;
    font-size: 1.1em;
}

.game-over-stats div, .level-stats div {
    margin: 8px 0;
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
        width: 98%;
        max-width: 500px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
        max-width: 400px;
        max-height: 500px;
    }
    
    .game-info {
        flex-direction: row;
        justify-content: space-between;
        gap: 5px;
    }
    
    .info-item {
        min-width: 50px;
    }
    
    .info-label {
        font-size: 0.7em;
    }
    
    .info-value {
        font-size: 1em;
    }
    
    .controls {
        flex-direction: row;
        gap: 8px;
    }
    
    button {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .shooter {
        width: 50px;
        height: 50px;
    }
    
    .current-bubble {
        width: 35px;
        height: 35px;
    }
    
    .next-bubble {
        width: 25px;
        height: 25px;
    }
    
    .instructions {
        text-align: center;
        padding: 12px;
    }
    
    .instructions ul {
        margin-left: 0;
        list-style-position: inside;
    }
    
    .instructions li {
        font-size: 0.8em;
    }
    
    .game-over, .level-complete {
        width: 90%;
        padding: 30px 20px;
    }
    
    .score-popup {
        font-size: 16px;
    }
    
    .combo-display {
        padding: 6px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #gameCanvas {
        max-width: 320px;
        max-height: 400px;
    }
    
    .info-item {
        min-width: 45px;
    }
    
    .info-label {
        font-size: 0.6em;
    }
    
    .info-value {
        font-size: 0.9em;
    }
    
    button {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .shooter {
        width: 45px;
        height: 45px;
    }
    
    .current-bubble {
        width: 30px;
        height: 30px;
    }
    
    .next-bubble {
        width: 22px;
        height: 22px;
    }
}