/* 像素弹球 - 像素风格样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

@font-face {
    font-family: 'PixelFont';
    src: local('Press Start 2P'), local('Courier New');
}

body {
    background-color: #1a1a2e;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.overlay {
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
}

.overlay-content {
    text-align: center;
    padding: 30px;
    background: linear-gradient(180deg, #2d2d44 0%, #1a1a2e 100%);
    border: 4px solid #4a9eff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.5),
                inset 0 0 20px rgba(74, 158, 255, 0.1);
}

.overlay-content h2 {
    color: #4a9eff;
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #000,
                 0 0 10px rgba(74, 158, 255, 0.8);
}

.overlay-content p {
    color: #fff;
    font-size: 18px;
    margin-bottom: 15px;
}

/* 像素标题 */
.pixel-title {
    font-size: clamp(32px, 8vw, 64px);
    color: #ffcc00;
    text-shadow: 
        4px 4px 0 #ff6600,
        -2px -2px 0 #ff3333,
        0 0 20px rgba(255, 204, 0, 0.8),
        0 0 40px rgba(255, 204, 0, 0.4);
    margin-bottom: 10px;
    letter-spacing: 4px;
    animation: titlePulse 2s ease-in-out infinite;
}

.pixel-subtitle {
    font-size: clamp(14px, 3vw, 24px);
    color: #4a9eff;
    letter-spacing: 8px;
    margin-bottom: 40px;
    text-shadow: 0 0 10px rgba(74, 158, 255, 0.8);
}

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

/* 像素按钮 */
.pixel-btn {
    font-family: 'Courier New', monospace;
    font-size: clamp(16px, 4vw, 24px);
    padding: 15px 40px;
    margin: 10px;
    background: linear-gradient(180deg, #4a9eff 0%, #2563eb 100%);
    color: #fff;
    border: 4px solid #1e40af;
    border-radius: 4px;
    cursor: pointer;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 
        0 4px 0 #1e40af,
        0 6px 10px rgba(0, 0, 0, 0.5);
    transition: all 0.1s;
    min-width: 200px;
}

.pixel-btn:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 0 #1e40af,
        0 8px 15px rgba(0, 0, 0, 0.5);
}

.pixel-btn:active {
    transform: translateY(2px);
    box-shadow: 
        0 2px 0 #1e40af,
        0 4px 5px rgba(0, 0, 0, 0.5);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.high-score-display {
    font-size: clamp(14px, 3vw, 20px);
    color: #ffcc00;
    text-shadow: 2px 2px 0 #000;
}

/* 游戏HUD */
#game-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    border-bottom: 3px solid #4a9eff;
    z-index: 10;
}

.hud-left, .hud-center, .hud-right {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-label {
    font-size: clamp(10px, 2vw, 14px);
    color: #888;
    margin-bottom: 2px;
}

.hud-value {
    font-size: clamp(16px, 4vw, 24px);
    color: #fff;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
}

#lives {
    font-size: clamp(14px, 3vw, 20px);
}

/* 游戏画布 */
#game-canvas {
    display: block;
    background: transparent;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* 道具指示器 */
#powerup-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #4a9eff;
    border-radius: 4px;
    z-index: 10;
}

#powerup-text {
    color: #ffcc00;
    font-size: clamp(12px, 2.5vw, 16px);
    text-shadow: 1px 1px 0 #000;
}

/* 响应式调整 */
@media (max-width: 600px) {
    .pixel-btn {
        min-width: 160px;
        padding: 12px 30px;
    }
    
    #game-hud {
        padding: 8px 10px;
    }
    
    .overlay-content {
        padding: 20px;
        margin: 20px;
    }
}

@media (max-height: 500px) {
    .pixel-title {
        margin-bottom: 5px;
    }
    
    .pixel-subtitle {
        margin-bottom: 20px;
    }
    
    .pixel-btn {
        padding: 10px 30px;
        margin: 5px;
    }
}

/* 横屏模式 */
@media (orientation: landscape) and (max-height: 500px) {
    #game-hud {
        padding: 5px 20px;
    }
    
    .hud-label {
        display: none;
    }
    
    .hud-value {
        font-size: 16px;
    }
}

/* 触控反馈 */
.pixel-btn.touching {
    transform: translateY(2px);
    box-shadow: 
        0 2px 0 #1e40af,
        0 4px 5px rgba(0, 0, 0, 0.5);
}

/* 禁用选择 */
.screen, .pixel-btn, #game-canvas {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 星星背景效果 */
#game-container::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 160px 120px, #fff, transparent);
    background-size: 200px 200px;
    animation: starTwinkle 4s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.5;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}
