/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: manipulation;
}

body {
    font-family: 'Arial', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url('../assets/images/background.jpeg') no-repeat center center fixed;
    background-size: cover;
    padding: 10px;
}

/* 游戏容器 */
.game-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 12px;
    width: 100%;
    max-width: 260px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* 头部区域 */
.header {
    margin-bottom: 8px;
}

h1 {
    color: #333;
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 6px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stats {
    font-size: 0.75rem;
    line-height: 1.3;
}

.stats div {
    margin-bottom: 2px;
}

.next-piece {
    text-align: center;
    font-size: 0.75rem;
}

#nextPieceCanvas {
    width: 50px;
    height: 50px;
    margin-top: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

/* 游戏画布 */
#gameCanvas {
    background: rgba(0, 0, 0, 0.1);
    display: block;
    width: 100%;
    height: 300px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* 控制面板 */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.main-controls, .game-controls {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

button {
    padding: 4px 6px;
    font-size: 0.75rem;
    min-width: 45px;
    border: none;
    border-radius: 3px;
    color: white;
    cursor: pointer;
}

#startBtn { background: #4CAF50; }
#pauseBtn { background: #f44336; }
#restartBtn { background: #2196F3; }
#backBtn { background: #9C27B0; }
#rotateBtn { background: #FF9800; }
#leftBtn, #mobileLeftBtn { background: #607D8B; }
#rightBtn, #mobileRightBtn { background: #607D8B; }
#downBtn, #mobileDownBtn { background: #795548; }
#dropBtn { background: #E91E63; }

/* 移动端触摸控制 */
.touch-controls {
    display: none;
    margin-top: 10px;
    user-select: none;
    justify-content: center;
}

.arrow {
    background: rgba(0, 0, 0, 0.15);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    margin: 3px;
}

.arrow-row {
    display: flex;
    justify-content: center;
}

.up {
    margin: 0 auto 3px;
}

/* 响应式设计 */
@media (max-width: 400px) {
    .game-container {
        padding: 8px;
    }
    
    .game-controls {
        display: none;
    }
    
    .touch-controls {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}