* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.game-container {
    text-align: center;
    max-width: 800px;
    width: 100%;
}

h1 {
    font-size: 3rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 2px 2px 4px rgba(0,0,0,0.5), 0 0 10px #fff; }
    to { text-shadow: 2px 2px 4px rgba(0,0,0,0.5), 0 0 20px #fff, 0 0 30px #fff; }
}

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

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 200px;
}

.score-board {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.stat label {
    font-weight: bold;
}

.next-piece {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.next-piece label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

#next-canvas {
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
}

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

button {
    padding: 12px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: white;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.game-board {
    position: relative;
}

#game-canvas {
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 15px;
    background: rgba(0,0,0,0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

.game-over h2 {
    margin-bottom: 15px;
    color: #ff6b6b;
}

.game-over p {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.hidden {
    display: none !important;
}

.instructions {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.instructions h3 {
    margin-bottom: 15px;
}

.keys {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.key {
    background: rgba(255,255,255,0.2);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .game-area {
        flex-direction: column;
        align-items: center;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: row;
    }
    
    .keys {
        font-size: 0.8rem;
    }
    
    .key {
        font-size: 0.8rem;
    }
}
