/* 俄罗斯方块游戏样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

header h1 {
    font-size: 2rem;
    color: #4a148c;
    margin-bottom: 10px;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .game-container {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 30px;
    }
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game-board {
    border: 3px solid #4a148c;
    background-color: #000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.side-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .side-panel {
        margin-top: 0;
    }
}

.next-piece {
    border: 2px solid #4a148c;
    background-color: #000;
    margin-bottom: 20px;
    width: 120px;
    height: 120px;
}

.score-container {
    background-color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    text-align: center;
    width: 100%;
}

.score {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4a148c;
}

.level {
    font-size: 1.2rem;
    color: #4a148c;
    margin-top: 5px;
}

.controls {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

button {
    background-color: #4a148c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    width: 100%;
    max-width: 200px;
}

button:hover {
    background-color: #7b1fa2;
}

.home-button {
    margin-top: 20px;
    background-color: #333;
}

.home-button:hover {
    background-color: #555;
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    display: none;
    z-index: 100;
}

.game-over h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.game-over p {
    margin-bottom: 20px;
}

/* 移动设备控制按钮 */
.mobile-controls {
    display: none;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
    width: 100%;
    max-width: 300px;
}

.control-btn {
    background-color: #4a148c;
    color: white;
    border: none;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px;
    height: 50px;
}

.left-btn {
    grid-column: 1;
    grid-row: 1;
}

.rotate-btn {
    grid-column: 2 / span 2;
    grid-row: 1;
}

.right-btn {
    grid-column: 4;
    grid-row: 1;
}

.down-btn {
    grid-column: 1 / span 2;
    grid-row: 2;
}

.drop-btn {
    grid-column: 3 / span 2;
    grid-row: 2;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    #game-board {
        max-width: 100%;
    }
    
    .mobile-controls {
        display: grid;
    }
    
    .keyboard-instructions {
        display: none;
    }
}
