* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #1a1a2e;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* 登录模态框 */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #16213e;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    width: 300px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #00ffff;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 2px solid #0f3460;
    border-radius: 5px;
    background-color: #0f3460;
    color: #ffffff;
    font-size: 16px;
}

.modal-content input:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.modal-content button {
    background-color: #00ffff;
    color: #16213e;
    border: none;
    padding: 10px 20px;
    margin: 10px 0;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-content button:hover {
    background-color: #00cccc;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.4);
}

.error {
    color: #ff4757;
    margin-top: 10px;
    font-size: 14px;
}

/* 游戏容器 */
#gameContainer {
    background-color: #16213e;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    max-width: 900px;
    width: 100%;
}

/* 游戏头部 */
.gameHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0f3460;
}

.gameHeader h1 {
    color: #00ffff;
    font-size: 36px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.userInfo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.userInfo span {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
}

.userInfo button {
    background-color: #ff4757;
    color: #ffffff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.userInfo button:hover {
    background-color: #ff3742;
    transform: translateY(-2px);
}

/* 游戏主区域 */
.gameMain {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* 左侧和右侧面板 */
.leftPanel, .rightPanel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 150px;
}

/* 信息框 */
.infoBox {
    background-color: #0f3460;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.infoBox h3 {
    color: #00ffff;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.infoBox div {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
}

/* 游戏区域 */
.gameArea {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 画布 */
#gameCanvas, #nextCanvas {
    background-color: #0a0a0a;
    border: 3px solid #00ffff;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

#nextCanvas {
    background-color: #0f3460;
}

/* 游戏结束和暂停界面 */
.gameOver, .pauseMenu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(22, 33, 62, 0.95);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    display: none;
}

.gameOver h2, .pauseMenu h2 {
    color: #00ffff;
    margin-bottom: 20px;
    font-size: 32px;
}

.gameOver p {
    font-size: 18px;
    margin-bottom: 20px;
    color: #ffffff;
}

.gameOver span {
    color: #00ffff;
    font-weight: bold;
}

.gameOver button, .pauseMenu button {
    background-color: #00ffff;
    color: #16213e;
    border: none;
    padding: 12px 25px;
    margin: 10px;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gameOver button:hover, .pauseMenu button:hover {
    background-color: #00cccc;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.4);
}

/* 操作说明 */
.controls {
    font-size: 14px;
    color: #cccccc;
    text-align: left;
}

.controls p {
    margin: 5px 0;
}

/* 游戏控制按钮 */
.gameControls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #0f3460;
}

.gameControls button {
    background-color: #00ffff;
    color: #16213e;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.gameControls button:hover {
    background-color: #00cccc;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.4);
}

.gameControls button:disabled {
    background-color: #666666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 方块颜色 */
.tetromino-I { background-color: #00ffff; }
.tetromino-J { background-color: #0000ff; }
.tetromino-L { background-color: #ffa500; }
.tetromino-O { background-color: #ffff00; }
.tetromino-S { background-color: #00ff00; }
.tetromino-T { background-color: #800080; }
.tetromino-Z { background-color: #ff0000; }

/* 响应式设计 */
@media (max-width: 768px) {
    .gameMain {
        flex-direction: column;
        align-items: center;
    }
    
    .leftPanel, .rightPanel {
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }
    
    .infoBox {
        width: 22%;
    }
}