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

body {
    font-family: 'Arial', sans-serif;
    background-color: #000;
    overflow: hidden;
    touch-action: none;
}

/* 游戏容器 */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #111;
}

/* 加载屏幕 */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-content h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: #9e9eff;
    text-shadow: 0 0 10px rgba(158, 158, 255, 0.7);
}

.loading-bar-container {
    width: 300px;
    height: 20px;
    background-color: #222;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 1rem;
}

#loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #5e5eff, #9e9eff);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* 开始屏幕 */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #1a1a2e 0%, #0f0f1a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 90;
}

.start-content {
    text-align: center;
    color: #fff;
}

.start-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #9e9eff;
    text-shadow: 0 0 15px rgba(158, 158, 255, 0.7);
}

.start-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #ccc;
}

button {
    background: linear-gradient(135deg, #5e5eff, #9e9eff);
    border: none;
    border-radius: 25px;
    color: white;
    padding: 12px 30px;
    margin: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(158, 158, 255, 0.5);
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(158, 158, 255, 0.8);
}

/* 设置菜单 */
#settings-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 95;
}

.settings-content {
    background-color: #1a1a2e;
    padding: 2rem;
    border-radius: 15px;
    width: 80%;
    max-width: 500px;
    color: #fff;
}

.settings-content h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #9e9eff;
}

.setting-item {
    margin-bottom: 1.5rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.setting-item input[type="range"] {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #9e9eff;
    border-radius: 50%;
    cursor: pointer;
}

.setting-item select {
    width: 100%;
    padding: 8px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
}

/* 游戏UI */
#game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 80;
}

#fragments-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 1.1rem;
    pointer-events: none;
}

#pause-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    pointer-events: auto;
}

/* 移动设备控制 */
#mobile-controls {
    position: absolute;
    bottom: 50px;
    left: 50px;
    pointer-events: auto;
}

#touch-joystick {
    width: 120px;
    height: 120px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    position: relative;
}

/* 暂停菜单 */
#pause-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 85;
}

.pause-content {
    background-color: #1a1a2e;
    padding: 2rem;
    border-radius: 15px;
    width: 80%;
    max-width: 400px;
    text-align: center;
    color: #fff;
}

.pause-content h2 {
    margin-bottom: 1.5rem;
    color: #9e9eff;
}

/* 记忆显示 */
#memory-display {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 85;
}

#memory-content {
    width: 80%;
    max-width: 800px;
    background-color: rgba(26, 26, 46, 0.9);
    padding: 2rem;
    border-radius: 15px;
    color: #fff;
    text-align: center;
}

/* 通用类 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .loading-content h1, .start-content h1 {
        font-size: 2.5rem;
    }
    
    .start-content p {
        font-size: 1.2rem;
    }
    
    button {
        padding: 10px 25px;
        font-size: 1rem;
    }
    
    .loading-bar-container {
        width: 250px;
    }
}

@media (max-width: 480px) {
    .loading-content h1, .start-content h1 {
        font-size: 2rem;
    }
    
    .start-content p {
        font-size: 1rem;
    }
    
    button {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
    
    .loading-bar-container {
        width: 200px;
    }
}
