/* 全局样式 */
body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(to bottom, #0a0a0a, #1a0a2a);
    color: #0ff;
    font-family: 'Press Start 2P', cursive; /* 赛博朋克风格字体 */
    overflow: hidden;
    position: relative; /* 用于背景效果 */
}

/* 添加一些赛博朋克背景效果 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 255, 255, 0.1) 0%, transparent 70%);
    animation: neon-glow 10s infinite alternate;
    pointer-events: none;
}

@keyframes neon-glow {
    from { opacity: 0.5; transform: scale(1); }
    to { opacity: 0.8; transform: scale(1.2); }
}

/* 游戏容器 */
.game-container {
    background-color: rgba(17, 17, 17, 0.9);
    border: 2px solid #0ff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6), 0 0 40px rgba(0, 255, 255, 0.3) inset;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transform: perspective(1000px) rotateY(5deg);
    transition: transform 0.3s ease-in-out;
    width: 90%;
    max-width: 400px; /* 限制最大宽度 */
}

.game-container:hover {
    transform: perspective(1000px) rotateY(0deg);
}

.game-instructions {
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    font-size: 0.9em;
    margin-top: -10px;
    margin-bottom: 20px;
}

h1 {
    color: #f0f;
    text-shadow: 0 0 10px #f0f, 0 0 20px #f0f;
    margin-bottom: 20px;
}

/* 游戏信息 (分数和等级) */
.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.next-piece-container {
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #0ff;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5), 0 0 20px rgba(0, 255, 255, 0.3) inset;
}

.next-piece-container h3 {
    color: #f0f;
    text-shadow: 0 0 5px #f0f, 0 0 10px #f0f;
    margin-bottom: 10px;
}

#nextPieceCanvas {
    background-color: #000;
    border: 1px solid #0ff;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.5), 0 0 16px rgba(0, 255, 255, 0.3) inset;
}

.score, .level {
    background-color: #333;
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid #0ff;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.4), 0 0 10px rgba(0, 255, 255, 0.2) inset;
}

/* Canvas 样式 */
#gameCanvas {
    background-color: #000;
    border: 2px solid #0ff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.7), 0 0 30px rgba(0, 255, 255, 0.4) inset;
    display: block;
    margin: 20px auto;
}

/* 控制按钮 */
.controls button {
    background: linear-gradient(45deg, #f0f, #0ff);
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
    margin: 5px; /* 添加外边距 */
    text-shadow: 0 0 5px #fff; /* 添加文字发光 */
}

.controls button:hover {
    background: linear-gradient(45deg, #0ff, #f0f);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.7), 0 0 20px rgba(255, 0, 255, 0.7);
    transform: translateY(-2px); /* 悬停效果 */
}

.controls button:active {
    background: linear-gradient(45deg, #099, #c0c);
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
    transform: translateY(0); /* 点击效果 */
}

@media (max-width: 600px) {
    .game-container {
        transform: none; /* 禁用小屏幕上的 3D 效果 */
    }

    h1 {
        font-size: 1.5em;
    }

    .game-instructions,
    .game-info {
        font-size: 0.8em;
    }

    .controls button {
        font-size: 0.9em;
        padding: 8px 15px;
    }

    #gameCanvas, #nextPieceCanvas {
        border-width: 1px;
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.5), 0 0 20px rgba(0, 255, 255, 0.2) inset;
    }
}
