/* 基础样式设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    background-attachment: fixed;
    font-family: 'Inter', system-ui, sans-serif;
    color: #F9FAFB;
    overflow-x: hidden;
}

/* 按钮效果增强 */
button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

button:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

button:active::after {
    animation: ripple 0.5s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(100, 100);
        opacity: 0;
    }
}

/* 滑动条样式 */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 10px;
    background: #111827;
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #2563EB;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #1D4ED8;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #2563EB;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #1D4ED8;
    transform: scale(1.1);
}

/* 难度按钮激活状态 */
.difficulty-btn.active {
    background-color: #2563EB;
    border-color: #2563EB;
    color: white;
}

/* 复选框样式 */
input[type="checkbox"] {
    accent-color: #2563EB;
}

/* 游戏画布容器样式 */
.canvas-container {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

/* 玻璃态效果增强 */
.glass-effect {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* 游戏标题动画 */
h1 {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    #controlsHint {
        font-size: 0.9rem;
    }
    
    .btn-hover {
        font-size: 1rem !important;
    }
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#startMenu,
#settingsMenu,
#gameOverMenu {
    animation: fadeIn 0.4s ease-out;
}

/* 游戏元素过渡效果 */
#pauseOverlay,
#gameArea,
#startMenu,
#settingsMenu,
#gameOverMenu {
    transition: all 0.3s ease-in-out;
}

/* 禁用文本选择 */
button, canvas, .no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #374151;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}