/* 俄罗斯方块颜色定义 */
.tetris-color-red {
    color: #C33333;
}

.tetris-color-blue {
    color: #293FDD;
}

.tetris-color-yellow {
    color: #DBA53F;
}

.tetris-color-purple {
    color: #8A48D6;
}

.tetris-color-green {
    color: #2AC58E;
}

.tetris-color-brown {
    color: #F25F5C;
}

.tetris-color-pink {
    color: #CC44A1;
}

.tetris-color-white {
    color: #ffffff;
}

/* 俄罗斯方块雨滴效果容器 */
#tetris-rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* 俄罗斯方块基础样式 */
.tetris-piece {
    position: absolute;
    display: grid;
    opacity: 0.7;
    filter: drop-shadow(0 0 3px currentColor);
    animation: falling linear infinite, rotating linear infinite;
    top: -50px;
}

/* 掉落动画 */
@keyframes falling {
    from {
        top: -50px;
    }
    to {
        top: calc(100vh + 200px);
    }
}

/* 旋转动画 */
@keyframes rotating {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 消失动画 */
@keyframes fadeOut {
    0% {
        transform: scale(1) rotate(var(--current-rotation, 0deg));
        opacity: 0.7;
    }
    100% {
        transform: scale(0) rotate(var(--current-rotation, 0deg));
        opacity: 0;
    }
}

/* 消失状态 */
.tetris-piece.fade-out {
    animation: fadeOut 0.5s ease-in-out forwards;
}

/* 方块单元格 */
.tetris-block {
    width: 8px;
    height: 8px;
    background-color: currentColor;
    border: 1px solid currentColor;
    border-radius: 1px;
    box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.3);
}

/* 不同形状的网格布局 */
.tetris-I {
    grid-template-columns: repeat(4, 8px);
    grid-template-rows: 8px;
    gap: 1px;
}

.tetris-O {
    grid-template-columns: repeat(2, 8px);
    grid-template-rows: repeat(2, 8px);
    gap: 1px;
}

.tetris-T {
    grid-template-columns: repeat(3, 8px);
    grid-template-rows: repeat(2, 8px);
    gap: 1px;
}

.tetris-S {
    grid-template-columns: repeat(3, 8px);
    grid-template-rows: repeat(2, 8px);
    gap: 1px;
}

.tetris-Z {
    grid-template-columns: repeat(3, 8px);
    grid-template-rows: repeat(2, 8px);
    gap: 1px;
}

.tetris-J {
    grid-template-columns: repeat(3, 8px);
    grid-template-rows: repeat(2, 8px);
    gap: 1px;
}

.tetris-L {
    grid-template-columns: repeat(3, 8px);
    grid-template-rows: repeat(2, 8px);
    gap: 1px;
}

