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

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

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

.tetris-icon {
    font-size: 18px;
}

.tetris-label {
    letter-spacing: 1px;
}

/* Modal Overlay */
.tetris-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.tetris-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tetris-modal-content {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tetris-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tetris-modal-header h2 {
    margin: 0;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 20px;
    letter-spacing: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tetris-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.tetris-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.tetris-modal-body {
    padding: 20px;
}

/* Game Container */
.tetris-game-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

#tetris-canvas {
    background: #0a0a0a;
    border-radius: 8px;
    border: 2px solid #333;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.tetris-info {
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.4);
    padding: 16px;
    border-radius: 8px;
    min-width: 120px;
}

.tetris-info div {
    margin-bottom: 12px;
}

.tetris-info span {
    color: #ffd700;
    font-weight: bold;
}

#tetris-next {
    background: #0a0a0a;
    border-radius: 4px;
    display: block;
    margin-top: 8px;
}

/* Controls Info */
.tetris-controls {
    text-align: center;
    margin-top: 16px;
    color: #888;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
}

.tetris-controls p {
    margin: 4px 0;
}

.tetris-controls strong {
    color: #667eea;
}

/* Responsive */
@media (max-width: 600px) {
    .tetris-corner-btn {
        padding: 10px 14px;
        font-size: 12px;
    }
    
    .tetris-icon {
        font-size: 16px;
    }
    
    .tetris-label {
        display: none;
    }
    
    #tetris-canvas {
        width: 250px;
        height: 500px;
    }
    
    .tetris-game-container {
        flex-direction: column;
        align-items: center;
    }
}