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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    overflow: hidden;
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    background: #0f0f23;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.3);
}

/* 重力控制按钮 */
#gravity-controls {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.gravity-btn {
    position: absolute;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.gravity-btn:active, .gravity-btn.active {
    background: rgba(0, 200, 255, 0.5);
    border-color: #00c8ff;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.6);
}

#btn-up { top: 10px; left: 50%; transform: translateX(-50%); }
#btn-down { bottom: 10px; left: 50%; transform: translateX(-50%); }
#btn-left { left: 10px; top: 50%; transform: translateY(-50%); }
#btn-right { right: 10px; top: 50%; transform: translateY(-50%); }

#btn-up.active { transform: translateX(-50%) scale(1.1); }
#btn-down.active { transform: translateX(-50%) scale(1.1); }
#btn-left.active { transform: translateY(-50%) scale(1.1); }
#btn-right.active { transform: translateY(-50%) scale(1.1); }

/* UI层 */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

#ui-layer button {
    pointer-events: auto;
}

#level-info, #stars {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.3);
    padding: 8px 15px;
    border-radius: 20px;
}

#ui-layer button {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

#ui-layer button:active {
    background: rgba(0, 200, 255, 0.5);
    transform: scale(0.95);
}

/* 屏幕 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(15, 15, 35, 0.85);
    backdrop-filter: blur(5px);
    z-index: 100;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    color: #00c8ff;
    font-size: 42px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 200, 255, 0.5);
}

.screen h2 {
    color: #00c8ff;
    font-size: 32px;
    margin-bottom: 20px;
}

.screen p {
    color: #aaa;
    font-size: 16px;
    max-width: 300px;
    text-align: center;
    margin-bottom: 40px;
    line-height: 1.6;
}

.btn-primary, .btn-secondary {
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    margin: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #00c8ff, #0099cc);
    color: #fff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:active, .btn-secondary:active {
    transform: scale(0.95);
}

/* 关卡选择 */
#level-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    max-width: 350px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

.level-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.level-btn.completed {
    background: linear-gradient(135deg, #00ff88, #00cc66);
}

.level-btn.current {
    border: 3px solid #00c8ff;
    box-shadow: 0 0 15px rgba(0, 200, 255, 0.5);
}

.level-btn.locked {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 过关星星 */
#win-stars {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.win-star {
    font-size: 40px;
    color: #444;
    transition: all 0.3s;
}

.win-star.active {
    color: #ffdd00;
    text-shadow: 0 0 20px rgba(255, 221, 0, 0.6);
    transform: scale(1.2);
}
