* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 1000px;
    width: 100%;
    backdrop-filter: blur(10px);
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h1 {
    font-size: 3rem;
    color: #4a5568;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.score-board {
    display: flex;
    gap: 30px;
}

.score-item {
    text-align: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.score-item:hover {
    transform: translateY(-5px);
}

.score-item .label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.score-item .value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.game-main {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.game-area {
    position: relative;
    flex-shrink: 0;
}

#gameCanvas {
    border: 3px solid #4a5568;
    border-radius: 10px;
    background: #f7fafc;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.game-overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 30px;
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #f7fafc;
}

.overlay-content p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

.btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    margin: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.game-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.next-piece,
.controls,
.high-scores {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.next-piece h3,
.controls h3,
.high-scores h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

#nextCanvas {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f7fafc;
    display: block;
    margin: 0 auto;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.control-item:last-child {
    border-bottom: none;
}

.key {
    background: #4a5568;
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

.desc {
    color: #64748b;
    font-size: 0.9rem;
}

.high-score-list {
    text-align: center;
}

.high-score-item {
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 0.9rem;
}

.game-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        margin: 20px;
    }

    .game-header h1 {
        font-size: 2rem;
    }

    .game-main {
        flex-direction: column;
        align-items: center;
    }

    .game-info {
        flex-direction: column;
        gap: 20px;
    }

    .score-board {
        flex-direction: column;
        gap: 15px;
    }

    #gameCanvas {
        width: 280px;
        height: 560px;
    }

    #nextCanvas {
        width: 100px;
        height: 100px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-container {
    animation: fadeIn 0.6s ease-out;
}

/* 方块颜色 */
.tetromino {
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1);
}

.tetromino-I {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
}

.tetromino-O {
    background: linear-gradient(135deg, #ffd700, #ffb347);
}

.tetromino-T {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.tetromino-S {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.tetromino-Z {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.tetromino-J {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.tetromino-L {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}