* {
    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: #fff;
}

.game-container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
}

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

.game-header h1 {
    font-size: 4rem;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5),
                 0 0 40px rgba(102, 126, 234, 0.8),
                 0 0 60px rgba(118, 75, 162, 0.8);
    letter-spacing: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.5),
                     0 0 40px rgba(102, 126, 234, 0.8),
                     0 0 60px rgba(118, 75, 162, 0.8);
    }
    to {
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.8),
                     0 0 60px rgba(102, 126, 234, 1),
                     0 0 90px rgba(118, 75, 162, 1);
    }
}

.game-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

.game-board {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#gameCanvas {
    background: #1a1a2e;
    border-radius: 10px;
    display: block;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

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

.next-piece {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.next-piece h3 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: #f0f0f0;
}

#nextCanvas {
    background: #1a1a2e;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
}

.score-board {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.score-item:last-child {
    margin-bottom: 0;
}

.score-item span:first-child {
    color: #ccc;
}

.score-item span:last-child {
    font-size: 1.8rem;
    font-weight: bold;
    color: #00ff88;
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.8);
}

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

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

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

.game-footer {
    margin-top: 30px;
    text-align: center;
}

.controls-info {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.controls-info h4 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: #f0f0f0;
}

.controls-pc,
.controls-mobile {
    color: #ddd;
    font-size: 1rem;
    margin-bottom: 10px;
}

.controls-mobile {
    display: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.modal-content p {
    margin-bottom: 30px;
    font-size: 1.5rem;
    color: white;
}

.modal-content #finalScore {
    font-size: 2rem;
    font-weight: bold;
    color: #00ff88;
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.8);
}

@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .game-header h1 {
        font-size: 2.5rem;
        letter-spacing: 5px;
    }
    
    .game-main {
        flex-direction: column;
        align-items: center;
    }
    
    .game-board {
        padding: 15px;
    }
    
    #gameCanvas {
        width: 280px;
        height: 560px;
    }
    
    .game-info {
        width: 100%;
        max-width: 320px;
    }
    
    .controls-pc {
        display: none;
    }
    
    .controls-mobile {
        display: block;
    }
    
    .modal-content {
        padding: 30px;
        margin: 20px;
    }
    
    .modal-content h2 {
        font-size: 2rem;
    }
    
    .modal-content p {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 2rem;
    }
    
    #gameCanvas {
        width: 240px;
        height: 480px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}