* {
    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: white;
}

.game-container {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 30px;
    padding: 50px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 1200px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 50px;
}

header h1 {
    font-size: 5rem;
    font-weight: bold;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    margin-bottom: 30px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.score-display {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
}

.score-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 25px 35px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.score-item .label {
    display: block;
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 8px;
}

.score-item .value {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #4ecdc4;
}

.game-main {
    display: flex;
    gap: 50px;
    align-items: flex-start;
    justify-content: center;
}

.game-board-container {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 25px;
    padding: 30px;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

#gameCanvas {
    display: block;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.8);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.overlay-content {
    text-align: center;
    padding: 50px;
}

.overlay-content h2 {
    font-size: 3.5rem;
    margin-bottom: 25px;
    color: #4ecdc4;
}

.overlay-content p {
    font-size: 1.8rem;
    margin-bottom: 40px;
    opacity: 0.8;
}

.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 40px;
    min-width: 300px;
}

.next-piece {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.next-piece h3 {
    margin-bottom: 20px;
    color: #4ecdc4;
    font-size: 1.8rem;
}

#nextCanvas {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.5);
}

.controls {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.controls h3 {
    margin-bottom: 20px;
    color: #4ecdc4;
    font-size: 1.8rem;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.key {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1.2rem;
    min-width: 80px;
    text-align: center;
}

.action {
    font-size: 1.2rem;
    opacity: 0.9;
}

.game-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-button {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    border: none;
    color: white;
    padding: 18px 30px;
    border-radius: 15px;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
    background: linear-gradient(45deg, #44a08d, #4ecdc4);
}

.game-button:active {
    transform: translateY(0);
}

.game-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive design */
@media (max-width: 1200px) {
    .game-container {
        padding: 30px;
        margin: 20px;
    }
    
    header h1 {
        font-size: 3.5rem;
    }
    
    .game-main {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .game-sidebar {
        width: 100%;
        max-width: 450px;
    }
    
    .score-display {
        gap: 30px;
    }
    
    .score-item {
        padding: 20px 25px;
    }
    
    .score-item .value {
        font-size: 2rem;
    }
    
    .overlay-content h2 {
        font-size: 2.5rem;
    }
    
    .overlay-content p {
        font-size: 1.4rem;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        margin: 10px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .score-item .value {
        font-size: 1.8rem;
    }
    
    .overlay-content h2 {
        font-size: 2rem;
    }
    
    .overlay-content p {
        font-size: 1.2rem;
    }
    
    .game-button {
        padding: 15px 25px;
        font-size: 1.2rem;
    }
}

/* Game over animation */
@keyframes gameOverPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.game-over .overlay-content {
    animation: gameOverPulse 1s ease-in-out infinite;
}

/* Line clear animation */
@keyframes lineClear {
    0% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.5; transform: scaleY(0.1); }
    100% { opacity: 0; transform: scaleY(0); }
}

.line-clearing {
    animation: lineClear 0.5s ease-in-out;
}
