/* 游戏画布样式 */
.game-canvas {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 3/4;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    display: block;
    position: relative;
    overflow: hidden;
}

/* 游戏区域容器 */
.game-area {
    position: relative;
    width: 100%;
    height: 100vh;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    background: #f5f5f7;
    overflow: hidden;
    overscroll-behavior: none;
    gap: 20px;
}

/* 游戏信息区域 */
.game-info {
    position: relative;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    z-index: 100;
    margin-top: 20px;
    min-width: 200px;
}

/* 下一个方块预览区域 */
.next-piece-preview {
    width: 100%;
    height: 100px;
    background: #ffffff;
    border: 1px solid #e5e5e7;
    border-radius: 8px;
    margin: 10px 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 预览区域中的方块样式 */
.next-piece-preview .tetromino {
    position: relative;
    transform: scale(0.8);
    transform-origin: center;
}

/* 预览标题 */
.preview-title {
    font-size: 16px;
    color: #1d1d1f;
    margin-bottom: 10px;
    text-align: center;
}

/* 方块基础样式 */
.tetromino,
.fixed-block {
    position: absolute;
    width: calc(100% / 12);
    height: calc(100% / 16);
    border-radius: 0;
    transition: transform 0.1s ease;
}

/* 不同形状方块的颜色 */
.tetromino.I,
.fixed-block.I {
    background: #00B8D4;
}

.tetromino.O,
.fixed-block.O {
    background: #FFD700;
}

.tetromino.T,
.fixed-block.T {
    background: #D500F9;
}

.tetromino.S,
.fixed-block.S {
    background: #64DD17;
}

.tetromino.Z,
.fixed-block.Z {
    background: #FF1744;
}

.tetromino.J,
.fixed-block.J {
    background: #2979FF;
}

.tetromino.L,
.fixed-block.L {
    background: #FF6D00;
}

/* 网格线样式 */
.grid-line {
    position: absolute;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 1px;
}

/* 消除行动画 */
.clear-line {
    animation: clearLine 0.3s ease-out;
}

@keyframes clearLine {
    0% {
        transform: scaleY(1);
        opacity: 1;
    }
    50% {
        transform: scaleY(0.1);
        opacity: 0.5;
    }
    100% {
        transform: scaleY(0);
        opacity: 0;
    }
}

/* 游戏结束效果 */
.game-over {
    animation: gameOver 0.5s ease-out;
}

@keyframes gameOver {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 控制提示样式 */
.control-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-width: 90%;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-hint.collapsed {
    display: none;
}

.control-hint .keyboard-hint,
.control-hint .gamepad-hint {
    display: none;
}

.control-hint .keyboard-hint.active,
.control-hint .gamepad-hint.active {
    display: block;
}

/* 暂停菜单样式 */
.pause-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    text-align: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

/* 加载动画 */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0071e3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 双人模式布局 */
.double-mode .game-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0;
}

.double-mode #game-canvas,
.double-mode #player2-canvas {
    max-width: 100%;
    border-radius: 0;
}

.double-mode .game-info {
    position: absolute;
    right: 20px;
    top: 20px;
} 