/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* 背景粒子 */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* 游戏容器 */
.game-container {
    position: relative;
    width: 90vw;
    max-width: 600px;
    height: 90vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

/* 信息栏 */
.info-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 15px;
}

.score-panel {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.score-panel .label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-panel .score {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Canvas 画布 */
#gameCanvas {
    width: 100%;
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: block;
}

/* 遮罩层 */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s ease;
    border-radius: 20px;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 菜单面板 */
.menu-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.game-title {
    font-size: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-weight: bold;
}

.game-subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.pause-title, .gameover-title {
    font-size: 32px;
    margin-bottom: 30px;
    color: #333;
}

/* 最终分数显示 */
.final-score {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
}

.final-score p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 10px;
}

.score-big {
    color: #fff;
    font-size: 48px;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 按钮样式 */
.btn {
    padding: 15px 40px;
    font-size: 18px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    margin: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

/* 控制信息 */
.controls-info {
    margin-top: 30px;
    color: #666;
    font-size: 14px;
    line-height: 1.8;
}

.controls-info p:first-child {
    font-weight: bold;
    margin-bottom: 5px;
}

/* 游戏中控制按钮 */
.game-controls {
    position: absolute;
    top: 80px;
    right: 20px;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.game-controls.hidden {
    opacity: 0;
    pointer-events: none;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.control-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

.control-btn:active {
    transform: scale(0.95);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .game-container {
        width: 95vw;
        height: 95vh;
    }

    .menu-panel {
        padding: 30px 20px;
        max-width: 90%;
    }

    .game-title {
        font-size: 36px;
    }

    .btn {
        padding: 12px 30px;
        font-size: 16px;
    }

    .score-panel .score {
        font-size: 24px;
    }

    .info-bar {
        gap: 10px;
        margin-bottom: 10px;
    }

    .score-panel {
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 28px;
    }

    .score-big {
        font-size: 36px;
    }

    .pause-title, .gameover-title {
        font-size: 24px;
    }
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 震动动画 */
@keyframes shake {
    0%, 100% { transform: translate(0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-5px, 0); }
    20%, 40%, 60%, 80% { transform: translate(5px, 0); }
}

.shake {
    animation: shake 0.5s ease;
}
