/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* 主要容器布局 */
#main-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    gap: 30px;
}

/* 游戏容器 */
#game-container {
    position: relative;
    width: min(90vw, 600px);
    height: min(90vw, 600px);
    max-width: 600px;
    max-height: 600px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 18px;
}

/* 游戏状态显示 */
#text-container {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 18px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    z-index: 10;
}

#timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(48px, 12vw, 120px);
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    z-index: 10;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#health {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 18px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    z-index: 10;
    color: #ff6b6b;
}

/* 游戏规则容器 */
#rules-container {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

#rules-container h2 {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(45deg, #feca57, #ff9ff3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#rules-container ul {
    list-style: none;
    padding: 0;
    margin-bottom: 25px;
}

#rules-container li {
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
    font-size: 16px;
    line-height: 1.6;
}

#rules-container li::before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #feca57;
    font-size: 14px;
}

/* 难度选择器 */
#rules-container > div {
    margin-bottom: 20px;
    text-align: center;
}

#rules-container label {
    font-size: 16px;
    font-weight: 600;
    margin-right: 10px;
}

#difficulty-select {
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    backdrop-filter: blur(5px);
    cursor: pointer;
}

#difficulty-select option {
    background: #333;
    color: #fff;
}

/* 按钮容器 */
#button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

#button-container button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    border-radius: 25px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

#button-container button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #764ba2, #667eea);
}

#button-container button:active:not(:disabled) {
    transform: translateY(0);
}

#button-container button:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 版权信息 */
#copyright {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    z-index: 1000;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    #main-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    #game-container {
        width: min(90vw, 500px);
        height: min(90vw, 500px);
    }
    
    #rules-container {
        max-width: 500px;
        width: 90%;
    }
}

@media (max-width: 768px) {
    #main-container {
        padding: 15px;
        gap: 15px;
    }
    
    #game-container {
        width: min(95vw, 350px);
        height: min(95vw, 350px);
    }
    
    #rules-container {
        padding: 20px;
        width: 95%;
    }
    
    #button-container {
        flex-direction: column;
        align-items: center;
    }
    
    #button-container button {
        width: 100%;
        max-width: 200px;
    }
    
    #text-container, #health {
        font-size: 14px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    #main-container {
        padding: 10px;
        gap: 10px;
    }
    
    #game-container {
        width: min(98vw, 300px);
        height: min(98vw, 300px);
    }
    
    #rules-container {
        padding: 15px;
    }
    
    #rules-container h2 {
        font-size: 20px;
    }
    
    #rules-container li {
        font-size: 14px;
    }
    
    #text-container, #health {
        font-size: 12px;
        padding: 4px 8px;
    }
}