/* Tetris Top Right Modal V5 - Button Styles */
.tetris-btn-v5 {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.tetris-btn-v5:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.tetris-btn-v5:active {
    transform: translateY(0) scale(0.98);
}

.tetris-icon-v5 {
    font-size: 20px;
}

.tetris-label-v5 {
    display: inline;
}

@media (max-width: 480px) {
    .tetris-btn-v5 {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .tetris-label-v5 {
        display: none;
    }
}

/* Tetris Modal Styles */
.tetris-modal-v5 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tetris-modal-v5.active {
    display: flex;
    opacity: 1;
}

.tetris-modal-backdrop-v5 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.tetris-modal-content-v5 {
    position: relative;
    margin: auto;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.tetris-modal-v5.active .tetris-modal-content-v5 {
    transform: scale(1);
}

.tetris-modal-header-v5 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-bottom: 3px solid #ff6b6b;
}

.tetris-title-v5 {
    margin: 0;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tetris-close-v5 {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tetris-close-v5:hover {
    background: #ff6b6b;
    transform: rotate(90deg);
}

.tetris-game-container-v5 {
    display: flex;
    gap: 20px;
    padding: 25px;
}

#tetris-canvas-v5 {
    background: #0f0f23;
    border: 3px solid #667eea;
    border-radius: 10px;
    box-shadow: inset 0 0 20px rgba(102, 126, 234, 0.3);
}

.tetris-sidebar-v5 {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 120px;
}

.tetris-score-box-v5,
.tetris-level-box-v5,
.tetris-lines-box-v5,
.tetris-next-box-v5 {
    background: rgba(102, 126, 234, 0.15);
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.tetris-score-label-v5,
.tetris-level-label-v5,
.tetris-lines-label-v5,
.tetris-next-label-v5 {
    color: #a0a0c0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.tetris-score-value-v5,
.tetris-level-value-v5,
.tetris-lines-value-v5 {
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: 700;
}

.tetris-score-value-v5 {
    color: #ffd700;
}

#tetris-next-v5 {
    background: #0f0f23;
    border: 2px solid #667eea;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
}

.tetris-controls-v5 {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 11px;
}

.tetris-control-item-v5 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #c0c0d0;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tetris-control-item-v5:last-child {
    border-bottom: none;
}

.tetris-key-v5 {
    background: #667eea;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    font-weight: 700;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tetris-modal-content-v5 {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .tetris-game-container-v5 {
        flex-direction: column;
        padding: 15px;
    }
    
    #tetris-canvas-v5 {
        width: 100%;
        max-width: 300px;
        height: auto;
        margin: 0 auto;
    }
    
    .tetris-sidebar-v5 {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tetris-sidebar-v5 > div {
        flex: 1 1 calc(50% - 10px);
        min-width: 100px;
    }
}

/* Animation for game over */
@keyframes gameOverPulse {
    0%, 100% { box-shadow: inset 0 0 30px rgba(255, 107, 107, 0.5); }
    50% { box-shadow: inset 0 0 50px rgba(255, 107, 107, 0.8); }
}

.tetris-game-over-v5 #tetris-canvas-v5 {
    animation: gameOverPulse 1s ease infinite;
}

/* Pause overlay */
.tetris-pause-overlay-v5 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 40px 60px;
    border-radius: 15px;
    text-align: center;
    z-index: 10;
}

.tetris-pause-overlay-v5 h3 {
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 28px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.tetris-pause-overlay-v5 p {
    color: #a0a0c0;
    font-size: 14px;
}
