/*!
 * 俄罗斯方块游戏样式文件
 * 基于现代CSS的最佳实践设计
 */

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

/* 页面主体样式 */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    overflow: hidden;
}

/* 游戏容器 */
.game-container {
    text-align: center;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    position: relative;
}

/* 标题样式 */
h1 {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: 0;
    font-size: 2.5em;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 游戏区域布局 */
.game-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
}

/* 游戏画布 */
.game-board {
    border: 3px solid #444;
    background-color: #111;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 5px;
}

/* 侧边栏 */
.side-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    width: 150px;
}

/* 信息面板 */
.info-panel {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* 下一个方块容器 */
.next-piece-container {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
}

/* 下一个方块标题 */
.next-piece-title {
    margin-top: 0;
    font-size: 1.1em;
}

/* 下一个方块画布 */
.next-piece-canvas {
    background-color: #111;
    border: 2px solid #444;
    border-radius: 4px;
}

/* 得分板 */
.score-board {
    font-size: 1.2em;
    font-weight: bold;
    margin: 8px 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 控制按钮区域 */
.controls {
    margin: 15px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* 按钮样式 */
button {
    padding: 10px 20px;
    font-size: 16px;
    background: linear-gradient(to bottom, #4CAF50, #2E7D32);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin: 0 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    min-width: 120px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    background: linear-gradient(to bottom, #66BB6A, #388E3C);
}

button:active {
    transform: translateY(1px);
}

/* 音效按钮特殊样式 */
#soundBtn {
    background: linear-gradient(to bottom, #2196F3, #0D47A1);
}

#soundBtn:hover {
    background: linear-gradient(to bottom, #42A5F5, #1565C0);
}

#soundBtn.muted {
    background: linear-gradient(to bottom, #f44336, #b71c1c);
}

#soundBtn.muted:hover {
    background: linear-gradient(to bottom, #ef5350, #c62828);
}

/* 操作说明 */
.instructions {
    margin-top: 15px;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
}

/* 游戏结束弹窗 */
.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    display: none;
    z-index: 10;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border: 2px solid #ff5252;
    min-width: 300px;
}

.game-over h2 {
    margin-top: 0;
    color: #FF5252;
    font-size: 2em;
}

/* 暂停界面 */
.pause-overlay {
    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;
    border-radius: 20px;
    display: none;
    z-index: 5;
}

.pause-text {
    font-size: 3em;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-area {
        flex-direction: column;
        align-items: center;
    }
    
    .side-panel {
        width: 300px;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .next-piece-container {
        width: 150px;
    }
    
    .game-container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    button {
        padding: 8px 15px;
        font-size: 14px;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .side-panel {
        flex-direction: column;
        width: 150px;
    }
    
    .game-container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    button {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 90px;
    }
    
    .controls {
        gap: 5px;
    }
}