* {
    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.1);
    padding: 30px;
    max-width: 800px;
    width: 100%;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h1 {
    font-size: 3em;
    color: #4a5568;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 3px;
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.score-item {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.score-item .label {
    display: block;
    font-size: 0.9em;
    opacity: 0.9;
}

.score-item span:last-child {
    font-size: 1.5em;
    display: block;
    margin-top: 5px;
}

.game-area {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.game-board {
    position: relative;
    background: #2d3748;
    border-radius: 15px;
    padding: 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

#gameCanvas {
    border: 3px solid #4a5568;
    border-radius: 10px;
    background: #1a202c;
    display: block;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-width: 200px;
}

.next-piece {
    background: #f7fafc;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.next-piece h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2em;
}

#nextCanvas {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #1a202c;
    display: block;
    margin: 0 auto;
}

.controls {
    background: #f7fafc;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.controls h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.control-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.key {
    background: #4a5568;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

.action {
    color: #2d3748;
    font-weight: 500;
}

.game-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(72, 187, 120, 0.4);
}

.btn:not(.btn-primary) {
    background: linear-gradient(45deg, #e2e8f0, #cbd5e0);
    color: #4a5568;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:not(.btn-primary):hover {
    background: linear-gradient(45deg, #cbd5e0, #a0aec0);
    transform: translateY(-1px);
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.game-over h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #ff6b6b;
}

.game-over p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.hidden {
    display: none;
}

/* Анимации */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.score-item {
    animation: pulse 2s infinite;
}

/* Адаптивность */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        margin: 10px;
    }
    
    .game-header h1 {
        font-size: 2em;
    }
    
    .score-board {
        gap: 15px;
    }
    
    .game-area {
        flex-direction: column;
        align-items: center;
    }
    
    .game-info {
        width: 100%;
        max-width: 300px;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 300px;
        height: auto;
    }
}

/* Эффекты для фигур */
.tetris-piece {
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tetris-piece-0 { background: #ff6b6b; } /* I */
.tetris-piece-1 { background: #4ecdc4; } /* O */
.tetris-piece-2 { background: #45b7d1; } /* T */
.tetris-piece-3 { background: #96ceb4; } /* S */
.tetris-piece-4 { background: #feca57; } /* Z */
.tetris-piece-5 { background: #ff9ff3; } /* J */
.tetris-piece-6 { background: #54a0ff; } /* L */
